diff --git a/9unit.h b/9unit.h index 3cfda13..a8f4056 100644 --- a/9unit.h +++ b/9unit.h @@ -21,15 +21,14 @@ // Types & Structs -// Tracks information about the tests being run. -typedef struct TestState TestState; - -// Defines a log entry in a TestState struct -typedef struct TestLogEntry TestLogEntry; - // The following structures will typically be maintained by the // testing framework. You shouldn't need to concern yourself with // them. + +typedef struct TestState TestState; +typedef struct TestLogEntry TestLogEntry; + +// Tracks information about the tests being run. struct TestState { int run; // number of tests run @@ -45,6 +44,7 @@ struct TestState void (*report)(const char *); // prints a string immediately }; +// Defines a log entry in a TestState struct struct TestLogEntry { char *text; // the entry text @@ -74,11 +74,9 @@ extern void run_test_with( void * // the value to pass in ); -// Runs multiple tests, displaying a summary at the end -extern void run_tests( - // runs the tests and updates a provided TestState - void (*)(TestState *) -); +// Creates an initial TestState, passes it to the supplied function, +// and displays the resulting log and summary +extern void run_tests(void (*)(TestState *)); // Adds an entry to the log that is displayed after the tests have // completed