bool
dcp::operator== (dcp::VerificationNote const& a, dcp::VerificationNote const& b)
{
- return a.type() == b.type() && a.code() == b.code() && a.note() == b.note() && a.file() == b.file() && a.line() == b.line();
+ return a.type() == b.type() &&
+ a.code() == b.code() &&
+ a.note() == b.note() &&
+ a.file() == b.file() &&
+ a.line() == b.line() &&
+ a.frame() == b.frame() &&
+ a.component() == b.component() &&
+ a.size() == b.size() &&
+ a.id() == b.id() &&
+ a.other_id() == b.other_id();
}
return a.file().get_value_or("") < b.file().get_value_or("");
}
- return a.line().get_value_or(0) < b.line().get_value_or(0);
+ if (a.line() != b.line()) {
+ return a.line().get_value_or(0) < b.line().get_value_or(0);
+ }
+
+ if (a.frame() != b.frame()) {
+ return a.frame().get_value_or(0) < b.frame().get_value_or(0);
+ }
+
+ if (a.component() != b.component()) {
+ return a.component().get_value_or(0) < b.component().get_value_or(0);
+ }
+
+ if (a.size() != b.size()) {
+ return a.size().get_value_or(0) < b.size().get_value_or(0);
+ }
+
+ if (a.id() != b.id()) {
+ return a.id().get_value_or("") < b.id().get_value_or("");
+ }
+
+ return a.other_id().get_value_or("") < b.other_id().get_value_or("");
}
dcp->set_annotation_text("A Test DCP");
dcp->write_xml();
- check_verify_result(
- { path },
- {},
- {
- dcp::VerificationNote(dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_JPEG2000_TILE_PART_SIZE).set_frame(0).set_component(0).set_size(1321721),
- { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_SIZE_IN_BYTES, canonical(path / "video.mxf") },
- { dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::MISSING_FFOC },
- { dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::MISSING_LFOC },
- });
+ vector<dcp::VerificationNote> expected;
+
+ expected.push_back(
+ { dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_SIZE_IN_BYTES, canonical(path / "video.mxf") }
+ );
+
+ int component_sizes[] = {
+ 1321721,
+ 1294364,
+ 1289952,
+ };
+
+ for (auto frame = 0; frame < 24; frame++) {
+ for (auto component = 0; component < 3; component++) {
+ expected.push_back(
+ dcp::VerificationNote(
+ dcp::VerificationNote::Type::ERROR, dcp::VerificationNote::Code::INVALID_JPEG2000_TILE_PART_SIZE
+ ).set_frame(frame).set_component(component).set_size(component_sizes[component])
+ );
+ }
+ }
+
+ expected.push_back(
+ { dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::MISSING_FFOC }
+ );
+
+ expected.push_back(
+ { dcp::VerificationNote::Type::WARNING, dcp::VerificationNote::Code::MISSING_LFOC }
+ );
+
+ check_verify_result({ path }, {}, expected);
}