Closed GoogleCodeExporter closed 9 years ago
Jason,
ASSERT_DOUBLE_EQ verifies that the actual number is within 4 ULPs
(http://en.wikipedia.org/wiki/Unit_in_the_last_place) of expected one (see our
FP
macro documentation at
http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide#Floating-
Point_Comparison). numeric_limits::epsilon is by definition a ULP for 1, but
you are
comparing your numbers to 0, and ULP for 0 is much, much smaller so your
comparison
fails. What you need is likely ASSERT_NEAR (see the link above).
HTH,
Vlad
Original comment by vladlosev
on 20 Oct 2009 at 7:48
Original issue reported on code.google.com by
Jason.S....@gmail.com
on 15 Oct 2009 at 7:36