make sure run_test() doesn't crash when handed a null state

This commit is contained in:
jlamothe 2023-11-11 23:08:08 +00:00
parent 3393c3b9af
commit 94d6bc8cf9

View File

@ -31,6 +31,7 @@
static void test_pass(TestState *);
static void test_fail(TestState *);
static void test_pend(TestState *);
static void null_state(TestState *);
decl_test(always_passes);
decl_test(always_fails);
decl_test(always_pends);
@ -44,6 +45,7 @@ test_run_test(TestState *s)
test_pass(s);
test_fail(s);
test_pend(s);
null_state(s);
}
// Internal Functions
@ -126,6 +128,14 @@ test_pend(TestState *s)
);
}
static void
null_state(TestState *s)
{
print("\tnull state\n");
// make sure it doesn't crash
run_test(0, always_passes);
}
decl_test(always_passes)
{
return test_success;