reorganized functions and such

This commit is contained in:
jlamothe
2023-11-19 23:48:11 +00:00
parent 55926ec0d8
commit f808eb4cb0
2 changed files with 68 additions and 68 deletions

38
9unit.h
View File

@@ -25,6 +25,14 @@
// testing framework. You shouldn't need to concern yourself with
// them.
// Possible results of running a single test
typedef enum TestResult
{
test_success, // the test succeeded
test_failure, // the test failed
test_pending // the test is pending
} TestResult;
typedef struct TestState TestState;
typedef struct TestLogEntry TestLogEntry;
@@ -51,16 +59,19 @@ struct TestLogEntry
TestLogEntry *next; // points to the next entry
};
// Possible results of running a single test
typedef enum TestResult
{
test_success, // the test succeeded
test_failure, // the test failed
test_pending // the test is pending
} TestResult;
// Functions
// 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
extern void append_test_log(
TestState *, // the current state
const char * // the message to append
);
// Runs a single test
extern void run_test(
TestState *, // the TestState data
@@ -89,17 +100,6 @@ extern void run_test_compare(
void * // the second value
);
// 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
extern void append_test_log(
TestState *, // the current state
const char * // the message to append
);
// Gives additional context for a test
extern void test_context(
TestState *, // the current state