diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-09-09 12:48:47 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-09-09 12:48:47 +0100 |
| commit | 5c29a3586ea262abcc8829bf267d38d8a5a84d9b (patch) | |
| tree | 394c46a1b18d0b02b19b3b99439fdb5e33e11b85 /test/tests.cc | |
| parent | 403c1e43d7e12af9ae72291f4bdff78fd242f9f6 (diff) | |
Somewhat hacky rearrangement to support multiple CPLs per DCP.
Diffstat (limited to 'test/tests.cc')
| -rw-r--r-- | test/tests.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/test/tests.cc b/test/tests.cc index 43c95905..ce9dae75 100644 --- a/test/tests.cc +++ b/test/tests.cc @@ -63,7 +63,8 @@ BOOST_AUTO_TEST_CASE (dcp_test) t->issue_date = "2012-07-17T04:45:18+00:00"; filesystem::remove_all ("build/test/foo"); filesystem::create_directories ("build/test/foo"); - libdcp::DCP d ("build/test/foo", "A Test DCP", libdcp::FEATURE, 24, 24); + libdcp::DCP d ("build/test/foo"); + shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("build/test/foo", "A Test DCP", libdcp::FEATURE, 24, 24)); shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ( sigc::ptr_fun (&j2c), @@ -86,14 +87,15 @@ BOOST_AUTO_TEST_CASE (dcp_test) 2 )); - d.add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (mp, ms, shared_ptr<libdcp::SubtitleAsset> ()))); + cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (mp, ms, shared_ptr<libdcp::SubtitleAsset> ()))); + d.add_cpl (cpl); d.write_xml (); } BOOST_AUTO_TEST_CASE (error_test) { - libdcp::DCP d ("build/test/bar", "A Test DCP", libdcp::TEST, 24, 24); + libdcp::DCP d ("build/test/bar"); vector<string> p; p.push_back ("frobozz"); @@ -104,11 +106,15 @@ BOOST_AUTO_TEST_CASE (error_test) BOOST_AUTO_TEST_CASE (read_dcp) { libdcp::DCP d ("test/ref/DCP"); + d.read (); - BOOST_CHECK_EQUAL (d.name(), "A Test DCP"); - BOOST_CHECK_EQUAL (d.content_kind(), libdcp::FEATURE); - BOOST_CHECK_EQUAL (d.frames_per_second(), 24); - BOOST_CHECK_EQUAL (d.length(), 24); + list<shared_ptr<const libdcp::CPL> > cpls = d.cpls (); + BOOST_CHECK_EQUAL (cpls.size(), 1); + + BOOST_CHECK_EQUAL (cpls.front()->name(), "A Test DCP"); + BOOST_CHECK_EQUAL (cpls.front()->content_kind(), libdcp::FEATURE); + BOOST_CHECK_EQUAL (cpls.front()->frames_per_second(), 24); + BOOST_CHECK_EQUAL (cpls.front()->length(), 24); } BOOST_AUTO_TEST_CASE (subtitles1) |
