diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-09 01:08:14 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-17 20:13:22 +0100 |
| commit | 2c3f7f03e50c6bb618b3f1b321b4ed27788152f9 (patch) | |
| tree | 2a706a106d16277c7e597921c165812c643a2e27 /test | |
| parent | 730952e63932bd50310cb20c61e78ae0c215e14b (diff) | |
Bv2.1 6.2.1: Check that subtitle reel <Language> conforms to RFC 5646.
Diffstat (limited to 'test')
| -rw-r--r-- | test/verify_test.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/verify_test.cc b/test/verify_test.cc index 5a05bcd3..d3c17b77 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -874,3 +874,31 @@ BOOST_AUTO_TEST_CASE (verify_test25) list<dcp::VerificationNote> notes = dcp::verify (dirs, &stage, &progress, xsd_test); } + +/* SMPTE DCP with invalid <Language> in the MainSubtitle */ +BOOST_AUTO_TEST_CASE (verify_test26) +{ + boost::filesystem::path const dir("build/test/verify_test26"); + boost::filesystem::remove_all (dir); + boost::filesystem::create_directories (dir); + boost::filesystem::copy_file ("test/data/subs.mxf", dir / "subs.mxf"); + shared_ptr<dcp::SMPTESubtitleAsset> asset(new dcp::SMPTESubtitleAsset(dir / "subs.mxf")); + shared_ptr<dcp::ReelSubtitleAsset> reel_asset(new dcp::ReelSubtitleAsset(asset, dcp::Fraction(24, 1), 16 * 24, 0)); + reel_asset->_language = "badlang"; + shared_ptr<dcp::Reel> reel(new dcp::Reel()); + reel->add (reel_asset); + shared_ptr<dcp::CPL> cpl(new dcp::CPL("hello", dcp::FEATURE)); + cpl->add (reel); + shared_ptr<dcp::DCP> dcp(new dcp::DCP(dir)); + dcp->add (cpl); + dcp->write_xml (dcp::SMPTE); + + vector<boost::filesystem::path> dirs; + dirs.push_back (dir); + list<dcp::VerificationNote> notes = dcp::verify (dirs, &stage, &progress, xsd_test); + BOOST_REQUIRE_EQUAL (notes.size(), 1U); + list<dcp::VerificationNote>::const_iterator i = notes.begin (); + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::BAD_LANGUAGE); + +} + |
