minor tweaks to README.md
This commit is contained in:
parent
7e0c088cf0
commit
9cdc474456
29
README.md
29
README.md
|
@ -172,12 +172,15 @@ void run_test_compare(
|
|||
## Test Contexts
|
||||
|
||||
It is useful to document what your tests are doing. This can be
|
||||
achieved using contexts. These are essentially just string values
|
||||
describing what the provided test(s) are for. Contexts can be nested
|
||||
into hierarchies. This is useful both for organization purposes as
|
||||
well as creating reusable test code. The following functions allow
|
||||
for the creation of test contexts as well as displaying information
|
||||
about the tests as they're run.
|
||||
achieved using contexts. Contexts are essentially labelled
|
||||
collections of related tests. Contexts can be nested into
|
||||
hierarchies. This is useful both for organization purposes as well as
|
||||
creating reusable test code. There are several functions written for
|
||||
managing these contexts. Each of these functions takes as its first
|
||||
two arguments: a pointer to the current `TestState`, and a pointer to
|
||||
a pointer to a string describing the context it defines. If the
|
||||
pointer to the string is null, the tests are run as a part of the
|
||||
existing context.
|
||||
|
||||
### `test_context()`
|
||||
|
||||
|
@ -191,7 +194,7 @@ void test_context(
|
|||
|
||||
This function takes a pointer to the current `TestState`, a string
|
||||
describing the context, and a function pointer that is used the same
|
||||
way as the funciton pointer passed to `run_tests()`.
|
||||
way as the pointer passed to `run_tests()`.
|
||||
|
||||
### `test_context_with()`
|
||||
|
||||
|
@ -205,7 +208,7 @@ void test_context_with(
|
|||
```
|
||||
|
||||
This funciton allows for the passing of a `void` pointer into the test
|
||||
function, in much the same way as the `run_test_with()` function. Its
|
||||
function in much the same way as the `run_test_with()` function. Its
|
||||
arguments are (in order), a pointer to the current state, the context
|
||||
description, a pointer to the test function, and the pointer being
|
||||
passed into that function.
|
||||
|
@ -287,11 +290,11 @@ void append_test_log(
|
|||
```
|
||||
|
||||
This appends an arbitrary string to the end of the test log. The
|
||||
string is copied into the log, so the value pointed to by the second
|
||||
argument does not need to persist in memory beyond the end of the call
|
||||
to the function. Log entries are expected to be single lines. No
|
||||
trailing newline should be present (but the trailing NUL character
|
||||
should (obviously)).
|
||||
contents of the string are copied into the log, so the value pointed
|
||||
to by the second argument does not need to persist in memory beyond
|
||||
the end of the call to the function. Log entries are expected to be
|
||||
single lines. No trailing newline should be present (but the trailing
|
||||
NUL character should (obviously)).
|
||||
|
||||
### `log_test_context()`
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user