summaryrefslogtreecommitdiff
path: root/test/testHelpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/testHelpers.h')
-rw-r--r--test/testHelpers.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/testHelpers.h b/test/testHelpers.h
index 79e966a..f2b0901 100644
--- a/test/testHelpers.h
+++ b/test/testHelpers.h
@@ -15,6 +15,16 @@ std::unique_ptr<char, decltype(&free)> uasprintf(const char * fmt, ...) __attrib
} \
}
+#define BOOST_CHECK_CLOSE_VECI(a_, b_) \
+ { \
+ const auto a {a_}, b {b_}; \
+ BOOST_TEST_CONTEXT("BOOST_CHECK_CLOSE_VEC(" << std::setprecision(8) << a << ", " << b << ")") { \
+ BOOST_CHECK_LE(std::abs(a.x - b.x), 1); \
+ BOOST_CHECK_LE(std::abs(a.y - b.y), 1); \
+ BOOST_CHECK_LE(std::abs(a.z - b.z), 1); \
+ } \
+ }
+
#define BOOST_CHECK_BETWEEN(a_, b_, c_) \
{ \
const auto a {a_}, b {b_}, c {c_}; \