X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=test%2Fsubtitle_charset_test.cc;h=84f249c659c45fcea3e289ed13c9ab8e00506725;hb=ce73eaf7875a9a3326afcd839ad85eb95879c160;hp=828411c9b5236d9fb1995980a45334328f0c80f7;hpb=65cc06076b46cbd27ccfcf7387894358e2c8ab1e;p=dcpomatic.git diff --git a/test/subtitle_charset_test.cc b/test/subtitle_charset_test.cc index 828411c9b..84f249c65 100644 --- a/test/subtitle_charset_test.cc +++ b/test/subtitle_charset_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -18,35 +18,34 @@ */ -#include "test.h" + #include "lib/content.h" -#include "lib/film.h" #include "lib/content_factory.h" -#include "lib/text_subtitle.h" -#include "lib/text_text_content.h" +#include "lib/film.h" +#include "lib/string_text_file.h" +#include "lib/string_text_file_content.h" +#include "test.h" #include -using boost::shared_ptr; -using boost::dynamic_pointer_cast; + +using std::dynamic_pointer_cast; + /** Test parsing of UTF16 CR/LF input */ BOOST_AUTO_TEST_CASE (subtitle_charset_test1) { - shared_ptr film = new_test_film2 ("subtitle_charset_test1"); - shared_ptr content = content_factory (film, private_data / "PADDINGTON soustitresVFdef.srt").front (); - film->examine_and_add_content (content); - BOOST_REQUIRE (!wait_for_jobs ()); + auto content = content_factory(TestPaths::private_data() / "PADDINGTON soustitresVFdef.srt"); + auto film = new_test_film2 ("subtitle_charset_test1", content); } + /** Test parsing of OSX input */ BOOST_AUTO_TEST_CASE (subtitle_charset_test2) { - shared_ptr film = new_test_film2 ("subtitle_charset_test2"); - shared_ptr content = content_factory (film, "test/data/osx.srt").front (); - film->examine_and_add_content (content); - BOOST_REQUIRE (!wait_for_jobs ()); - shared_ptr ts = dynamic_pointer_cast (content); + auto content = content_factory("test/data/osx.srt"); + auto film = new_test_film2 ("subtitle_charset_test2", content); + auto ts = dynamic_pointer_cast(content[0]); BOOST_REQUIRE (ts); /* Make sure we got the subtitle data from the file */ - BOOST_REQUIRE_EQUAL (content->full_length().get(), 6052032); + BOOST_REQUIRE_EQUAL(content[0]->full_length(film).get(), 6052032); }