diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-01-06 08:28:18 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-01-10 13:09:45 +0000 |
| commit | 93f29880839dc5589bb35f63260a7152ead7655f (patch) | |
| tree | 865dd65298dd11d949efed2ac3f58f3564c7cc8f /test/decryption_test.cc | |
| parent | d7965cce4c5f95da7971bce6f800739a4cd2f17d (diff) | |
Introduce dc::Package, changing lots of namespaces in the process.
Diffstat (limited to 'test/decryption_test.cc')
| -rw-r--r-- | test/decryption_test.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/decryption_test.cc b/test/decryption_test.cc index 322d910c..48e014d6 100644 --- a/test/decryption_test.cc +++ b/test/decryption_test.cc @@ -38,19 +38,19 @@ using boost::dynamic_pointer_cast; using boost::shared_ptr; using boost::scoped_array; -pair<uint8_t*, dcp::dc::Size> +pair<uint8_t*, dcp::Size> get_frame (dcp::dc::Package const & dcp) { shared_ptr<const dcp::dc::Reel> reel = dcp.cpls().front()->reels().front (); - shared_ptr<dcp::dc::PictureAsset> picture = reel->main_picture()->asset (); + shared_ptr<dcp::PictureAsset> picture = reel->main_picture()->asset (); BOOST_CHECK (picture); - shared_ptr<const dcp::dc::MonoPictureAsset> mono_picture = dynamic_pointer_cast<const dcp::dc::MonoPictureAsset> (picture); - shared_ptr<const dcp::dc::MonoPictureFrame> j2k_frame = mono_picture->get_frame (0); - shared_ptr<dcp::dc::OpenJPEGImage> xyz = j2k_frame->xyz_image(); + shared_ptr<const dcp::MonoPictureAsset> mono_picture = dynamic_pointer_cast<const dcp::MonoPictureAsset> (picture); + shared_ptr<const dcp::MonoPictureFrame> j2k_frame = mono_picture->get_frame (0); + shared_ptr<dcp::OpenJPEGImage> xyz = j2k_frame->xyz_image(); uint8_t* argb = new uint8_t[xyz->size().width * xyz->size().height * 4]; - dcp::dc::xyz_to_rgba (j2k_frame->xyz_image(), dcp::dc::ColourConversion::srgb_to_xyz(), argb); + dcp::xyz_to_rgba (j2k_frame->xyz_image(), dcp::ColourConversion::srgb_to_xyz(), argb); return make_pair (argb, xyz->size ()); } @@ -71,15 +71,15 @@ BOOST_AUTO_TEST_CASE (decryption_test) dcp::dc::DecryptedKDM kdm ( dcp::dc::EncryptedKDM ( - dcp::dc::file_to_string ("test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml") + dcp::file_to_string ("test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml") ), - dcp::dc::file_to_string ("test/data/private.key") + dcp::file_to_string ("test/data/private.key") ); encrypted.add (kdm); - pair<uint8_t *, dcp::dc::Size> plaintext_frame = get_frame (plaintext); - pair<uint8_t *, dcp::dc::Size> encrypted_frame = get_frame (encrypted); + pair<uint8_t *, dcp::Size> plaintext_frame = get_frame (plaintext); + pair<uint8_t *, dcp::Size> encrypted_frame = get_frame (encrypted); /* Check that plaintext and encrypted are the same */ @@ -102,7 +102,7 @@ BOOST_AUTO_TEST_CASE (decryption_test) BOOST_AUTO_TEST_CASE (failing_kdm_test) { dcp::dc::DecryptedKDM kdm ( - dcp::dc::EncryptedKDM (dcp::dc::file_to_string ("test/data/target.pem.crt.de5d4eba-e683-41ca-bdda-aa4ad96af3f4.kdm.xml")), - dcp::dc::file_to_string ("test/data/private.key") + dcp::dc::EncryptedKDM (dcp::file_to_string ("test/data/target.pem.crt.de5d4eba-e683-41ca-bdda-aa4ad96af3f4.kdm.xml")), + dcp::file_to_string ("test/data/private.key") ); } |
