summaryrefslogtreecommitdiff
path: root/test/verify_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-09-03 01:52:14 +0200
committerCarl Hetherington <cth@carlh.net>2022-09-03 14:46:38 +0200
commit1d13ce8be4df51e85b7222a7c9d357366c841a89 (patch)
tree1be0a392051a1f520eef79778379497db800c22e /test/verify_test.cc
parent6740903432bca2ab447a47ac773a735d4f1f2e50 (diff)
Properly support ContentKind scope attribute.v1.8.26
Diffstat (limited to 'test/verify_test.cc')
-rw-r--r--test/verify_test.cc54
1 files changed, 52 insertions, 2 deletions
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 20bef0fa..0b65c9d3 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -419,8 +419,10 @@ BOOST_AUTO_TEST_CASE (verify_failed_read_content_kind)
check_verify_result (
{ dir },
- {{ dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::FAILED_READ, string("Bad content kind 'xtrailer'")}}
- );
+ {
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, dcp_test1_cpl_id, canonical(dir / dcp_test1_cpl) },
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_CONTENT_KIND, string("xtrailer") }
+ });
}
@@ -3159,3 +3161,51 @@ BOOST_AUTO_TEST_CASE (verify_unexpected_things_in_main_markers)
});
}
+
+BOOST_AUTO_TEST_CASE(verify_invalid_content_kind)
+{
+ path dir = "build/test/verify_invalid_content_kind";
+ prepare_directory (dir);
+ auto dcp = make_simple (dir, 1, 24);
+ dcp->set_annotation_text("A Test DCP");
+ dcp->write_xml();
+
+ {
+ Editor e(find_cpl(dir));
+ e.replace("trailer", "trip");
+ }
+
+ dcp::CPL cpl (find_cpl(dir));
+
+ check_verify_result (
+ { dir },
+ {
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl.id(), canonical(find_cpl(dir)) },
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_CONTENT_KIND, string("trip") }
+ });
+
+}
+
+
+BOOST_AUTO_TEST_CASE(verify_valid_content_kind)
+{
+ path dir = "build/test/verify_valid_content_kind";
+ prepare_directory (dir);
+ auto dcp = make_simple (dir, 1, 24);
+ dcp->set_annotation_text("A Test DCP");
+ dcp->write_xml();
+
+ {
+ Editor e(find_cpl(dir));
+ e.replace("<ContentKind>trailer</ContentKind>", "<ContentKind scope=\"http://bobs.contents/\">trip</ContentKind>");
+ }
+
+ dcp::CPL cpl (find_cpl(dir));
+
+ check_verify_result (
+ { dir },
+ {
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl.id(), canonical(find_cpl(dir)) },
+ });
+
+}