X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fisdcf_name_test.cc;h=96ef5a420d681ef43703ad38bf14f51b15e12a50;hb=5f4fed93bbd469067d825de67f09c71d45a7d2cc;hp=e3023f9f5e891cb8712561cb5b5c1f4eb59e1752;hpb=5a5324ed3a381a86dfe0a6e3932c1d58fdcd596f;p=dcpomatic.git diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index e3023f9f5..96ef5a420 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -18,6 +18,11 @@ */ +/** @file test/isdcf_name_test.cc + * @brief Test creation of ISDCF names. + * @ingroup specific + */ + #include #include "lib/film.h" #include "lib/ratio.h" @@ -28,12 +33,10 @@ #include "lib/ffmpeg_content.h" #include "lib/audio_content.h" #include "test.h" -#include #include using std::cout; using boost::shared_ptr; -using boost::make_shared; BOOST_AUTO_TEST_CASE (isdcf_name_test) { @@ -78,7 +81,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) /* Test interior aspect ratio: shouldn't be shown with trailers */ - shared_ptr content = make_shared (film, "test/data/simple_testcard_640x480.png"); + shared_ptr content (new ImageContent (film, "test/data/simple_testcard_640x480.png")); film->examine_and_add_content (content); wait_for_jobs (); content->video->set_scale (VideoContentScale (Ratio::from_id ("133"))); @@ -90,6 +93,15 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_dcp_content_type (DCPContentType::from_isdcf_name ("XSN")); BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-133_DE-fr_US-R_4K_DI_20140704_PP_SMPTE_OV"); + /* And it should always be numeric */ + + content->video->set_scale (VideoContentScale (Ratio::from_id ("239"))); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-239_DE-fr_US-R_4K_DI_20140704_PP_SMPTE_OV"); + + content->video->set_scale (VideoContentScale (Ratio::from_id ("190"))); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-190_DE-fr_US-R_4K_DI_20140704_PP_SMPTE_OV"); + content->video->set_scale (VideoContentScale (Ratio::from_id ("133"))); + /* Test 3D */ film->set_three_d (true); @@ -130,7 +142,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) /* Test audio channel markup */ film->set_audio_channels (6); - shared_ptr sound = make_shared (film, "test/data/sine_440.wav"); + shared_ptr sound (new FFmpegContent (film, "test/data/sine_440.wav")); film->examine_and_add_content (sound); wait_for_jobs (); BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PP_SMPTE_OV");