Move ScopeGuard into libdcp.
[dcpomatic.git] / test / dcp_subtitle_test.cc
index 20fbe5f1a243b7ad034d1013e14b844ed8675603..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);
 }
 
 
@@ -111,7 +115,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test)
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs ());
 
-       shared_ptr<DCPDecoder> decoder (new DCPDecoder (film, content, false, false, shared_ptr<DCPDecoder>()));
+       auto decoder = make_shared<DCPDecoder>(film, content, false, false, shared_ptr<DCPDecoder>());
        decoder->only_text()->PlainStart.connect (bind (store, _1));
 
        stored = optional<ContentStringText> ();
@@ -140,7 +144,8 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test2)
        stored = optional<ContentStringText> ();
        while (!decoder->pass()) {
                if (stored && stored->from() == ContentTime(0)) {
-                       BOOST_CHECK_EQUAL (stored->subs.front().text(), "&lt;b&gt;Hello world!&lt;/b&gt;");
+                       /* Text passed around by the player should be unescaped */
+                       BOOST_CHECK_EQUAL(stored->subs.front().text(), "<b>Hello world!</b>");
                }
        }
 }
@@ -304,6 +309,7 @@ BOOST_AUTO_TEST_CASE(entity_from_dcp_source)
 
        /* Remake with burn */
        content->only_text()->set_burn(true);
+       boost::filesystem::remove_all(film->dir(film->dcp_name()));
        make_and_verify_dcp (
                film,
                {