{
int num;
- if (t->subtest.get_nr)
- return t->subtest.get_nr();
-
if (!t->test_cases)
return 0;
static bool has_subtests(const struct test_suite *t)
{
- return t->subtest.get_nr || num_subtests(t) > 1;
+ return num_subtests(t) > 1;
}
static const char *skip_reason(const struct test_suite *t, int subtest)
{
- if (t->subtest.skip_reason)
- return t->subtest.skip_reason(subtest);
-
if (t->test_cases && subtest >= 0)
return t->test_cases[subtest].skip_reason;
if (t->test_cases && subtest >= 0)
return t->test_cases[subtest].desc;
- if (t->subtest.get_desc && subtest >= 0)
- return t->subtest.get_desc(subtest);
-
return t->desc;
}
test_fnptr func;
struct {
bool skip_if_fail;
- int (*get_nr)(void);
- const char *(*get_desc)(int subtest);
- const char *(*skip_reason)(int subtest);
} subtest;
struct test_case *test_cases;
bool (*is_supported)(void);