summaryrefslogtreecommitdiff
path: root/test/create_cli_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-09-30 12:28:05 +0200
committerCarl Hetherington <cth@carlh.net>2023-09-30 12:28:05 +0200
commit8a112904ee3cbdcd8e6c88e0a46c67e8d387ba9e (patch)
treede7000e0e6e51110464fc2ef21507a6a3878e636 /test/create_cli_test.cc
parent5e34ba58c0c6821756308c09ddcbf08f8a775f3f (diff)
Allow SMPTE/interop setting from template to work.
Diffstat (limited to 'test/create_cli_test.cc')
-rw-r--r--test/create_cli_test.cc43
1 files changed, 41 insertions, 2 deletions
diff --git a/test/create_cli_test.cc b/test/create_cli_test.cc
index 3ebdcb81b..0359b2f35 100644
--- a/test/create_cli_test.cc
+++ b/test/create_cli_test.cc
@@ -102,11 +102,13 @@ BOOST_AUTO_TEST_CASE (create_cli_test)
cc = run ("dcpomatic2_create x --standard SMPTE");
BOOST_CHECK (!cc.error);
- BOOST_CHECK_EQUAL(cc._standard, dcp::Standard::SMPTE);
+ BOOST_REQUIRE(cc._standard);
+ 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::Standard::INTEROP);
+ BOOST_REQUIRE(cc._standard);
+ BOOST_CHECK_EQUAL(*cc._standard, dcp::Standard::INTEROP);
cc = run ("dcpomatic2_create x --standard SMPTEX");
BOOST_CHECK (cc.error);
@@ -265,5 +267,42 @@ BOOST_AUTO_TEST_CASE(create_cli_template_test)
cc = run("dcpomatic2_create test/data/flat_red.png --template encrypted --no-encrypt");
film = cc.make_film();
BOOST_CHECK(!film->encrypted());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png");
+ film = cc.make_film();
+ BOOST_CHECK(!film->interop());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template interop");
+ film = cc.make_film();
+ BOOST_CHECK(film->interop());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template interop --standard SMPTE");
+ film = cc.make_film();
+ BOOST_CHECK(!film->interop());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template smpte");
+ film = cc.make_film();
+ BOOST_CHECK(!film->interop());
+
+ cc = run("dcpomatic2_create test/data/flat_red.png --template smpte --standard interop");
+ film = cc.make_film();
+ BOOST_CHECK(film->interop());
+}
+
+
+BOOST_AUTO_TEST_CASE(create_cli_defaults_test)
+{
+ ConfigRestorer cr;
+
+ /* I think on balance dcpomatic2_create should not use the defaults from Config;
+ * it seems a bit surprising that settings from a GUI tool can change the behaviour of
+ * a CLI tool, and at some point we're probably going to remove all the default config
+ * options from the main DoM anyway (in favour of a default template).
+ */
+ Config::instance()->set_default_interop(true);
+ auto cc = run("dcpomatic2_create test/data/flat_red.png");
+ auto film = cc.make_film();
+ BOOST_CHECK(!film->interop());
+
}