summaryrefslogtreecommitdiff
path: root/test/create_cli_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-19 22:38:15 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-19 22:38:15 +0100
commitbec175cf2eb7d288c6f11df751ec969f92e077db (patch)
tree0d4cb53c9591d41887199b6768d71516aec771d9 /test/create_cli_test.cc
parenta259b250cadf7bdeb7c56d214f69fee94ae50ab4 (diff)
Add --colourspace opton to create CLI (#2967).
Diffstat (limited to 'test/create_cli_test.cc')
-rw-r--r--test/create_cli_test.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/create_cli_test.cc b/test/create_cli_test.cc
index 5831e6b6f..1209f9344 100644
--- a/test/create_cli_test.cc
+++ b/test/create_cli_test.cc
@@ -177,6 +177,18 @@ BOOST_AUTO_TEST_CASE (create_cli_test)
BOOST_CHECK_EQUAL (cc.content[1].frame_type, VideoFrameType::THREE_D_RIGHT);
BOOST_CHECK_EQUAL(cc._fourk, false);
+ cc = run ("dcpomatic2_create --colourspace rec1886 test/data/flat_red.png");
+ BOOST_REQUIRE_EQUAL(cc.content.size(), 1U);
+ BOOST_CHECK_EQUAL(cc.content[0].colour_conversion.get_value_or(""), "rec1886");
+ BOOST_CHECK(!cc.error);
+ auto film = cc.make_film(error);
+ BOOST_REQUIRE_EQUAL(film->content().size(), 1U);
+ BOOST_REQUIRE(static_cast<bool>(film->content()[0]->video->colour_conversion()));
+ BOOST_REQUIRE(film->content()[0]->video->colour_conversion() == PresetColourConversion::from_id("rec1886").conversion);
+
+ cc = run ("dcpomatic2_create --colourspace ostrobogulous foo.mp4");
+ BOOST_CHECK_EQUAL(cc.error.get_value_or(""), "dcpomatic2_create: ostrobogulous is not a recognised colourspace");
+
cc = run ("dcpomatic2_create --twok foo.mp4");
BOOST_REQUIRE_EQUAL (cc.content.size(), 1U);
BOOST_CHECK_EQUAL (cc.content[0].path, "foo.mp4");
@@ -210,7 +222,7 @@ BOOST_AUTO_TEST_CASE (create_cli_test)
auto pillarbox = TestPaths::private_data() / "pillarbox.png";
cc = run("dcpomatic2_create --auto-crop " + pillarbox.string());
- auto film = cc.make_film(error);
+ film = cc.make_film(error);
BOOST_CHECK_EQUAL(film->content().size(), 1U);
BOOST_CHECK(film->content()[0]->video->actual_crop() == Crop(113, 262, 0, 0));
BOOST_CHECK_EQUAL(collected_error, fmt::format("Cropped {} to 113 left, 262 right, 0 top and 0 bottom", pillarbox.string()));