projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More error message improvements.
[dcpomatic.git]
/
test
/
create_cli_test.cc
diff --git
a/test/create_cli_test.cc
b/test/create_cli_test.cc
index acc3f64b0eb6eb31de56de6c40ff632578b395ea..97ac25374da8a135e3e6c7f38e46c099f93749f3 100644
(file)
--- a/
test/create_cli_test.cc
+++ b/
test/create_cli_test.cc
@@
-37,21
+37,19
@@
run (string cmd)
boost::escaped_list_separator<char> els ("", " ", "\"\'");
boost::tokenizer<boost::escaped_list_separator<char> > tok (cmd, els);
boost::escaped_list_separator<char> els ("", " ", "\"\'");
boost::tokenizer<boost::escaped_list_separator<char> > tok (cmd, els);
-
char** argv = new char*[256]
;
+
std::vector<char*> argv(256)
;
int argc = 0;
for (boost::tokenizer<boost::escaped_list_separator<char> >::iterator i = tok.begin(); i != tok.end(); ++i) {
argv[argc++] = strdup (i->c_str());
}
int argc = 0;
for (boost::tokenizer<boost::escaped_list_separator<char> >::iterator i = tok.begin(); i != tok.end(); ++i) {
argv[argc++] = strdup (i->c_str());
}
- CreateCLI cc (argc, argv);
+ CreateCLI cc (argc, argv
.data()
);
for (int i = 0; i < argc; ++i) {
free (argv[i]);
}
for (int i = 0; i < argc; ++i) {
free (argv[i]);
}
- delete[] argv;
-
return cc;
}
return cc;
}
@@
-144,6
+142,12
@@
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);
BOOST_CHECK_EQUAL (cc.content[1].frame_type, VideoFrameType::THREE_D_RIGHT);
BOOST_CHECK_EQUAL (cc.fourk, false);
+ cc = run ("dcpomatic2_create --twok foo.mp4");
+ BOOST_REQUIRE_EQUAL (cc.content.size(), 1U);
+ BOOST_CHECK_EQUAL (cc.content[0].path, "foo.mp4");
+ BOOST_CHECK_EQUAL (cc.twok, true);
+ BOOST_CHECK (!cc.error);
+
cc = run ("dcpomatic2_create --fourk foo.mp4");
BOOST_REQUIRE_EQUAL (cc.content.size(), 1U);
BOOST_CHECK_EQUAL (cc.content[0].path, "foo.mp4");
cc = run ("dcpomatic2_create --fourk foo.mp4");
BOOST_REQUIRE_EQUAL (cc.content.size(), 1U);
BOOST_CHECK_EQUAL (cc.content[0].path, "foo.mp4");