I am adding tests to legacy code using the boost test environment.
One such test might be
double expectedPrice =
BOOST_CHECK_CLOSE(expectedPrice, object->price, ACCURACY_THRESHOLD);
Where expectedPrice is double computed locally and the object is retrieved from the system under test.
error in "MyTest": difference{0.21097%} between expectedPrice{4.7300000000000004} and object->price{4.7400000000000002} exceeds 1.0000000000000001e-05%
Of course, it's a little hard to read, given all the decimal numbers. Is there any way to get the test result formatted better / in different ways, given that I use bare doubles and not some other type?
source
share