A number of unit test fixes.
authorCarl Hetherington <cth@carlh.net>
Fri, 2 Feb 2018 21:56:27 +0000 (21:56 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 2 Feb 2018 21:56:27 +0000 (21:56 +0000)
test/image_test.cc
test/import_dcp_test.cc
test/player_test.cc
test/reels_test.cc
test/repeat_frame_test.cc
test/skip_frame_test.cc
test/srt_subtitle_test.cc

index 299ef2e51d381e7c6002e271707490b24c34a313..7780c94cc4f428ef77e30729469bb7efe5724a1a 100644 (file)
@@ -194,14 +194,14 @@ BOOST_AUTO_TEST_CASE (merge_test1)
 {
        int const stride = 48 * 4;
 
 {
        int const stride = 48 * 4;
 
-       shared_ptr<Image> A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 48), false));
+       shared_ptr<Image> A (new Image (AV_PIX_FMT_BGRA, dcp::Size (48, 48), false));
        A->make_transparent ();
        uint8_t* a = A->data()[0];
 
        for (int y = 0; y < 48; ++y) {
                uint8_t* p = a + y * stride;
                for (int x = 0; x < 16; ++x) {
        A->make_transparent ();
        uint8_t* a = A->data()[0];
 
        for (int y = 0; y < 48; ++y) {
                uint8_t* p = a + y * stride;
                for (int x = 0; x < 16; ++x) {
-                       /* red */
+                       /* blue */
                        p[x * 4] = 255;
                        /* opaque */
                        p[x * 4 + 3] = 255;
                        p[x * 4] = 255;
                        /* opaque */
                        p[x * 4 + 3] = 255;
@@ -219,21 +219,21 @@ BOOST_AUTO_TEST_CASE (merge_test1)
 /** Test merge (list<PositionImage>) with two images */
 BOOST_AUTO_TEST_CASE (merge_test2)
 {
 /** Test merge (list<PositionImage>) with two images */
 BOOST_AUTO_TEST_CASE (merge_test2)
 {
-       shared_ptr<Image> A (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false));
+       shared_ptr<Image> A (new Image (AV_PIX_FMT_BGRA, dcp::Size (48, 1), false));
        A->make_transparent ();
        uint8_t* a = A->data()[0];
        for (int x = 0; x < 16; ++x) {
        A->make_transparent ();
        uint8_t* a = A->data()[0];
        for (int x = 0; x < 16; ++x) {
-               /* red */
+               /* blue */
                a[x * 4] = 255;
                /* opaque */
                a[x * 4 + 3] = 255;
        }
 
                a[x * 4] = 255;
                /* opaque */
                a[x * 4 + 3] = 255;
        }
 
-       shared_ptr<Image> B (new Image (AV_PIX_FMT_RGBA, dcp::Size (48, 1), false));
+       shared_ptr<Image> B (new Image (AV_PIX_FMT_BGRA, dcp::Size (48, 1), false));
        B->make_transparent ();
        uint8_t* b = B->data()[0];
        for (int x = 0; x < 16; ++x) {
        B->make_transparent ();
        uint8_t* b = B->data()[0];
        for (int x = 0; x < 16; ++x) {
-               /* blue */
+               /* red */
                b[(x + 32) * 4 + 2] = 255;
                /* opaque */
                b[(x + 32) * 4 + 3] = 255;
                b[(x + 32) * 4 + 2] = 255;
                /* opaque */
                b[(x + 32) * 4 + 3] = 255;
index 163a3a4a966054dc200943cc94572e1016f8dc27..403c1c992320edf01e635f5d6457048f79748ea3 100644 (file)
@@ -45,6 +45,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
        A->set_container (Ratio::from_id ("185"));
        A->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        A->set_name ("frobozz");
        A->set_container (Ratio::from_id ("185"));
        A->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        A->set_name ("frobozz");
+       A->set_interop (false);
 
        shared_ptr<FFmpegContent> c (new FFmpegContent (A, "test/data/test.mp4"));
        A->examine_and_add_content (c);
 
        shared_ptr<FFmpegContent> c (new FFmpegContent (A, "test/data/test.mp4"));
        A->examine_and_add_content (c);
@@ -72,6 +73,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
        B->set_container (Ratio::from_id ("185"));
        B->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        B->set_name ("frobozz");
        B->set_container (Ratio::from_id ("185"));
        B->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        B->set_name ("frobozz");
+       B->set_interop (false);
 
        shared_ptr<DCPContent> d (new DCPContent (B, "build/test/import_dcp_test/" + A->dcp_name()));
        d->add_kdm (kdm);
 
        shared_ptr<DCPContent> d (new DCPContent (B, "build/test/import_dcp_test/" + A->dcp_name()));
        d->add_kdm (kdm);
index 0ddb67afcb70b817e718803190cc1ca0aa25ff93..1580d5902e3a4da40e3ad32c7b21593cc5fa16ee 100644 (file)
@@ -92,6 +92,7 @@ BOOST_AUTO_TEST_CASE (player_black_fill_test)
        film->set_name ("black_fill_test");
        film->set_container (Ratio::from_id ("185"));
        film->set_sequence (false);
        film->set_name ("black_fill_test");
        film->set_container (Ratio::from_id ("185"));
        film->set_sequence (false);
+       film->set_interop (false);
        shared_ptr<ImageContent> contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
        shared_ptr<ImageContent> contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
 
        shared_ptr<ImageContent> contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
        shared_ptr<ImageContent> contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
 
index bd7b1c06a05c8c9f6372fa9b2d604aa804797444..9e8e120a6822072054a75a8e811ccabb12d5f178 100644 (file)
@@ -91,6 +91,7 @@ BOOST_AUTO_TEST_CASE (reels_test2)
        shared_ptr<Film> film = new_test_film ("reels_test2");
        film->set_name ("reels_test2");
        film->set_container (Ratio::from_id ("185"));
        shared_ptr<Film> film = new_test_film ("reels_test2");
        film->set_name ("reels_test2");
        film->set_container (Ratio::from_id ("185"));
+       film->set_interop (false);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
 
        {
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
 
        {
@@ -194,6 +195,7 @@ BOOST_AUTO_TEST_CASE (reels_test4)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT);
+       film->set_interop (false);
 
        /* 4 piece of 1s-long content */
        shared_ptr<ImageContent> content[4];
 
        /* 4 piece of 1s-long content */
        shared_ptr<ImageContent> content[4];
index 24075991cad5a2b0e124c708aab6e7bb82d19103..fd64ba018cbf47746798220f5438de28d9b17c5b 100644 (file)
@@ -42,6 +42,7 @@ BOOST_AUTO_TEST_CASE (repeat_frame_test)
        film->set_name ("repeat_frame_test");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_name ("repeat_frame_test");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
+       film->set_interop (false);
        shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/red_24.mp4"));
        film->examine_and_add_content (c);
 
        shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/red_24.mp4"));
        film->examine_and_add_content (c);
 
index 97aadb2f74f8f5eff66c109c83f02d5151fdc0bf..fdea35849eafdf21c156b575afe7c1241ec634b1 100644 (file)
@@ -42,6 +42,7 @@ BOOST_AUTO_TEST_CASE (skip_frame_test)
        film->set_name ("skip_frame_test");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
        film->set_name ("skip_frame_test");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TST"));
+       film->set_interop (false);
        shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
        film->examine_and_add_content (c);
 
        shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
        film->examine_and_add_content (c);
 
index b6df6e393751f12d695e02cc00ca626162a0fc5d..025972da8ddab4f4195acd76181235b19a1fa855 100644 (file)
@@ -46,6 +46,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_audio_channels (6);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_audio_channels (6);
+       film->set_interop (false);
        shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
        shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
@@ -67,6 +68,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2)
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_audio_channels (6);
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_audio_channels (6);
+       film->set_interop (false);
        shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
        shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
@@ -118,6 +120,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test3)
        film->set_name ("frobozz");
        film->set_interop (true);
        film->set_audio_channels (6);
        film->set_name ("frobozz");
        film->set_interop (true);
        film->set_audio_channels (6);
+       film->set_interop (false);
        shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, private_data / "Ankoemmling_short.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
        shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, private_data / "Ankoemmling_short.srt"));
        film->examine_and_add_content (content);
        wait_for_jobs ();
@@ -138,6 +141,7 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test4)
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
        film->set_container (Ratio::from_id ("185"));
        film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
        film->set_name ("frobozz");
+       film->set_interop (false);
        shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
        content->subtitle->set_use (true);
        content->subtitle->set_burn (false);
        shared_ptr<TextSubtitleContent> content (new TextSubtitleContent (film, "test/data/subrip2.srt"));
        content->subtitle->set_use (true);
        content->subtitle->set_burn (false);