summaryrefslogtreecommitdiff
path: root/test/closed_caption_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-02-02 16:36:31 +0100
committerCarl Hetherington <cth@carlh.net>2021-02-02 16:36:31 +0100
commit369821c41e62d4cce506cd4206f9db0d91b4f643 (patch)
tree2c990929b56ef47d99495a8aa22a23f626420885 /test/closed_caption_test.cc
parentb539d468acc3ca73cc58a4434002e511a4995f7d (diff)
Reduce the disk space needed when running tests.v2.15.124
Diffstat (limited to 'test/closed_caption_test.cc')
-rw-r--r--test/closed_caption_test.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/test/closed_caption_test.cc b/test/closed_caption_test.cc
index 31824b443..cc2dca930 100644
--- a/test/closed_caption_test.cc
+++ b/test/closed_caption_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -29,13 +29,16 @@
#include <boost/test/unit_test.hpp>
using std::list;
+using std::make_shared;
using std::shared_ptr;
/** Basic test that Interop closed captions are written */
BOOST_AUTO_TEST_CASE (closed_caption_test1)
{
- shared_ptr<Film> film = new_test_film2 ("closed_caption_test1");
- shared_ptr<StringTextFileContent> content (new StringTextFileContent("test/data/subrip.srt"));
+ Cleanup cl;
+
+ auto film = new_test_film2 ("closed_caption_test1", &cl);
+ auto content = make_shared<StringTextFileContent>("test/data/subrip.srt");
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs ());
@@ -54,17 +57,21 @@ BOOST_AUTO_TEST_CASE (closed_caption_test1)
BOOST_REQUIRE_EQUAL (check.cpls().size(), 1U);
BOOST_REQUIRE_EQUAL (check.cpls().front()->reels().size(), 1U);
BOOST_REQUIRE (!check.cpls().front()->reels().front()->closed_captions().empty());
+
+ cl.run ();
}
/** Test multiple closed captions */
BOOST_AUTO_TEST_CASE (closed_caption_test2)
{
- shared_ptr<Film> film = new_test_film2 ("closed_caption_test2");
- shared_ptr<StringTextFileContent> content1 (new StringTextFileContent("test/data/subrip.srt"));
+ Cleanup cl;
+
+ auto film = new_test_film2 ("closed_caption_test2", &cl);
+ auto content1 = make_shared<StringTextFileContent>("test/data/subrip.srt");
film->examine_and_add_content (content1);
- shared_ptr<StringTextFileContent> content2 (new StringTextFileContent("test/data/subrip2.srt"));
+ auto content2 = make_shared<StringTextFileContent>("test/data/subrip2.srt");
film->examine_and_add_content (content2);
- shared_ptr<StringTextFileContent> content3 (new StringTextFileContent("test/data/subrip3.srt"));
+ auto content3 = make_shared<StringTextFileContent>("test/data/subrip3.srt");
film->examine_and_add_content (content3);
BOOST_REQUIRE (!wait_for_jobs ());
@@ -98,4 +105,6 @@ BOOST_AUTO_TEST_CASE (closed_caption_test2)
BOOST_CHECK_EQUAL ((*i)->annotation_text(), "Third track");
BOOST_REQUIRE (static_cast<bool>((*i)->language()));
BOOST_CHECK_EQUAL ((*i)->language().get(), "it-IT");
+
+ cl.run ();
}