mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-25 05:59:24 +00:00
Completed CumulativeReporterBase and reimplemented JUnitReporter in terms of it
This commit is contained in:
parent
1f519dd856
commit
2ddb9d3802
9 changed files with 601 additions and 270 deletions
|
@ -174,9 +174,17 @@ inline std::string toString( unsigned int value ) {
|
|||
|
||||
inline std::string toString( const double value ) {
|
||||
std::ostringstream oss;
|
||||
oss << std::setprecision (std::numeric_limits<double>::digits10 + 1)
|
||||
oss << std::setprecision( 10 )
|
||||
<< std::fixed
|
||||
<< value;
|
||||
return oss.str();
|
||||
std::string d = oss.str();
|
||||
std::size_t i = d.find_last_not_of( '0' );
|
||||
if( i != std::string::npos && i != d.size()-1 ) {
|
||||
if( d[i] == '.' )
|
||||
i++;
|
||||
d = d.substr( 0, i+1 );
|
||||
}
|
||||
return d;
|
||||
}
|
||||
|
||||
inline std::string toString( bool value ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue