Allow a slightly worrying amount of error so that the Windows tests
[dcpomatic.git] / test / ssa_subtitle_test.cc
index 5c2e61b7e41d74602209432e0f6e9017d6fdf33b..3a1430696ddf3c9cbbe24e66c43a300eb8bb5c8c 100644 (file)
@@ -32,6 +32,7 @@
 #include "lib/ratio.h"
 #include "lib/text_content.h"
 #include "test.h"
+#include <dcp/interop_subtitle_asset.h>
 #include <boost/test/unit_test.hpp>
 #include <boost/algorithm/string.hpp>
 
@@ -61,8 +62,16 @@ BOOST_AUTO_TEST_CASE (ssa_subtitle_test1)
 
        make_and_verify_dcp (film, { dcp::VerificationNote::Code::INVALID_STANDARD });
 
-       /* Find the subtitle file and check it */
-       check_xml (subtitle_file(film), TestPaths::private_data() / "DKH_UT_EN20160601def.xml", {"SubtitleID"});
+       auto ref = make_shared<dcp::InteropSubtitleAsset>(TestPaths::private_data() / "DKH_UT_EN20160601def.xml");
+       auto check = make_shared<dcp::InteropSubtitleAsset>(subtitle_file(film));
+
+       dcp::EqualityOptions options;
+       options.max_subtitle_vertical_position_error = 0.1;
+       BOOST_CHECK(ref->equals(check, options, [](dcp::NoteType t, string n) {
+               if (t == dcp::NoteType::ERROR) {
+                       std::cerr << n << "\n";
+               }
+       }));
 
        cl.run ();
 }