summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-04-09 02:02:28 +0200
committerCarl Hetherington <cth@carlh.net>2024-04-17 09:36:45 +0200
commitaf20e21e2363f7c4d5f7031c444984f383c26914 (patch)
tree072277c1a9c48d81367384d0c0f4a3ae356ce54e /test
parent39960bc88eee794ade1a73b00523e749945b9eab (diff)
Separate GUI verifier with basic reporting (#1823).
Diffstat (limited to 'test')
-rw-r--r--test/reels_test.cc36
-rw-r--r--test/test.cc6
2 files changed, 27 insertions, 15 deletions
diff --git a/test/reels_test.cc b/test/reels_test.cc
index d4a783f91..df4bbbbe6 100644
--- a/test/reels_test.cc
+++ b/test/reels_test.cc
@@ -54,6 +54,14 @@ using std::vector;
using namespace dcpomatic;
+static
+void
+filter_ok(std::vector<dcp::VerificationNote>& notes)
+{
+ notes.erase(std::remove_if(notes.begin(), notes.end(), [](dcp::VerificationNote const& note) { return note.type() == dcp::VerificationNote::Type::OK; }), notes.end());
+}
+
+
/** Test Film::reels() */
BOOST_AUTO_TEST_CASE (reels_test1)
{
@@ -508,9 +516,10 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short1)
make_and_verify_dcp (film);
vector<boost::filesystem::path> dirs = { film->dir(film->dcp_name(false)) };
- auto notes = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
- dump_notes (notes);
- BOOST_REQUIRE (notes.empty());
+ auto result = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
+ filter_ok(result.notes);
+ dump_notes(result.notes);
+ BOOST_REQUIRE(result.notes.empty());
}
@@ -533,9 +542,10 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short2)
make_and_verify_dcp (film);
vector<boost::filesystem::path> dirs = { film->dir(film->dcp_name(false)) };
- auto const notes = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
- dump_notes (notes);
- BOOST_REQUIRE (notes.empty());
+ auto result = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
+ filter_ok(result.notes);
+ dump_notes(result.notes);
+ BOOST_REQUIRE(result.notes.empty());
}
@@ -554,9 +564,10 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short3)
make_and_verify_dcp (film);
- auto const notes = dcp::verify({}, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
- dump_notes (notes);
- BOOST_REQUIRE (notes.empty());
+ auto result = dcp::verify({}, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
+ filter_ok(result.notes);
+ dump_notes(result.notes);
+ BOOST_REQUIRE(result.notes.empty());
}
@@ -584,9 +595,10 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short4)
BOOST_REQUIRE (!wait_for_jobs());
vector<boost::filesystem::path> dirs = { film->dir(film->dcp_name(false)) };
- auto const notes = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
- dump_notes (notes);
- BOOST_REQUIRE (notes.empty());
+ auto result = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
+ filter_ok(result.notes);
+ dump_notes(result.notes);
+ BOOST_REQUIRE(result.notes.empty());
}
diff --git a/test/test.cc b/test/test.cc
index ff4a3c9c0..4064f9b0e 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -965,10 +965,10 @@ void progress (float) {}
void
verify_dcp(boost::filesystem::path dir, vector<dcp::VerificationNote::Code> ignore)
{
- auto notes = dcp::verify({dir}, {}, &stage, &progress, {}, TestPaths::xsd());
+ auto result = dcp::verify({dir}, {}, &stage, &progress, {}, TestPaths::xsd());
bool ok = true;
- for (auto i: notes) {
- if (find(ignore.begin(), ignore.end(), i.code()) == ignore.end()) {
+ for (auto i: result.notes) {
+ if (i.type() != dcp::VerificationNote::Type::OK && find(ignore.begin(), ignore.end(), i.code()) == ignore.end()) {
std::cout << "\t" << dcp::note_to_string(i) << "\n";
ok = false;
}