X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=dither_effect_test.cpp;h=1b72ecb5caec50c93d3ad34fc56a2e09ef390e26;hp=bdba1212c76eaca680e3eabe6763cc6831c1b140;hb=cef6dcbc9ebaceb7b0cb47d6a519cb08a390c358;hpb=e2962f03fe8fb0b1c47be56eca26761da97453a0 diff --git a/dither_effect_test.cpp b/dither_effect_test.cpp index bdba121..1b72ecb 100644 --- a/dither_effect_test.cpp +++ b/dither_effect_test.cpp @@ -1,9 +1,15 @@ // Unit tests for DitherEffect. +#include #include -#include "test_util.h" +#include "effect_chain.h" #include "gtest/gtest.h" +#include "image_format.h" +#include "test_util.h" +#include "util.h" + +namespace movit { TEST(DitherEffectTest, NoDitherOnExactValues) { const int size = 4; @@ -23,8 +29,11 @@ TEST(DitherEffectTest, NoDitherOnExactValues) { unsigned char out_data[size * size]; EffectChainTester tester(data, size, size, FORMAT_GRAYSCALE, COLORSPACE_sRGB, GAMMA_LINEAR, GL_RGBA8); + check_error(); tester.get_chain()->set_dither_bits(8); + check_error(); tester.run(out_data, GL_RED, COLORSPACE_sRGB, GAMMA_LINEAR); + check_error(); expect_equal(expected_data, out_data, size, size); } @@ -52,3 +61,5 @@ TEST(DitherEffectTest, SinusoidBelowOneLevelComesThrough) { EXPECT_NEAR(amplitude, sum / (size * 255.0f), 1.1e-5); } + +} // namespace movit