diff options
| -rw-r--r-- | test/test.cc | 14 | ||||
| -rw-r--r-- | test/test.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/test.cc b/test/test.cc index ed8a93135..e6a97e06a 100644 --- a/test/test.cc +++ b/test/test.cc @@ -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); +} diff --git a/test/test.h b/test/test.h index 863a015af..217b738f4 100644 --- a/test/test.h +++ b/test/test.h @@ -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 |
