summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/verify.cc38
-rw-r--r--src/verify.h2
-rw-r--r--test/verify_test.cc20
3 files changed, 32 insertions, 28 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 40a7d44f..432d5b1f 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -1463,17 +1463,19 @@ verify_reel(
if (main_picture_active_area) {
if (main_picture_active_area->width > asset_size.width) {
context.add_note(
- VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA,
- String::compose("width %1 is bigger than the asset width %2", main_picture_active_area->width, asset_size.width),
- context.cpl->file().get()
- );
+ VerificationNote(
+ VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA,
+ context.cpl->file().get()
+ ).set_error(fmt::format("width {} is bigger than the asset width {}", main_picture_active_area->width, asset_size.width))
+ );
}
if (main_picture_active_area->height > asset_size.height) {
context.add_note(
- VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA,
- String::compose("height %1 is bigger than the asset height %2", main_picture_active_area->height, asset_size.height),
- context.cpl->file().get()
- );
+ VerificationNote(
+ VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA,
+ context.cpl->file().get()
+ ).set_error(fmt::format("height {} is bigger than the asset height {}", main_picture_active_area->height, asset_size.height))
+ );
}
}
}
@@ -1650,18 +1652,20 @@ verify_cpl(Context& context, shared_ptr<const CPL> cpl)
bool active_area_ok = true;
if (main_picture_active_area && (main_picture_active_area->width % 2)) {
context.add_note(
- VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA,
- String::compose("width %1 is not a multiple of 2", main_picture_active_area->width),
- cpl->file().get()
- );
+ VerificationNote(
+ VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA,
+ cpl->file().get()
+ ).set_error(fmt::format("width {} is not a multiple of 2", main_picture_active_area->width))
+ );
active_area_ok = false;
}
if (main_picture_active_area && (main_picture_active_area->height % 2)) {
context.add_note(
- VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA,
- String::compose("height %1 is not a multiple of 2", main_picture_active_area->height),
- cpl->file().get()
- );
+ VerificationNote(
+ VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA,
+ cpl->file().get()
+ ).set_error(fmt::format("height {} is not a multiple of 2", main_picture_active_area->height))
+ );
active_area_ok = false;
}
@@ -2174,7 +2178,7 @@ dcp::note_to_string(VerificationNote note, function<string (string)> process_str
case VerificationNote::Code::VALID_CONTENT_KIND:
return compose("Valid <ContentKind> %1.", *note.content_kind());
case VerificationNote::Code::INVALID_MAIN_PICTURE_ACTIVE_AREA:
- return compose("<MainPictureActiveaArea> has an invalid value: %1", note.note().get());
+ return compose("<MainPictureActiveaArea> has an invalid value: %1", *note.error());
case VerificationNote::Code::VALID_MAIN_PICTURE_ACTIVE_AREA:
return compose("<MainPictureActiveaArea> %1 is valid", note.note().get());
case VerificationNote::Code::DUPLICATE_ASSET_ID_IN_PKL:
diff --git a/src/verify.h b/src/verify.h
index b2e8000f..4425a0c2 100644
--- a/src/verify.h
+++ b/src/verify.h
@@ -500,7 +500,7 @@ public:
*/
VALID_CONTENT_KIND,
/** Either the width or height of a _<MainPictureActiveArea>_ in a CPL is either not an even number, or bigger than the corresponding asset dimension
- * note contains details of what is wrong
+ * error contains details of what is wrong
* file contains the CPL filename
* reel_index contains the reel index (starting from 0)
*/
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 09884b4b..5afc3e2e 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -5220,11 +5220,11 @@ BOOST_AUTO_TEST_CASE(verify_invalid_main_picture_active_area_1)
VC::MISMATCHED_CPL_HASHES, canonical(find_cpl(dir))
).set_cpl_id(cpl->id()).set_reference_hash(calc.old_hash()).set_calculated_hash(calc.new_hash()),
VN(
- VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, "width 1997 is not a multiple of 2", canonical(find_cpl(dir))
- ).set_cpl_id(cpl->id()),
+ VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, canonical(find_cpl(dir))
+ ).set_cpl_id(cpl->id()).set_error("width 1997 is not a multiple of 2"),
VN(
- VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, "height 4080 is bigger than the asset height 1080", canonical(find_cpl(dir))
- ).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(picture_id),
+ VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, canonical(find_cpl(dir))
+ ).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(picture_id).set_error("height 4080 is bigger than the asset height 1080"),
});
}
@@ -5269,14 +5269,14 @@ BOOST_AUTO_TEST_CASE(verify_invalid_main_picture_active_area_2)
VC::MISMATCHED_CPL_HASHES, canonical(find_cpl(dir))
).set_cpl_id(cpl->id()).set_reference_hash(calc.old_hash()).set_calculated_hash(calc.new_hash()),
VN(
- VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, "height 5125 is not a multiple of 2", canonical(find_cpl(dir))
- ).set_cpl_id(cpl->id()),
+ VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, canonical(find_cpl(dir))
+ ).set_cpl_id(cpl->id()).set_error("height 5125 is not a multiple of 2"),
VN(
- VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, "width 9900 is bigger than the asset width 1998", canonical(find_cpl(dir))
- ).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(picture_id),
+ VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, canonical(find_cpl(dir))
+ ).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(picture_id).set_error("width 9900 is bigger than the asset width 1998"),
VN(
- VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, "height 5125 is bigger than the asset height 1080", canonical(find_cpl(dir))
- ).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(picture_id),
+ VC::INVALID_MAIN_PICTURE_ACTIVE_AREA, canonical(find_cpl(dir))
+ ).set_cpl_id(cpl->id()).set_reel_index(0).set_asset_id(picture_id).set_error("height 5125 is bigger than the asset height 1080"),
});
}