summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/combine_test.cc2
-rw-r--r--test/dcp_test.cc34
-rw-r--r--test/read_dcp_test.cc2
-rw-r--r--test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml2
-rw-r--r--test/ref/DCP/dcp_test1/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml2
-rw-r--r--test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml2
-rw-r--r--test/ref/DCP/dcp_test7/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml2
-rw-r--r--test/test.cc2
-rw-r--r--test/verify_test.cc26
9 files changed, 38 insertions, 36 deletions
diff --git a/test/combine_test.cc b/test/combine_test.cc
index f6f4789c..54e908d4 100644
--- a/test/combine_test.cc
+++ b/test/combine_test.cc
@@ -312,7 +312,7 @@ BOOST_AUTO_TEST_CASE (combine_two_dcps_with_shared_asset)
mxf_meta.company_name = "OpenDCP";
mxf_meta.product_version = "0.0.25";
- shared_ptr<dcp::CPL> cpl (new dcp::CPL("A Test DCP", dcp::FEATURE));
+ shared_ptr<dcp::CPL> cpl (new dcp::CPL("A Test DCP", dcp::TRAILER));
cpl->set_content_version (
dcp::ContentVersion("urn:uuid:75ac29aa-42ac-1234-ecae-49251abefd11","content-version-label-text")
);
diff --git a/test/dcp_test.cc b/test/dcp_test.cc
index 3f395c53..b22202ea 100644
--- a/test/dcp_test.cc
+++ b/test/dcp_test.cc
@@ -47,6 +47,7 @@
#include "reel_stereo_picture_asset.h"
#include "reel_sound_asset.h"
#include "reel_atmos_asset.h"
+#include "reel_markers_asset.h"
#include <asdcp/KM_util.h>
#include <sndfile.h>
#include <boost/test/unit_test.hpp>
@@ -55,6 +56,7 @@ using std::string;
using std::vector;
using std::dynamic_pointer_cast;
using std::shared_ptr;
+using std::make_shared;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
@@ -175,35 +177,35 @@ static
void
test_rewriting_sound(string name, bool modify)
{
+ using namespace boost::filesystem;
+
dcp::DCP A ("test/ref/DCP/dcp_test1");
A.read ();
BOOST_REQUIRE (!A.cpls().empty());
BOOST_REQUIRE (!A.cpls().front()->reels().empty());
- shared_ptr<dcp::ReelMonoPictureAsset> A_picture = dynamic_pointer_cast<dcp::ReelMonoPictureAsset>(A.cpls().front()->reels().front()->main_picture());
+ auto A_picture = dynamic_pointer_cast<dcp::ReelMonoPictureAsset>(A.cpls().front()->reels().front()->main_picture());
BOOST_REQUIRE (A_picture);
- shared_ptr<dcp::ReelSoundAsset> A_sound = dynamic_pointer_cast<dcp::ReelSoundAsset>(A.cpls().front()->reels().front()->main_sound());
+ auto A_sound = dynamic_pointer_cast<dcp::ReelSoundAsset>(A.cpls().front()->reels().front()->main_sound());
+
+ string const picture = "j2c_5279f9aa-94d7-42a6-b0e0-e4eaec4e2a15.mxf";
- boost::filesystem::remove_all ("build/test/" + name);
+ remove_all ("build/test/" + name);
dcp::DCP B ("build/test/" + name);
- shared_ptr<dcp::Reel> reel(new dcp::Reel());
+ auto reel = make_shared<dcp::Reel>();
BOOST_REQUIRE (A_picture->mono_asset());
BOOST_REQUIRE (A_picture->mono_asset()->file());
- boost::filesystem::copy_file (A_picture->mono_asset()->file().get(), "build/test/" +name + "/picture.mxf");
- reel->add(
- shared_ptr<dcp::ReelMonoPictureAsset>(
- new dcp::ReelMonoPictureAsset(shared_ptr<dcp::MonoPictureAsset>(new dcp::MonoPictureAsset("build/test/" + name + "/picture.mxf")), 0)
- )
- );
+ copy_file (A_picture->mono_asset()->file().get(), path("build") / "test" / name / picture);
+ reel->add(make_shared<dcp::ReelMonoPictureAsset>(make_shared<dcp::MonoPictureAsset>(path("build") / "test" / name / picture), 0));
- shared_ptr<dcp::SoundAssetReader> reader = A_sound->asset()->start_read();
- shared_ptr<dcp::SoundAsset> sound(new dcp::SoundAsset(A_sound->asset()->edit_rate(), A_sound->asset()->sampling_rate(), A_sound->asset()->channels(), dcp::LanguageTag("en-US"), dcp::SMPTE));
- shared_ptr<dcp::SoundAssetWriter> writer = sound->start_write("build/test/" + name + "/sound.mxf", vector<dcp::Channel>());
+ auto reader = A_sound->asset()->start_read();
+ auto sound = make_shared<dcp::SoundAsset>(A_sound->asset()->edit_rate(), A_sound->asset()->sampling_rate(), A_sound->asset()->channels(), dcp::LanguageTag("en-US"), dcp::SMPTE);
+ auto writer = sound->start_write(path("build") / "test" / name / "pcm_8246f87f-e1df-4c42-a290-f3b3069ff021.mxf", {});
bool need_to_modify = modify;
for (int i = 0; i < A_sound->asset()->intrinsic_duration(); ++i) {
- shared_ptr<const dcp::SoundFrame> sf = reader->get_frame (i);
+ auto sf = reader->get_frame (i);
float* out[sf->channels()];
for (int j = 0; j < sf->channels(); ++j) {
out[j] = new float[sf->samples()];
@@ -224,9 +226,9 @@ test_rewriting_sound(string name, bool modify)
}
writer->finalize();
- reel->add(shared_ptr<dcp::ReelSoundAsset>(new dcp::ReelSoundAsset(sound, 0)));
+ reel->add(make_shared<dcp::ReelSoundAsset>(sound, 0));
- shared_ptr<dcp::CPL> cpl(new dcp::CPL("A Test DCP", dcp::FEATURE));
+ auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::TRAILER);
cpl->add (reel);
B.add (cpl);
diff --git a/test/read_dcp_test.cc b/test/read_dcp_test.cc
index b42a3c39..c529e5ea 100644
--- a/test/read_dcp_test.cc
+++ b/test/read_dcp_test.cc
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE (read_dcp_test1)
BOOST_REQUIRE (cpls[0]->annotation_text());
BOOST_CHECK_EQUAL (cpls[0]->annotation_text().get(), "A Test DCP");
- BOOST_CHECK_EQUAL (cpls[0]->content_kind(), dcp::FEATURE);
+ BOOST_CHECK_EQUAL (cpls[0]->content_kind(), dcp::TRAILER);
BOOST_REQUIRE (d.standard());
BOOST_CHECK_EQUAL (d.standard(), dcp::SMPTE);
}
diff --git a/test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml b/test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml
index ec32f39f..256c3a39 100644
--- a/test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml
+++ b/test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml
@@ -6,7 +6,7 @@
<Issuer>OpenDCP 0.0.25</Issuer>
<Creator>OpenDCP 0.0.25</Creator>
<ContentTitleText>A Test DCP</ContentTitleText>
- <ContentKind>feature</ContentKind>
+ <ContentKind>trailer</ContentKind>
<ContentVersion>
<Id>urn:uuid:75ac29aa-42ac-1234-ecae-49251abefd11</Id>
<LabelText>content-version-label-text</LabelText>
diff --git a/test/ref/DCP/dcp_test1/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml b/test/ref/DCP/dcp_test1/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml
index 870fb677..93386451 100644
--- a/test/ref/DCP/dcp_test1/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml
+++ b/test/ref/DCP/dcp_test1/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml
@@ -9,7 +9,7 @@
<Asset>
<Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id>
<AnnotationText>81fb54df-e1bf-4647-8788-ea7ba154375b</AnnotationText>
- <Hash>786I2gazclNFDZSUFBO6NfqbBbo=</Hash>
+ <Hash>QqphASVaO8SqRvmlJ0acJP6c0GE=</Hash>
<Size>1589</Size>
<Type>text/xml</Type>
</Asset>
diff --git a/test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml b/test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml
index faa322a3..9e307a2f 100644
--- a/test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml
+++ b/test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml
@@ -6,7 +6,7 @@
<Issuer>OpenDCP 0.0.25</Issuer>
<Creator>OpenDCP 0.0.25</Creator>
<ContentTitleText>A Test DCP</ContentTitleText>
- <ContentKind>feature</ContentKind>
+ <ContentKind>trailer</ContentKind>
<ContentVersion>
<Id>urn:uuid:75ac29aa-42ac-1234-ecae-49251abefd11</Id>
<LabelText>content-version-label-text</LabelText>
diff --git a/test/ref/DCP/dcp_test7/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml b/test/ref/DCP/dcp_test7/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml
index f5ed5055..fdb0c16c 100644
--- a/test/ref/DCP/dcp_test7/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml
+++ b/test/ref/DCP/dcp_test7/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml
@@ -9,7 +9,7 @@
<Asset>
<Id>urn:uuid:81fb54df-e1bf-4647-8788-ea7ba154375b</Id>
<AnnotationText>81fb54df-e1bf-4647-8788-ea7ba154375b</AnnotationText>
- <Hash>gcNHRpu5EEZrXIYyIMEqjA792h0=</Hash>
+ <Hash>WSXYtHMlxzMuhrEmXrRctm9Ij04=</Hash>
<Size>1587</Size>
<Type>text/xml;asdcpKind=CPL</Type>
</Asset>
diff --git a/test/test.cc b/test/test.cc
index ba309f0e..e43e5a70 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -322,7 +322,7 @@ make_simple (boost::filesystem::path path, int reels, int frames)
boost::filesystem::remove_all (path);
boost::filesystem::create_directories (path);
shared_ptr<dcp::DCP> d (new dcp::DCP (path));
- shared_ptr<dcp::CPL> cpl (new dcp::CPL ("A Test DCP", dcp::FEATURE));
+ shared_ptr<dcp::CPL> cpl (new dcp::CPL ("A Test DCP", dcp::TRAILER));
cpl->set_annotation_text ("A Test DCP");
cpl->set_issuer ("OpenDCP 0.0.25");
cpl->set_creator ("OpenDCP 0.0.25");
diff --git a/test/verify_test.cc b/test/verify_test.cc
index 0a9852ee..cfc3990c 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -108,7 +108,7 @@ write_dcp_with_single_asset (boost::filesystem::path dir, shared_ptr<dcp::ReelAs
{
auto reel = make_shared<dcp::Reel>();
reel->add (reel_asset);
- auto cpl = make_shared<dcp::CPL>("hello", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("hello", dcp::TRAILER);
cpl->add (reel);
auto dcp = make_shared<dcp::DCP>(dir);
dcp->add (cpl);
@@ -316,7 +316,7 @@ BOOST_AUTO_TEST_CASE (verify_test4)
BOOST_REQUIRE_EQUAL (notes.size(), 1);
BOOST_CHECK_EQUAL (notes.front().code(), dcp::VerificationNote::GENERAL_READ);
- BOOST_CHECK_EQUAL (*notes.front().note(), "Bad content kind 'xfeature'");
+ BOOST_CHECK_EQUAL (*notes.front().note(), "Bad content kind 'xtrailer'");
}
static
@@ -700,7 +700,7 @@ BOOST_AUTO_TEST_CASE (verify_test23)
auto reel = make_shared<dcp::Reel>();
reel->add (reel_asset);
- auto cpl = make_shared<dcp::CPL>("hello", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("hello", dcp::TRAILER);
cpl->add (reel);
cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-");
cpl->set_main_sound_sample_rate (48000);
@@ -737,7 +737,7 @@ BOOST_AUTO_TEST_CASE (verify_test24)
auto reel = make_shared<dcp::Reel>();
reel->add (black_picture_asset(dir));
- auto cpl = make_shared<dcp::CPL>("hello", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("hello", dcp::TRAILER);
cpl->add (reel);
cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-");
cpl->set_main_sound_sample_rate (48000);
@@ -772,7 +772,7 @@ BOOST_AUTO_TEST_CASE (verify_test25)
auto reel = make_shared<dcp::Reel>();
reel->add (black_picture_asset(dir));
- auto cpl = make_shared<dcp::CPL>("hello", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("hello", dcp::TRAILER);
cpl->add (reel);
cpl->set_main_sound_configuration ("L,C,R,Lfe,-,-");
cpl->set_main_sound_sample_rate (48000);
@@ -862,7 +862,7 @@ BOOST_AUTO_TEST_CASE (verify_various_invalid_languages)
auto sound = simple_sound (dir, "foo", dcp::MXFMetadata(), "frobozz");
auto reel_sound = make_shared<dcp::ReelSoundAsset>(sound, 0);
reel->add (reel_sound);
- auto cpl = make_shared<dcp::CPL>("hello", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("hello", dcp::TRAILER);
cpl->add (reel);
cpl->_additional_subtitle_languages.push_back("this-is-wrong");
cpl->_additional_subtitle_languages.push_back("andso-is-this");
@@ -924,7 +924,7 @@ check_picture_size (int width, int height, int frame_rate, bool three_d)
picture_writer->finalize ();
auto d = make_shared<dcp::DCP>(dcp_path);
- auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::TRAILER);
cpl->set_annotation_text ("A Test DCP");
cpl->set_issue_date ("2012-07-17T04:45:18+00:00");
@@ -1396,7 +1396,7 @@ BOOST_AUTO_TEST_CASE (verify_text_early_on_second_reel)
auto reel2 = make_shared<dcp::Reel>();
reel2->add (reel_asset2);
- auto cpl = make_shared<dcp::CPL>("hello", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("hello", dcp::TRAILER);
cpl->add (reel1);
cpl->add (reel2);
auto dcp = make_shared<dcp::DCP>(dir);
@@ -1622,7 +1622,7 @@ BOOST_AUTO_TEST_CASE (verify_sound_sampling_rate_must_be_48k)
auto sound = simple_sound (dir, "foo", dcp::MXFMetadata(), "de-DE", 24, 96000);
auto reel_sound = make_shared<dcp::ReelSoundAsset>(sound, 0);
reel->add (reel_sound);
- auto cpl = make_shared<dcp::CPL>("hello", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("hello", dcp::TRAILER);
cpl->add (reel);
auto dcp = make_shared<dcp::DCP>(dir);
dcp->add (cpl);
@@ -1682,7 +1682,7 @@ BOOST_AUTO_TEST_CASE (verify_reel_assets_durations_must_match)
boost::filesystem::remove_all (dir);
boost::filesystem::create_directories (dir);
shared_ptr<dcp::DCP> dcp (new dcp::DCP(dir));
- shared_ptr<dcp::CPL> cpl (new dcp::CPL("A Test DCP", dcp::FEATURE));
+ shared_ptr<dcp::CPL> cpl (new dcp::CPL("A Test DCP", dcp::TRAILER));
shared_ptr<dcp::MonoPictureAsset> mp = simple_picture (dir, "", 24);
shared_ptr<dcp::SoundAsset> ms = simple_sound (dir, "", dcp::MXFMetadata(), "en-US", 25);
@@ -1709,7 +1709,7 @@ verify_subtitles_must_be_in_all_reels_check (boost::filesystem::path dir, bool a
boost::filesystem::remove_all (dir);
boost::filesystem::create_directories (dir);
auto dcp = make_shared<dcp::DCP>(dir);
- auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::TRAILER);
auto subs = make_shared<dcp::SMPTESubtitleAsset>();
subs->set_language (dcp::LanguageTag("de-DE"));
@@ -1777,7 +1777,7 @@ verify_closed_captions_must_be_in_all_reels_check (boost::filesystem::path dir,
boost::filesystem::remove_all (dir);
boost::filesystem::create_directories (dir);
auto dcp = make_shared<dcp::DCP>(dir);
- auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::TRAILER);
auto subs = make_shared<dcp::SMPTESubtitleAsset>();
subs->set_language (dcp::LanguageTag("de-DE"));
@@ -1844,7 +1844,7 @@ verify_text_entry_point_check (boost::filesystem::path dir, dcp::VerificationNot
boost::filesystem::remove_all (dir);
boost::filesystem::create_directories (dir);
auto dcp = make_shared<dcp::DCP>(dir);
- auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::FEATURE);
+ auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::TRAILER);
auto subs = make_shared<dcp::SMPTESubtitleAsset>();
subs->set_language (dcp::LanguageTag("de-DE"));