Be a bit more defensive in a test that is failing on Windows.
[dcpomatic.git] / test / subtitle_font_id_change_test.cc
index f325419800b67233a5e92eb43a7abf6edda3d1ee..57add5c63e6d825fb8cfaa045f4cc01b1ded5aea 100644 (file)
 using std::string;
 
 
-class Editor
-{
-public:
-       Editor (boost::filesystem::path path)
-               : _path(path)
-               , _content(dcp::file_to_string(path))
-       {
-
-       }
-
-       ~Editor ()
-       {
-               auto f = fopen(_path.string().c_str(), "w");
-               BOOST_REQUIRE(f);
-               fwrite(_content.c_str(), _content.length(), 1, f);
-               fclose(f);
-       }
-
-       void replace (string a, string b)
-       {
-               auto old_content = _content;
-               boost::algorithm::replace_all (_content, a, b);
-               BOOST_REQUIRE (_content != old_content);
-       }
-
-private:
-       boost::filesystem::path _path;
-       std::string _content;
-};
-
-
 BOOST_AUTO_TEST_CASE(subtitle_font_id_change_test1)
 {
        auto film = new_test_film2("subtitle_font_id_change_test1");
@@ -145,10 +114,12 @@ BOOST_AUTO_TEST_CASE(subtitle_font_id_change_test3)
        BOOST_REQUIRE (!wait_for_jobs());
 
        auto font = content[0]->text.front()->get_font("Arial Black");
+       BOOST_REQUIRE(font);
        BOOST_REQUIRE(font->file());
        BOOST_CHECK_EQUAL(*font->file(), "test/data/Inconsolata-VF.ttf");
 
        font = content[0]->text.front()->get_font("Helvetica Neue");
+       BOOST_REQUIRE(font);
        BOOST_REQUIRE(font->file());
        BOOST_CHECK_EQUAL(*font->file(), "test/data/Inconsolata-VF.ttf");