From 638ad269e75f28f9830f7bfc01278aeaf5b00135 Mon Sep 17 00:00:00 2001 From: Billy Donahue Date: Sun, 3 Nov 2019 15:27:39 -0500 Subject: [PATCH] Explicitly specify hexfloat in TestResult operator<< (#1078) --- src/test_lib_json/jsontest.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test_lib_json/jsontest.h b/src/test_lib_json/jsontest.h index 49d1dcd..e076f7c 100644 --- a/src/test_lib_json/jsontest.h +++ b/src/test_lib_json/jsontest.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -83,9 +84,7 @@ public: // Generic operator that will work with anything ostream can deal with. template TestResult& operator<<(const T& value) { Json::OStringStream oss; - oss.precision(16); - oss.setf(std::ios_base::floatfield); - oss << value; + oss << std::setprecision(16) << std::hexfloat << value; return addToLastFailure(oss.str()); }