diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-09 10:21:57 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-01-17 20:13:22 +0100 |
| commit | 0d7a7b85095a5accf5f3666bc1d0a037a5455d0b (patch) | |
| tree | b9083e6d14520830168c074d076bd91641406f90 /test | |
| parent | 3187bc1ffbc7bd2716abc99e064b1e6e471b8172 (diff) | |
Bv2.1 6.2.1: Check that subtitle XML <Language> conforms to RFC 5646.
Diffstat (limited to 'test')
| -rw-r--r-- | test/verify_test.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/verify_test.cc b/test/verify_test.cc index 3e983e4d..62b5c6c4 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -874,13 +874,15 @@ BOOST_AUTO_TEST_CASE (verify_test25) } -/* SMPTE DCP with invalid <Language> in the MainSubtitle */ +/* SMPTE DCP with invalid <Language> in the MainSubtitle reel and also in the XML within the MXF */ BOOST_AUTO_TEST_CASE (verify_test26) { boost::filesystem::path const dir("build/test/verify_test26"); prepare_directory (dir); boost::filesystem::copy_file ("test/data/subs.mxf", dir / "subs.mxf"); shared_ptr<dcp::SMPTESubtitleAsset> asset(new dcp::SMPTESubtitleAsset(dir / "subs.mxf")); + asset->_language = "wrong-andbad"; + asset->write (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()); @@ -894,9 +896,14 @@ BOOST_AUTO_TEST_CASE (verify_test26) 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); + BOOST_REQUIRE_EQUAL (notes.size(), 2U); list<dcp::VerificationNote>::const_iterator i = notes.begin (); BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::BAD_LANGUAGE); - + BOOST_REQUIRE (i->note()); + BOOST_CHECK_EQUAL (*i->note(), "badlang"); + i++; + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::BAD_LANGUAGE); + BOOST_REQUIRE (i->note()); + BOOST_CHECK_EQUAL (*i->note(), "wrong-andbad"); } |
