diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-03-09 16:42:30 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-03-11 22:24:28 +0100 |
| commit | ffe35585f08d0a5aeccf3e32f9c4cd2a5a6f43f5 (patch) | |
| tree | e570ca8bf2b95c0ece69dfe5aaf8e4ceb51f324c /test/reels_test.cc | |
| parent | bc36ddea65fda2088f7e8fa98390e3feac07df84 (diff) | |
Add failing test for one short-reel possibility.
Diffstat (limited to 'test/reels_test.cc')
| -rw-r--r-- | test/reels_test.cc | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/test/reels_test.cc b/test/reels_test.cc index 3d79017f0..8d15aba52 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2015-2019 Carl Hetherington <cth@carlh.net> + Copyright (C) 2015-2020 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -39,7 +39,10 @@ using std::list; using std::cout; +using std::vector; +using std::string; using boost::shared_ptr; +using boost::function; using namespace dcpomatic; /** Test Film::reels() */ @@ -482,3 +485,32 @@ BOOST_AUTO_TEST_CASE (reels_test12) BOOST_CHECK_EQUAL (i->from.get(), DCPTime::from_seconds(14).get()); BOOST_CHECK_EQUAL (i->to.get(), DCPTime::from_seconds(19).get()); } + +static void +no_op () +{ + +} + + +/** Using less than 1 second's worth of content should not result in a reel + * of less than 1 second's duration. + */ +BOOST_AUTO_TEST_CASE (reels_should_not_be_short1) +{ + shared_ptr<Film> film = new_test_film2 ("reels_should_not_be_short1"); + film->set_video_frame_rate (24); + + shared_ptr<FFmpegContent> A(new FFmpegContent("test/data/flat_red.png")); + film->examine_and_add_content (A); + BOOST_REQUIRE (!wait_for_jobs()); + A->video->set_length (23); + + film->make_dcp (); + BOOST_REQUIRE (!wait_for_jobs()); + + vector<boost::filesystem::path> dirs; + dirs.push_back (film->dir(film->dcp_name(false))); + BOOST_REQUIRE (dcp::verify(dirs, boost::bind(&no_op), boost::bind(&no_op), TestPaths::xsd).empty()); +} + |
