Rename j2k_bandwidth -> video_bit_rate.
[dcpomatic.git] / test / reels_test.cc
index d4a783f91a72a30acd2e08b5ec8385f2d4d5995e..5fcddfe781378ade48ce2ad86be6d5f4efeee13f 100644 (file)
@@ -54,6 +54,14 @@ using std::vector;
 using namespace dcpomatic;
 
 
+static
+void
+filter_ok(std::vector<dcp::VerificationNote>& notes)
+{
+       notes.erase(std::remove_if(notes.begin(), notes.end(), [](dcp::VerificationNote const& note) { return note.type() == dcp::VerificationNote::Type::OK; }), notes.end());
+}
+
+
 /** Test Film::reels() */
 BOOST_AUTO_TEST_CASE (reels_test1)
 {
@@ -80,7 +88,7 @@ BOOST_AUTO_TEST_CASE (reels_test1)
        BOOST_CHECK_EQUAL (r.back().from.get(), 288000);
        BOOST_CHECK_EQUAL (r.back().to.get(), 288000 * 2);
 
-       film->set_j2k_bandwidth (100000000);
+       film->set_video_bit_rate(100000000);
        film->set_reel_type (ReelType::BY_LENGTH);
        /* This is just over 2.5s at 100Mbit/s; should correspond to 60 frames */
        film->set_reel_length (31253154);
@@ -302,7 +310,7 @@ BOOST_AUTO_TEST_CASE (reels_test6)
        auto A = make_shared<FFmpegContent>("test/data/test2.mp4");
        auto film = new_test_film2 ("reels_test6", {A});
 
-       film->set_j2k_bandwidth (100000000);
+       film->set_video_bit_rate(100000000);
        film->set_reel_type (ReelType::BY_LENGTH);
        /* This is just over 2.5s at 100Mbit/s; should correspond to 60 frames */
        film->set_reel_length (31253154);
@@ -508,9 +516,10 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short1)
        make_and_verify_dcp (film);
 
        vector<boost::filesystem::path> dirs = { film->dir(film->dcp_name(false)) };
-       auto notes = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
-       dump_notes (notes);
-       BOOST_REQUIRE (notes.empty());
+       auto result = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
+       filter_ok(result.notes);
+       dump_notes(result.notes);
+       BOOST_REQUIRE(result.notes.empty());
 }
 
 
@@ -533,9 +542,10 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short2)
        make_and_verify_dcp (film);
 
        vector<boost::filesystem::path> dirs = { film->dir(film->dcp_name(false)) };
-       auto const notes = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
-       dump_notes (notes);
-       BOOST_REQUIRE (notes.empty());
+       auto result = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
+       filter_ok(result.notes);
+       dump_notes(result.notes);
+       BOOST_REQUIRE(result.notes.empty());
 }
 
 
@@ -554,9 +564,10 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short3)
 
        make_and_verify_dcp (film);
 
-       auto const notes = dcp::verify({}, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
-       dump_notes (notes);
-       BOOST_REQUIRE (notes.empty());
+       auto result = dcp::verify({}, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
+       filter_ok(result.notes);
+       dump_notes(result.notes);
+       BOOST_REQUIRE(result.notes.empty());
 }
 
 
@@ -584,9 +595,10 @@ BOOST_AUTO_TEST_CASE (reels_should_not_be_short4)
        BOOST_REQUIRE (!wait_for_jobs());
 
        vector<boost::filesystem::path> dirs = { film->dir(film->dcp_name(false)) };
-       auto const notes = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
-       dump_notes (notes);
-       BOOST_REQUIRE (notes.empty());
+       auto result = dcp::verify(dirs, {}, boost::bind(&no_op), boost::bind(&no_op), {}, TestPaths::xsd());
+       filter_ok(result.notes);
+       dump_notes(result.notes);
+       BOOST_REQUIRE(result.notes.empty());
 }