![]() |
UTPP
|
Macros | |
| #define | CHECK(value) |
| Generate a failure if value is 0. Failure message is the value itself. | |
| #define | CHECK_EX(value, ...) |
| Generate a failure with the given message if value is 0. | |
| #define | CHECK_EQUAL(expected, actual) |
| Generate a failure if actual value is different from expected. | |
| #define | CHECK_NAN(value) |
| Generate a failure if value is not NaN. | |
| #define | CHECK_EQUAL_EX(expected, actual, ...) |
| Generate a failure if actual value is different from expected. The given message is appended to the standard CHECK_EQUAL message. | |
| #define | CHECK_CLOSE(expected, actual, ...) |
| Generate a failure if actual value differs from expected value with more than tolerance. | |
| #define | CHECK_CLOSE_EX(expected, actual, tolerance, ...) |
| Generate a failure if actual value differs from expected value with more than given tolerance. The additional message is appended to the standard CHECK_CLOSE message. | |
| #define | CHECK_ARRAY_EQUAL(expected, actual, count) |
| Generate a failure if actual array is different from expected one. | |
| #define | CHECK_ARRAY_CLOSE(expected, actual, count, ...) |
| Generate a failure if actual array elements differs from expected ones with more than given tolerance. | |
| #define | CHECK_ARRAY2D_EQUAL(expected, actual, rows, columns) |
| Generate a failure if 2D array actual differs from expected values. | |
| #define | CHECK_ARRAY2D_CLOSE(expected, actual, rows, columns, ...) |
| Generate a failure if 2D array actual differs from expected values with more than given tolerance. | |
| #define | CHECK_THROW(expr, except) |
| Generate a failure if evaluating the expression does not throw an exception of the expected type. | |
| #define | CHECK_THROW_EX(expr, except, ...) |
| Generate a failure if evaluating the expression does not throw an exception of the expected type. | |
| #define | CHECK_THROW_EQUAL(expr, value, except) |
| Checks if evaluating the expression triggers an exception of the given type and with the expected value. | |
| #define | CHECK_THROW_EQUAL_EX(expr, value, except, ...) |
| Checks if evaluating the expression triggers an exception of the given type and with the expected value. | |
| #define | CHECK_FILE_EQUAL(expected, actual) |
| Generate a failure if the two files are different. | |
| #define | FAILURE(...) |
| Generate a failure. | |
Macro-definitions used to check various conditions during tests
| #define CHECK | ( | value | ) |
Generate a failure if value is 0. Failure message is the value itself.
| value | Value to check |
| #define CHECK_ARRAY2D_CLOSE | ( | expected, | |
| actual, | |||
| rows, | |||
| columns, | |||
| ... ) |
Generate a failure if 2D array actual differs from expected values with more than given tolerance.
| expected | Expected array values |
| actual | Actual array values |
| rows | Number of rows in the 2D array |
| columns | Number of columns in the 2D array |
| ... | Optional tolerance value |
If no tolerance value is specified, it uses the UnitTest::default_tolerance value.
| #define CHECK_ARRAY2D_EQUAL | ( | expected, | |
| actual, | |||
| rows, | |||
| columns ) |
Generate a failure if 2D array actual differs from expected values.
| expected | Expected array values |
| actual | Actual array values |
| rows | Number of rows in the 2D array |
| columns | Number of columns in the 2D array |
| #define CHECK_ARRAY_CLOSE | ( | expected, | |
| actual, | |||
| count, | |||
| ... ) |
Generate a failure if actual array elements differs from expected ones with more than given tolerance.
| expected | Expected array values |
| actual | Actual array values |
| count | Number of values in the array |
| ... | Optional tolerance value |
If no tolerance value is specified, it uses the UnitTest::default_tolerance value.
| #define CHECK_ARRAY_EQUAL | ( | expected, | |
| actual, | |||
| count ) |
Generate a failure if actual array is different from expected one.
| expected | Expected arrasy values |
| actual | Actual array values |
| count | Number of values in the array |
| #define CHECK_CLOSE | ( | expected, | |
| actual, | |||
| ... ) |
Generate a failure if actual value differs from expected value with more than tolerance.
| expected | Expected value |
| actual | Actual value |
| ... | Optional tolerance value |
If no tolerance value is specified, it uses the UnitTest::default_tolerance value.
| #define CHECK_CLOSE_EX | ( | expected, | |
| actual, | |||
| tolerance, | |||
| ... ) |
Generate a failure if actual value differs from expected value with more than given tolerance. The additional message is appended to the standard CHECK_CLOSE message.
| expected | Expected value |
| actual | Actual value |
| tolerance | Tolerance value |
| ... | Additional parameters passed to a printf-type function |
| #define CHECK_EQUAL | ( | expected, | |
| actual ) |
Generate a failure if actual value is different from expected.
| expected | Expected value |
| actual | Actual value |
| #define CHECK_EQUAL_EX | ( | expected, | |
| actual, | |||
| ... ) |
Generate a failure if actual value is different from expected. The given message is appended to the standard CHECK_EQUAL message.
| expected | Expected value |
| actual | Actual value |
| ... | Additional parameters passed to a printf-type function |
| #define CHECK_EX | ( | value, | |
| ... ) |
Generate a failure with the given message if value is 0.
| value | Value to check |
| ... | Additinal parameters passed to a printf-type function |
| #define CHECK_FILE_EQUAL | ( | expected, | |
| actual ) |
Generate a failure if the two files are different.
| expected | Name of file with expected values |
| actual | Name of file with actual values |
| #define CHECK_NAN | ( | value | ) |
Generate a failure if value is not NaN.
| value | Value to check |
| #define CHECK_THROW | ( | expr, | |
| except ) |
Generate a failure if evaluating the expression does not throw an exception of the expected type.
| except | Expected exception type |
| expr | Expression to evaluate |
| #define CHECK_THROW_EQUAL | ( | expr, | |
| value, | |||
| except ) |
Checks if evaluating the expression triggers an exception of the given type and with the expected value.
| expr | Expression to evaluate |
| value | Expected exception value |
| except | Expected exception type |
| #define CHECK_THROW_EQUAL_EX | ( | expr, | |
| value, | |||
| except, | |||
| ... ) |
Checks if evaluating the expression triggers an exception of the given type and with the expected value.
| expr | Expression to evaluate |
| value | Expected exception value |
| except | Expected exception type |
| ... | Additional parameters passed to a printf-type function |
| #define CHECK_THROW_EX | ( | expr, | |
| except, | |||
| ... ) |
Generate a failure if evaluating the expression does not throw an exception of the expected type.
| except | Expected exception type |
| expr | Expression to evaluate |
| ... | Additional parameters passed to a printf-type function |
| #define FAILURE | ( | ... | ) |
Generate a failure.
| ... | Additional parameters passed to a printf-type function |