summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-01-21 02:44:11 +0100
committerCarl Hetherington <cth@carlh.net>2021-01-21 20:15:14 +0100
commit28111007e2e6fd62f5810be780706ae1618bd33f (patch)
treed99fe830ba961b174d3f024d2b5671a9821ed8a9 /test
parentc7d77490382d6ddb625340c05b57487cde244f96 (diff)
Adapt for libdcp use of enum class.
Diffstat (limited to 'test')
-rw-r--r--test/atmos_test.cc2
-rw-r--r--test/create_cli_test.cc7
-rw-r--r--test/dcp_decoder_test.cc2
-rw-r--r--test/ffmpeg_encoder_test.cc8
-rw-r--r--test/image_test.cc44
-rw-r--r--test/import_dcp_test.cc2
-rw-r--r--test/isdcf_name_test.cc36
-rw-r--r--test/kdm_naming_test.cc4
-rw-r--r--test/ratio_test.cc3
-rw-r--r--test/recover_test.cc2
-rw-r--r--test/remake_id_test.cc2
-rw-r--r--test/render_subtitles_test.cc8
-rw-r--r--test/stream_test.cc12
-rw-r--r--test/test.cc23
-rw-r--r--test/test.h9
-rw-r--r--test/vf_kdm_test.cc4
-rw-r--r--test/video_content_scale_test.cc1
17 files changed, 100 insertions, 69 deletions
diff --git a/test/atmos_test.cc b/test/atmos_test.cc
index 95c43ce34..6689ee8d7 100644
--- a/test/atmos_test.cc
+++ b/test/atmos_test.cc
@@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE (atmos_encrypted_passthrough_test)
dcp_file(film, "cpl"),
dcp::LocalTime(),
dcp::LocalTime(),
- dcp::MODIFIED_TRANSITIONAL_1,
+ dcp::Formulation::MODIFIED_TRANSITIONAL_1,
false,
optional<int>()
);
diff --git a/test/create_cli_test.cc b/test/create_cli_test.cc
index 747f0f045..31c8ae877 100644
--- a/test/create_cli_test.cc
+++ b/test/create_cli_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -21,6 +21,7 @@
#include "lib/create_cli.h"
#include "lib/ratio.h"
#include "lib/dcp_content_type.h"
+#include "test.h"
#include <boost/test/unit_test.hpp>
#include <boost/tokenizer.hpp>
#include <boost/algorithm/string/predicate.hpp>
@@ -98,11 +99,11 @@ BOOST_AUTO_TEST_CASE (create_cli_test)
cc = run ("dcpomatic2_create x --standard SMPTE");
BOOST_CHECK (!cc.error);
- BOOST_CHECK_EQUAL (cc.standard, dcp::SMPTE);
+ BOOST_CHECK_EQUAL (cc.standard, dcp::Standard::SMPTE);
cc = run ("dcpomatic2_create x --standard interop");
BOOST_CHECK (!cc.error);
- BOOST_CHECK_EQUAL (cc.standard, dcp::INTEROP);
+ BOOST_CHECK_EQUAL (cc.standard, dcp::Standard::INTEROP);
cc = run ("dcpomatic2_create x --standard SMPTEX");
BOOST_CHECK (cc.error);
diff --git a/test/dcp_decoder_test.cc b/test/dcp_decoder_test.cc
index 28538a281..c1ad90d6f 100644
--- a/test/dcp_decoder_test.cc
+++ b/test/dcp_decoder_test.cc
@@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE (check_reuse_old_data_test)
encrypted_dcp.cpls().front()->file().get(),
dcp::LocalTime ("2030-07-21T00:00:00+00:00"),
dcp::LocalTime ("2031-07-21T00:00:00+00:00"),
- dcp::MODIFIED_TRANSITIONAL_1,
+ dcp::Formulation::MODIFIED_TRANSITIONAL_1,
true, 0
);
diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc
index e43ea76e8..1147b4d07 100644
--- a/test/ffmpeg_encoder_test.cc
+++ b/test/ffmpeg_encoder_test.cc
@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test6)
film->examine_and_add_content (s);
BOOST_REQUIRE (!wait_for_jobs ());
s->only_text()->set_colour (dcp::Colour (255, 255, 0));
- s->only_text()->set_effect (dcp::SHADOW);
+ s->only_text()->set_effect (dcp::Effect::SHADOW);
s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255));
film->write_metadata();
@@ -156,7 +156,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_prores_test7)
film->examine_and_add_content (s);
BOOST_REQUIRE (!wait_for_jobs ());
s->only_text()->set_colour (dcp::Colour (255, 255, 0));
- s->only_text()->set_effect (dcp::SHADOW);
+ s->only_text()->set_effect (dcp::Effect::SHADOW);
s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255));
shared_ptr<Job> job (new TranscodeJob (film));
@@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test2)
film->examine_and_add_content (s);
BOOST_REQUIRE (!wait_for_jobs ());
s->only_text()->set_colour (dcp::Colour (255, 255, 0));
- s->only_text()->set_effect (dcp::SHADOW);
+ s->only_text()->set_effect (dcp::Effect::SHADOW);
s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255));
film->write_metadata();
@@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test3)
film->examine_and_add_content (s);
BOOST_REQUIRE (!wait_for_jobs ());
s->only_text()->set_colour (dcp::Colour (255, 255, 0));
- s->only_text()->set_effect (dcp::SHADOW);
+ s->only_text()->set_effect (dcp::Effect::SHADOW);
s->only_text()->set_effect_colour (dcp::Colour (0, 255, 255));
film->write_metadata();
diff --git a/test/image_test.cc b/test/image_test.cc
index 88bb00b8d..f69383724 100644
--- a/test/image_test.cc
+++ b/test/image_test.cc
@@ -140,7 +140,7 @@ alpha_blend_test_one (AVPixelFormat format, string suffix)
{
shared_ptr<FFmpegImageProxy> proxy (new FFmpegImageProxy (TestPaths::private_data() / "prophet_frame.tiff", VIDEO_RANGE_FULL));
shared_ptr<Image> raw = proxy->image().image;
- shared_ptr<Image> background = raw->convert_pixel_format (dcp::YUV_TO_RGB_REC709, format, true, false);
+ shared_ptr<Image> background = raw->convert_pixel_format (dcp::YUVToRGB::REC709, format, true, false);
shared_ptr<Image> overlay (new Image (AV_PIX_FMT_BGRA, dcp::Size(431, 891), true));
overlay->make_transparent ();
@@ -171,7 +171,7 @@ alpha_blend_test_one (AVPixelFormat format, string suffix)
background->alpha_blend (overlay, Position<int> (13, 17));
- shared_ptr<Image> save = background->convert_pixel_format (dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, false, false);
+ shared_ptr<Image> save = background->convert_pixel_format (dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, false, false);
write_image (save, "build/test/image_test_" + suffix + ".png");
check_image ("build/test/image_test_" + suffix + ".png", TestPaths::private_data() / ("image_test_" + suffix + ".png"));
@@ -263,9 +263,9 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test)
shared_ptr<FFmpegImageProxy> proxy(new FFmpegImageProxy("test/data/flat_red.png", VIDEO_RANGE_FULL));
shared_ptr<Image> raw = proxy->image().image;
shared_ptr<Image> out = raw->crop_scale_window(
- Crop(), dcp::Size(1998, 836), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_YUV420P, VIDEO_RANGE_FULL, true, false
+ Crop(), dcp::Size(1998, 836), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_YUV420P, VIDEO_RANGE_FULL, true, false
);
- shared_ptr<Image> save = out->scale(dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, false, false);
+ shared_ptr<Image> save = out->scale(dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, false, false);
write_image(save, "build/test/crop_scale_window_test.png");
check_image("test/data/crop_scale_window_test.png", "build/test/crop_scale_window_test.png");
}
@@ -275,19 +275,19 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test2)
{
shared_ptr<Image> image (new Image(AV_PIX_FMT_XYZ12LE, dcp::Size(2048, 858), true));
image->crop_scale_window (
- Crop(279, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false
+ Crop(279, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false
);
image->crop_scale_window (
- Crop(2048, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false
+ Crop(2048, 0, 0, 0), dcp::Size(1069, 448), dcp::Size(1069, 578), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false
);
}
BOOST_AUTO_TEST_CASE (crop_scale_window_test3)
{
shared_ptr<FFmpegImageProxy> proxy(new FFmpegImageProxy(TestPaths::private_data() / "player_seek_test_0.png", VIDEO_RANGE_FULL));
- shared_ptr<Image> xyz = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, true, false);
+ shared_ptr<Image> xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, true, false);
shared_ptr<Image> cropped = xyz->crop_scale_window(
- Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false
+ Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false
);
write_image(cropped, "build/test/crop_scale_window_test3.png");
check_image("test/data/crop_scale_window_test3.png", "build/test/crop_scale_window_test3.png");
@@ -296,9 +296,9 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test3)
BOOST_AUTO_TEST_CASE (crop_scale_window_test4)
{
shared_ptr<FFmpegImageProxy> proxy(new FFmpegImageProxy(TestPaths::private_data() / "player_seek_test_0.png", VIDEO_RANGE_FULL));
- shared_ptr<Image> xyz = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, true, false);
+ shared_ptr<Image> xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, true, false);
shared_ptr<Image> cropped = xyz->crop_scale_window(
- Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_XYZ12LE, VIDEO_RANGE_FULL, false, false
+ Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_XYZ12LE, VIDEO_RANGE_FULL, false, false
);
write_image(cropped, "build/test/crop_scale_window_test4.png");
check_image("test/data/crop_scale_window_test4.png", "build/test/crop_scale_window_test4.png", 35000);
@@ -307,9 +307,9 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test4)
BOOST_AUTO_TEST_CASE (crop_scale_window_test5)
{
shared_ptr<FFmpegImageProxy> proxy(new FFmpegImageProxy(TestPaths::private_data() / "player_seek_test_0.png", VIDEO_RANGE_FULL));
- shared_ptr<Image> xyz = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_XYZ12LE, true, false);
+ shared_ptr<Image> xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_XYZ12LE, true, false);
shared_ptr<Image> cropped = xyz->crop_scale_window(
- Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false
+ Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, false, false
);
write_image(cropped, "build/test/crop_scale_window_test5.png");
check_image("test/data/crop_scale_window_test5.png", "build/test/crop_scale_window_test5.png");
@@ -318,9 +318,9 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test5)
BOOST_AUTO_TEST_CASE (crop_scale_window_test6)
{
shared_ptr<FFmpegImageProxy> proxy(new FFmpegImageProxy(TestPaths::private_data() / "player_seek_test_0.png", VIDEO_RANGE_FULL));
- shared_ptr<Image> xyz = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_XYZ12LE, true, false);
+ shared_ptr<Image> xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_XYZ12LE, true, false);
shared_ptr<Image> cropped = xyz->crop_scale_window(
- Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_XYZ12LE, VIDEO_RANGE_FULL, false, false
+ Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_XYZ12LE, VIDEO_RANGE_FULL, false, false
);
write_image(cropped, "build/test/crop_scale_window_test6.png");
check_image("test/data/crop_scale_window_test6.png", "build/test/crop_scale_window_test6.png", 35000);
@@ -333,13 +333,13 @@ BOOST_AUTO_TEST_CASE (crop_scale_window_test7)
using namespace boost::filesystem;
for (int left_crop = 0; left_crop < 8; ++left_crop) {
shared_ptr<FFmpegImageProxy> proxy(new FFmpegImageProxy("test/data/rgb_grey_testcard.png", VIDEO_RANGE_FULL));
- shared_ptr<Image> yuv = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_YUV420P, true, false);
+ shared_ptr<Image> yuv = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_YUV420P, true, false);
int rounded = left_crop - (left_crop % 2);
shared_ptr<Image> cropped = yuv->crop_scale_window(
Crop(left_crop, 0, 0, 0),
dcp::Size(1998 - rounded, 1080),
dcp::Size(1998 - rounded, 1080),
- dcp::YUV_TO_RGB_REC709,
+ dcp::YUVToRGB::REC709,
VIDEO_RANGE_VIDEO,
AV_PIX_FMT_RGB24,
VIDEO_RANGE_VIDEO,
@@ -357,7 +357,7 @@ BOOST_AUTO_TEST_CASE (as_png_test)
{
shared_ptr<FFmpegImageProxy> proxy(new FFmpegImageProxy("test/data/3d_test/000001.png", VIDEO_RANGE_FULL));
shared_ptr<Image> image_rgb = proxy->image().image;
- shared_ptr<Image> image_bgr = image_rgb->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_BGRA, true, false);
+ shared_ptr<Image> image_bgr = image_rgb->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_BGRA, true, false);
image_rgb->as_png().write ("build/test/as_png_rgb.png");
image_bgr->as_png().write ("build/test/as_png_bgr.png");
@@ -373,7 +373,7 @@ fade_test_format_black (AVPixelFormat f, string name)
yuv.make_black ();
yuv.fade (0);
string const filename = "fade_test_black_" + name + ".png";
- yuv.convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGBA, true, false)->as_png().write("build/test/" + filename);
+ yuv.convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, true, false)->as_png().write("build/test/" + filename);
check_image ("test/data/" + filename, "build/test/" + filename);
}
@@ -382,10 +382,10 @@ static void
fade_test_format_red (AVPixelFormat f, float amount, string name)
{
shared_ptr<FFmpegImageProxy> proxy(new FFmpegImageProxy("test/data/flat_red.png", VIDEO_RANGE_FULL));
- shared_ptr<Image> red = proxy->image().image->convert_pixel_format(dcp::YUV_TO_RGB_REC709, f, true, false);
+ shared_ptr<Image> red = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, f, true, false);
red->fade (amount);
string const filename = "fade_test_red_" + name + ".png";
- red->convert_pixel_format(dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGBA, true, false)->as_png().write("build/test/" + filename);
+ red->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, true, false)->as_png().write("build/test/" + filename);
check_image ("test/data/" + filename, "build/test/" + filename);
}
@@ -462,7 +462,7 @@ BOOST_AUTO_TEST_CASE (make_black_test)
for (list<AVPixelFormat>::const_iterator i = pix_fmts.begin(); i != pix_fmts.end(); ++i) {
std::shared_ptr<Image> foo (new Image (*i, in_size, true));
foo->make_black ();
- std::shared_ptr<Image> bar = foo->scale (out_size, dcp::YUV_TO_RGB_REC601, AV_PIX_FMT_RGB24, true, false);
+ std::shared_ptr<Image> bar = foo->scale (out_size, dcp::YUVToRGB::REC601, AV_PIX_FMT_RGB24, true, false);
uint8_t* p = bar->data()[0];
for (int y = 0; y < bar->size().height; ++y) {
@@ -490,7 +490,7 @@ BOOST_AUTO_TEST_CASE (over_crop_test)
shared_ptr<Image> image (new Image (AV_PIX_FMT_RGB24, dcp::Size(128, 128), true));
image->make_black ();
shared_ptr<Image> scaled = image->crop_scale_window (
- Crop(0, 0, 128, 128), dcp::Size(1323, 565), dcp::Size(1349, 565), dcp::YUV_TO_RGB_REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, true, true
+ Crop(0, 0, 128, 128), dcp::Size(1323, 565), dcp::Size(1349, 565), dcp::YUVToRGB::REC709, VIDEO_RANGE_FULL, AV_PIX_FMT_RGB24, VIDEO_RANGE_FULL, true, true
);
string const filename = "over_crop_test.png";
write_image (scaled, "build/test/" + filename);
diff --git a/test/import_dcp_test.cc b/test/import_dcp_test.cc
index 7ecb6c822..7729cfe5b 100644
--- a/test/import_dcp_test.cc
+++ b/test/import_dcp_test.cc
@@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE (import_dcp_test)
A_dcp.cpls().front()->file().get(),
dcp::LocalTime ("2030-07-21T00:00:00+00:00"),
dcp::LocalTime ("2031-07-21T00:00:00+00:00"),
- dcp::MODIFIED_TRANSITIONAL_1,
+ dcp::Formulation::MODIFIED_TRANSITIONAL_1,
true, 0
);
diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc
index 11886cbef..3465db750 100644
--- a/test/isdcf_name_test.cc
+++ b/test/isdcf_name_test.cc
@@ -162,56 +162,56 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test)
AudioMapping mapping = sound->audio->mapping ();
- mapping.set (0, dcp::LEFT, 1.0);
+ mapping.set (0, dcp::Channel::LEFT, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_20_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::RIGHT, 1.0);
+ mapping.set (0, dcp::Channel::RIGHT, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_30_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::LFE, 1.0);
+ mapping.set (0, dcp::Channel::LFE, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_31_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::LS, 1.0);
+ mapping.set (0, dcp::Channel::LS, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_41_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::RS, 1.0);
+ mapping.set (0, dcp::Channel::RS, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::HI, 1.0);
+ mapping.set (0, dcp::Channel::HI, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV");
film->set_audio_channels (8);
- mapping.set (0, dcp::HI, 1.0);
+ mapping.set (0, dcp::Channel::HI, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::VI, 1.0);
+ mapping.set (0, dcp::Channel::VI, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI-VI_4K_DI_20140704_PP_SMPTE_OV");
film->set_audio_channels(10);
- mapping.set (0, dcp::HI, 0.0);
- mapping.set (0, dcp::VI, 0.0);
+ mapping.set (0, dcp::Channel::HI, 0.0);
+ mapping.set (0, dcp::Channel::VI, 0.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::HI, 1.0);
+ mapping.set (0, dcp::Channel::HI, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::VI, 1.0);
+ mapping.set (0, dcp::Channel::VI, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI-VI_4K_DI_20140704_PP_SMPTE_OV");
film->set_audio_channels(12);
- mapping.set (0, dcp::BSL, 1.0);
- mapping.set (0, dcp::BSR, 1.0);
- mapping.set (0, dcp::HI, 0.0);
- mapping.set (0, dcp::VI, 0.0);
+ mapping.set (0, dcp::Channel::BSL, 1.0);
+ mapping.set (0, dcp::Channel::BSR, 1.0);
+ mapping.set (0, dcp::Channel::HI, 0.0);
+ mapping.set (0, dcp::Channel::VI, 0.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::HI, 1.0);
+ mapping.set (0, dcp::Channel::HI, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71-HI_4K_DI_20140704_PP_SMPTE_OV");
- mapping.set (0, dcp::VI, 1.0);
+ mapping.set (0, dcp::Channel::VI, 1.0);
sound->audio->set_mapping (mapping);
BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71-HI-VI_4K_DI_20140704_PP_SMPTE_OV");
}
diff --git a/test/kdm_naming_test.cc b/test/kdm_naming_test.cc
index 85a0b60f6..fb0f37dcf 100644
--- a/test/kdm_naming_test.cc
+++ b/test/kdm_naming_test.cc
@@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
cinema_a_screen_1,
boost::posix_time::time_from_string(from_string),
boost::posix_time::time_from_string(until_string),
- dcp::MODIFIED_TRANSITIONAL_1,
+ dcp::Formulation::MODIFIED_TRANSITIONAL_1,
false,
optional<int>()
);
@@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on(
i,
boost::posix_time::time_from_string(from_string),
boost::posix_time::time_from_string(until_string),
- dcp::MODIFIED_TRANSITIONAL_1,
+ dcp::Formulation::MODIFIED_TRANSITIONAL_1,
false,
optional<int>()
);
diff --git a/test/ratio_test.cc b/test/ratio_test.cc
index 43f1d2a15..1e8d54333 100644
--- a/test/ratio_test.cc
+++ b/test/ratio_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -28,6 +28,7 @@
#include <dcp/util.h>
#include "lib/ratio.h"
#include "lib/util.h"
+#include "test.h"
using std::ostream;
diff --git a/test/recover_test.cc b/test/recover_test.cc
index aa8da8ba9..13cb37a07 100644
--- a/test/recover_test.cc
+++ b/test/recover_test.cc
@@ -45,7 +45,7 @@ using namespace boost::placeholders;
static void
note (dcp::NoteType t, string n)
{
- if (t == dcp::DCP_ERROR) {
+ if (t == dcp::NoteType::ERROR) {
cout << n << "\n";
}
}
diff --git a/test/remake_id_test.cc b/test/remake_id_test.cc
index 488fada90..8f8ab820b 100644
--- a/test/remake_id_test.cc
+++ b/test/remake_id_test.cc
@@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE (remake_id_test2)
*cpl,
dcp::LocalTime ("2030-01-01T01:00:00+00:00"),
dcp::LocalTime ("2031-01-01T01:00:00+00:00"),
- dcp::MODIFIED_TRANSITIONAL_1,
+ dcp::Formulation::MODIFIED_TRANSITIONAL_1,
true,
0
);
diff --git a/test/render_subtitles_test.cc b/test/render_subtitles_test.cc
index 99e1e7a1b..a81ef05bf 100644
--- a/test/render_subtitles_test.cc
+++ b/test/render_subtitles_test.cc
@@ -43,12 +43,12 @@ add (std::list<StringText>& s, std::string text, bool italic, bool bold, bool un
dcp::Time (),
dcp::Time (),
1,
- dcp::HALIGN_LEFT,
+ dcp::HAlign::LEFT,
1,
- dcp::VALIGN_TOP,
- dcp::DIRECTION_LTR,
+ dcp::VAlign::TOP,
+ dcp::Direction::LTR,
text,
- dcp::NONE,
+ dcp::Effect::NONE,
dcp::Colour (0, 0, 0),
dcp::Time (),
dcp::Time ()
diff --git a/test/stream_test.cc b/test/stream_test.cc
index a706906f8..25c2d98a6 100644
--- a/test/stream_test.cc
+++ b/test/stream_test.cc
@@ -82,11 +82,11 @@ BOOST_AUTO_TEST_CASE (stream_test)
BOOST_CHECK_EQUAL (a.name, "hello there world");
BOOST_CHECK_EQUAL (a.mapping().input_channels(), 2);
- BOOST_CHECK_EQUAL (a.mapping().get (0, static_cast<int> (dcp::LEFT)), 1);
- BOOST_CHECK_EQUAL (a.mapping().get (0, static_cast<int> (dcp::RIGHT)), 0);
- BOOST_CHECK_EQUAL (a.mapping().get (0, static_cast<int> (dcp::CENTRE)), 1);
- BOOST_CHECK_EQUAL (a.mapping().get (1, static_cast<int> (dcp::LEFT)), 0);
- BOOST_CHECK_EQUAL (a.mapping().get (1, static_cast<int> (dcp::RIGHT)), 1);
- BOOST_CHECK_EQUAL (a.mapping().get (1, static_cast<int> (dcp::CENTRE)), 1);
+ BOOST_CHECK_EQUAL (a.mapping().get(0, dcp::Channel::LEFT), 1);
+ BOOST_CHECK_EQUAL (a.mapping().get(0, dcp::Channel::RIGHT), 0);
+ BOOST_CHECK_EQUAL (a.mapping().get(0, dcp::Channel::CENTRE), 1);
+ BOOST_CHECK_EQUAL (a.mapping().get(1, dcp::Channel::LEFT), 0);
+ BOOST_CHECK_EQUAL (a.mapping().get(1, dcp::Channel::RIGHT), 1);
+ BOOST_CHECK_EQUAL (a.mapping().get(1, dcp::Channel::CENTRE), 1);
}
diff --git a/test/test.cc b/test/test.cc
index 19e8f978a..cbd12e1ee 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -458,7 +458,7 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check)
static void
note (dcp::NoteType t, string n)
{
- if (t == dcp::DCP_ERROR) {
+ if (t == dcp::NoteType::ERROR) {
cerr << n << "\n";
}
}
@@ -790,3 +790,24 @@ LogSwitcher::~LogSwitcher ()
dcpomatic_log = _old;
}
+std::ostream&
+dcp::operator<< (std::ostream& s, dcp::Size i)
+{
+ s << i.width << "x" << i.height;
+ return s;
+}
+
+std::ostream&
+dcp::operator<< (std::ostream& s, Standard t)
+{
+ switch (t) {
+ case Standard::INTEROP:
+ s << "interop";
+ break;
+ case Standard::SMPTE:
+ s << "smpte";
+ break;
+ }
+ return s;
+}
+
diff --git a/test/test.h b/test/test.h
index 44ca706f6..c188a614f 100644
--- a/test/test.h
+++ b/test/test.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -20,6 +20,7 @@
#include "lib/warnings.h"
+#include <dcp/types.h>
#include <boost/filesystem.hpp>
@@ -66,3 +67,9 @@ private:
std::shared_ptr<Log> _old;
};
+namespace dcp {
+
+std::ostream& operator<< (std::ostream& s, dcp::Size i);
+std::ostream& operator<< (std::ostream& s, Standard t);
+
+}
diff --git a/test/vf_kdm_test.cc b/test/vf_kdm_test.cc
index 7a9c30263..9b987a703 100644
--- a/test/vf_kdm_test.cc
+++ b/test/vf_kdm_test.cc
@@ -68,7 +68,7 @@ BOOST_AUTO_TEST_CASE (vf_kdm_test)
A_dcp.cpls().front()->file().get(),
dcp::LocalTime ("2030-07-21T00:00:00+00:00"),
dcp::LocalTime ("2031-07-21T00:00:00+00:00"),
- dcp::MODIFIED_TRANSITIONAL_1,
+ dcp::Formulation::MODIFIED_TRANSITIONAL_1,
true, 0
);
@@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE (vf_kdm_test)
B_dcp.cpls().front()->file().get(),
dcp::LocalTime ("2030-07-21T00:00:00+00:00"),
dcp::LocalTime ("2031-07-21T00:00:00+00:00"),
- dcp::MODIFIED_TRANSITIONAL_1,
+ dcp::Formulation::MODIFIED_TRANSITIONAL_1,
true, 0
);
diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc
index b3e3ff76c..73feb7dc6 100644
--- a/test/video_content_scale_test.cc
+++ b/test/video_content_scale_test.cc
@@ -21,6 +21,7 @@
#include "lib/ratio.h"
#include "lib/video_content.h"
+#include "test.h"
#include <boost/test/unit_test.hpp>