summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-04-01 22:55:12 +0200
committerCarl Hetherington <cth@carlh.net>2025-12-15 17:13:38 +0100
commit0f525e4d9c1315236bb76cd2e8e38633c1dacd8e (patch)
treec73a6c3bf30593346000bd32d2c5f9caf6e341f1
parentda2837520e0d1f0d4d5aad04ee5bf11de303f6ed (diff)
Use error for INVALID_EXTENSION_METADATA.
-rw-r--r--src/verify.cc6
-rw-r--r--src/verify.h2
-rw-r--r--test/verify_test.cc20
3 files changed, 15 insertions, 13 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 81cfd7fb..6291788b 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -1395,10 +1395,12 @@ dcp::verify_extension_metadata(Context& context)
}
}
+ using VN = dcp::VerificationNote;
+
if (missing) {
context.bv21_error(VerificationNote::Code::MISSING_EXTENSION_METADATA, context.cpl->file().get());
} else if (!malformed.empty()) {
- context.bv21_error(VerificationNote::Code::INVALID_EXTENSION_METADATA, malformed, context.cpl->file().get());
+ context.add_note(VN(VN::Type::BV21_ERROR, VN::Code::INVALID_EXTENSION_METADATA, context.cpl->file().get()).set_error(malformed));
}
}
@@ -2135,7 +2137,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str
case VerificationNote::Code::MISSING_EXTENSION_METADATA:
return compose("The CPL %1 has no <ExtensionMetadata> in its <CompositionMetadataAsset>.", note.cpl_id().get());
case VerificationNote::Code::INVALID_EXTENSION_METADATA:
- return compose("The CPL %1 has a malformed <ExtensionMetadata> (%2).", filename(), note.note().get());
+ return compose("The CPL %1 has a malformed <ExtensionMetadata> (%2).", filename(), note.error().get());
case VerificationNote::Code::UNSIGNED_CPL_WITH_ENCRYPTED_CONTENT:
return compose("The CPL %1, which has encrypted content, is not signed.", note.cpl_id().get());
case VerificationNote::Code::UNSIGNED_PKL_WITH_ENCRYPTED_CONTENT:
diff --git a/src/verify.h b/src/verify.h
index 2c61771b..174a1125 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -336,7 +336,7 @@ public:
*/
MISSING_EXTENSION_METADATA,
/** _<ExtensionMetadata>_ does not have the correct form [Bv2.1_8.6.3]
- * note contains details of what's wrong
+ * error contains details of what's wrong
* file contains the CPL filename
*/
INVALID_EXTENSION_METADATA,
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 9a902034..4e93d3bb 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -4335,8 +4335,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_extension_metadata1)
dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->file().get()
).set_cpl_id(cpl->id()).set_reference_hash(calc.old_hash()).set_calculated_hash(calc.new_hash()),
dcp::VerificationNote(
- dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, string("<Name> should be 'Application'"), cpl->file().get()
- ).set_cpl_id(cpl->id())
+ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, cpl->file().get()
+ ).set_cpl_id(cpl->id()).set_error("<Name> should be 'Application'")
});
}
@@ -4376,8 +4376,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_extension_metadata2)
dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->file().get()
).set_cpl_id(cpl->id()).set_reference_hash(calc.old_hash()).set_calculated_hash(calc.new_hash()),
dcp::VerificationNote(
- dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, string("No correctly-formed DCP Constraints Profile found"), cpl->file().get()
- ).set_cpl_id(cpl->id())
+ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, cpl->file().get()
+ ).set_cpl_id(cpl->id()).set_error("No correctly-formed DCP Constraints Profile found")
});
}
@@ -4424,8 +4424,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata6)
dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->file().get()
).set_cpl_id(cpl->id()).set_reference_hash(calc.old_hash()).set_calculated_hash(calc.new_hash()),
dcp::VerificationNote(
- dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, string("No correctly-formed DCP Constraints Profile found"), cpl->file().get()
- ).set_cpl_id(cpl->id())
+ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, cpl->file().get()
+ ).set_cpl_id(cpl->id()).set_error("No correctly-formed DCP Constraints Profile found")
});
}
@@ -4465,8 +4465,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata7)
dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->file().get()
).set_cpl_id(cpl->id()).set_reference_hash(calc.old_hash()).set_calculated_hash(calc.new_hash()),
dcp::VerificationNote(
- dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, string("No correctly-formed DCP Constraints Profile found"), cpl->file().get()
- ).set_cpl_id(cpl->id())
+ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, cpl->file().get()
+ ).set_cpl_id(cpl->id()).set_error("No correctly-formed DCP Constraints Profile found")
});
}
@@ -4513,8 +4513,8 @@ BOOST_AUTO_TEST_CASE (verify_invalid_xml_cpl_extension_metadata8)
dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::MISMATCHED_CPL_HASHES, cpl->file().get()
).set_cpl_id(cpl->id()).set_reference_hash(calc.old_hash()).set_calculated_hash(calc.new_hash()),
dcp::VerificationNote(
- dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, string("No correctly-formed DCP Constraints Profile found"), cpl->file().get()
- ).set_cpl_id(cpl->id())
+ dcp::VerificationNote::Type::BV21_ERROR, dcp::VerificationNote::Code::INVALID_EXTENSION_METADATA, cpl->file().get()
+ ).set_cpl_id(cpl->id()).set_error("No correctly-formed DCP Constraints Profile found")
});
}