Details
-
Suggestion
-
Resolution: Duplicate
-
P3: Somewhat important
-
4.3.0
-
None
Description
It would be very helpfull to have a makro, that compares real values like (float, double, long double) againts an expected value with a precision.
e.g. QCOMPARE_REAL(actual, expect, precision) QVERIFY(qAbs((expect) - (actual)) < prec)
but with a more well-defined output
so that you can use
QCOMPARE_REAL(sqrt(2), 1.4, 0.1)
QCOMPARE_REAL(foo(), 1., 0.0005)
QCOMPARE_REAL(123.456, 123.455987, 0.00001)