C++11 tidying.
[dcpomatic.git] / test / create_cli_test.cc
index 31c8ae877e8a8841ecbed7ac0f93c1a90b8cb21a..ad794226f8adc47640b9eb5ebadf7cc0f47e5377 100644 (file)
@@ -37,21 +37,19 @@ run (string cmd)
        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());
        }
 
-       CreateCLI cc (argc, argv);
+       CreateCLI cc (argc, argv.data());
 
        for (int i = 0; i < argc; ++i) {
                free (argv[i]);
        }
 
-       delete[] argv;
-
        return cc;
 }
 
@@ -130,18 +128,18 @@ BOOST_AUTO_TEST_CASE (create_cli_test)
        BOOST_CHECK_EQUAL (*cc.output_dir, "flaps");
        BOOST_REQUIRE_EQUAL (cc.content.size(), 3U);
        BOOST_CHECK_EQUAL (cc.content[0].path, "fred");
-       BOOST_CHECK_EQUAL (cc.content[0].frame_type, VIDEO_FRAME_TYPE_2D);
+       BOOST_CHECK_EQUAL (cc.content[0].frame_type, VideoFrameType::TWO_D);
        BOOST_CHECK_EQUAL (cc.content[1].path, "jim");
-       BOOST_CHECK_EQUAL (cc.content[1].frame_type, VIDEO_FRAME_TYPE_2D);
+       BOOST_CHECK_EQUAL (cc.content[1].frame_type, VideoFrameType::TWO_D);
        BOOST_CHECK_EQUAL (cc.content[2].path, "sheila");
-       BOOST_CHECK_EQUAL (cc.content[2].frame_type, VIDEO_FRAME_TYPE_2D);
+       BOOST_CHECK_EQUAL (cc.content[2].frame_type, VideoFrameType::TWO_D);
 
        cc = run ("dcpomatic2_create --left-eye left.mp4 --right-eye right.mp4");
        BOOST_REQUIRE_EQUAL (cc.content.size(), 2U);
        BOOST_CHECK_EQUAL (cc.content[0].path, "left.mp4");
-       BOOST_CHECK_EQUAL (cc.content[0].frame_type, VIDEO_FRAME_TYPE_3D_LEFT);
+       BOOST_CHECK_EQUAL (cc.content[0].frame_type, VideoFrameType::THREE_D_LEFT);
        BOOST_CHECK_EQUAL (cc.content[1].path, "right.mp4");
-       BOOST_CHECK_EQUAL (cc.content[1].frame_type, VIDEO_FRAME_TYPE_3D_RIGHT);
+       BOOST_CHECK_EQUAL (cc.content[1].frame_type, VideoFrameType::THREE_D_RIGHT);
        BOOST_CHECK_EQUAL (cc.fourk, false);
 
        cc = run ("dcpomatic2_create --fourk foo.mp4");