Don't check sound assets in some tests.
authorCarl Hetherington <cth@carlh.net>
Sat, 29 Jul 2023 00:26:33 +0000 (02:26 +0200)
committerCarl Hetherington <cth@carlh.net>
Sat, 29 Jul 2023 00:26:34 +0000 (02:26 +0200)
When fiddling with MXF channel counts it makes a lot of tests fail
that probably don't need to.

12 files changed:
cscript
test/4k_test.cc
test/dcp_subtitle_test.cc
test/image_content_fade_test.cc
test/player_test.cc
test/repeat_frame_test.cc
test/scaling_test.cc
test/skip_frame_test.cc
test/srt_subtitle_test.cc
test/subtitle_language_test.cc
test/test.cc
test/test.h

diff --git a/cscript b/cscript
index 0f5daa30845fb176b265430310cef38cee717186..d4fe2b10639f980dd28bcfac40cf4d37ce10d5d2 100644 (file)
--- a/cscript
+++ b/cscript
@@ -506,7 +506,7 @@ def dependencies(target, options):
         # Use distro-provided FFmpeg on Arch
         deps = []
 
-    deps.append(('libdcp', '9f7980e15f14c0d5f6b59e53b9bf939e62df20c9'))
+    deps.append(('libdcp', '03609704034192ae157f6328024989eec58ac1c3'))
     deps.append(('libsub', 'v1.6.44'))
     deps.append(('leqm-nrt', '4560105773c66ac9216b62313a24093bb0a027ae'))
     deps.append(('rtaudio', 'f619b76'))
index 86cb0275b54e7456b22f3459ad0a930e7f15018a..9e80a6e27bb035c25e940fd8dccf3d9b060a57fc 100644 (file)
@@ -64,5 +64,9 @@ BOOST_AUTO_TEST_CASE (fourk_test)
        boost::filesystem::path p (test_film_dir("4k_test"));
        p /= film->dcp_name ();
 
-       check_dcp ("test/data/4k_test", p.string());
+       /* This test is concerned with the image and its metadata, so we'll
+        * ignore any differences in sound between the DCP and the reference to
+        * avoid test failures for unrelated reasons.
+        */
+       check_dcp("test/data/4k_test", p.string(), true);
 }
index 6798cf67868be4c6dd26c5da68dc7823835633e5..9b7b77279968f6afffa977c448a685ebb7989ed4 100644 (file)
@@ -96,7 +96,11 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test)
                        dcp::VerificationNote::Code::MISSING_CPL_METADATA
                });
 
-       check_dcp ("test/data/dcp_subtitle_test", film->dir(film->dcp_name()));
+       /* This test is concerned with the subtitles, so we'll ignore any
+        * differences in sound between the DCP and the reference to avoid test
+        * failures for unrelated reasons.
+        */
+       check_dcp("test/data/dcp_subtitle_test", film->dir(film->dcp_name()), true);
 }
 
 
index 39cdfe602dc2a09fe9eff107b415c09512a7b575..d7f03ad51b770e0a00e767ba6c73c1b0df49fd5d 100644 (file)
@@ -41,5 +41,9 @@ BOOST_AUTO_TEST_CASE (image_content_fade_test)
        content->video->set_fade_in (1);
        make_and_verify_dcp (film);
 
-       check_dcp ("test/data/image_content_fade_test", film->dir(film->dcp_name()));
+       /* This test is concerned with the image, so we'll ignore any
+        * differences in sound between the DCP and the reference to avoid test
+        * failures for unrelated reasons.
+        */
+       check_dcp("test/data/image_content_fade_test", film->dir(film->dcp_name()), true);
 }
index a72e5fc170debfd1eee9035bad3f8a3cdf39ce81..a6e7cd2ded37fa73233a5c11854fe137a6226a5d 100644 (file)
@@ -142,7 +142,11 @@ BOOST_AUTO_TEST_CASE (player_black_fill_test)
        check /= "black_fill_test";
        check /= film->dcp_name();
 
-       check_dcp (ref.string(), check.string());
+       /* This test is concerned with the image, so we'll ignore any
+        * differences in sound between the DCP and the reference to avoid test
+        * failures for unrelated reasons.
+        */
+       check_dcp(ref.string(), check.string(), true);
 }
 
 
index afdaf48a644da9c10a38b78baa7caabeec747892..0d0f38616d3047a71db479863b3a9ab627e7d649 100644 (file)
@@ -50,6 +50,8 @@ BOOST_AUTO_TEST_CASE (repeat_frame_test)
        film->set_video_frame_rate (48);
        make_and_verify_dcp (film);
 
-       /* Should be 32 frames of red followed by 16 frames of black to fill the DCP up to 1 second */
-       check_dcp ("test/data/repeat_frame_test", film->dir (film->dcp_name ()));
+       /* Should be 32 frames of red followed by 16 frames of black to fill the DCP up to 1 second;
+        * no need to check sound.
+        */
+       check_dcp("test/data/repeat_frame_test", film->dir(film->dcp_name()), true);
 }
index 11b8ae1b744587c50cbe4842e73600c45308d51f..2d453600e69949338a553a27af17f1af2972b8ff 100644 (file)
@@ -63,7 +63,11 @@ static void scaling_test_for (shared_ptr<Film> film, shared_ptr<Content> content
        check /= "scaling_test";
        check /= film->dcp_name();
 
-       check_dcp (ref.string(), check.string());
+       /* This test is concerned with the image, so we'll ignore any
+        * differences in sound between the DCP and the reference to avoid test
+        * failures for unrelated reasons.
+        */
+       check_dcp(ref.string(), check.string(), true);
 }
 
 
index 4c4098c2a86f3df8d136e0f09577077fac23ad77..8df2fa1d5566af7868bc4c5fa8fc49cd3fc890fd 100644 (file)
@@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE (skip_frame_test)
        make_and_verify_dcp (film);
 
        /* Should be white numbers on a black background counting up from 2 in steps of 2
-          up to 300.
-       */
-       check_dcp ("test/data/skip_frame_test", film->dir (film->dcp_name ()));
+        * up to 300.  The sound is irrelevant here.
+        */
+       check_dcp("test/data/skip_frame_test", film->dir(film->dcp_name()), true);
 }
index 63d508b7654ba4093c6492261dd1bada2b98ebae..3863ebf9f26a8aad1250f3f5d482f921dd7aeeb3 100644 (file)
@@ -101,8 +101,8 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test2)
                        dcp::VerificationNote::Code::MISSING_CPL_METADATA
                });
 
-       /* Should be blank video with a subtitle MXF */
-       check_dcp ("test/data/srt_subtitle_test2", film->dir (film->dcp_name ()));
+       /* Should be blank video with a subtitle MXF; sound is irrelevant */
+       check_dcp("test/data/srt_subtitle_test2", film->dir(film->dcp_name()), true);
 }
 
 
@@ -158,8 +158,8 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test4)
                        dcp::VerificationNote::Code::MISSING_CPL_METADATA
                });
 
-       /* Should be blank video with MXF subtitles */
-       check_dcp ("test/data/xml_subtitle_test", film->dir (film->dcp_name ()));
+       /* Should be blank video with MXF subtitles; sound is irrelevant */
+       check_dcp("test/data/xml_subtitle_test", film->dir(film->dcp_name()), true);
 }
 
 
@@ -203,7 +203,11 @@ BOOST_AUTO_TEST_CASE (srt_subtitle_test6)
                        dcp::VerificationNote::Code::INVALID_SUBTITLE_SPACING,
                });
 
-       check_dcp ("test/data/srt_subtitle_test6", film->dir(film->dcp_name()));
+       /* This test is concerned with the subtitles, so we'll ignore any
+        * differences in sound between the DCP and the reference to avoid test
+        * failures for unrelated reasons.
+        */
+       check_dcp("test/data/srt_subtitle_test6", film->dir(film->dcp_name()), true);
 }
 
 
index 5b7a261fd2c038c80394eaf07fd665c2be5b5c0c..ad9d6bde22020f9044d6a9bea0c352853ff40427 100644 (file)
@@ -78,7 +78,11 @@ BOOST_AUTO_TEST_CASE (subtitle_language_smpte_test)
                        dcp::VerificationNote::Code::MISSING_CPL_METADATA
                });
 
-       check_dcp (String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()));
+       /* This test is concerned with the subtitles, so we'll ignore any
+        * differences in sound between the DCP and the reference to avoid test
+        * failures for unrelated reasons.
+        */
+       check_dcp(String::compose("test/data/%1", name), String::compose("build/test/%1/%2", name, film->dcp_name()), true);
 }
 
 
index bd23f7522d0c8072b273972df108901e2ee83d4a..dae02610014f72a75e5cf70b672f922432c375e3 100644 (file)
@@ -544,7 +544,7 @@ check_dcp (boost::filesystem::path ref, shared_ptr<const Film> film)
 
 
 void
-check_dcp (boost::filesystem::path ref, boost::filesystem::path check)
+check_dcp(boost::filesystem::path ref, boost::filesystem::path check, bool sound_can_differ)
 {
        dcp::DCP ref_dcp (ref);
        ref_dcp.read ();
@@ -561,6 +561,7 @@ check_dcp (boost::filesystem::path ref, boost::filesystem::path check)
        options.asset_hashes_can_differ = true;
        options.issue_dates_can_differ = true;
        options.max_subtitle_vertical_position_error = 0.001;
+       options.sound_assets_can_differ = sound_can_differ;
 
        BOOST_CHECK (ref_dcp.equals (check_dcp, options, boost::bind (note, _1, _2)));
 }
index 01ddb19874e525ced470ae9c029a1af8261d528c..c586b1ac00363886e5429b9c437315f4b3bdd854 100644 (file)
@@ -59,7 +59,7 @@ private:
 extern bool wait_for_jobs ();
 extern std::shared_ptr<Film> new_test_film (std::string);
 extern std::shared_ptr<Film> new_test_film2 (std::string, std::vector<std::shared_ptr<Content>> content = {}, Cleanup* cleanup = nullptr);
-extern void check_dcp (boost::filesystem::path, boost::filesystem::path);
+extern void check_dcp(boost::filesystem::path, boost::filesystem::path, bool sound_can_differ = false);
 extern void check_dcp (boost::filesystem::path, std::shared_ptr<const Film>);
 extern void check_file (boost::filesystem::path ref, boost::filesystem::path check);
 extern void check_text_file (boost::filesystem::path ref, boost::filesystem::path check);