X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fdcp_subtitle_test.cc;h=407ac26164e405cc674c0b349f4c4dcd7869f5ee;hb=99bcbf1e71585a13c00d9696284d5a1e71913fbd;hp=b1689a6cc59443b1aebec2dc226fdb8a615bc760;hpb=7a77c0cb257f4e783b844c1699b003990977de5e;p=dcpomatic.git diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index b1689a6cc..407ac2616 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -20,6 +20,7 @@ /** @file test/dcp_subtitle_test.cc * @brief Test DCP subtitle content in various ways. + * @ingroup specific */ #include @@ -46,7 +47,13 @@ optional stored; static void store (ContentTextSubtitle sub) { - stored = sub; + if (!stored) { + stored = sub; + } else { + BOOST_FOREACH (dcp::SubtitleString i, sub.subs) { + stored->subs.push_back (i); + } + } } /** Test pass-through of a very simple DCP subtitle file */ @@ -56,6 +63,7 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test) 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 content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml")); film->examine_and_add_content (content); wait_for_jobs (); @@ -81,8 +89,8 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_within_dcp_test) film->examine_and_add_content (content); wait_for_jobs (); - shared_ptr decoder (new DCPDecoder (content, film->log())); - decoder->subtitle->TextData.connect (bind (store, _1)); + shared_ptr decoder (new DCPDecoder (content, film->log(), false)); + decoder->subtitle->TextStart.connect (bind (store, _1)); stored = optional (); while (!decoder->pass() && !stored) {} @@ -105,11 +113,11 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test2) wait_for_jobs (); shared_ptr decoder (new DCPSubtitleDecoder (content, film->log())); - decoder->subtitle->TextData.connect (bind (store, _1)); + decoder->subtitle->TextStart.connect (bind (store, _1)); stored = optional (); while (!decoder->pass ()) { - if (stored && stored->period().from == ContentTime(0)) { + if (stored && stored->from() == ContentTime(0)) { BOOST_CHECK_EQUAL (stored->subs.front().text(), "<b>Hello world!</b>"); } } @@ -133,8 +141,8 @@ BOOST_AUTO_TEST_CASE (dcp_subtitle_test3) shared_ptr decoder (new DCPSubtitleDecoder (content, film->log())); stored = optional (); while (!decoder->pass ()) { - decoder->subtitle->TextData.connect (bind (store, _1)); - if (stored && stored->period().from == ContentTime::from_seconds(0.08)) { + decoder->subtitle->TextStart.connect (bind (store, _1)); + if (stored && stored->from() == ContentTime::from_seconds(0.08)) { list s = stored->subs; list::const_iterator i = s.begin (); BOOST_CHECK_EQUAL (i->text(), "This");