X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fisdcf_name_test.cc;h=28df9b2b933a6a9fc49274469b8b69da92b382ab;hb=cbdd9d4b569d1ffe59ccfb9c88c1ddf71adc1607;hp=cf39c112e5ceabeff448b01ffef35226b95c08e1;hpb=c53884e0a6f0533f90e688332ac60fa828b8ccc1;p=dcpomatic.git diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index cf39c112e..28df9b2b9 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 */