CppUnit and cassert / assert.h assertions

Help
2011-08-10
2013-04-22
  • Magnus Björk
    Magnus Björk
    2011-08-10

    I'm trying to use CppUnit on a project that has numerous assertions (of the kind defined in the standard C++ header cassert). I cannot build without these assertions, since they are extremely useful during CppUnit test case construction (it's a large projects and easy to make mistakes during test case set up).

    The problem is that CppUnit throws away the info from failed assertions. It only says that an unknown exception occurred. Can I turn off CppUnit's handling of cassert assertions, or at least get it to show the information in the assertion failure?

    I'm using g++ 4.4.3 under Linux, if that matters.