diff options
-rw-r--r-- | README.md | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -175,24 +175,25 @@ simple-test's interface consists of a series of preprocessor macros: |---------:|:----------------| | **BEGIN_TEST** | must be included once, after includes and global declarations and before the first `TEST` statement | | **END_TEST** | must be included once, after the final `TEST` statement | -| **TEST(<description>)**{} | declare a test, described by `description`, which consists of statements between the {} | -| **REGISTER_TEARDOWN(<func>)** | optionally included after `BEGIN_TEST` and before the first `TEST` statement. registers function `func`, which must be of type `void func(void)`, as a teardown function to be called after subscribing tests exit | +| **TEST(description)**{} | declare a test, described by `description`, which consists of statements between the {} | +| **REGISTER_TEARDOWN(func)** | optionally included after `BEGIN_TEST` and before the first `TEST` statement. registers function `func`, which must be of type `void func(void)`, as a teardown function to be called after subscribing tests exit | | **USE_TEARDOWN;** | if included within a `TEST` body (before any `ASSERT` statements), the designated `TEST` will call the function registered with `REGISTER_TEARDOWN` on terminating | -| **ECHO(<...>)** | print a formatted description of the state within the current test | -| **ASSERT<_condition>(<args>)** | assert, on either one or two `args`, that `_condition` is true | +| **ECHO(...)** | print a formatted description of the state within the current test | -valid assertions are: +assertions are used to check that the behaviour of code executed inside the +body of a `TEST` statement is correct. values are passed and the assertion +fails if those values do not reflect expectations. valid assertions are: | **NAME** | **DESCRIPTION** | |---------:|:----------------| -| **ASSERT(<a>)** | assert that the value of `a` is not a "not" value, i.e. NULL, 0, or '\0' | -| **ASSERT_NOT(<a>)** | assert that the value of `a` is a "not" value | -| **ASSERT_EQ(<a>, <b>)** | fail if the values of `a` and `b` are not equal | -| **ASSERT_NEQ(<a>, <b>)** | fail if the values of `a` and `b` are equal | -| **ASSERT_GT(<a>, <b>)** | fail if the value of `a` is not greater the value of `b` | -| **ASSERT_GEQ(<a>, <b>)** | fail if the value of `a` is not greater than or equal to the value of `b` | -| **ASSERT_LT(<a>, <b>)** | fail if the value of `a` is not less than the value of `b` | -| **ASSERT_LEQ(<a>, <b>)** | fail if the value of `a` is not less than or equal to the value of `b` | +| **ASSERT(a)** | assert that the value of `a` is not a "not" value, i.e. NULL, 0, or '\0' | +| **ASSERT_NOT(a)** | assert that the value of `a` is a "not" value | +| **ASSERT_EQ(a, b)** | fail if the values of `a` and `b` are not equal | +| **ASSERT_NEQ(a, b)** | fail if the values of `a` and `b` are equal | +| **ASSERT_GT(a, b)** | fail if the value of `a` is not greater the value of `b` | +| **ASSERT_GEQ(a, b)** | fail if the value of `a` is not greater than or equal to the value of `b` | +| **ASSERT_LT(a, b)** | fail if the value of `a` is not less than the value of `b` | +| **ASSERT_LEQ(a, b)** | fail if the value of `a` is not less than or equal to the value of `b` | note |