Compare two floating-point values

1,113 views
Skip to first unread message

Jason

unread,
Aug 29, 2008, 7:07:25 AM8/29/08
to Google C++ Testing Framework
Hi,
Like the "CPPUNIT_ASSERT_DOUBLES_EQUAL(expected,actual,delta) " of
CppUnit, maybe we could add similar ASSERT to make it easier to
compare two floating-point values.

Markus Heule

unread,
Aug 29, 2008, 8:05:44 AM8/29/08
to Jason, Google C++ Testing Framework
Hi Jason


This is already supported by Google Test. Please take a look at ASSERT_NEAR or ASSERT_DOUBLE_EQ.

http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide


Markus


Message has been deleted

Jason

unread,
Aug 29, 2008, 8:23:10 AM8/29/08
to Google C++ Testing Framework
Oh, I'm sorry. I just see "ASSERT_DOUBLE_EQ(expected, actual)" which
doesn't have "delta". But it's provided in "ASSERT_NEAR".

Thanks for your quick reply.

On Aug 29, 8:05 pm, "Markus Heule" <markus.he...@gmail.com> wrote:
> Hi Jason
>
Reply all
Reply to author
Forward
0 new messages