From 621b82e1a5dfeb34602f336d645c670618d6db7e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 12 Dec 2020 20:21:28 +0100 Subject: Bv2.1 6.2.1: Check that additional subtitle languages conform to RFC 5646. --- test/verify_test.cc | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/verify_test.cc b/test/verify_test.cc index b2c4b542..91d4a8e1 100644 --- a/test/verify_test.cc +++ b/test/verify_test.cc @@ -951,18 +951,27 @@ BOOST_AUTO_TEST_CASE (verify_invalid_closed_caption_languages) } -/* SMPTE DCP with invalid in the MainSound reel */ -BOOST_AUTO_TEST_CASE (verify_invalid_sound_reel_language) +/* SMPTE DCP with invalid in the MainSound reel and in the CPL additional subtitles languages */ +BOOST_AUTO_TEST_CASE (verify_invalid_sound_reel_and_additional_language) { - boost::filesystem::path const dir("build/test/verify_invalid_sound_reel_language"); + boost::filesystem::path const dir("build/test/verify_invalid_sound_reel_and_additional_language"); prepare_directory (dir); + shared_ptr picture = simple_picture (dir, "foo"); + shared_ptr reel_picture(new dcp::ReelMonoPictureAsset(picture, 0)); + shared_ptr reel(new dcp::Reel()); + reel->add (reel_picture); shared_ptr sound = simple_sound (dir, "foo", dcp::MXFMetadata(), "frobozz"); shared_ptr reel_sound(new dcp::ReelSoundAsset(sound, 0)); - shared_ptr reel(new dcp::Reel()); reel->add (reel_sound); shared_ptr cpl(new dcp::CPL("hello", dcp::FEATURE)); cpl->add (reel); + cpl->_additional_subtitle_languages.push_back("this-is-wrong"); + cpl->_additional_subtitle_languages.push_back("andso-is-this"); + cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-"); + cpl->set_main_sound_sample_rate (48000); + cpl->set_main_picture_stored_area (dcp::Size(1998, 1080)); + cpl->set_main_picture_active_area (dcp::Size(1440, 1080)); shared_ptr dcp(new dcp::DCP(dir)); dcp->add (cpl); dcp->write_xml (dcp::SMPTE); @@ -970,10 +979,19 @@ BOOST_AUTO_TEST_CASE (verify_invalid_sound_reel_language) vector dirs; dirs.push_back (dir); list notes = dcp::verify (dirs, &stage, &progress, xsd_test); - BOOST_REQUIRE_EQUAL (notes.size(), 1U); + BOOST_REQUIRE_EQUAL (notes.size(), 3U); list::const_iterator i = notes.begin (); BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::BAD_LANGUAGE); BOOST_REQUIRE (i->note()); + BOOST_CHECK_EQUAL (*i->note(), "this-is-wrong"); + ++i; + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::BAD_LANGUAGE); + BOOST_REQUIRE (i->note()); + BOOST_CHECK_EQUAL (*i->note(), "andso-is-this"); + ++i; + BOOST_CHECK_EQUAL (i->code(), dcp::VerificationNote::BAD_LANGUAGE); + BOOST_REQUIRE (i->note()); BOOST_CHECK_EQUAL (*i->note(), "frobozz"); + ++i; } -- cgit v1.2.3