CppTest
Version 2.0.0
|
#include <sstream>
Go to the source code of this file.
Macros | |
#define | TEST_FAIL(msg) |
#define | TEST_ASSERT(expr) |
#define | TEST_ASSERT_MSG(expr, msg) |
#define | TEST_ASSERT_EQUALS(expected, got) |
#define | TEST_ASSERT_EQUALS_OBJ(expected, got) |
#define | TEST_ASSERT_EQUALS_MSG(expected, got, msg) |
#define | TEST_ASSERT_DELTA(a, b, delta) |
#define | TEST_ASSERT_DELTA_MSG(a, b, delta, msg) |
#define | TEST_THROWS(expr, x) |
#define | TEST_THROWS_MSG(expr, x, msg) |
#define | TEST_THROWS_ANYTHING(expr) |
#define | TEST_THROWS_ANYTHING_MSG(expr, msg) |
#define | TEST_THROWS_NOTHING(expr) |
#define | TEST_THROWS_NOTHING_MSG(expr, msg) |
#define TEST_FAIL | ( | msg | ) |
Unconditional failure.
Used in conjunction with Test::Suite.
msg | Provided message. |
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. |
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_EQUALS | ( | expected, | |
got | |||
) |
Verify that two expressions are equal, issues an assertment if it fails. Requires the output operator (<<) to be defined for both expected and got.
If the output operator is not available, you should use TEST_ASSERT_EQUALS_OBJ(expected, got).
Used in conjunction with Test::Suite.
expected | Expected value. |
got | Value to test against expected value. |
For a description of all asserts, see Available asserts.
#define TEST_ASSERT_EQUALS_OBJ | ( | expected, | |
got | |||
) |
Verify that two expressions are equal, issues an assertment if it fails.
If the output operator is defined for the objects being compared you should use TEST_ASSERT_EQUALS(expected, got) instead for more useful failure messages.
Used in conjunction with Test::Suite.
expected | Expected value. |
got | Value to test against expected value. |
For a description of all asserts, see Available asserts.
#define TEST_ASSERT_EQUALS_MSG | ( | expected, | |
got, | |||
msg | |||
) |
Verify that two expressions are equal, issues an assertment if it fails. The output operator (<<) must be defined for the object under test. If the output operator is not available, you should use TEST_ASSERT_EQUALS_OBJ(expected, got) instead.
Used in conjunction with Test::Suite.
expected | Expected value. |
got | Value to test against expected value. |
msg | User message to print out on failure. |
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.