X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fisdcf_name_test.cc;h=d3227f636ee5ba57d75e71ef40841d73dc1ae49e;hb=c8a036eb727ceddc64a0304d781c916eb952c001;hp=cf39c112e5ceabeff448b01ffef35226b95c08e1;hpb=c53884e0a6f0533f90e688332ac60fa828b8ccc1;p=dcpomatic.git diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index cf39c112e..d3227f636 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2019 Carl Hetherington + Copyright (C) 2014-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -59,8 +59,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) auto audio = content_factory("test/data/sine_440.wav").front(); film->examine_and_add_content (audio); BOOST_REQUIRE (!wait_for_jobs()); - BOOST_REQUIRE (audio->audio); - audio->audio->set_language(dcp::LanguageTag("en-US")); + film->set_audio_language(dcp::LanguageTag("en-US")); film->set_content_versions({"1"}); film->set_release_territory(dcp::LanguageTag::RegionSubtag("GB")); film->set_ratings({dcp::Rating("BBFC", "PG")}); @@ -70,7 +69,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_EN-XX_GB-PG_10_2K_ST_20140704_FAC_IOP_OV"); /* Check that specifying no audio language writes XX */ - audio->audio->set_language (boost::none); + film->set_audio_language (boost::none); BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_XX-XX_GB-PG_10_2K_ST_20140704_FAC_IOP_OV"); /* Test a long name and some different data */ @@ -95,8 +94,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) audio = content_factory("test/data/sine_440.wav").front(); film->examine_and_add_content (audio); BOOST_REQUIRE (!wait_for_jobs()); - BOOST_REQUIRE (audio->audio); - audio->audio->set_language (dcp::LanguageTag("de-DE")); + film->set_audio_language (dcp::LanguageTag("de-DE")); film->set_interop (false); BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); @@ -126,6 +124,13 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) content->video->set_custom_ratio (1.9); BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-190_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); + + /* And it should be possible to set any 'strange' ratio, not just the ones we know about */ + content->video->set_custom_ratio (2.2); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-220_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); + content->video->set_custom_ratio (1.95); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-195_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); + content->video->set_custom_ratio (1.33); /* Test 3D */ @@ -225,5 +230,9 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) mapping.set (0, dcp::Channel::VI, 1.0); sound->audio->set_mapping (mapping); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71-HI-VI_4K_DI_20140704_PPF_SMPTE_OV"); + + /* Check that the proper codes are used, not just part of the language code; in this case, QBP instead of PT (#2235) */ + film->set_audio_language(dcp::LanguageTag("pt-BR")); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_QBP-fr_US-R_71-HI-VI_4K_DI_20140704_PPF_SMPTE_OV"); }