From 6cb5e8213a0714d47efe87ee8e96794d91f8ac6d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 10 Mar 2020 23:15:17 +0100 Subject: [PATCH] Test updates now that there can't be <1s long DCPs any more. --- test/data | 2 +- test/empty_test.cc | 22 +++++++++++++++------- test/file_naming_test.cc | 25 ++++++++++++++++++++++++- test/repeat_frame_test.cc | 2 +- test/video_mxf_content_test.cc | 2 +- 5 files changed, 42 insertions(+), 11 deletions(-) diff --git a/test/data b/test/data index 24df650e7..6b6948894 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit 24df650e742a9a19ffd6adad42413eb9491e61b7 +Subproject commit 6b694889479064979b52c1839a1919dc5fde6731 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 + Copyright (C) 2017-2020 Carl Hetherington This file is part of DCP-o-matic. @@ -29,6 +29,7 @@ #include "test.h" #include +using std::list; using boost::shared_ptr; using namespace dcpomatic; @@ -63,11 +64,16 @@ BOOST_AUTO_TEST_CASE (empty_test1) shared_ptr 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::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 (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 + Copyright (C) 2016-2020 Carl Hetherington 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 #include @@ -58,6 +59,7 @@ BOOST_AUTO_TEST_CASE (file_naming_test) shared_ptr 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 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) { -- 2.30.2