Warn/error on making KDMs using recipient certs whose validity periods
[dcpomatic.git] / test / kdm_naming_test.cc
index f53f4aba2102d1987a324400884c628883ac6aef..994217a14e7a02878fde4a341ee72cd7cdd48fac 100644 (file)
@@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
        boost::filesystem::remove_all ("build/test/single_kdm_naming_test");
        auto film = new_test_film2 ("single_kdm_naming_test");
        film->set_name ("my_great_film");
-       film->examine_and_add_content (content_factory("test/data/flat_black.png").front());
+       film->examine_and_add_content (content_factory("test/data/flat_black.png")[0]);
        BOOST_REQUIRE (!wait_for_jobs());
        film->set_encrypted (true);
        make_and_verify_dcp (film);
@@ -98,6 +98,8 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
        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;
        auto kdm = kdm_for_screen (
                        film,
@@ -107,7 +109,8 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
                        boost::posix_time::time_from_string(until_string),
                        dcp::Formulation::MODIFIED_TRANSITIONAL_1,
                        false,
-                       optional<int>()
+                       optional<int>(),
+                       period_checks
                        );
 
        write_files (
@@ -136,7 +139,7 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on(
        boost::filesystem::remove_all ("build/test/directory_kdm_naming_test");
        auto film = new_test_film2 (
                "directory_kdm_naming_test",
-               { content_factory("test/data/flat_black.png").front() }
+               { content_factory("test/data/flat_black.png")[0] }
                );
 
        film->set_name ("my_great_film");
@@ -162,6 +165,7 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on(
        auto const cpl = cpls.front().cpl_file;
        auto const cpl_id = cpls.front().cpl_id;
 
+       std::vector<KDMCertificatePeriod> period_checks;
        list<KDMWithMetadataPtr> kdms;
        for (auto i: screens) {
                auto kdm = kdm_for_screen (
@@ -172,7 +176,8 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on(
                                boost::posix_time::time_from_string(until_string),
                                dcp::Formulation::MODIFIED_TRANSITIONAL_1,
                                false,
-                               optional<int>()
+                               optional<int>(),
+                               period_checks
                                );
 
                kdms.push_back (kdm);