added context info to TestState
This commit is contained in:
15
9unit.c
15
9unit.c
@@ -68,7 +68,7 @@ run_tests(void (*tests)(TestState *))
|
||||
{
|
||||
if (!tests) return;
|
||||
TestState s;
|
||||
init_TestState(&s);
|
||||
memset(&s, 0, sizeof(TestState));
|
||||
(*tests)(&s);
|
||||
print_log(&s);
|
||||
printf("Tests run: %d\n", s.run);
|
||||
@@ -111,19 +111,6 @@ append_test_log(TestState *s, const char *msg)
|
||||
|
||||
// Internal Functions
|
||||
|
||||
static void
|
||||
init_TestState(TestState *s)
|
||||
{
|
||||
if (!s) return;
|
||||
s->run = 0;
|
||||
s->passed = 0;
|
||||
s->failed = 0;
|
||||
s->pending = 0;
|
||||
s->first_log = 0;
|
||||
s->last_log = 0;
|
||||
s->ptr = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
print_log(TestState *s)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user