diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-09-29 09:12:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-09-29 09:12:31 +0100 |
| commit | 140b6c89909dbb47e85989df6a5f1ea16009d1dd (patch) | |
| tree | 31063aafe6580dec0060ff63f351525fdadd1e48 /test | |
| parent | 13993e692e7a9b0f41e04c863964f086b10c6c04 (diff) | |
Test KDMKeys reload.
Diffstat (limited to 'test')
| -rw-r--r-- | test/round_trip_test.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/round_trip_test.cc b/test/round_trip_test.cc index 2747a71f..fe720142 100644 --- a/test/round_trip_test.cc +++ b/test/round_trip_test.cc @@ -31,6 +31,7 @@ #include "argb_frame.h" #include "signer_chain.h" +using std::list; using boost::shared_ptr; /* Build an encrypted picture MXF and a KDM for it and check that the KDM can be decrypted */ @@ -86,6 +87,18 @@ BOOST_AUTO_TEST_CASE (round_trip_test) /* Reload the KDM, using our private key to decrypt it */ libdcp::KDM kdm_B (kdm_file, "build/test/signer/leaf.key"); + /* Check that the decrypted KDMKeys are the same as the ones we started with */ + BOOST_CHECK_EQUAL (kdm_A.keys().size(), kdm_B.keys().size()); + list<libdcp::KDMKey> keys_A = kdm_A.keys (); + list<libdcp::KDMKey> keys_B = kdm_B.keys (); + list<libdcp::KDMKey>::const_iterator i = keys_A.begin(); + list<libdcp::KDMKey>::const_iterator j = keys_B.begin(); + while (i != keys_A.end ()) { + BOOST_CHECK (*i == *j); + ++i; + ++j; + } + /* Reload the picture MXF */ shared_ptr<libdcp::MonoPictureAsset> asset_B ( new libdcp::MonoPictureAsset (work_dir, "video.mxf") |
