summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/frame_info_hash_test.cc11
-rw-r--r--test/recovery_test.cc6
2 files changed, 10 insertions, 7 deletions
diff --git a/test/frame_info_hash_test.cc b/test/frame_info_hash_test.cc
index 331eabf1..edf89f5c 100644
--- a/test/frame_info_hash_test.cc
+++ b/test/frame_info_hash_test.cc
@@ -44,10 +44,11 @@
using std::make_shared;
using std::shared_ptr;
using std::string;
+using std::vector;
static void
-check (shared_ptr<dcp::J2KPictureAssetWriter> writer, boost::random::uniform_int_distribution<>& dist, boost::random::mt19937& rng, string hash)
+check(shared_ptr<dcp::J2KPictureAssetWriter> writer, boost::random::uniform_int_distribution<>& dist, boost::random::mt19937& rng, vector<uint8_t> hash)
{
auto xyz = make_shared<dcp::OpenJPEGImage>(dcp::Size(1998, 1080));
for (int c = 0; c < 3; ++c) {
@@ -59,7 +60,7 @@ check (shared_ptr<dcp::J2KPictureAssetWriter> writer, boost::random::uniform_int
auto data = dcp::compress_j2k (xyz, 100000000, 24, false, false);
auto info = writer->write (data.data(), data.size());
- BOOST_CHECK_EQUAL (info.hash, hash);
+ BOOST_CHECK(info.hash == hash);
}
@@ -73,7 +74,7 @@ BOOST_AUTO_TEST_CASE (frame_info_hash_test)
boost::random::uniform_int_distribution<> dist(0, 4095);
/* Check a few random frames */
- check(writer, dist, rng, "8f3dc7321d6dff3d5691011de31fc713");
- check(writer, dist, rng, "a305b83a40367fda1b5cf0efa096fd18");
- check(writer, dist, rng, "1abc71e011ced46d9928a4b2d22e20f6");
+ check(writer, dist, rng, vector<uint8_t>{0x8f, 0x3d, 0xc7, 0x32, 0x1d, 0x6d, 0xff, 0x3d, 0x56, 0x91, 0x01, 0x1d, 0xe3, 0x1f, 0xc7, 0x13});
+ check(writer, dist, rng, vector<uint8_t>{0xa3, 0x05, 0xb8, 0x3a, 0x40, 0x36, 0x7f, 0xda, 0x1b, 0x5c, 0xf0, 0xef, 0xa0, 0x96, 0xfd, 0x18});
+ check(writer, dist, rng, vector<uint8_t>{0x1a, 0xbc, 0x71, 0xe0, 0x11, 0xce, 0xd4, 0x6d, 0x99, 0x28, 0xa4, 0xb2, 0xd2, 0x2e, 0x20, 0xf6});
}
diff --git a/test/recovery_test.cc b/test/recovery_test.cc
index 327c248a..6eb48259 100644
--- a/test/recovery_test.cc
+++ b/test/recovery_test.cc
@@ -43,6 +43,7 @@
using std::make_shared;
using std::shared_ptr;
using std::string;
+using std::vector;
/** Check that recovery from a partially-written MXF works */
@@ -58,10 +59,11 @@ BOOST_AUTO_TEST_CASE (recovery)
auto mp = make_shared<dcp::MonoJ2KPictureAsset>(dcp::Fraction (24, 1), dcp::Standard::SMPTE);
auto writer = mp->start_write("build/test/baz/video1.mxf", dcp::Behaviour::MAKE_NEW);
+ auto ref = vector<uint8_t>{0xc3, 0xc9, 0xa3, 0xad, 0xec, 0x09, 0xba, 0xf2, 0xb0, 0xbc, 0xb6, 0x58, 0x06, 0xfb, 0xea, 0xc8};
uint64_t written_size = 0;
for (int i = 0; i < 24; ++i) {
auto info = writer->write (data.data(), data.size());
- BOOST_CHECK_EQUAL (info.hash, "c3c9a3adec09baf2b0bcb65806fbeac8");
+ BOOST_CHECK(info.hash == ref);
written_size = info.size;
}
@@ -88,7 +90,7 @@ BOOST_AUTO_TEST_CASE (recovery)
writer->write (data.data(), data.size());
for (int i = 1; i < 4; ++i) {
- writer->fake_write(dcp::J2KFrameInfo{0, written_size, "xxx"});
+ writer->fake_write(dcp::J2KFrameInfo{0, written_size, vector<uint8_t>{0x42, 0x42, 0x42}});
}
for (int i = 4; i < 24; ++i) {