diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-12-01 22:30:58 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-09-14 22:27:41 +0200 |
| commit | f19abd2f18c890018269d95c345b507c6cb9d315 (patch) | |
| tree | 6f886274b2f91a546270c90c6a865de5c0fe0fda /test/kdm_naming_test.cc | |
| parent | 6a7b01a6703ce2f19dd3a2bf104e0ccd39150dc9 (diff) | |
Move UTC offset for KDMs from the cinema to the point of KDM creation (#2300).v2.17.7
Diffstat (limited to 'test/kdm_naming_test.cc')
| -rw-r--r-- | test/kdm_naming_test.cc | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/test/kdm_naming_test.cc b/test/kdm_naming_test.cc index 32500553e..0f44fe2ea 100644 --- a/test/kdm_naming_test.cc +++ b/test/kdm_naming_test.cc @@ -59,16 +59,14 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test) auto crypt_cert = c->decryption_chain()->leaf(); - /* Cinema A: UTC +4:30 */ - auto cinema_a = make_shared<Cinema>("Cinema A", vector<string>(), "", 4, 30); + auto cinema_a = make_shared<Cinema>("Cinema A", vector<string>(), ""); cinema_a_screen_1 = std::make_shared<dcpomatic::Screen>("Screen 1", "", crypt_cert, boost::none, vector<TrustedDevice>()); cinema_a->add_screen (cinema_a_screen_1); cinema_a_screen_2 = std::make_shared<dcpomatic::Screen>("Screen 2", "", crypt_cert, boost::none, vector<TrustedDevice>()); cinema_a->add_screen (cinema_a_screen_2); c->add_cinema (cinema_a); - /* Cinema B: UTC -1:00 */ - auto cinema_b = make_shared<Cinema>("Cinema B", vector<string>(), "", -1, 0); + auto cinema_b = make_shared<Cinema>("Cinema B", vector<string>(), ""); cinema_b_screen_x = std::make_shared<dcpomatic::Screen>("Screen X", "", crypt_cert, boost::none, vector<TrustedDevice>()); cinema_b->add_screen (cinema_b_screen_x); cinema_b_screen_y = std::make_shared<dcpomatic::Screen>("Screen Y", "", crypt_cert, boost::none, vector<TrustedDevice>()); @@ -90,14 +88,13 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test) auto sign_cert = c->signer_chain()->leaf(); - dcp::LocalTime from (sign_cert.not_before()); + dcp::LocalTime from = sign_cert.not_before(); + from.set_offset({ 4, 30 }); from.add_months (2); - dcp::LocalTime until (sign_cert.not_after()); + dcp::LocalTime until = sign_cert.not_after(); + until.set_offset({ 4, 30 }); until.add_months (-2); - auto const from_string = from.date() + " " + from.time_of_day(true, false); - auto const until_string = until.date() + " " + until.time_of_day(true, false); - std::vector<KDMCertificatePeriod> period_checks; auto cpl = cpls.front().cpl_file; @@ -107,8 +104,8 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test) auto kdm = kdm_for_screen ( make_kdm, cinema_a_screen_1, - boost::posix_time::time_from_string(from_string), - boost::posix_time::time_from_string(until_string), + from, + until, dcp::Formulation::MODIFIED_TRANSITIONAL_1, false, optional<int>(), @@ -157,9 +154,6 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on( dcp::LocalTime until (sign_cert.not_after()); until.add_months (-2); - string const from_string = from.date() + " " + from.time_of_day(true, false); - string const until_string = until.date() + " " + until.time_of_day(true, false); - vector<shared_ptr<dcpomatic::Screen>> screens = { cinema_a_screen_2, cinema_b_screen_x, cinema_a_screen_1, (cinema_b_screen_z) }; @@ -178,8 +172,8 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on( auto kdm = kdm_for_screen ( make_kdm, i, - boost::posix_time::time_from_string(from_string), - boost::posix_time::time_from_string(until_string), + from, + until, dcp::Formulation::MODIFIED_TRANSITIONAL_1, false, optional<int>(), |
