]> git.sesse.net Git - casparcg/commitdiff
Updated unit-tests.
authorHelge Norberg <helge.norberg@svt.se>
Wed, 16 Oct 2013 09:53:09 +0000 (11:53 +0200)
committerHelge Norberg <helge.norberg@svt.se>
Wed, 16 Oct 2013 09:53:09 +0000 (11:53 +0200)
unit-test/base64_test.cpp
unit-test/image_mixer_test.cpp

index 7e60fc0a6e4477e271530d5e3ae3cb009b349bd8..e37d2995191ce4b56f75c77759da4e2a18cf55d8 100644 (file)
@@ -54,11 +54,11 @@ namespace caspar {
 TEST(Base64Test, InvalidInputLength)
 {
        // 0 and 4 characters should be ok
-       /*EXPECT_THROW(from_base64("1"), caspar_exception);
+       EXPECT_THROW(from_base64("1"), caspar_exception);
        EXPECT_THROW(from_base64("12"), caspar_exception);
        EXPECT_THROW(from_base64("123"), caspar_exception);
        EXPECT_THROW(from_base64("1234\n567"), caspar_exception);
-       EXPECT_THROW(from_base64("12345"), caspar_exception);*/
+       EXPECT_THROW(from_base64("12345"), caspar_exception);
 }
 
 TEST(Base64Test, InvalidInputCharacters)
@@ -73,7 +73,7 @@ TEST(Base64Test, InvalidInputCharacters)
                {
                        auto invalid = PREFIX + static_cast<char>(i);
 
-                       //EXPECT_THROW(from_base64(invalid), std::exception);
+                       EXPECT_THROW(from_base64(invalid), std::exception);
                }
        }
 }
index 522ed10082fb8ed671e7b08b42967ae96e99a709..6bd8942d298fe7aafec0de19cf0429933890a515 100644 (file)
@@ -193,6 +193,9 @@ TYPED_TEST(MixerTestEveryImpl, HalfAlpha)
        add_layer(red_under);
        add_layer(half_green_over);
        assert_all_pixels_eq(127, 127, 0, 255, get_result(16, 16));
+
+       add_layer(half_green_over);
+       assert_all_pixels_eq(0, 127, 0, 127, get_result(16, 16));
 }
 
 // Tests for use cases that currently *only* works on GPU mixer
@@ -214,6 +217,9 @@ TYPED_TEST(MixerTestOgl, HalfOpacity)
        add_layer(red_under);
        add_layer(green_over);
        assert_all_pixels_eq(127, 127, 0, 255, get_result(1, 1));
+
+       add_layer(green_over);
+       assert_all_pixels_eq(0, 127, 0, 127, get_result(1, 1));
 }
 
 TYPED_TEST(MixerTestOgl, MakeGrayscaleWithSaturation)
@@ -229,7 +235,7 @@ TYPED_TEST(MixerTestOgl, MakeGrayscaleWithSaturation)
 
 TYPED_TEST(MixerTestOgl, TransformFillScale)
 {
-       core::draw_frame frame(create_single_color_frame(255, 255, 255, 255, 2, 2));
+       core::draw_frame frame(create_single_color_frame(255, 255, 255, 255, 1, 1));
        frame.transform().image_transform.fill_translation[0] = 0.5;
        frame.transform().image_transform.fill_translation[1] = 0.5;
        frame.transform().image_transform.fill_scale[0] = 0.5;