summaryrefslogtreecommitdiff
path: root/test/test-helpers.hpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-11-16 00:07:48 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-11-16 00:07:48 +0000
commitb7fadd730a78671a0eaf55c36df24c04661ef2c3 (patch)
treea9d5bce62b3c6e42008d7e0f637665aa97b73764 /test/test-helpers.hpp
parentDon't write null value for pointers (diff)
downloadilt-b7fadd730a78671a0eaf55c36df24c04661ef2c3.tar.bz2
ilt-b7fadd730a78671a0eaf55c36df24c04661ef2c3.tar.xz
ilt-b7fadd730a78671a0eaf55c36df24c04661ef2c3.zip
Swap y,z axis
This was a pain... but all the coords make much more sense now and a lot of mystery negation has disappeared.
Diffstat (limited to 'test/test-helpers.hpp')
-rw-r--r--test/test-helpers.hpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test-helpers.hpp b/test/test-helpers.hpp
new file mode 100644
index 0000000..294b6ff
--- /dev/null
+++ b/test/test-helpers.hpp
@@ -0,0 +1,18 @@
+#ifndef TEST_HELPERS_H
+#define TEST_HELPERS_H
+
+#include <boost/test/tools/context.hpp>
+#include <boost/test/tools/interface.hpp>
+
+#define BOOST_CHECK_CLOSE_VEC(a, b) \
+ BOOST_TEST_CONTEXT("BOOST_CHECK_CLOSE_VEC(" << a << ", " << b << ")") { \
+ BOOST_CHECK_LT(glm::length(a - b), 0.1F); \
+ }
+
+#define BOOST_CHECK_BETWEEN(a, b, c) \
+ BOOST_TEST_CONTEXT("BOOST_CHECK_BETWEEN(" << a << ", " << b << ", " << c << ")") { \
+ BOOST_CHECK_LE(b, a); \
+ BOOST_CHECK_GE(c, a); \
+ }
+
+#endif