#52 Additional ASSERT macros

open
nobody
None
5
2006-06-27
2006-06-27
Tuomo Latto
No

Here's a proper patch with Doxygen documentation.
Should compile just about on any platform. Tested with
VC++ 6.0 on Windows.

The patch adds CPPUNIT_ASSERT_EQ and *MESSAGE for
testing different types using (custom?) equality
operator. It also adds CPPUNIT_ASSERT_POINTERS_EQUAL (+
*MESSAGE) for testing pointers and CPPUNIT_ASSERT_NULL
(+ *MESSAGE) for NULL test.

In addition to these it adds negations to most
assertions. To be exact, CPPUNIT_ASSERT_NOT_EQUAL,
CPPUNIT_ASSERT_NOT_EQ,
CPPUNIT_ASSERT_DOUBLES_NOT_EQUAL,
CPPUNIT_ASSERT_POINTERS_NOT_EQUAL,
CPPUNIT_ASSERT_NOT_NULL,
and custom message versions of all of these.

Tests for all of these are added to examples/cppunittest.

Discussion

  • Tuomo Latto
    Tuomo Latto
    2006-06-27

     
    Attachments