Boost.Test extensions

Macros

#define COMPILE_FAIL(n)   void n()
 Check for compile failure. More...
 
#define SENF_CHECK_NO_THROW(expr)
 Show exception information. More...
 
#define SENF_CHECK_EQUAL_COLLECTIONS(left_begin, left_end, right_begin, right_end)
 Check ranges for equality, writing char's as int's. More...
 
#define SENF_AUTO_TEST_CASE(name)
 Define new test case. More...
 
#define SENF_CHECK_NOT_EQUAL(Left, Rigth)
 Check for non-equality. More...
 

Detailed Description

This module defines some additional extensions to Boost.Test

Macro Definition Documentation

◆ COMPILE_FAIL

#define COMPILE_FAIL (   n)    void n()

Check for compile failure.

COMPILE_FAIL() is used to check, that a certain piece of code will produce a compile time failure.

#ifdef COMPILE_CHECK
{
// fails to compile ....
int x = "foo";
}
{ ... }
#endif
This check is performed by the extended unit-test builder in \c senfscons.

Definition at line 59 of file auto_unit_test.hh.

◆ SENF_AUTO_TEST_CASE

#define SENF_AUTO_TEST_CASE (   name)

Define new test case.

SENF_AUTO_UNIT_TEST() is like BOOST_AUTO_UNIT_TEST(). The only difference is, that if an exception is thrown in the test case SENF_AUTO_UNIT_TEST() will write out the complete what-message of the exception.

Definition at line 110 of file auto_unit_test.hh.

◆ SENF_CHECK_EQUAL_COLLECTIONS

#define SENF_CHECK_EQUAL_COLLECTIONS (   left_begin,
  left_end,
  right_begin,
  right_end 
)

Check ranges for equality, writing char's as int's.

SENF_CHECK_EQUAL_COLLECTIONS() is like BOOST_CHECK_EQUAL_COLLECTIONS(). The only difference is, that SENF_CHECK_EQUAL_COLLECTIONS() will write out collection values in numeric form (and not as single characters) if the elements are of any char type. Other types are not affected.

Definition at line 96 of file auto_unit_test.hh.

◆ SENF_CHECK_NO_THROW

#define SENF_CHECK_NO_THROW (   expr)
Value:
BOOST_CHECK_NO_THROW( \
try { expr ; } \
catch (std::exception & e) { std::cerr << e.what() << std::endl; throw; } )

Show exception information.

SENF_CHECK_NO_THROW() is an extension to BOOST_CHECK_NO_THROW() which will write out the unabridged exception information when an exception is thrown in addition to signaling an error.

Definition at line 68 of file auto_unit_test.hh.

◆ SENF_CHECK_NOT_EQUAL

#define SENF_CHECK_NOT_EQUAL (   Left,
  Rigth 
)

Check for non-equality.

SENF_CHECK_NOT_EQUAL() is the opposite of BOOST_CHECK_EQUAL.

Definition at line 132 of file auto_unit_test.hh.