summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-01-06 19:30:00 +0000
committerCarl Hetherington <cth@carlh.net>2019-01-06 19:30:00 +0000
commitb8c235e96ee6ac9548263682eb6c92bf28fc29b0 (patch)
tree1c7e8a6ce0c2fc0d8c42fcff99da3b59f56cc0d5 /test
parent59f7cacd98de32c70787a4b4fb69cbddbc94016b (diff)
More DCP verification detail and testing.
Diffstat (limited to 'test')
-rw-r--r--test/verify_test.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 58bc5978..a7e703a2 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE (verify_test2)
list<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress);
- BOOST_CHECK_EQUAL (notes.size(), 2);
+ BOOST_REQUIRE_EQUAL (notes.size(), 2);
BOOST_CHECK_EQUAL (notes.front().type(), dcp::VerificationNote::VERIFY_ERROR);
BOOST_CHECK_EQUAL (notes.front().note(), "Picture asset hash is incorrect.");
BOOST_CHECK_EQUAL (notes.back().type(), dcp::VerificationNote::VERIFY_ERROR);
@@ -178,6 +178,26 @@ BOOST_AUTO_TEST_CASE (verify_test4)
list<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress);
- BOOST_CHECK_EQUAL (notes.size(), 1);
+ BOOST_REQUIRE_EQUAL (notes.size(), 1);
BOOST_CHECK_EQUAL (notes.front().note(), "Bad content kind 'xfeature'");
}
+
+/* FrameRate */
+BOOST_AUTO_TEST_CASE (verify_test5)
+{
+ vector<boost::filesystem::path> directories = setup (5);
+
+ boost::filesystem::path const cpl_file = "build/test/verify_test5/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml";
+
+ string cpl = dcp::file_to_string (cpl_file);
+ boost::algorithm::replace_all (cpl, "<FrameRate>24 1", "<FrameRate>99 1");
+ FILE* f = fopen(cpl_file.string().c_str(), "w");
+ fwrite(cpl.c_str(), cpl.length(), 1, f);
+ fclose(f);
+
+ list<dcp::VerificationNote> notes = dcp::verify (directories, &stage, &progress);
+
+ BOOST_REQUIRE_EQUAL (notes.size(), 2);
+ BOOST_CHECK_EQUAL (notes.front().note(), "CPL hash is incorrect.");
+ BOOST_CHECK_EQUAL (notes.back().note(), "Invalid frame rate for picture");
+}