consider calling run_test() with a null function as a pending test

This commit is contained in:
jlamothe
2023-11-12 01:25:55 +00:00
parent 94d6bc8cf9
commit e41263adf0
2 changed files with 39 additions and 2 deletions

10
9unit.c
View File

@@ -37,8 +37,16 @@ static void reindex(TestState *);
void
run_test(TestState *s, TestResult (*t)(TestState *))
{
if (!(s && t)) return;
if (!s) return;
s->run++;
// a null test function is a pending test
if (!t)
{
s->pending++;
return;
}
switch ((*t)(s))
{
case test_success: