summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-12-09 00:44:07 +0100
committerCarl Hetherington <cth@carlh.net>2019-12-22 01:21:00 +0100
commit66bd89f87412736ba2488f5b3ca4aec9dea8ef94 (patch)
tree05e961c0b4ca0f90f376e63f5adf6d8b03a1985b /test
parent84d01dde2fb2520572d122d53e1ffebefed48157 (diff)
Check ASSETMAP; add a PKL test; tidy up calls to validate_xml().
Diffstat (limited to 'test')
-rw-r--r--test/verify_test.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/verify_test.cc b/test/verify_test.cc
index f23e54c4..9ac19ada 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -120,6 +120,7 @@ BOOST_AUTO_TEST_CASE (verify_test1)
boost::filesystem::path const cpl_file = "build/test/verify_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml";
boost::filesystem::path const pkl_file = "build/test/verify_test1/pkl_ae8a9818-872a-4f86-8493-11dfdea03e09.xml";
+ boost::filesystem::path const assetmap_file = "build/test/verify_test1/ASSETMAP.xml";
list<pair<string, optional<boost::filesystem::path> > >::const_iterator st = stages.begin();
BOOST_CHECK_EQUAL (st->first, "Checking DCP");
@@ -145,6 +146,10 @@ BOOST_AUTO_TEST_CASE (verify_test1)
BOOST_REQUIRE (st->second);
BOOST_CHECK_EQUAL (st->second.get(), boost::filesystem::canonical(pkl_file));
++st;
+ BOOST_CHECK_EQUAL (st->first, "Checking ASSETMAP");
+ BOOST_REQUIRE (st->second);
+ BOOST_CHECK_EQUAL (st->second.get(), boost::filesystem::canonical(assetmap_file));
+ ++st;
BOOST_REQUIRE (st == stages.end());
dump_notes (notes);
@@ -240,6 +245,20 @@ cpl (int n)
}
static
+boost::filesystem::path
+pkl (int n)
+{
+ return dcp::String::compose("build/test/verify_test%1/pkl_ae8a9818-872a-4f86-8493-11dfdea03e09.xml", n);
+}
+
+static
+boost::filesystem::path
+asset_map (int n)
+{
+ return dcp::String::compose("build/test/verify_test%1/ASSETMAP.xml", n);
+}
+
+static
void check_after_replace (int n, boost::function<boost::filesystem::path (int)> file, string from, string to, dcp::VerificationNote::Code code1)
{
vector<boost::filesystem::path> directories = setup (n);
@@ -380,3 +399,23 @@ BOOST_AUTO_TEST_CASE (verify_test10)
dcp::VerificationNote::Code::CPL_HASH_INCORRECT
);
}
+
+/* Badly-formatted <Id> in PKL */
+BOOST_AUTO_TEST_CASE (verify_test11)
+{
+ check_after_replace (
+ 11, &pkl,
+ "<Id>urn:uuid:ae8", "<Id>urn:uuid:xe8",
+ dcp::VerificationNote::Code::XML_VALIDATION_ERROR
+ );
+}
+
+/* Badly-formatted <Id> in ASSETMAP */
+BOOST_AUTO_TEST_CASE (verify_test12)
+{
+ check_after_replace (
+ 12, &asset_map,
+ "<Id>urn:uuid:74e", "<Id>urn:uuid:x4e",
+ dcp::VerificationNote::Code::XML_VALIDATION_ERROR
+ );
+}