mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-14 01:47:54 +08:00
Explicitly specify hexfloat in TestResult operator<< (#1078)
This commit is contained in:
parent
ec9302c4ed
commit
638ad269e7
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
#include <iomanip>
|
||||||
#include <json/config.h>
|
#include <json/config.h>
|
||||||
#include <json/value.h>
|
#include <json/value.h>
|
||||||
#include <json/writer.h>
|
#include <json/writer.h>
|
||||||
@ -83,9 +84,7 @@ public:
|
|||||||
// Generic operator that will work with anything ostream can deal with.
|
// Generic operator that will work with anything ostream can deal with.
|
||||||
template <typename T> TestResult& operator<<(const T& value) {
|
template <typename T> TestResult& operator<<(const T& value) {
|
||||||
Json::OStringStream oss;
|
Json::OStringStream oss;
|
||||||
oss.precision(16);
|
oss << std::setprecision(16) << std::hexfloat << value;
|
||||||
oss.setf(std::ios_base::floatfield);
|
|
||||||
oss << value;
|
|
||||||
return addToLastFailure(oss.str());
|
return addToLastFailure(oss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user