diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-01-17 17:11:32 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-01-17 17:11:32 +0000 |
| commit | 41fc6e366ad3de85704c35961beaf539ab9ceb8b (patch) | |
| tree | 22c68206025af06f3915650d5feece76e57cbfc0 /test | |
| parent | 394abae7986abf4438184a712f16dfbe3c2734da (diff) | |
namespace libdcp -> dcp.
Diffstat (limited to 'test')
| -rw-r--r-- | test/certificates_test.cc | 14 | ||||
| -rw-r--r-- | test/color_test.cc | 8 | ||||
| -rw-r--r-- | test/cpl_sar.cc | 6 | ||||
| -rw-r--r-- | test/dcp_test.cc | 16 | ||||
| -rw-r--r-- | test/dcp_time_test.cc | 22 | ||||
| -rw-r--r-- | test/decryption_test.cc | 24 | ||||
| -rw-r--r-- | test/encryption_test.cc | 34 | ||||
| -rw-r--r-- | test/error_test.cc | 10 | ||||
| -rw-r--r-- | test/frame_info_test.cc | 6 | ||||
| -rw-r--r-- | test/kdm_key_test.cc | 2 | ||||
| -rw-r--r-- | test/kdm_test.cc | 6 | ||||
| -rw-r--r-- | test/lut_test.cc | 6 | ||||
| -rw-r--r-- | test/read_dcp_test.cc | 6 | ||||
| -rw-r--r-- | test/recovery_test.cc | 12 | ||||
| -rw-r--r-- | test/rewrite_subs.cc | 2 | ||||
| -rw-r--r-- | test/round_trip_test.cc | 44 | ||||
| -rw-r--r-- | test/subs_in_out.cc | 2 | ||||
| -rw-r--r-- | test/subtitle_tests.cc | 444 | ||||
| -rw-r--r-- | test/test.cc | 4 | ||||
| -rw-r--r-- | test/test.h | 2 | ||||
| -rw-r--r-- | test/utc_offset_to_string_test.cc | 12 | ||||
| -rw-r--r-- | test/util_test.cc | 26 |
22 files changed, 354 insertions, 354 deletions
diff --git a/test/certificates_test.cc b/test/certificates_test.cc index 0a66bc66..690afa77 100644 --- a/test/certificates_test.cc +++ b/test/certificates_test.cc @@ -25,15 +25,15 @@ using boost::shared_ptr; BOOST_AUTO_TEST_CASE (certificates) { - libdcp::CertificateChain c; + dcp::CertificateChain c; - c.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("test/ref/crypt/ca.self-signed.pem")))); - c.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("test/ref/crypt/intermediate.signed.pem")))); - c.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("test/ref/crypt/leaf.signed.pem")))); + c.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/ca.self-signed.pem")))); + c.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/intermediate.signed.pem")))); + c.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("test/ref/crypt/leaf.signed.pem")))); - list<shared_ptr<libdcp::Certificate> > leaf_to_root = c.leaf_to_root (); + list<shared_ptr<dcp::Certificate> > leaf_to_root = c.leaf_to_root (); - list<shared_ptr<libdcp::Certificate> >::iterator i = leaf_to_root.begin (); + list<shared_ptr<dcp::Certificate> >::iterator i = leaf_to_root.begin (); /* Leaf */ BOOST_CHECK_EQUAL (*i, c.leaf ()); @@ -78,6 +78,6 @@ BOOST_AUTO_TEST_CASE (certificates) ); /* Check that reconstruction from a string works */ - libdcp::Certificate test (c.root()->certificate (true)); + dcp::Certificate test (c.root()->certificate (true)); BOOST_CHECK_EQUAL (test.certificate(), c.root()->certificate()); } diff --git a/test/color_test.cc b/test/color_test.cc index 30a96a0d..d68f59d4 100644 --- a/test/color_test.cc +++ b/test/color_test.cc @@ -21,24 +21,24 @@ #include "util.h" -/* Check that libdcp::Color works */ +/* Check that dcp::Color works */ BOOST_AUTO_TEST_CASE (color) { - libdcp::Color c ("FFFF0000"); + dcp::Color c ("FFFF0000"); BOOST_CHECK_EQUAL (c.r, 255); BOOST_CHECK_EQUAL (c.g, 0); BOOST_CHECK_EQUAL (c.b, 0); BOOST_CHECK_EQUAL (c.to_argb_string(), "FFFF0000"); - c = libdcp::Color ("FF00FF00"); + c = dcp::Color ("FF00FF00"); BOOST_CHECK_EQUAL (c.r, 0); BOOST_CHECK_EQUAL (c.g, 255); BOOST_CHECK_EQUAL (c.b, 0); BOOST_CHECK_EQUAL (c.to_argb_string(), "FF00FF00"); - c = libdcp::Color ("FF0000FF"); + c = dcp::Color ("FF0000FF"); BOOST_CHECK_EQUAL (c.r, 0); BOOST_CHECK_EQUAL (c.g, 0); diff --git a/test/cpl_sar.cc b/test/cpl_sar.cc index c91ce287..5628363a 100644 --- a/test/cpl_sar.cc +++ b/test/cpl_sar.cc @@ -29,11 +29,11 @@ using boost::shared_ptr; */ BOOST_AUTO_TEST_CASE (cpl_sar) { - shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/foo", "video.mxf")); + shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset ("build/test/foo", "video.mxf")); mp->set_interop (true); { - mp->set_size (libdcp::Size (1998, 1080)); + mp->set_size (dcp::Size (1998, 1080)); xmlpp::Document doc; xmlpp::Element* el = doc.create_root_node ("Test"); mp->write_to_cpl (el); @@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE (cpl_sar) } { - mp->set_size (libdcp::Size (2048, 858)); + mp->set_size (dcp::Size (2048, 858)); xmlpp::Document doc; xmlpp::Element* el = doc.create_root_node ("Test"); mp->write_to_cpl (el); diff --git a/test/dcp_test.cc b/test/dcp_test.cc index f70c6ce8..eccd7ad3 100644 --- a/test/dcp_test.cc +++ b/test/dcp_test.cc @@ -35,11 +35,11 @@ BOOST_AUTO_TEST_CASE (dcp_test) Kumu::libdcp_test = true; /* Some known metadata */ - libdcp::XMLMetadata xml_meta; + dcp::XMLMetadata xml_meta; 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"; - libdcp::MXFMetadata mxf_meta; + dcp::MXFMetadata mxf_meta; mxf_meta.company_name = "OpenDCP"; mxf_meta.product_name = "OpenDCP"; mxf_meta.product_version = "0.0.25"; @@ -47,19 +47,19 @@ BOOST_AUTO_TEST_CASE (dcp_test) /* We're making build/test/foo */ boost::filesystem::remove_all ("build/test/foo"); boost::filesystem::create_directories ("build/test/foo"); - libdcp::DCP d ("build/test/foo"); - shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("build/test/foo", "A Test DCP", libdcp::FEATURE, 24, 24)); + dcp::DCP d ("build/test/foo"); + shared_ptr<dcp::CPL> cpl (new dcp::CPL ("build/test/foo", "A Test DCP", dcp::FEATURE, 24, 24)); - shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/foo", "video.mxf")); + shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset ("build/test/foo", "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_size (dcp::Size (32, 32)); mp->set_metadata (mxf_meta); mp->create (j2c); - shared_ptr<libdcp::SoundAsset> ms (new libdcp::SoundAsset ("build/test/foo", "audio.mxf")); + shared_ptr<dcp::SoundAsset> ms (new dcp::SoundAsset ("build/test/foo", "audio.mxf")); ms->set_progress (&d.Progress); ms->set_edit_rate (24); ms->set_intrinsic_duration (24); @@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE (dcp_test) ms->set_metadata (mxf_meta); ms->create (wav); - cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (mp, ms, shared_ptr<libdcp::SubtitleAsset> ()))); + cpl->add_reel (shared_ptr<dcp::Reel> (new dcp::Reel (mp, ms, shared_ptr<dcp::SubtitleAsset> ()))); d.add_cpl (cpl); d.write_xml (false, xml_meta); diff --git a/test/dcp_time_test.cc b/test/dcp_time_test.cc index 6892711e..2a5bca1b 100644 --- a/test/dcp_time_test.cc +++ b/test/dcp_time_test.cc @@ -20,10 +20,10 @@ #include <boost/test/unit_test.hpp> #include "dcp_time.h" -/** Check that libdcp::Time works */ +/** Check that dcp::Time works */ BOOST_AUTO_TEST_CASE (dcp_time) { - libdcp::Time t (977143, 24); + dcp::Time t (977143, 24); BOOST_CHECK_EQUAL (t.t, 73); BOOST_CHECK_EQUAL (t.s, 34); @@ -32,10 +32,10 @@ BOOST_AUTO_TEST_CASE (dcp_time) BOOST_CHECK_EQUAL (t.to_string(), "11:18:34:73"); BOOST_CHECK_EQUAL (t.to_ticks(), 10178573); - libdcp::Time a (3, 2, 3, 4); - libdcp::Time b (2, 3, 4, 5); + dcp::Time a (3, 2, 3, 4); + dcp::Time b (2, 3, 4, 5); - libdcp::Time r = a - b; + dcp::Time r = a - b; BOOST_CHECK_EQUAL (r.h, 0); BOOST_CHECK_EQUAL (r.m, 58); BOOST_CHECK_EQUAL (r.s, 58); @@ -43,8 +43,8 @@ BOOST_AUTO_TEST_CASE (dcp_time) BOOST_CHECK_EQUAL (r.to_string(), "0:58:58:249"); BOOST_CHECK_EQUAL (r.to_ticks(), 884749); - a = libdcp::Time (1, 58, 56, 240); - b = libdcp::Time (1, 7, 12, 120); + a = dcp::Time (1, 58, 56, 240); + b = dcp::Time (1, 7, 12, 120); r = a + b; BOOST_CHECK_EQUAL (r.h, 3); BOOST_CHECK_EQUAL (r.m, 6); @@ -53,10 +53,10 @@ BOOST_AUTO_TEST_CASE (dcp_time) BOOST_CHECK_EQUAL (r.to_string(), "3:6:9:110"); BOOST_CHECK_EQUAL (r.to_ticks(), 2792360); - a = libdcp::Time (24, 12, 6, 3); - b = libdcp::Time (16, 8, 4, 2); + a = dcp::Time (24, 12, 6, 3); + b = dcp::Time (16, 8, 4, 2); BOOST_CHECK_CLOSE (a / b, 1.5, 1e-5); - BOOST_CHECK_EQUAL (libdcp::Time (4128391203LL).to_ticks(), 4128391203LL); - BOOST_CHECK_EQUAL (libdcp::Time (60000).to_ticks(), 60000); + BOOST_CHECK_EQUAL (dcp::Time (4128391203LL).to_ticks(), 4128391203LL); + BOOST_CHECK_EQUAL (dcp::Time (60000).to_ticks(), 60000); } diff --git a/test/decryption_test.cc b/test/decryption_test.cc index 0f5a4ef0..5fd29c6c 100644 --- a/test/decryption_test.cc +++ b/test/decryption_test.cc @@ -30,15 +30,15 @@ using boost::dynamic_pointer_cast; using boost::shared_ptr; -static shared_ptr<const libdcp::ARGBFrame> -get_frame (libdcp::DCP const & dcp) +static shared_ptr<const dcp::ARGBFrame> +get_frame (dcp::DCP const & dcp) { - shared_ptr<const libdcp::Reel> reel = dcp.cpls().front()->reels().front (); - shared_ptr<const libdcp::PictureAsset> picture = reel->main_picture (); + shared_ptr<const dcp::Reel> reel = dcp.cpls().front()->reels().front (); + shared_ptr<const dcp::PictureAsset> picture = reel->main_picture (); BOOST_CHECK (picture); - shared_ptr<const libdcp::MonoPictureAsset> mono_picture = dynamic_pointer_cast<const libdcp::MonoPictureAsset> (picture); - shared_ptr<const libdcp::MonoPictureFrame> j2k_frame = mono_picture->get_frame (0); + 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); return j2k_frame->argb_frame (); } @@ -47,25 +47,25 @@ BOOST_AUTO_TEST_CASE (decryption_test) { boost::filesystem::path plaintext_path = test_corpus; plaintext_path /= "TONEPLATES-SMPTE-PLAINTEXT_TST_F_XX-XX_ITL-TD_51-XX_2K_WOE_20111001_WOE_OV"; - libdcp::DCP plaintext (plaintext_path.string ()); + dcp::DCP plaintext (plaintext_path.string ()); plaintext.read (); BOOST_CHECK_EQUAL (plaintext.encrypted (), false); boost::filesystem::path encrypted_path = test_corpus; encrypted_path /= "TONEPLATES-SMPTE-ENCRYPTED_TST_F_XX-XX_ITL-TD_51-XX_2K_WOE_20111001_WOE_OV"; - libdcp::DCP encrypted (encrypted_path.string ()); + dcp::DCP encrypted (encrypted_path.string ()); encrypted.read (); BOOST_CHECK_EQUAL (encrypted.encrypted (), true); - libdcp::KDM kdm ( + dcp::KDM kdm ( "test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml", "test/data/private.key" ); encrypted.add_kdm (kdm); - shared_ptr<const libdcp::ARGBFrame> plaintext_frame = get_frame (plaintext); - shared_ptr<const libdcp::ARGBFrame> encrypted_frame = get_frame (encrypted); + shared_ptr<const dcp::ARGBFrame> plaintext_frame = get_frame (plaintext); + shared_ptr<const dcp::ARGBFrame> encrypted_frame = get_frame (encrypted); /* Check that plaintext and encrypted are the same */ BOOST_CHECK_EQUAL (plaintext_frame->stride(), encrypted_frame->stride()); @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE (decryption_test) /** Load in a KDM that didn't work at first */ BOOST_AUTO_TEST_CASE (failing_kdm_test) { - libdcp::KDM kdm ( + dcp::KDM kdm ( "test/data/target.pem.crt.de5d4eba-e683-41ca-bdda-aa4ad96af3f4.kdm.xml", "test/data/private.key" ); diff --git a/test/encryption_test.cc b/test/encryption_test.cc index dc49562c..7cd202f2 100644 --- a/test/encryption_test.cc +++ b/test/encryption_test.cc @@ -40,51 +40,51 @@ 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", "openssl"); + dcp::make_signer_chain ("build/test/signer", "openssl"); Kumu::libdcp_test = true; - libdcp::MXFMetadata mxf_metadata; + dcp::MXFMetadata mxf_metadata; mxf_metadata.company_name = "OpenDCP"; mxf_metadata.product_name = "OpenDCP"; mxf_metadata.product_version = "0.0.25"; - libdcp::XMLMetadata xml_metadata; + dcp::XMLMetadata xml_metadata; 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/bar"); boost::filesystem::create_directories ("build/test/DCP/bar"); - libdcp::DCP d ("build/test/DCP/bar"); + dcp::DCP d ("build/test/DCP/bar"); - libdcp::CertificateChain chain; - chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/ca.self-signed.pem")))); - chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/intermediate.signed.pem")))); - chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/leaf.signed.pem")))); + dcp::CertificateChain chain; + chain.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("build/test/signer/ca.self-signed.pem")))); + chain.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("build/test/signer/intermediate.signed.pem")))); + chain.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("build/test/signer/leaf.signed.pem")))); - shared_ptr<libdcp::Signer> signer ( - new libdcp::Signer ( + shared_ptr<dcp::Signer> signer ( + new dcp::Signer ( chain, "build/test/signer/leaf.key" ) ); - shared_ptr<libdcp::CPL> cpl (new libdcp::CPL ("build/test/DCP/bar", "A Test DCP", libdcp::FEATURE, 24, 24)); + shared_ptr<dcp::CPL> cpl (new dcp::CPL ("build/test/DCP/bar", "A Test DCP", dcp::FEATURE, 24, 24)); - libdcp::Key key; + dcp::Key key; - shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/DCP/bar", "video.mxf")); + shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset ("build/test/DCP/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_size (dcp::Size (32, 32)); mp->set_metadata (mxf_metadata); mp->set_key (key); mp->create (j2c); - shared_ptr<libdcp::SoundAsset> ms (new libdcp::SoundAsset ("build/test/DCP/bar", "audio.mxf")); + shared_ptr<dcp::SoundAsset> ms (new dcp::SoundAsset ("build/test/DCP/bar", "audio.mxf")); ms->set_progress (&d.Progress); ms->set_edit_rate (24); ms->set_intrinsic_duration (24); @@ -94,12 +94,12 @@ BOOST_AUTO_TEST_CASE (encryption) ms->set_key (key); ms->create (wav); - cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (mp, ms, shared_ptr<libdcp::SubtitleAsset> ()))); + cpl->add_reel (shared_ptr<dcp::Reel> (new dcp::Reel (mp, ms, shared_ptr<dcp::SubtitleAsset> ()))); d.add_cpl (cpl); d.write_xml (false, xml_metadata, signer); - libdcp::KDM kdm ( + dcp::KDM kdm ( cpl, signer, signer->certificates().leaf(), diff --git a/test/error_test.cc b/test/error_test.cc index eeff4f41..52d97556 100644 --- a/test/error_test.cc +++ b/test/error_test.cc @@ -31,17 +31,17 @@ using std::string; BOOST_AUTO_TEST_CASE (error_test) { /* Create an empty DCP */ - libdcp::DCP d ("build/test/fred"); + dcp::DCP d ("build/test/fred"); /* Random filename that does not exist */ vector<boost::filesystem::path> p; p.push_back ("frobozz"); /* Trying to create video/audio MXFs using a non-existant file should throw an exception */ - libdcp::MonoPictureAsset pa ("build/test/fred", "video.mxf"); - BOOST_CHECK_THROW (pa.create (p), libdcp::FileError); + dcp::MonoPictureAsset pa ("build/test/fred", "video.mxf"); + BOOST_CHECK_THROW (pa.create (p), dcp::FileError); - libdcp::SoundAsset sa ("build/test/fred", "audio.mxf"); + dcp::SoundAsset sa ("build/test/fred", "audio.mxf"); sa.set_channels (1); - BOOST_CHECK_THROW (sa.create (p), libdcp::FileError); + BOOST_CHECK_THROW (sa.create (p), dcp::FileError); } diff --git a/test/frame_info_test.cc b/test/frame_info_test.cc index db73d7fb..bf4181a0 100644 --- a/test/frame_info_test.cc +++ b/test/frame_info_test.cc @@ -26,7 +26,7 @@ using namespace std; /* Test writing and reading of frame_info_test with fstream and stdio */ BOOST_AUTO_TEST_CASE (frame_info_test) { - libdcp::FrameInfo a (8589934592LL, 17179869184LL, "thisisahash"); + dcp::FrameInfo a (8589934592LL, 17179869184LL, "thisisahash"); ofstream o1 ("build/test/frame_info1"); a.write (o1); @@ -48,11 +48,11 @@ BOOST_AUTO_TEST_CASE (frame_info_test) BOOST_CHECK_EQUAL (s1, s2); ifstream l1 ("build/test/frame_info1"); - libdcp::FrameInfo b1 (l1); + dcp::FrameInfo b1 (l1); FILE* l2 = fopen ("build/test/frame_info2", "r"); BOOST_CHECK (l2); - libdcp::FrameInfo b2 (l2); + dcp::FrameInfo b2 (l2); BOOST_CHECK_EQUAL (b1.offset, b2.offset); BOOST_CHECK_EQUAL (b1.size, b2.size); diff --git a/test/kdm_key_test.cc b/test/kdm_key_test.cc index 05b85312..4a84fe3b 100644 --- a/test/kdm_key_test.cc +++ b/test/kdm_key_test.cc @@ -24,7 +24,7 @@ BOOST_AUTO_TEST_CASE (kdm_key_test) { uint8_t foo[138]; memset (foo, 0, 138); - libdcp::KDMKey kkey (foo, 138); + dcp::KDMKey kkey (foo, 138); uint8_t* raw = new uint8_t[16]; uint8_t* p = raw; diff --git a/test/kdm_test.cc b/test/kdm_test.cc index 0f0db031..f2ee9345 100644 --- a/test/kdm_test.cc +++ b/test/kdm_test.cc @@ -26,12 +26,12 @@ using boost::shared_ptr; BOOST_AUTO_TEST_CASE (kdm_test) { - libdcp::KDM kdm ( + dcp::KDM kdm ( "test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml", "test/data/private.key" ); - list<libdcp::KDMKey> keys = kdm.keys (); + list<dcp::KDMKey> keys = kdm.keys (); BOOST_CHECK_EQUAL (keys.size(), 2); @@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE (kdm_test) /* Check that we can read in a KDM and then write it back out again the same */ BOOST_AUTO_TEST_CASE (kdm_passthrough_test) { - libdcp::xml::DCinemaSecurityMessage kdm ( + dcp::xml::DCinemaSecurityMessage kdm ( "test/data/kdm_TONEPLATES-SMPTE-ENC_.smpte-430-2.ROOT.NOT_FOR_PRODUCTION_20130706_20230702_CAR_OV_t1_8971c838.xml" ); diff --git a/test/lut_test.cc b/test/lut_test.cc index c90dff76..32dac97a 100644 --- a/test/lut_test.cc +++ b/test/lut_test.cc @@ -29,19 +29,19 @@ */ BOOST_AUTO_TEST_CASE (lut_test) { - libdcp::SRGBLinearisedGammaLUT lut_in_srgb (12, 2.4); + dcp::SRGBLinearisedGammaLUT lut_in_srgb (12, 2.4); for (int i = 0; i < 4096; ++i) { /* Hmm; 1% isn't exactly great... */ BOOST_CHECK_CLOSE (opendcp::lut_in[0][i], lut_in_srgb.lut()[i], 1); } - libdcp::Rec709LinearisedGammaLUT lut_in_rec709 (12, 1 / 0.45); + dcp::Rec709LinearisedGammaLUT lut_in_rec709 (12, 1 / 0.45); for (int i = 0; i < 4096; ++i) { /* Hmm; 1% isn't exactly great... */ BOOST_CHECK_CLOSE (opendcp::lut_in[1][i], lut_in_rec709.lut()[i], 1); } - libdcp::GammaLUT lut_out (16, 1 / 2.6); + dcp::GammaLUT lut_out (16, 1 / 2.6); for (int i = 0; i < 65536; ++i) { BOOST_CHECK_CLOSE (opendcp::lut_out[0][i], lut_out.lut()[i] * 4096, 1); } diff --git a/test/read_dcp_test.cc b/test/read_dcp_test.cc index 0a9ac119..06df7058 100644 --- a/test/read_dcp_test.cc +++ b/test/read_dcp_test.cc @@ -27,14 +27,14 @@ using boost::shared_ptr; /* Read DCP that is in git and make sure that basic stuff is read in correctly */ BOOST_AUTO_TEST_CASE (read_dcp) { - libdcp::DCP d ("test/ref/DCP/foo"); + dcp::DCP d ("test/ref/DCP/foo"); d.read (); - list<shared_ptr<libdcp::CPL> > cpls = d.cpls (); + list<shared_ptr<dcp::CPL> > cpls = d.cpls (); BOOST_CHECK_EQUAL (cpls.size(), 1); BOOST_CHECK_EQUAL (cpls.front()->name(), "A Test DCP"); - BOOST_CHECK_EQUAL (cpls.front()->content_kind(), libdcp::FEATURE); + BOOST_CHECK_EQUAL (cpls.front()->content_kind(), dcp::FEATURE); BOOST_CHECK_EQUAL (cpls.front()->frames_per_second(), 24); BOOST_CHECK_EQUAL (cpls.front()->length(), 24); } diff --git a/test/recovery_test.cc b/test/recovery_test.cc index 42697c37..27a4c150 100644 --- a/test/recovery_test.cc +++ b/test/recovery_test.cc @@ -48,14 +48,14 @@ BOOST_AUTO_TEST_CASE (recovery) boost::filesystem::remove_all ("build/test/baz"); boost::filesystem::create_directories ("build/test/baz"); - shared_ptr<libdcp::MonoPictureAsset> mp (new libdcp::MonoPictureAsset ("build/test/baz", "video1.mxf")); + shared_ptr<dcp::MonoPictureAsset> mp (new dcp::MonoPictureAsset ("build/test/baz", "video1.mxf")); mp->set_edit_rate (24); - mp->set_size (libdcp::Size (32, 32)); - shared_ptr<libdcp::PictureAssetWriter> writer = mp->start_write (false); + mp->set_size (dcp::Size (32, 32)); + shared_ptr<dcp::PictureAssetWriter> writer = mp->start_write (false); int written_size = 0; for (int i = 0; i < 24; ++i) { - libdcp::FrameInfo info = writer->write (data, size); + dcp::FrameInfo info = writer->write (data, size); written_size = info.size; } @@ -78,9 +78,9 @@ BOOST_AUTO_TEST_CASE (recovery) Kumu::ResetTestRNG (); #endif - mp.reset (new libdcp::MonoPictureAsset ("build/test/baz", "video2.mxf")); + mp.reset (new dcp::MonoPictureAsset ("build/test/baz", "video2.mxf")); mp->set_edit_rate (24); - mp->set_size (libdcp::Size (32, 32)); + mp->set_size (dcp::Size (32, 32)); writer = mp->start_write (true); writer->write (data, size); diff --git a/test/rewrite_subs.cc b/test/rewrite_subs.cc index c7f8bfbd..5628ec70 100644 --- a/test/rewrite_subs.cc +++ b/test/rewrite_subs.cc @@ -9,7 +9,7 @@ using std::cout; using std::cerr; using std::list; using boost::shared_ptr; -using namespace libdcp; +using namespace dcp; int main (int argc, char* argv[]) diff --git a/test/round_trip_test.cc b/test/round_trip_test.cc index a6ee2097..51edf111 100644 --- a/test/round_trip_test.cc +++ b/test/round_trip_test.cc @@ -39,15 +39,15 @@ BOOST_AUTO_TEST_CASE (round_trip_test) { boost::filesystem::remove_all ("build/test/signer"); boost::filesystem::create_directory ("build/test/signer"); - libdcp::make_signer_chain ("build/test/signer", "openssl"); + dcp::make_signer_chain ("build/test/signer", "openssl"); - libdcp::CertificateChain chain; - chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/ca.self-signed.pem")))); - chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/intermediate.signed.pem")))); - chain.add (shared_ptr<libdcp::Certificate> (new libdcp::Certificate (boost::filesystem::path ("build/test/signer/leaf.signed.pem")))); + dcp::CertificateChain chain; + chain.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("build/test/signer/ca.self-signed.pem")))); + chain.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("build/test/signer/intermediate.signed.pem")))); + chain.add (shared_ptr<dcp::Certificate> (new dcp::Certificate (boost::filesystem::path ("build/test/signer/leaf.signed.pem")))); - shared_ptr<libdcp::Signer> signer ( - new libdcp::Signer ( + shared_ptr<dcp::Signer> signer ( + new dcp::Signer ( chain, "test/data/signer.key" ) @@ -56,21 +56,21 @@ BOOST_AUTO_TEST_CASE (round_trip_test) boost::filesystem::path work_dir = "build/test/round_trip_test"; boost::filesystem::create_directory (work_dir); - shared_ptr<libdcp::MonoPictureAsset> asset_A (new libdcp::MonoPictureAsset (work_dir, "video.mxf")); + shared_ptr<dcp::MonoPictureAsset> asset_A (new dcp::MonoPictureAsset (work_dir, "video.mxf")); asset_A->set_edit_rate (24); asset_A->set_intrinsic_duration (24); - asset_A->set_size (libdcp::Size (32, 32)); + asset_A->set_size (dcp::Size (32, 32)); asset_A->create (j2c); - libdcp::Key key; + dcp::Key key; asset_A->set_key (key); - shared_ptr<libdcp::CPL> cpl (new libdcp::CPL (work_dir, "A Test DCP", libdcp::FEATURE, 24, 24)); - cpl->add_reel (shared_ptr<libdcp::Reel> (new libdcp::Reel (asset_A, shared_ptr<libdcp::SoundAsset> (), shared_ptr<libdcp::SubtitleAsset> ()))); + shared_ptr<dcp::CPL> cpl (new dcp::CPL (work_dir, "A Test DCP", dcp::FEATURE, 24, 24)); + cpl->add_reel (shared_ptr<dcp::Reel> (new dcp::Reel (asset_A, shared_ptr<dcp::SoundAsset> (), shared_ptr<dcp::SubtitleAsset> ()))); /* A KDM using our certificate chain's leaf key pair */ - libdcp::KDM kdm_A ( + dcp::KDM kdm_A ( cpl, signer, signer->certificates().leaf(), @@ -85,14 +85,14 @@ BOOST_AUTO_TEST_CASE (round_trip_test) kdm_A.as_xml (kdm_file); /* Reload the KDM, using our private key to decrypt it */ - libdcp::KDM kdm_B (kdm_file, "build/test/signer/leaf.key"); + dcp::KDM kdm_B (kdm_file, "build/test/signer/leaf.key"); /* Check that the decrypted KDMKeys are the same as the ones we started with */ BOOST_CHECK_EQUAL (kdm_A.keys().size(), kdm_B.keys().size()); - list<libdcp::KDMKey> keys_A = kdm_A.keys (); - list<libdcp::KDMKey> keys_B = kdm_B.keys (); - list<libdcp::KDMKey>::const_iterator i = keys_A.begin(); - list<libdcp::KDMKey>::const_iterator j = keys_B.begin(); + list<dcp::KDMKey> keys_A = kdm_A.keys (); + list<dcp::KDMKey> keys_B = kdm_B.keys (); + list<dcp::KDMKey>::const_iterator i = keys_A.begin(); + list<dcp::KDMKey>::const_iterator j = keys_B.begin(); while (i != keys_A.end ()) { BOOST_CHECK (*i == *j); ++i; @@ -100,14 +100,14 @@ BOOST_AUTO_TEST_CASE (round_trip_test) } /* Reload the picture MXF */ - shared_ptr<libdcp::MonoPictureAsset> asset_B ( - new libdcp::MonoPictureAsset (work_dir, "video.mxf") + shared_ptr<dcp::MonoPictureAsset> asset_B ( + new dcp::MonoPictureAsset (work_dir, "video.mxf") ); asset_B->set_key (kdm_B.keys().front().key()); - shared_ptr<libdcp::ARGBFrame> frame_A = asset_A->get_frame(0)->argb_frame (); - shared_ptr<libdcp::ARGBFrame> frame_B = asset_B->get_frame(0)->argb_frame (); + shared_ptr<dcp::ARGBFrame> frame_A = asset_A->get_frame(0)->argb_frame (); + shared_ptr<dcp::ARGBFrame> frame_B = asset_B->get_frame(0)->argb_frame (); BOOST_CHECK_EQUAL (frame_A->size().width, frame_B->size().width); BOOST_CHECK_EQUAL (frame_A->size().height, frame_B->size().height); BOOST_CHECK_EQUAL (memcmp (frame_A->data(), frame_B->data(), frame_A->size().width * frame_A->size().height), 0); diff --git a/test/subs_in_out.cc b/test/subs_in_out.cc index f0a7e96f..923cfe2e 100644 --- a/test/subs_in_out.cc +++ b/test/subs_in_out.cc @@ -10,7 +10,7 @@ int main (int argc, char* argv[]) exit (EXIT_FAILURE); } - libdcp::SubtitleAsset s ("foo", "bar", "baz"); + dcp::SubtitleAsset s ("foo", "bar", "baz"); s.read_xml (argv[1]); cout << s.xml_as_string (); return 0; diff --git a/test/subtitle_tests.cc b/test/subtitle_tests.cc index a8fa78b7..23e5b821 100644 --- a/test/subtitle_tests.cc +++ b/test/subtitle_tests.cc @@ -26,398 +26,398 @@ using boost::shared_ptr; /* Load a subtitle asset from XML and check that it is read correctly */ BOOST_AUTO_TEST_CASE (subtitles1) { - libdcp::SubtitleAsset subs ("test/data", "subs1.xml"); + dcp::SubtitleAsset subs ("test/data", "subs1.xml"); BOOST_CHECK_EQUAL (subs.language(), "French"); - list<shared_ptr<libdcp::Subtitle> > s = subs.subtitles_at (libdcp::Time (0, 0, 6, 1)); + list<shared_ptr<dcp::Subtitle> > s = subs.subtitles_at (dcp::Time (0, 0, 6, 1)); BOOST_CHECK_EQUAL (s.size(), 1); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 39, - libdcp::Time (0, 0, 5, 198), - libdcp::Time (0, 0, 7, 115), + dcp::Time (0, 0, 5, 198), + dcp::Time (0, 0, 7, 115), 15, - libdcp::BOTTOM, + dcp::BOTTOM, "My jacket was Idi Amin's", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 1), - libdcp::Time (0, 0, 0, 1) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 1), + dcp::Time (0, 0, 0, 1) )); - s = subs.subtitles_at (libdcp::Time (0, 0, 7, 190)); + s = subs.subtitles_at (dcp::Time (0, 0, 7, 190)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 39, - libdcp::Time (0, 0, 7, 177), - libdcp::Time (0, 0, 11, 31), + dcp::Time (0, 0, 7, 177), + dcp::Time (0, 0, 11, 31), 21, - libdcp::BOTTOM, + dcp::BOTTOM, "My corset was H.M. The Queen's", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 1), - libdcp::Time (0, 0, 0, 1) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 1), + dcp::Time (0, 0, 0, 1) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 39, - libdcp::Time (0, 0, 7, 177), - libdcp::Time (0, 0, 11, 31), + dcp::Time (0, 0, 7, 177), + dcp::Time (0, 0, 11, 31), 15, - libdcp::BOTTOM, + dcp::BOTTOM, "My large wonderbra", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 1), - libdcp::Time (0, 0, 0, 1) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 1), + dcp::Time (0, 0, 0, 1) )); - s = subs.subtitles_at (libdcp::Time (0, 0, 11, 95)); + s = subs.subtitles_at (dcp::Time (0, 0, 11, 95)); BOOST_CHECK_EQUAL (s.size(), 1); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 39, - libdcp::Time (0, 0, 11, 94), - libdcp::Time (0, 0, 13, 63), + dcp::Time (0, 0, 11, 94), + dcp::Time (0, 0, 13, 63), 15, - libdcp::BOTTOM, + dcp::BOTTOM, "Once belonged to the Shah", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 1), - libdcp::Time (0, 0, 0, 1) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 1), + dcp::Time (0, 0, 0, 1) )); - s = subs.subtitles_at (libdcp::Time (0, 0, 14, 42)); + s = subs.subtitles_at (dcp::Time (0, 0, 14, 42)); BOOST_CHECK_EQUAL (s.size(), 1); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 39, - libdcp::Time (0, 0, 13, 104), - libdcp::Time (0, 0, 15, 177), + dcp::Time (0, 0, 13, 104), + dcp::Time (0, 0, 15, 177), 15, - libdcp::BOTTOM, + dcp::BOTTOM, "And these are Roy Hattersley's jeans", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 1), - libdcp::Time (0, 0, 0, 1) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 1), + dcp::Time (0, 0, 0, 1) )); } /** And similarly for another one */ BOOST_AUTO_TEST_CASE (subtitles2) { - libdcp::SubtitleAsset subs ("test/data", "subs2.xml"); + dcp::SubtitleAsset subs ("test/data", "subs2.xml"); - list<shared_ptr<libdcp::Subtitle> > s = subs.subtitles_at (libdcp::Time (0, 0, 42, 100)); + list<shared_ptr<dcp::Subtitle> > s = subs.subtitles_at (dcp::Time (0, 0, 42, 100)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 0, 41, 62), - libdcp::Time (0, 0, 43, 52), + dcp::Time (0, 0, 41, 62), + dcp::Time (0, 0, 43, 52), 89, - libdcp::TOP, + dcp::TOP, "At afternoon tea with John Peel", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 0, 41, 62), - libdcp::Time (0, 0, 43, 52), + dcp::Time (0, 0, 41, 62), + dcp::Time (0, 0, 43, 52), 95, - libdcp::TOP, + dcp::TOP, "I enquired if his accent was real", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - s = subs.subtitles_at (libdcp::Time (0, 0, 50, 50)); + s = subs.subtitles_at (dcp::Time (0, 0, 50, 50)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 0, 50, 42), - libdcp::Time (0, 0, 52, 21), + dcp::Time (0, 0, 50, 42), + dcp::Time (0, 0, 52, 21), 89, - libdcp::TOP, + dcp::TOP, "He said \"out of the house", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 0, 50, 42), - libdcp::Time (0, 0, 52, 21), + dcp::Time (0, 0, 50, 42), + dcp::Time (0, 0, 52, 21), 95, - libdcp::TOP, + dcp::TOP, "I'm incredibly scouse", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - s = subs.subtitles_at (libdcp::Time (0, 1, 2, 300)); + s = subs.subtitles_at (dcp::Time (0, 1, 2, 300)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 2, 208), - libdcp::Time (0, 1, 4, 10), + dcp::Time (0, 1, 2, 208), + dcp::Time (0, 1, 4, 10), 89, - libdcp::TOP, + dcp::TOP, "At home it depends how I feel.\"", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 2, 208), - libdcp::Time (0, 1, 4, 10), + dcp::Time (0, 1, 2, 208), + dcp::Time (0, 1, 4, 10), 95, - libdcp::TOP, + dcp::TOP, "I spent a long weekend in Brighton", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - s = subs.subtitles_at (libdcp::Time (0, 1, 15, 50)); + s = subs.subtitles_at (dcp::Time (0, 1, 15, 50)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 15, 42), - libdcp::Time (0, 1, 16, 42), + dcp::Time (0, 1, 15, 42), + dcp::Time (0, 1, 16, 42), 89, - libdcp::TOP, + dcp::TOP, "With the legendary Miss Enid Blyton", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 15, 42), - libdcp::Time (0, 1, 16, 42), + dcp::Time (0, 1, 15, 42), + dcp::Time (0, 1, 16, 42), 95, - libdcp::TOP, + dcp::TOP, "She said \"you be Noddy", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - s = subs.subtitles_at (libdcp::Time (0, 1, 27, 200)); + s = subs.subtitles_at (dcp::Time (0, 1, 27, 200)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 27, 115), - libdcp::Time (0, 1, 28, 208), + dcp::Time (0, 1, 27, 115), + dcp::Time (0, 1, 28, 208), 89, - libdcp::TOP, + dcp::TOP, "That curious creature the Sphinx", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 27, 115), - libdcp::Time (0, 1, 28, 208), + dcp::Time (0, 1, 27, 115), + dcp::Time (0, 1, 28, 208), 95, - libdcp::TOP, + dcp::TOP, "Is smarter than anyone thinks", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - s = subs.subtitles_at (libdcp::Time (0, 1, 42, 300)); + s = subs.subtitles_at (dcp::Time (0, 1, 42, 300)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 42, 229), - libdcp::Time (0, 1, 45, 62), + dcp::Time (0, 1, 42, 229), + dcp::Time (0, 1, 45, 62), 89, - libdcp::TOP, + dcp::TOP, "It sits there and smirks", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 42, 229), - libdcp::Time (0, 1, 45, 62), + dcp::Time (0, 1, 42, 229), + dcp::Time (0, 1, 45, 62), 95, - libdcp::TOP, + dcp::TOP, "And you don't think it works", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - s = subs.subtitles_at (libdcp::Time (0, 1, 45, 200)); + s = subs.subtitles_at (dcp::Time (0, 1, 45, 200)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 45, 146), - libdcp::Time (0, 1, 47, 94), + dcp::Time (0, 1, 45, 146), + dcp::Time (0, 1, 47, 94), 89, - libdcp::TOP, + dcp::TOP, "Then when you're not looking, it winks.", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 45, 146), - libdcp::Time (0, 1, 47, 94), + dcp::Time (0, 1, 45, 146), + dcp::Time (0, 1, 47, 94), 95, - libdcp::TOP, + dcp::TOP, "When it snows you will find Sister Sledge", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - s = subs.subtitles_at (libdcp::Time (0, 1, 47, 249)); + s = subs.subtitles_at (dcp::Time (0, 1, 47, 249)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 47, 146), - libdcp::Time (0, 1, 48, 167), + dcp::Time (0, 1, 47, 146), + dcp::Time (0, 1, 48, 167), 89, - libdcp::TOP, + dcp::TOP, "Out mooning, at night, on the ledge", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", false, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 1, 47, 146), - libdcp::Time (0, 1, 48, 167), + dcp::Time (0, 1, 47, 146), + dcp::Time (0, 1, 48, 167), 95, - libdcp::TOP, + dcp::TOP, "One storey down", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - s = subs.subtitles_at (libdcp::Time (0, 2, 6, 210)); + s = subs.subtitles_at (dcp::Time (0, 2, 6, 210)); BOOST_CHECK_EQUAL (s.size(), 2); - BOOST_CHECK_EQUAL (*(s.front().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.front().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 2, 5, 208), - libdcp::Time (0, 2, 7, 31), + dcp::Time (0, 2, 5, 208), + dcp::Time (0, 2, 7, 31), 89, - libdcp::TOP, + dcp::TOP, "HELLO", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); - BOOST_CHECK_EQUAL (*(s.back().get()), libdcp::Subtitle ( + BOOST_CHECK_EQUAL (*(s.back().get()), dcp::Subtitle ( "Arial", true, - libdcp::Color (255, 255, 255), + dcp::Color (255, 255, 255), 42, - libdcp::Time (0, 2, 5, 208), - libdcp::Time (0, 2, 7, 31), + dcp::Time (0, 2, 5, 208), + dcp::Time (0, 2, 7, 31), 95, - libdcp::TOP, + dcp::TOP, "WORLD", - libdcp::BORDER, - libdcp::Color (0, 0, 0), - libdcp::Time (0, 0, 0, 0), - libdcp::Time (0, 0, 0, 0) + dcp::BORDER, + dcp::Color (0, 0, 0), + dcp::Time (0, 0, 0, 0), + dcp::Time (0, 0, 0, 0) )); diff --git a/test/test.cc b/test/test.cc index 72d0c7dd..f693467e 100644 --- a/test/test.cc +++ b/test/test.cc @@ -28,7 +28,7 @@ struct TestConfig { TestConfig() { - libdcp::init (); + dcp::init (); } }; @@ -41,7 +41,7 @@ j2c (int) } boost::filesystem::path -wav (libdcp::Channel) +wav (dcp::Channel) { return "test/data/1s_24-bit_48k_silence.wav"; } diff --git a/test/test.h b/test/test.h index d6691bc0..dc704004 100644 --- a/test/test.h +++ b/test/test.h @@ -18,5 +18,5 @@ */ extern boost::filesystem::path j2c (int); -extern boost::filesystem::path wav (libdcp::Channel); +extern boost::filesystem::path wav (dcp::Channel); extern std::string test_corpus; diff --git a/test/utc_offset_to_string_test.cc b/test/utc_offset_to_string_test.cc index af9c6533..3b4e0b46 100644 --- a/test/utc_offset_to_string_test.cc +++ b/test/utc_offset_to_string_test.cc @@ -21,12 +21,12 @@ #include "metadata.h" #include "util.h" -/** Test libdcp::utc_offset_to_string */ +/** Test dcp::utc_offset_to_string */ BOOST_AUTO_TEST_CASE (utc_offset_to_string_test) { - BOOST_CHECK_EQUAL (libdcp::utc_offset_to_string (30), "+00:30"); - BOOST_CHECK_EQUAL (libdcp::utc_offset_to_string (60), "+01:00"); - BOOST_CHECK_EQUAL (libdcp::utc_offset_to_string (61), "+01:01"); - BOOST_CHECK_EQUAL (libdcp::utc_offset_to_string (7 * 60), "+07:00"); - BOOST_CHECK_EQUAL (libdcp::utc_offset_to_string (-11 * 60), "-11:00"); + BOOST_CHECK_EQUAL (dcp::utc_offset_to_string (30), "+00:30"); + BOOST_CHECK_EQUAL (dcp::utc_offset_to_string (60), "+01:00"); + BOOST_CHECK_EQUAL (dcp::utc_offset_to_string (61), "+01:01"); + BOOST_CHECK_EQUAL (dcp::utc_offset_to_string (7 * 60), "+07:00"); + BOOST_CHECK_EQUAL (dcp::utc_offset_to_string (-11 * 60), "-11:00"); } diff --git a/test/util_test.cc b/test/util_test.cc index f7114e90..74a3e920 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -47,7 +47,7 @@ BOOST_AUTO_TEST_CASE (base64_decode_test) } unsigned char decoded[N]; - int const r = libdcp::base64_decode (s, decoded, N); + int const r = dcp::base64_decode (s, decoded, N); BOOST_CHECK_EQUAL (r, N); for (int i = 0; i < N; ++i) { @@ -57,16 +57,16 @@ BOOST_AUTO_TEST_CASE (base64_decode_test) BOOST_AUTO_TEST_CASE (content_kind_test) { - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("feature"), libdcp::FEATURE); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("Feature"), libdcp::FEATURE); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("FeaturE"), libdcp::FEATURE); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("Short"), libdcp::SHORT); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("trailer"), libdcp::TRAILER); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("test"), libdcp::TEST); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("transitional"), libdcp::TRANSITIONAL); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("rating"), libdcp::RATING); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("teaser"), libdcp::TEASER); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("policy"), libdcp::POLICY); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("psa"), libdcp::PUBLIC_SERVICE_ANNOUNCEMENT); - BOOST_CHECK_EQUAL (libdcp::content_kind_from_string ("advertisement"), libdcp::ADVERTISEMENT); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("feature"), dcp::FEATURE); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("Feature"), dcp::FEATURE); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("FeaturE"), dcp::FEATURE); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("Short"), dcp::SHORT); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("trailer"), dcp::TRAILER); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("test"), dcp::TEST); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("transitional"), dcp::TRANSITIONAL); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("rating"), dcp::RATING); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("teaser"), dcp::TEASER); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("policy"), dcp::POLICY); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("psa"), dcp::PUBLIC_SERVICE_ANNOUNCEMENT); + BOOST_CHECK_EQUAL (dcp::content_kind_from_string ("advertisement"), dcp::ADVERTISEMENT); } |
