Skip memory leak checks if coverage analysis is enabled.

This commit is contained in:
Dag-Erling Smørgrav 2014-12-20 01:30:01 +00:00 committed by des
parent 75daba7501
commit eadeeb486c
2 changed files with 10 additions and 1 deletions

View file

@ -144,11 +144,16 @@ static int
t_run_test(struct t_test *t, int n)
{
char *desc;
int ret;
desc = t->desc ? t->desc : "no description";
if ((*t->func)(&desc, t->arg)) {
ret = (*t->func)(&desc, t->arg);
if (ret > 0) {
printf("ok %d - %s\n", n + 1, desc);
return (1);
} else if (ret < 0) {
printf("ok %d - # skip %s\n", n + 1, desc);
return (1);
} else {
printf("not ok %d - %s\n", n + 1, desc);
return (0);

View file

@ -478,6 +478,7 @@ t_malloc_printstats(FILE *f)
static int
t_malloc_leaked(char **desc, void *arg CRYB_UNUSED)
{
#if !CRYB_COVERAGE
struct bucket *b;
unsigned int shift;
unsigned long nleaked;
@ -493,6 +494,9 @@ t_malloc_leaked(char **desc, void *arg CRYB_UNUSED)
*desc = "no memory leaked";
return (1);
}
#else
return (-1);
#endif
}
struct t_test t_memory_leak = {