X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fcreate_cli_test.cc;h=aae5fb6de051d81b83719ba8275918d80c47cde5;hb=c5b32e265baa6957e55881945fd0ddf15cadeccc;hp=3ebdcb81b7b88f41243d946a501dd59fff11f454;hpb=5e34ba58c0c6821756308c09ddcbf08f8a775f3f;p=dcpomatic.git diff --git a/test/create_cli_test.cc b/test/create_cli_test.cc index 3ebdcb81b..aae5fb6de 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,46 @@ 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()); + + Config::instance()->set_default_dcp_content_type(DCPContentType::from_isdcf_name("FT")); + cc = run("dcpomatic2_create test/data/flat_red.png"); + film = cc.make_film(); + BOOST_CHECK_EQUAL(film->dcp_content_type()->isdcf_name(), "TST"); }