consider calling run_test() with a null function as a pending test
This commit is contained in:
@@ -32,6 +32,7 @@ static void test_pass(TestState *);
|
||||
static void test_fail(TestState *);
|
||||
static void test_pend(TestState *);
|
||||
static void null_state(TestState *);
|
||||
static void null_test(TestState *);
|
||||
decl_test(always_passes);
|
||||
decl_test(always_fails);
|
||||
decl_test(always_pends);
|
||||
@@ -46,6 +47,7 @@ test_run_test(TestState *s)
|
||||
test_fail(s);
|
||||
test_pend(s);
|
||||
null_state(s);
|
||||
null_test(s);
|
||||
}
|
||||
|
||||
// Internal Functions
|
||||
@@ -129,13 +131,40 @@ test_pend(TestState *s)
|
||||
}
|
||||
|
||||
static void
|
||||
null_state(TestState *s)
|
||||
null_state(TestState *)
|
||||
{
|
||||
print("\tnull state\n");
|
||||
|
||||
// make sure it doesn't crash
|
||||
run_test(0, always_passes);
|
||||
}
|
||||
|
||||
static void
|
||||
null_test(TestState *s)
|
||||
{
|
||||
TestState actual, expected;
|
||||
print("\tnull test\n");
|
||||
|
||||
// expected value
|
||||
memset(&expected, 0, sizeof(TestState));
|
||||
expected.passed = 1;
|
||||
expected.failed = 2;
|
||||
expected.pending = 4;
|
||||
expected.run = 7;
|
||||
|
||||
// actual value
|
||||
mk_sample_state(&actual);
|
||||
run_test(&actual, 0);
|
||||
|
||||
chk_TestState_eq(
|
||||
s,
|
||||
"\t\t",
|
||||
"ERROR: run_test(): null_test:",
|
||||
&actual,
|
||||
&expected
|
||||
);
|
||||
}
|
||||
|
||||
decl_test(always_passes)
|
||||
{
|
||||
return test_success;
|
||||
|
||||
Reference in New Issue
Block a user