#include "AceUnit.h"
Go to the source code of this file.
Defines | |
#define | ACEUNITASSERT_H 1 |
Include shield to protect the header file from being included more than once. | |
#define | fail(message) newAssertionError(message) |
Let a test case fail. | |
#define | assertTrue(message, condition) do { if (!(condition)) { fail(message); } } while (false) |
Asserts that the specified condition is true. | |
#define | assertFalse(message, condition) do { if (condition) { fail(message); } } while (false) |
Asserts that the specified condition is false. | |
#define | assertEquals(message, expected, actual) do { if (!((expected) == (actual))) { fail(message); } } while (false) |
Asserts that two values are equal. | |
#define | assertNotEquals(message, unexpected, actual) do { if ((unexpected) == (actual)) { fail(message); } } while (false) |
Asserts that two values are not equal. | |
#define | assertNotNull(message, ptr) do { if (NULL == (ptr)) { fail(message); } } while (false) |
Asserts that a pointer is not NULL. | |
#define | assertNull(message, ptr) do { if (NULL != (ptr)) { fail(message); } } while (false) |
Asserts that a pointer is NULL. |
#define ACEUNITASSERT_H 1 |
Include shield to protect the header file from being included more than once.
#define assertEquals | ( | message, | |||
expected, | |||||
actual | ) | do { if (!((expected) == (actual))) { fail(message); } } while (false) |
Asserts that two values are equal.
If the values are not equal, the test case fails and raises an Assertion Error that will be logged.
expected
and actual
. message | Message, usually with the positive description of why the assertion should not fail. | |
expected | Expected value. | |
actual | Actual value. |
#define assertFalse | ( | message, | |||
condition | ) | do { if (condition) { fail(message); } } while (false) |
Asserts that the specified condition is false.
If the condition is not false, the test case fails and raises an Assertion Error that will be logged.
message | Message, usually with the positive description of why the assertion should not fail. | |
condition | Condition to assert for false. |
#define assertNotEquals | ( | message, | |||
unexpected, | |||||
actual | ) | do { if ((unexpected) == (actual)) { fail(message); } } while (false) |
Asserts that two values are not equal.
If the values are equal, the test case fails and raises an AssertionError_t that will be logged.
expected
and actual
. message | Message, usually with the positive description of why the assertion should not fail. | |
unexpected | Not expected value. | |
actual | Actual value. |
#define assertNotNull | ( | message, | |||
ptr | ) | do { if (NULL == (ptr)) { fail(message); } } while (false) |
Asserts that a pointer is not NULL.
If the pointer is NULL, the test case fails and raises an AssertionError_t that will be logged.
message | Message, usually with the positive description of why the assertion should not fail. | |
ptr | Pointer expected to be not NULL. |
#define assertNull | ( | message, | |||
ptr | ) | do { if (NULL != (ptr)) { fail(message); } } while (false) |
Asserts that a pointer is NULL.
If the pointer is not NULL, the test case fails and raises an AssertionError_t that will be logged.
message | Message, usually with the positive description of why the assertion should not fail. | |
ptr | Pointer expected to be NULL. |
#define assertTrue | ( | message, | |||
condition | ) | do { if (!(condition)) { fail(message); } } while (false) |
Asserts that the specified condition is true.
If the condition is not true, the test case fails and raises an Assertion Error that will be logged.
message | Message, usually with the positive description of why the assertion should not fail. | |
condition | Condition to assert. |
#define fail | ( | message | ) | newAssertionError(message) |
Let a test case fail.
message | Message, usually with the reason why the test case failed. |