CppTest home page | CppTest project page |
Go to the source code of this file.
#define TEST_FAIL | ( | msg ) |
Unconditional failure.
Used in conjunction with Test::Suite.
msg | Provided message. |
void MySuite::test() { // ... switch (flag) { // handling valid cases ... default: TEST_FAIL("This should not happen") } }
For a description of all asserts, see Available asserts.
#define TEST_ASSERT | ( | expr ) |
Verify an expression and issues an assertment if it fails.
Used in conjunction with Test::Suite.
expr | Expression to test. |
void MySuite::test() { int i; // ... TEST_ASSERT(i == 13) }
For a description of all asserts, see Available asserts.
#define TEST_ASSERT_MSG | ( | expr, | |
msg | |||
) |
Verify an expression and issues an assertment if it fails.
Used in conjunction with Test::Suite.
expr | Expression to test. |
msg | User message. |
For a description of all asserts, see Available asserts.
#define TEST_ASSERT_DELTA | ( | a, | |
b, | |||
delta | |||
) |
Verify that two expressions are equal up to a constant, issues an assertment if it fails.
Used in conjunction with Test::Suite.
a | First expression to test. |
b | Second expression to test. |
delta | Constant. |
For a description of all asserts, see Available asserts.
#define TEST_ASSERT_DELTA_MSG | ( | a, | |
b, | |||
delta, | |||
msg | |||
) |
Verify that two expressions are equal up to a constant, issues an assertment if it fails.
Used in conjunction with Test::Suite.
a | First expression to test. |
b | Second expression to test. |
delta | Constant. |
msg | User message. |
For a description of all asserts, see Available asserts.
#define TEST_THROWS | ( | expr, | |
x | |||
) |
Verify an expression and expects an exception in return. An assertment is issued if the exception is not thrown.
Used in conjunction with Test::Suite.
expr | Expression to test. |
x | Expected exception. |
For a description of all asserts, see Available asserts.
#define TEST_THROWS_MSG | ( | expr, | |
x, | |||
msg | |||
) |
Verify an expression and expects an exception in return. An assertment is issued if the exception is not thrown.
Used in conjunction with Test::Suite.
expr | Expression to test. |
x | Expected exception. |
msg | User message. |
For a description of all asserts, see Available asserts.
#define TEST_THROWS_ANYTHING | ( | expr ) |
Verify an expression and expects any exception in return. An assertment is issued if no exception is thrown.
Used in conjunction with Test::Suite.
expr | Expression to test. |
For a description of all asserts, see Available asserts.
#define TEST_THROWS_ANYTHING_MSG | ( | expr, | |
msg | |||
) |
Verify an expression and expects any exception in return. An assertment is issued if no exception is thrown.
Used in conjunction with Test::Suite.
expr | Expression to test. |
msg | User message. |
For a description of all asserts, see Available asserts.
#define TEST_THROWS_NOTHING | ( | expr ) |
Verify an expression and expects no exception in return. An assertment is issued if any exception is thrown.
Used in conjunction with Test::Suite.
expr | Expression to test. |
For a description of all asserts, see Available asserts.
#define TEST_THROWS_NOTHING_MSG | ( | expr, | |
msg | |||
) |
Verify an expression and expects no exception in return. An assertment is issued if any exception is thrown.
Used in conjunction with Test::Suite.
expr | Expression to test. |
msg | User message. |
For a description of all asserts, see Available asserts.