diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-03 19:57:02 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-11-03 19:57:02 +0000 |
commit | 92f373bb676fa0b272ca2ac6091890f651377d01 (patch) | |
tree | bdd922112e83fd60b9f90fb3b8d1c805ca7f3942 /test/testHelpers.h | |
parent | Terrain mesh method for getting the height/position at a point on the surface (diff) | |
download | ilt-92f373bb676fa0b272ca2ac6091890f651377d01.tar.bz2 ilt-92f373bb676fa0b272ca2ac6091890f651377d01.tar.xz ilt-92f373bb676fa0b272ca2ac6091890f651377d01.zip |
Increase BOOST_CHECK_CLOSE_VEC stream precision
Spent way too long trying to explain a test failure because the
precision of the debug didn't show the differences.
Diffstat (limited to 'test/testHelpers.h')
-rw-r--r-- | test/testHelpers.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/testHelpers.h b/test/testHelpers.h index 54b7fc6..79e966a 100644 --- a/test/testHelpers.h +++ b/test/testHelpers.h @@ -2,6 +2,7 @@ #include <boost/test/tools/context.hpp> #include <boost/test/tools/interface.hpp> +#include <iomanip> // IWYU pragma: keep std::setprecision #include <memory> std::unique_ptr<char, decltype(&free)> uasprintf(const char * fmt, ...) __attribute__((format(printf, 1, 2))); @@ -9,7 +10,7 @@ std::unique_ptr<char, decltype(&free)> uasprintf(const char * fmt, ...) __attrib #define BOOST_CHECK_CLOSE_VEC(a_, b_) \ { \ const auto a {a_}, b {b_}; \ - BOOST_TEST_CONTEXT("BOOST_CHECK_CLOSE_VEC(" << a << ", " << b << ")") { \ + BOOST_TEST_CONTEXT("BOOST_CHECK_CLOSE_VEC(" << std::setprecision(8) << a << ", " << b << ")") { \ BOOST_CHECK_LT(glm::length(a - b), 0.1F); \ } \ } |