reorganized functions and such
This commit is contained in:
38
9unit.h
38
9unit.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user