summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-02-18 00:15:10 +0100
committerCarl Hetherington <cth@carlh.net>2023-05-13 08:54:58 +0200
commita4c510f8e3730d918c5ba54b1b4aaf307d748e0f (patch)
tree5ff2454617e3d09729f8d7508c68dbda7ec586b1
parente0935244e27bcc5e87588900e1010b291ee631bc (diff)
Add verify_dcp().
-rw-r--r--test/test.cc17
-rw-r--r--test/test.h1
2 files changed, 13 insertions, 5 deletions
diff --git a/test/test.cc b/test/test.cc
index c91701e55..354a79e26 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -937,12 +937,9 @@ void progress (float) {}
void
-make_and_verify_dcp (shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore)
+verify_dcp(boost::filesystem::path dir, vector<dcp::VerificationNote::Code> ignore)
{
- film->write_metadata ();
- make_dcp (film, TranscodeJob::ChangedBehaviour::IGNORE);
- BOOST_REQUIRE (!wait_for_jobs());
- auto notes = dcp::verify({film->dir(film->dcp_name())}, &stage, &progress, {}, TestPaths::xsd());
+ auto notes = dcp::verify({dir}, &stage, &progress, {}, TestPaths::xsd());
bool ok = true;
for (auto i: notes) {
if (find(ignore.begin(), ignore.end(), i.code()) == ignore.end()) {
@@ -955,6 +952,16 @@ make_and_verify_dcp (shared_ptr<Film> film, vector<dcp::VerificationNote::Code>
void
+make_and_verify_dcp (shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore)
+{
+ film->write_metadata ();
+ make_dcp (film, TranscodeJob::ChangedBehaviour::IGNORE);
+ BOOST_REQUIRE (!wait_for_jobs());
+ verify_dcp({film->dir(film->dcp_name())}, ignore);
+}
+
+
+void
check_int_close (int a, int b, int d)
{
BOOST_CHECK_MESSAGE (std::abs(a - b) < d, a << " differs from " << b << " by more than " << d);
diff --git a/test/test.h b/test/test.h
index 8399abf9a..01ddb1987 100644
--- a/test/test.h
+++ b/test/test.h
@@ -75,6 +75,7 @@ boost::filesystem::path dcp_file (std::shared_ptr<const Film> film, std::string
void check_one_frame (boost::filesystem::path dcp, int64_t index, boost::filesystem::path ref);
extern boost::filesystem::path subtitle_file (std::shared_ptr<Film> film);
extern void make_random_file (boost::filesystem::path path, size_t size);
+extern void verify_dcp(boost::filesystem::path dir, std::vector<dcp::VerificationNote::Code> ignore);
extern void make_and_verify_dcp (std::shared_ptr<Film> film, std::vector<dcp::VerificationNote::Code> ignore = {});
extern void check_int_close (int a, int b, int d);
extern void check_int_close (std::pair<int, int>, std::pair<int, int>, int d);