#endif
if(strcmp(env, "no") == 0)
return CK_NOFORK;
- else
- {
#if defined(HAVE_FORK) && HAVE_FORK==1
- return CK_FORK;
+ return CK_FORK;
#else /* HAVE_FORK */
- /* Ignoring, as Check is not compiled with fork support. */
- return CK_NOFORK;
+ /* Ignoring, as Check is not compiled with fork support. */
+ return CK_NOFORK;
#endif /* HAVE_FORK */
- }
}
- else
- return sr->fstat;
+ return sr->fstat;
}
void srunner_set_fork_status(SRunner * sr, enum fork_status fstat)
static const char *tr_type_str(TestResult * tr)
{
- const char *str = NULL;
-
if(tr->ctx == CK_CTX_TEST)
{
if(tr->rtype == CK_PASS)
- str = "P";
- else if(tr->rtype == CK_FAILURE)
- str = "F";
- else if(tr->rtype == CK_ERROR)
- str = "E";
+ return "P";
+ if(tr->rtype == CK_FAILURE)
+ return "F";
+ if(tr->rtype == CK_ERROR)
+ return "E";
+ return NULL;
}
- else
- str = "S";
-
- return str;
+ return "S";
}
static int percent_passed(TestStats * t)
{
if(t->n_failed == 0 && t->n_errors == 0)
return 100;
- else if(t->n_checked == 0)
+ if(t->n_checked == 0)
return 0;
- else
- return (int)((float)(t->n_checked - (t->n_failed + t->n_errors)) /
- (float)t->n_checked * 100);
+ return (int)((float)(t->n_checked - (t->n_failed + t->n_errors)) /
+ (float)t->n_checked * 100);
}