Write subtitle files in binary mode.
[libdcp.git] / test / cpl_metadata_test.cc
index eeef317263895dd54f96204488f47497fe121e81..b141d271d4a85483a625f2ca6c7aea584bce09fd 100644 (file)
@@ -235,12 +235,12 @@ BOOST_AUTO_TEST_CASE (cpl_metadata_read_test1)
        BOOST_CHECK (cpl.main_picture_active_area().get() == dcp::Size(1440, 1080));
 
        auto reels = cpl.reels ();
-       BOOST_REQUIRE_EQUAL (reels.size(), 1);
+       BOOST_REQUIRE_EQUAL (reels.size(), 1U);
        BOOST_REQUIRE (reels.front()->main_subtitle()->language());
        BOOST_CHECK_EQUAL (reels.front()->main_subtitle()->language().get(), "de-DE");
 
        auto asl = cpl.additional_subtitle_languages();
-       BOOST_REQUIRE_EQUAL (asl.size(), 2);
+       BOOST_REQUIRE_EQUAL (asl.size(), 2U);
        BOOST_CHECK_EQUAL (asl[0], "en-US");
        BOOST_CHECK_EQUAL (asl[1], "fr-ZA");
 
@@ -310,11 +310,13 @@ BOOST_AUTO_TEST_CASE (cpl_metadata_write_test1)
        auto lt = { dcp::LanguageTag("en-US"), dcp::LanguageTag("fr-ZA") };
        cpl.set_additional_subtitle_languages (lt);
 
+       cpl.set_sign_language_video_language (dcp::LanguageTag("bzs"));
+
        cpl.write_xml ("build/test/cpl_metadata_write_test1.xml", {});
        check_xml (
                dcp::file_to_string("test/ref/cpl_metadata_test1.xml"),
                dcp::file_to_string("build/test/cpl_metadata_write_test1.xml"),
-               vector<string>()
+               {"Id", "Hash"}
                );
 }
 
@@ -324,12 +326,10 @@ BOOST_AUTO_TEST_CASE (cpl_metadata_roundtrip_test_1)
 {
        dcp::CPL cpl ("test/ref/cpl_metadata_test1.xml");
        cpl.write_xml ("build/test/cpl_metadata_roundtrip_test1.xml", shared_ptr<dcp::CertificateChain>());
-       vector<string> ignore;
-       ignore.push_back ("Id");
        check_xml (
                dcp::file_to_string("test/ref/cpl_metadata_test1.xml"),
                dcp::file_to_string("build/test/cpl_metadata_roundtrip_test1.xml"),
-               ignore
+               {"Id"}
                );
 }
 
@@ -365,7 +365,7 @@ BOOST_AUTO_TEST_CASE (cpl_metadata_write_test2)
        check_xml (
                dcp::file_to_string("test/ref/cpl_metadata_test2.xml"),
                dcp::file_to_string("build/test/cpl_metadata_write_test2.xml"),
-               vector<string>()
+               {"Id", "Hash"}
                );
 }
 
@@ -406,7 +406,7 @@ BOOST_AUTO_TEST_CASE (cpl_metadata_read_test2)
        BOOST_CHECK (cpl.main_picture_active_area().get() == dcp::Size(1440, 1080));
 
        auto reels = cpl.reels ();
-       BOOST_REQUIRE_EQUAL (reels.size(), 1);
+       BOOST_REQUIRE_EQUAL (reels.size(), 1U);
 }