Sort notes when checking verifications.
[libdcp.git] / test / verify_test.cc
index 4e26c66e5e225e860e52ea13b3a59e8d79fbae23..417b456344b6460bfc5677fbea589e1a7327abd1 100644 (file)
@@ -193,7 +193,7 @@ private:
 };
 
 
-#if 0
+LIBDCP_DISABLE_WARNINGS
 static
 void
 dump_notes (vector<dcp::VerificationNote> const & notes)
@@ -202,7 +202,7 @@ dump_notes (vector<dcp::VerificationNote> const & notes)
                std::cout << dcp::note_to_string(i) << "\n";
        }
 }
-#endif
+LIBDCP_ENABLE_WARNINGS
 
 
 static
@@ -211,6 +211,8 @@ check_verify_result (vector<path> dir, vector<dcp::VerificationNote> test_notes)
 {
        auto notes = dcp::verify ({dir}, &stage, &progress, xsd_test);
        BOOST_REQUIRE_EQUAL (notes.size(), test_notes.size());
+       std::sort (notes.begin(), notes.end());
+       std::sort (test_notes.begin(), test_notes.end());
        for (auto i = 0U; i < notes.size(); ++i) {
                BOOST_REQUIRE_EQUAL (notes[i], test_notes[i]);
        }
@@ -706,6 +708,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_smpte_subtitles)
 
        path const dir("build/test/verify_invalid_smpte_subtitles");
        prepare_directory (dir);
+       /* This broken_smpte.mxf does not use urn:uuid: for its subtitle ID, which we tolerate (rightly or wrongly) */
        copy_file ("test/data/broken_smpte.mxf", dir / "subs.mxf");
        auto asset = make_shared<dcp::SMPTESubtitleAsset>(dir / "subs.mxf");
        auto reel_asset = make_shared<dcp::ReelSMPTESubtitleAsset>(asset, dcp::Fraction(24, 1), 6046, 0);
@@ -2951,3 +2954,23 @@ BOOST_AUTO_TEST_CASE (verify_incorrect_timed_text_id)
                        { dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::MISSING_CPL_METADATA, cpl->id(), cpl->file().get() }
                });
 }
+
+
+/** Check a DCP with a 3D asset marked as 2D */
+BOOST_AUTO_TEST_CASE (verify_threed_marked_as_twod)
+{
+       check_verify_result (
+               { private_test / "data" / "xm" },
+               {
+                       {
+                               dcp::VerificationNote::Type::WARNING,
+                               dcp::VerificationNote::Code::THREED_ASSET_MARKED_AS_TWOD, boost::filesystem::canonical(find_file(private_test / "data" / "xm", "j2c"))
+                       },
+                       {
+                               dcp::VerificationNote::Type::BV21_ERROR,
+                               dcp::VerificationNote::Code::INVALID_STANDARD
+                       },
+               });
+
+}
+