toast test tools


Detailed Description

We assert a lot (see TOAST_ASSERT)! Often to check preconditions and postconditions which of course define a function's domain and its expected results. Perfect for checking your boundary conditions! So we've added macros that integrate smoothly with the Boost Test Tools to check that assertions occur.


Files

file  tools.hpp
 This file contains toast specific extensions to the Boost Test Tools.

Defines

#define TOAST_WARN_ASSERT(statement)   TOAST_TEST_ASSERT_IMPL(statement, #statement, WARN)
 Warn if a statement *does not* trip a toast assertion!
#define TOAST_CHECK_ASSERT(statement)   TOAST_TEST_ASSERT_IMPL(statement, #statement, CHECK)
 Fail test if the statement *does not* trip a toast assertion!
#define TOAST_REQUIRE_ASSERT(statement)   TOAST_TEST_ASSERT_IMPL(statement, #statement, REQUIRE)
 Fail and stop test if the statement *does not* trip a toast assertion!


Define Documentation

#define TOAST_CHECK_ASSERT ( statement   )     TOAST_TEST_ASSERT_IMPL(statement, #statement, CHECK)

Fail test if the statement *does not* trip a toast assertion!

In your unit test (using boost test tools of course) the line 'TOAST_CHECK_ASSERT(TOAST_ASSERT(true));' will log a failed check and continue testing. Your unit test will report failure.

#define TOAST_REQUIRE_ASSERT ( statement   )     TOAST_TEST_ASSERT_IMPL(statement, #statement, REQUIRE)

Fail and stop test if the statement *does not* trip a toast assertion!

In your unit test (using boosts test tools of course) the line 'TOAST_REQUIRE_ASSERT(TOAST_ASSERT(true));' will log a failed check and exit reporting failure.

#define TOAST_WARN_ASSERT ( statement   )     TOAST_TEST_ASSERT_IMPL(statement, #statement, WARN)

Warn if a statement *does not* trip a toast assertion!

In your unit test (using boost test tools of course) the line 'TOAST_WARN_ASSERT(TOAST_ASSERT(true));' will log a warning and continue testing.


SourceForge.net Logo