]> git.sesse.net Git - movit/blobdiff - overlay_effect_test.cpp
.gitignore more unit tests.
[movit] / overlay_effect_test.cpp
index 865d392b73ea2b3db750e7132eb9ef53a5b061cb..0a9682e0392e8e2c61959d9565f30695ac1c28c1 100644 (file)
@@ -1,8 +1,15 @@
 // Unit tests for OverlayEffect.
 
-#include "test_util.h"
+#include <GL/glew.h>
+
+#include "effect_chain.h"
 #include "gtest/gtest.h"
+#include "image_format.h"
+#include "input.h"
 #include "overlay_effect.h"
+#include "test_util.h"
+
+namespace movit {
 
 TEST(OverlayEffectTest, TopDominatesBottomWhenNoAlpha) {
        float data_a[] = {
@@ -42,7 +49,7 @@ TEST(OverlayEffectTest, BottomDominatesTopWhenTopIsTransparent) {
        expect_equal(data_a, out_data, 4, 1);
 }
 
-TEST(OverlayEffectTest, ZeroAlphaBecomesAllZero) {
+TEST(OverlayEffectTest, ZeroAlphaRemainsZeroAlpha) {
        float data_a[] = {
                0.0f, 0.25f, 0.5f, 0.0f
        };
@@ -60,7 +67,7 @@ TEST(OverlayEffectTest, ZeroAlphaBecomesAllZero) {
        tester.get_chain()->add_effect(new OverlayEffect(), input1, input2);
        tester.run(out_data, GL_BGRA, COLORSPACE_sRGB, GAMMA_LINEAR);
 
-       expect_equal(expected_data, out_data, 4, 1);
+       EXPECT_FLOAT_EQ(0.0f, expected_data[3]);
 }
 
 // This is tested against what Photoshop does: (255,0,128, 0.25) over (128,255,0, 0.5)
@@ -86,3 +93,5 @@ TEST(OverlayEffectTest, PhotoshopReferenceTest) {
 
        expect_equal(expected_data, out_data, 4, 1);
 }
+
+}  // namespace movit