From 92f373bb676fa0b272ca2ac6091890f651377d01 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 3 Nov 2023 19:57:02 +0000 Subject: 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. --- test/testHelpers.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') 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 #include +#include // IWYU pragma: keep std::setprecision #include std::unique_ptr uasprintf(const char * fmt, ...) __attribute__((format(printf, 1, 2))); @@ -9,7 +10,7 @@ std::unique_ptr 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); \ } \ } -- cgit v1.2.3