From 9cdc474456ace23f2b84d439643d25ea9ef8522e Mon Sep 17 00:00:00 2001 From: jlamothe Date: Wed, 22 Nov 2023 22:50:05 +0000 Subject: [PATCH] minor tweaks to README.md --- README.md | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d19accd..306f184 100644 --- a/README.md +++ b/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()`