Search This Blog

Pages

Wednesday, January 12, 2011

Howto for CPPUNIT

Good information about using CPPUNIT is available at:

http://blog.csdn.net/snowphy/archive/2004/10/22/146766.aspx
http://www.uow.edu.au/~nabg/222/Lectures/P3UnittestingforC++.pdf

An important point is to using macros with which you can specify custom message for describing the error. In the following example, use the second macro instead of the first and so on:
  • CPPUNIT_ASSERT(condition)
    Assertions that a condition is true.
  • CPPUNIT_ASSERT_MESSAGE(message, condition)
    Assertion with a user specified message.

No comments:

Post a Comment