summaryrefslogtreecommitdiff
path: root/test/encryption_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-09-25 20:41:45 +0100
committerCarl Hetherington <cth@carlh.net>2013-09-25 20:41:45 +0100
commitf76647abae551840a43bb8f07189051ec20bab6d (patch)
tree12d67e33c71516480cb71381bc426dfe18513821 /test/encryption_test.cc
parente8530ea06f0b0883e5e19dd18beed70732ac5d3c (diff)
Switch away from the many-constructor-arguments approach to a hopefully simpler API.
Diffstat (limited to 'test/encryption_test.cc')
-rw-r--r--test/encryption_test.cc49
1 files changed, 23 insertions, 26 deletions
diff --git a/test/encryption_test.cc b/test/encryption_test.cc
index 82d5fe27..aa83d3ec 100644
--- a/test/encryption_test.cc
+++ b/test/encryption_test.cc
@@ -29,6 +29,7 @@
#include "sound_asset.h"
#include "reel.h"
#include "test.h"
+#include "signer_chain.h"
using boost::shared_ptr;
@@ -37,6 +38,10 @@ using boost::shared_ptr;
*/
BOOST_AUTO_TEST_CASE (encryption)
{
+ boost::filesystem::remove_all ("build/test/signer");
+ boost::filesystem::create_directory ("build/test/signer");
+ libdcp::make_signer_chain ("build/test/signer");
+
Kumu::libdcp_test = true;
libdcp::MXFMetadata mxf_metadata;
@@ -66,36 +71,28 @@ BOOST_AUTO_TEST_CASE (encryption)
);
shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("build/test/bar", "A Test DCP", libdcp::FEATURE, 24, 24));
-
- shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset (
- j2c,
- "build/test/bar",
- "video.mxf",
- &d.Progress,
- 24,
- 24,
- libdcp::Size (32, 32),
- false,
- mxf_metadata
- ));
libdcp::Key key;
-
+
+ shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/bar", "video.mxf"));
+ mp->set_progress (&d.Progress);
+ mp->set_edit_rate (24);
+ mp->set_intrinsic_duration (24);
+ mp->set_duration (24);
+ mp->set_size (libdcp::Size (32, 32));
+ mp->set_metadata (mxf_metadata);
mp->set_key (key);
-
- shared_ptr<libdcp::SoundAsset> ms (new libdcp::SoundAsset (
- wav,
- "build/test/bar",
- "audio.mxf",
- &(d.Progress),
- 24,
- 24,
- 2,
- false,
- mxf_metadata
- ));
-
+ mp->create (j2c);
+
+ shared_ptr<libdcp::SoundAsset> ms (new libdcp::SoundAsset ("build/test/bar", "audio.mxf"));
+ ms->set_progress (&d.Progress);
+ ms->set_edit_rate (24);
+ ms->set_intrinsic_duration (24);
+ mp->set_duration (24);
+ ms->set_channels (2);
+ ms->set_metadata (mxf_metadata);
ms->set_key (key);
+ ms->create (wav);
cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (mp, ms, shared_ptr<libdcp::SubtitleAsset> ())));
d.add_cpl (cpl);