diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-03-10 23:15:17 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-03-11 22:24:28 +0100 |
| commit | 6cb5e8213a0714d47efe87ee8e96794d91f8ac6d (patch) | |
| tree | 6622440f33cf624bd63841cd171cd58859715c97 | |
| parent | f06c5136e7d3cd0a8e1814763c7774859998efe4 (diff) | |
Test updates now that there can't be <1s long DCPs any more.
| m--------- | test/data | 0 | ||||
| -rw-r--r-- | test/empty_test.cc | 22 | ||||
| -rw-r--r-- | test/file_naming_test.cc | 25 | ||||
| -rw-r--r-- | test/repeat_frame_test.cc | 2 | ||||
| -rw-r--r-- | test/video_mxf_content_test.cc | 2 |
5 files changed, 41 insertions, 10 deletions
diff --git a/test/data b/test/data -Subproject 24df650e742a9a19ffd6adad42413eb9491e61b +Subproject 6b694889479064979b52c1839a1919dc5fde673 diff --git a/test/empty_test.cc b/test/empty_test.cc index 428d0f9bb..f0fa7138f 100644 --- a/test/empty_test.cc +++ b/test/empty_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2017 Carl Hetherington <cth@carlh.net> + Copyright (C) 2017-2020 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -29,6 +29,7 @@ #include "test.h" #include <boost/test/unit_test.hpp> +using std::list; using boost::shared_ptr; using namespace dcpomatic; @@ -63,11 +64,16 @@ BOOST_AUTO_TEST_CASE (empty_test1) shared_ptr<Player> player (new Player(film, film->playlist())); Empty black (film, player->_pieces, bind(&has_video, _1)); - BOOST_REQUIRE_EQUAL (black._periods.size(), 2); - BOOST_CHECK (black._periods.front().from == DCPTime()); - BOOST_CHECK (black._periods.front().to == DCPTime::from_frames(2, vfr)); - BOOST_CHECK (black._periods.back().from == DCPTime::from_frames(5, vfr)); - BOOST_CHECK (black._periods.back().to == DCPTime::from_frames(7, vfr)); + BOOST_REQUIRE_EQUAL (black._periods.size(), 3); + list<dcpomatic::DCPTimePeriod>::const_iterator i = black._periods.begin(); + BOOST_CHECK (i->from == DCPTime()); + BOOST_CHECK (i->to == DCPTime::from_frames(2, vfr)); + ++i; + BOOST_CHECK (i->from == DCPTime::from_frames(5, vfr)); + BOOST_CHECK (i->to == DCPTime::from_frames(7, vfr)); + ++i; + BOOST_CHECK (i->from == DCPTime::from_frames(8, vfr)); + BOOST_CHECK (i->to == DCPTime::from_frames(24, vfr)); } /** Some tests where the first empty period is not at time 0 */ @@ -96,7 +102,7 @@ BOOST_AUTO_TEST_CASE (empty_test2) shared_ptr<Player> player (new Player(film, film->playlist())); Empty black (film, player->_pieces, bind(&has_video, _1)); - BOOST_REQUIRE_EQUAL (black._periods.size(), 1); + BOOST_REQUIRE_EQUAL (black._periods.size(), 2); BOOST_CHECK (black._periods.front().from == DCPTime::from_frames(3, vfr)); BOOST_CHECK (black._periods.front().to == DCPTime::from_frames(7, vfr)); @@ -108,5 +114,7 @@ BOOST_AUTO_TEST_CASE (empty_test2) black.set_position (DCPTime::from_frames (4, vfr)); BOOST_CHECK (!black.done ()); black.set_position (DCPTime::from_frames (7, vfr)); + BOOST_CHECK (!black.done ()); + black.set_position (DCPTime::from_frames (24, vfr)); BOOST_CHECK (black.done ()); } diff --git a/test/file_naming_test.cc b/test/file_naming_test.cc index 6b5b2020d..160fc0813 100644 --- a/test/file_naming_test.cc +++ b/test/file_naming_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2016 Carl Hetherington <cth@carlh.net> + Copyright (C) 2016-2020 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -28,6 +28,7 @@ #include "lib/film.h" #include "lib/ffmpeg_content.h" #include "lib/dcp_content_type.h" +#include "lib/video_content.h" #include <boost/test/unit_test.hpp> #include <boost/regex.hpp> @@ -58,6 +59,7 @@ BOOST_AUTO_TEST_CASE (file_naming_test) shared_ptr<Film> film = new_test_film ("file_naming_test"); film->set_name ("file_naming_test"); + film->set_video_frame_rate (24); film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR")); shared_ptr<FFmpegContent> r (new FFmpegContent("test/data/flat_red.png")); film->examine_and_add_content (r); @@ -67,7 +69,18 @@ BOOST_AUTO_TEST_CASE (file_naming_test) film->examine_and_add_content (b); BOOST_REQUIRE (!wait_for_jobs()); + r->set_position (film, dcpomatic::DCPTime::from_seconds(0)); + r->set_video_frame_rate (24); + r->video->set_length (24); + g->set_position (film, dcpomatic::DCPTime::from_seconds(1)); + g->set_video_frame_rate (24); + g->video->set_length (24); + b->set_position (film, dcpomatic::DCPTime::from_seconds(2)); + b->set_video_frame_rate (24); + b->video->set_length (24); + film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); + film->write_metadata (); film->make_dcp (); BOOST_REQUIRE (!wait_for_jobs()); @@ -106,6 +119,16 @@ BOOST_AUTO_TEST_CASE (file_naming_test2) film->examine_and_add_content (b); BOOST_REQUIRE (!wait_for_jobs()); + r->set_position (film, dcpomatic::DCPTime::from_seconds(0)); + r->set_video_frame_rate (24); + r->video->set_length (24); + g->set_position (film, dcpomatic::DCPTime::from_seconds(1)); + g->set_video_frame_rate (24); + g->video->set_length (24); + b->set_position (film, dcpomatic::DCPTime::from_seconds(2)); + b->set_video_frame_rate (24); + b->video->set_length (24); + film->set_reel_type (REELTYPE_BY_VIDEO_CONTENT); film->make_dcp (); BOOST_REQUIRE (!wait_for_jobs()); diff --git a/test/repeat_frame_test.cc b/test/repeat_frame_test.cc index d5ee0c023..1075f96fc 100644 --- a/test/repeat_frame_test.cc +++ b/test/repeat_frame_test.cc @@ -54,6 +54,6 @@ BOOST_AUTO_TEST_CASE (repeat_frame_test) film->make_dcp (); BOOST_REQUIRE (!wait_for_jobs()); - /* Should be 32 frames of red */ + /* Should be 32 frames of red followed by 16 frames of black to fill the DCP up to 1 second */ check_dcp ("test/data/repeat_frame_test", film->dir (film->dcp_name ())); } diff --git a/test/video_mxf_content_test.cc b/test/video_mxf_content_test.cc index d2cb4cea2..7ce3201df 100644 --- a/test/video_mxf_content_test.cc +++ b/test/video_mxf_content_test.cc @@ -35,7 +35,7 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; -static boost::filesystem::path ref_mxf = "test/data/scaling_test_185_185/j2c_a41afbff-e1ad-41c4-9a84-de315b95dd0f.mxf"; +static boost::filesystem::path ref_mxf = "test/data/scaling_test_185_185/j2c_bff270b1-cf7c-483b-be22-265aee6097ba.mxf"; static void note (dcp::NoteType, std::string) { |
