testMacros.h File Reference

Header file declaring macros for dlrTest library. More...

#include <dlrTest/testException.h>

Include dependency graph for testMacros.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DLR_TEST_ASSERT(assertion)
 This macro throws a TestException if its argument does not evaluate to true.
#define DLR_TEST_ASSERT_EXCEPTION(exceptionType, assertion)
 This macro throws a TestException if its argument does not throw the specified exception when evaluated.
#define DLR_TEST_REGISTER_MEMBER(test)
 This macro makes it easier to call the TestFixture<>::registerTest() member function.


Detailed Description

Header file declaring macros for dlrTest library.

Copyright (C) 2004 David LaRose, dlr@cs.cmu.edu See accompanying file, LICENSE.TXT, for details.

Revision
975
Date
2007-12-30 01:57:17 -0500 (Sun, 30 Dec 2007)

Definition in file testMacros.h.


Define Documentation

#define DLR_TEST_ASSERT ( assertion   ) 

Value:

{ \
  if(!(assertion)) { \
    DLR_THROW2(dlr::TestException, (#assertion)); \
  } \
}
This macro throws a TestException if its argument does not evaluate to true.

Example: DLR_TEST_ASSERT(x == 10);

Definition at line 27 of file testMacros.h.

#define DLR_TEST_ASSERT_EXCEPTION ( exceptionType,
assertion   ) 

Value:

{ \
  try { \
    assertion; \
    DLR_THROW2(dlr::TestException, \
               (#assertion " should throw " #exceptionType)); \
  } catch(const exceptionType&) {} \
}
This macro throws a TestException if its argument does not throw the specified exception when evaluated.

Example: DLR_TEST_ASSERT_EXCEPTION(ValueException, functionWhichThrows());

Definition at line 40 of file testMacros.h.

#define DLR_TEST_REGISTER_MEMBER ( test   ) 

Value:

{ \
  this->registerTest((#test), &TestFixtureType::test); \
}
This macro makes it easier to call the TestFixture<>::registerTest() member function.

It only makes sense to use this macro from within a member function of a subclass of TestFixture.

Definition at line 55 of file testMacros.h.


Generated on Wed Nov 25 01:02:07 2009 for dlrTest Utility Library by  doxygen 1.5.8