std::shared_ptr
[libdcp.git] / test / test.cc
index 382ffd77b0c990e339990c46cc4b6e29b5588b91..76a6c4c572034ea8e4e5881741efc5b85acfe286 100644 (file)
@@ -68,7 +68,7 @@ using std::string;
 using std::min;
 using std::list;
 using std::vector;
-using boost::shared_ptr;
+using std::shared_ptr;
 using boost::optional;
 
 
@@ -176,9 +176,9 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check)
        uintmax_t N = boost::filesystem::file_size (ref);
        BOOST_CHECK_EQUAL (N, boost::filesystem::file_size (check));
        FILE* ref_file = dcp::fopen_boost (ref, "rb");
-       BOOST_CHECK (ref_file);
+       BOOST_REQUIRE (ref_file);
        FILE* check_file = dcp::fopen_boost (check, "rb");
-       BOOST_CHECK (check_file);
+       BOOST_REQUIRE (check_file);
 
        int const buffer_size = 65536;
        uint8_t* ref_buffer = new uint8_t[buffer_size];
@@ -344,9 +344,8 @@ make_simple_with_interop_subs (boost::filesystem::path path)
        subs->add (simple_subtitle());
 
        boost::filesystem::create_directory (path / "subs");
-       dcp::Data data(4096);
-       data.write (path / "subs" / "font.ttf");
-       subs->add_font ("afont", path / "subs" / "font.ttf");
+       dcp::ArrayData data(4096);
+       subs->add_font ("afont", data);
        subs->write (path / "subs" / "subs.xml");
 
        shared_ptr<dcp::ReelSubtitleAsset> reel_subs(new dcp::ReelSubtitleAsset(subs, dcp::Fraction(24, 1), 240, 0));
@@ -364,7 +363,7 @@ make_simple_with_smpte_subs (boost::filesystem::path path)
        shared_ptr<dcp::SMPTESubtitleAsset> subs(new dcp::SMPTESubtitleAsset());
        subs->add (simple_subtitle());
 
-       dcp::Data data(4096);
+       dcp::ArrayData data(4096);
        subs->write (path / "subs.mxf");
 
        shared_ptr<dcp::ReelSubtitleAsset> reel_subs(new dcp::ReelSubtitleAsset(subs, dcp::Fraction(24, 1), 240, 0));
@@ -422,14 +421,14 @@ shared_ptr<dcp::ReelAsset>
 black_picture_asset (boost::filesystem::path dir, int frames)
 {
        shared_ptr<dcp::OpenJPEGImage> image = black_image ();
-       dcp::Data frame = dcp::compress_j2k (image, 100000000, 24, false, false);
+       dcp::ArrayData frame = dcp::compress_j2k (image, 100000000, 24, false, false);
        BOOST_REQUIRE (frame.size() < 230000000 / (24 * 8));
 
        shared_ptr<dcp::MonoPictureAsset> asset(new dcp::MonoPictureAsset(dcp::Fraction(24, 1), dcp::SMPTE));
        boost::filesystem::create_directories (dir);
        shared_ptr<dcp::PictureAssetWriter> writer = asset->start_write (dir / "pic.mxf", true);
        for (int i = 0; i < frames; ++i) {
-               writer->write (frame.data().get(), frame.size());
+               writer->write (frame.data(), frame.size());
        }
        writer->finalize ();