Use feature not trailer for some tests to avoid verification errors about FFEC/FFMC.
authorCarl Hetherington <cth@carlh.net>
Sun, 17 Jan 2021 21:25:50 +0000 (22:25 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 17 Jan 2021 21:25:50 +0000 (22:25 +0100)
test/combine_test.cc
test/dcp_test.cc
test/read_dcp_test.cc
test/ref/DCP/dcp_test1/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml
test/ref/DCP/dcp_test1/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml
test/ref/DCP/dcp_test7/cpl_81fb54df-e1bf-4647-8788-ea7ba154375b.xml
test/ref/DCP/dcp_test7/pkl_cd49971e-bf4c-4594-8474-54ebef09a40c.xml
test/test.cc
test/verify_test.cc

index f6f4789c4f1a5b95c43ce2c8122cf189a968d49c..54e908d40b2f83aeba54ee178ea1d9cb821e7447 100644 (file)
@@ -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")
                );
index 3f395c533835a8874ca46d2f1ce7fa6dc7659f90..b22202ea1827c5b1c602c06e9cc0c9c9ef62bf40 100644 (file)
@@ -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);
index b42a3c391bdc3b0444a184ea79c86bbde5195e13..c529e5ea3c1c98dfdfe2c54dcd35a1abd5169797 100644 (file)
@@ -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);
 }
index ec32f39fbb357db1d48412bfa7ec0ea6ce2e455f..256c3a394a851f59172a3a8e2678cd0dcc3bdddb 100644 (file)
@@ -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>
index 870fb67797c26213257173c3b36c65a4b28599b0..93386451f41a9a2940377d55e2b4e3b0e45c9c08 100644 (file)
@@ -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>
index faa322a325f8a9acdcae40191ef79a2883e10deb..9e307a2f0188066d7004353b0d1cd9c7074a03b0 100644 (file)
@@ -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>
index f5ed505533a62b02bc10ec5f5057da7e6c1749c2..fdb0c16cfd425a9cc4d0c702ab274ccec6fd31af 100644 (file)
@@ -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>
index ba309f0e5228cc5188932cac7ff8bc8f7df20aa1..e43e5a70f9e922320a6a406cd423d137ac1ca44d 100644 (file)
@@ -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");
index 0a9852ee47d52727696d98f3930e5584fa8dd29a..cfc3990c301a35758f0b06cb4390309ad6138228 100644 (file)
@@ -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"));