Tidying.
authorCarl Hetherington <cth@carlh.net>
Wed, 20 Apr 2022 19:32:52 +0000 (21:32 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 4 May 2022 17:37:38 +0000 (19:37 +0200)
test/frame_info_hash_test.cc

index 677a00710fd55aae2d9fab99ebfce7a9aa9ee6ac..3033bb5b596e3e97f89ee30005573a5d2dd4f9b0 100644 (file)
     files in the program, then also delete it here.
 */
 
+
+#include "j2k_transcode.h"
 #include "mono_picture_asset.h"
 #include "mono_picture_asset_writer.h"
-#include "j2k_transcode.h"
 #include "openjpeg_image.h"
 #include <boost/test/unit_test.hpp>
+#include <memory>
+
 
-using std::string;
-using std::shared_ptr;
 using std::make_shared;
+using std::shared_ptr;
+using std::string;
+
 
 static void
 check (shared_ptr<dcp::PictureAssetWriter> writer, string hash)
 {
-       shared_ptr<dcp::OpenJPEGImage> xyz (new dcp::OpenJPEGImage (dcp::Size (1998, 1080)));
+       auto xyz = make_shared<dcp::OpenJPEGImage>(dcp::Size(1998, 1080));
        for (int c = 0; c < 3; ++c) {
                for (int p = 0; p < (1998 * 1080); ++p) {
                        xyz->data(c)[p] = rand() & 0xfff;
                }
        }
 
-       dcp::ArrayData data = dcp::compress_j2k (xyz, 100000000, 24, false, false);
+       auto data = dcp::compress_j2k (xyz, 100000000, 24, false, false);
 
-       dcp::FrameInfo info = writer->write (data.data(), data.size());
+       auto info = writer->write (data.data(), data.size());
        BOOST_CHECK_EQUAL (info.hash, hash);
 }