Add some new check methods.
authorCarl Hetherington <cth@carlh.net>
Fri, 23 Apr 2021 13:22:18 +0000 (15:22 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 23 Apr 2021 13:22:18 +0000 (15:22 +0200)
test/test.cc
test/test.h

index ed8a93135ca96c1cf0a82705fd4467d121977485..e6a97e06ac507720aefa1224331c0eb5f38c8b4c 100644 (file)
@@ -908,3 +908,17 @@ make_and_verify_dcp (shared_ptr<Film> film, vector<dcp::VerificationNote::Code>
        BOOST_CHECK(ok);
 }
 
+
+void
+check_int_close (int a, int b, int d)
+{
+       BOOST_CHECK (std::abs(a - b) < d);
+}
+
+
+void
+check_int_close (std::pair<int, int> a, std::pair<int, int> b, int d)
+{
+       check_int_close (a.first, b.first, d);
+       check_int_close (a.second, b.second, d);
+}
index 863a015af0916e6076f190f996afbc51fa9bccb5..217b738f48d2144d81fba4f4dc589f7f745fd09f 100644 (file)
@@ -76,6 +76,8 @@ void check_one_frame (boost::filesystem::path dcp, int64_t index, boost::filesys
 extern boost::filesystem::path subtitle_file (std::shared_ptr<Film> film);
 extern void make_random_file (boost::filesystem::path path, size_t size);
 extern void make_and_verify_dcp (std::shared_ptr<Film> film, std::vector<dcp::VerificationNote::Code> ignore = {});
+extern void check_int_close (int a, int b, int d);
+extern void check_int_close (std::pair<int, int>, std::pair<int, int>, int d);
 
 
 class LogSwitcher