diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-08-19 18:52:45 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-20 19:29:45 +0200 |
| commit | fffdfdd50c6ad582b221c05be10dbfc186990c88 (patch) | |
| tree | 8c424f4f6d178e62f949d1fd94af091eb7928d11 | |
| parent | 3f806092b5d0f60fe4c7e40399cf1f7ec0e535ec (diff) | |
Remove XMLMetadata use from tests.
| -rw-r--r-- | test/dcp_test.cc | 54 | ||||
| -rw-r--r-- | test/encryption_test.cc | 17 | ||||
| -rw-r--r-- | test/write_subtitle_test.cc | 19 |
3 files changed, 33 insertions, 57 deletions
diff --git a/test/dcp_test.cc b/test/dcp_test.cc index 21ed2f6c..d21ba318 100644 --- a/test/dcp_test.cc +++ b/test/dcp_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2020 Carl Hetherington <cth@carlh.net> This file is part of libdcp. @@ -60,12 +60,10 @@ BOOST_AUTO_TEST_CASE (dcp_test1) { RNGFixer fixer; - dcp::XMLMetadata xml_meta; - xml_meta.annotation_text = "Created by libdcp"; - xml_meta.issuer = "OpenDCP 0.0.25"; - xml_meta.creator = "OpenDCP 0.0.25"; - xml_meta.issue_date = "2012-07-17T04:45:18+00:00"; - make_simple("build/test/DCP/dcp_test1")->write_xml (dcp::SMPTE, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text); + make_simple("build/test/DCP/dcp_test1")->write_xml( + dcp::SMPTE, "OpenDCP 0.0.25", "OpenDCP 0.0.25", "2012-07-17T04:45:18+00:00", "Created by libdcp" + ); + /* build/test/DCP/dcp_test1 is checked against test/ref/DCP/dcp_test1 by run/tests */ } @@ -75,11 +73,6 @@ BOOST_AUTO_TEST_CASE (dcp_test2) RNGFixer fix; /* Some known metadata */ - dcp::XMLMetadata xml_meta; - xml_meta.annotation_text = "A Test DCP"; - xml_meta.issuer = "OpenDCP 0.0.25"; - xml_meta.creator = "OpenDCP 0.0.25"; - xml_meta.issue_date = "2012-07-17T04:45:18+00:00"; dcp::MXFMetadata mxf_meta; mxf_meta.company_name = "OpenDCP"; mxf_meta.product_name = "OpenDCP"; @@ -92,10 +85,10 @@ BOOST_AUTO_TEST_CASE (dcp_test2) shared_ptr<dcp::CPL> cpl (new dcp::CPL ("A Test DCP", dcp::FEATURE)); cpl->set_content_version_id ("urn:uri:81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00"); cpl->set_content_version_label_text ("81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00"); - cpl->set_issuer (xml_meta.issuer); - cpl->set_creator (xml_meta.creator); - cpl->set_issue_date (xml_meta.issue_date); - cpl->set_annotation_text (xml_meta.annotation_text); + cpl->set_issuer ("OpenDCP 0.0.25"); + cpl->set_creator ("OpenDCP 0.0.25"); + cpl->set_issue_date ("2012-07-17T04:45:18+00:00"); + cpl->set_annotation_text ("A Test DCP"); shared_ptr<dcp::StereoPictureAsset> mp (new dcp::StereoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE)); mp->set_metadata (mxf_meta); @@ -139,8 +132,7 @@ BOOST_AUTO_TEST_CASE (dcp_test2) d.add (cpl); - xml_meta.annotation_text = "Created by libdcp"; - d.write_xml (dcp::SMPTE, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text); + d.write_xml (dcp::SMPTE, "OpenDCP 0.0.25", "OpenDCP 0.0.25", "2012-07-17T04:45:18+00:00", "Created by libdcp"); /* build/test/DCP/dcp_test2 is checked against test/ref/DCP/dcp_test2 by run/tests */ } @@ -179,11 +171,6 @@ BOOST_AUTO_TEST_CASE (dcp_test5) RNGFixer fix; /* Some known metadata */ - dcp::XMLMetadata xml_meta; - xml_meta.annotation_text = "A Test DCP"; - xml_meta.issuer = "OpenDCP 0.0.25"; - xml_meta.creator = "OpenDCP 0.0.25"; - xml_meta.issue_date = "2012-07-17T04:45:18+00:00"; dcp::MXFMetadata mxf_meta; mxf_meta.company_name = "OpenDCP"; mxf_meta.product_name = "OpenDCP"; @@ -196,10 +183,10 @@ BOOST_AUTO_TEST_CASE (dcp_test5) shared_ptr<dcp::CPL> cpl (new dcp::CPL ("A Test DCP", dcp::FEATURE)); cpl->set_content_version_id ("urn:uri:81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00"); cpl->set_content_version_label_text ("81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00"); - cpl->set_issuer (xml_meta.issuer); - cpl->set_creator (xml_meta.creator); - cpl->set_issue_date (xml_meta.issue_date); - cpl->set_annotation_text (xml_meta.annotation_text); + cpl->set_issuer ("OpenDCP 0.0.25"); + cpl->set_creator ("OpenDCP 0.0.25"); + cpl->set_issue_date ("2012-07-17T04:45:18+00:00"); + cpl->set_annotation_text ("A Test DCP"); shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset (dcp::Fraction (24, 1), dcp::SMPTE)); mp->set_metadata (mxf_meta); @@ -245,8 +232,7 @@ BOOST_AUTO_TEST_CASE (dcp_test5) d.add (cpl); - xml_meta.annotation_text = "Created by libdcp"; - d.write_xml (dcp::SMPTE, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text); + d.write_xml (dcp::SMPTE, "OpenDCP 0.0.25", "OpenDCP 0.0.25", "2012-07-17T04:45:18+00:00", "Created by libdcp"); /* build/test/DCP/dcp_test5 is checked against test/ref/DCP/dcp_test5 by run/tests */ } @@ -270,12 +256,10 @@ BOOST_AUTO_TEST_CASE (dcp_test7) { RNGFixer fix; - dcp::XMLMetadata xml_meta; - xml_meta.annotation_text = "Created by libdcp"; - xml_meta.issuer = "OpenDCP 0.0.25"; - xml_meta.creator = "OpenDCP 0.0.25"; - xml_meta.issue_date = "2012-07-17T04:45:18+00:00"; - make_simple("build/test/DCP/dcp_test7")->write_xml(dcp::INTEROP, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text); + make_simple("build/test/DCP/dcp_test7")->write_xml( + dcp::INTEROP, "OpenDCP 0.0.25", "OpenDCP 0.0.25", "2012-07-17T04:45:18+00:00", "Created by libdcp" + ); + /* build/test/DCP/dcp_test7 is checked against test/ref/DCP/dcp_test7 by run/tests */ } diff --git a/test/encryption_test.cc b/test/encryption_test.cc index 3bb52c2f..913bd206 100644 --- a/test/encryption_test.cc +++ b/test/encryption_test.cc @@ -72,12 +72,6 @@ BOOST_AUTO_TEST_CASE (encryption_test) mxf_metadata.product_name = "OpenDCP"; mxf_metadata.product_version = "0.0.25"; - dcp::XMLMetadata xml_metadata; - xml_metadata.annotation_text = "A Test DCP"; - xml_metadata.issuer = "OpenDCP 0.0.25"; - xml_metadata.creator = "OpenDCP 0.0.25"; - xml_metadata.issue_date = "2012-07-17T04:45:18+00:00"; - boost::filesystem::remove_all ("build/test/DCP/encryption_test"); boost::filesystem::create_directories ("build/test/DCP/encryption_test"); dcp::DCP d ("build/test/DCP/encryption_test"); @@ -133,15 +127,14 @@ BOOST_AUTO_TEST_CASE (encryption_test) ))); cpl->set_content_version_id ("urn:uri:81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00"); cpl->set_content_version_label_text ("81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00"); - cpl->set_issuer (xml_metadata.issuer); - cpl->set_creator (xml_metadata.creator); - cpl->set_issue_date (xml_metadata.issue_date); - cpl->set_annotation_text (xml_metadata.annotation_text); + cpl->set_annotation_text ("A Test DCP"); + cpl->set_issuer ("OpenDCP 0.0.25"); + cpl->set_creator ("OpenDCP 0.0.25"); + cpl->set_issue_date ("2012-07-17T04:45:18+00:00"); d.add (cpl); - xml_metadata.annotation_text = "Created by libdcp"; - d.write_xml (dcp::SMPTE, xml_metadata.issuer, xml_metadata.creator, xml_metadata.issue_date, xml_metadata.annotation_text, signer); + d.write_xml (dcp::SMPTE, "OpenDCP 0.0.25", "OpenDCP 0.0.25", "2012-07-17T04:45:18+00:00", "Created by libdcp", signer); dcp::DecryptedKDM kdm ( cpl, diff --git a/test/write_subtitle_test.cc b/test/write_subtitle_test.cc index da2ec35c..808df31b 100644 --- a/test/write_subtitle_test.cc +++ b/test/write_subtitle_test.cc @@ -361,23 +361,22 @@ BOOST_AUTO_TEST_CASE (write_interop_subtitle_test3) shared_ptr<dcp::Reel> reel (new dcp::Reel()); reel->add(shared_ptr<dcp::ReelSubtitleAsset>(new dcp::ReelSubtitleAsset(c, dcp::Fraction(24, 1), 6046, 0))); - dcp::XMLMetadata xml_meta; - xml_meta.issue_date = "2018-09-02T04:45:18+00:00"; - xml_meta.issuer = "libdcp"; - xml_meta.creator = "libdcp"; - xml_meta.annotation_text = "Created by libdcp"; + string const issue_date = "2018-09-02T04:45:18+00:00"; + string const issuer = "libdcp"; + string const creator = "libdcp"; + string const annotation_text = "Created by libdcp"; shared_ptr<dcp::CPL> cpl (new dcp::CPL ("My film", dcp::FEATURE)); cpl->add (reel); - cpl->set_issuer (xml_meta.issuer); - cpl->set_creator (xml_meta.creator); - cpl->set_issue_date (xml_meta.issue_date); - cpl->set_annotation_text (xml_meta.annotation_text); + cpl->set_issuer (issuer); + cpl->set_creator (creator); + cpl->set_issue_date (issue_date); + cpl->set_annotation_text (annotation_text); cpl->set_content_version_label_text ("foo"); dcp::DCP dcp ("build/test/write_interop_subtitle_test3"); dcp.add (cpl); - dcp.write_xml (dcp::INTEROP, xml_meta.issuer, xml_meta.creator, xml_meta.issue_date, xml_meta.annotation_text); + dcp.write_xml (dcp::INTEROP, issuer, creator, issue_date, annotation_text); check_xml ( dcp::file_to_string("test/ref/write_interop_subtitle_test3/subs.xml"), |
