Completed CumulativeReporterBase and reimplemented JUnitReporter in terms of it

This commit is contained in:
Phil Nash 2013-08-15 18:39:55 +01:00
parent 1f519dd856
commit 2ddb9d3802
9 changed files with 601 additions and 270 deletions

View file

@ -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 ) {