make sure run_test() doesn't crash when handed a null state
This commit is contained in:
parent
3393c3b9af
commit
94d6bc8cf9
@ -31,6 +31,7 @@
|
|||||||
static void test_pass(TestState *);
|
static void test_pass(TestState *);
|
||||||
static void test_fail(TestState *);
|
static void test_fail(TestState *);
|
||||||
static void test_pend(TestState *);
|
static void test_pend(TestState *);
|
||||||
|
static void null_state(TestState *);
|
||||||
decl_test(always_passes);
|
decl_test(always_passes);
|
||||||
decl_test(always_fails);
|
decl_test(always_fails);
|
||||||
decl_test(always_pends);
|
decl_test(always_pends);
|
||||||
@ -44,6 +45,7 @@ test_run_test(TestState *s)
|
|||||||
test_pass(s);
|
test_pass(s);
|
||||||
test_fail(s);
|
test_fail(s);
|
||||||
test_pend(s);
|
test_pend(s);
|
||||||
|
null_state(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Internal Functions
|
// 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)
|
decl_test(always_passes)
|
||||||
{
|
{
|
||||||
return test_success;
|
return test_success;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user