X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fkdm_naming_test.cc;h=fb0f37dcf522957876a58fc7838051ddd81f71c5;hb=28111007e2e6fd62f5810be780706ae1618bd33f;hp=35188d5e602c56cad17b5743e87f9f50599b4ff6;hpb=47e29203daec51d313ed8ab8ef759752bce18d45;p=dcpomatic.git diff --git a/test/kdm_naming_test.cc b/test/kdm_naming_test.cc index 35188d5e6..fb0f37dcf 100644 --- a/test/kdm_naming_test.cc +++ b/test/kdm_naming_test.cc @@ -26,14 +26,14 @@ #include "lib/kdm_with_metadata.h" #include "test.h" #include -#include + using std::list; using std::string; using std::vector; -using boost::shared_ptr; +using std::shared_ptr; using boost::optional; -using boost::dynamic_pointer_cast; +using std::dynamic_pointer_cast; static bool @@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test) cinema_a_screen_1, boost::posix_time::time_from_string(from_string), boost::posix_time::time_from_string(until_string), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, false, optional() ); @@ -162,14 +162,14 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on( string const cpl_id = cpls.front().cpl_id; list kdms; - BOOST_FOREACH (shared_ptr i, screens) { + for (auto i: screens) { KDMWithMetadataPtr kdm = kdm_for_screen ( film, cpls.front().cpl_file, i, boost::posix_time::time_from_string(from_string), boost::posix_time::time_from_string(until_string), - dcp::MODIFIED_TRANSITIONAL_1, + dcp::Formulation::MODIFIED_TRANSITIONAL_1, false, optional() ); @@ -181,7 +181,12 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on( collect(kdms), path("build/test/directory_kdm_naming_test"), dcp::NameFormat("%c - %s - %f - %b - %e"), +#ifdef DCPOMATIC_WINDOWS + /* With %i in the format the path is too long for Windows */ + dcp::NameFormat("KDM %c - %s - %f - %b - %e"), +#else dcp::NameFormat("KDM %c - %s - %f - %b - %e - %i"), +#endif &confirm_overwrite ); @@ -197,16 +202,32 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on( path dir_b = String::compose("Cinema_B_-_%s_-_my_great_film_-_%1_%2_-_%3_%4", from.date(), from_time, until.date(), until_time); BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b), "Directory " << dir_b << " not found"); +#ifdef DCPOMATIC_WINDOWS + path ref = String::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time); +#else path ref = String::compose("KDM_Cinema_A_-_Screen_2_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id); +#endif BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a / ref), "File " << ref << " not found"); +#ifdef DCPOMATIC_WINDOWS + ref = String::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time); +#else ref = String::compose("KDM_Cinema_B_-_Screen_X_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id); +#endif BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b / ref), "File " << ref << " not found"); +#ifdef DCPOMATIC_WINDOWS + ref = String::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time); +#else ref = String::compose("KDM_Cinema_A_-_Screen_1_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id); +#endif BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_a / ref), "File " << ref << " not found"); +#ifdef DCPOMATIC_WINDOWS + ref = String::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4.xml", from.date(), from_time, until.date(), until_time); +#else ref = String::compose("KDM_Cinema_B_-_Screen_Z_-_my_great_film_-_%1_%2_-_%3_%4_-_%5.xml", from.date(), from_time, until.date(), until_time, cpl_id); +#endif BOOST_CHECK_MESSAGE (boost::filesystem::exists(base / dir_b / ref), "File " << ref << " not found"); }