mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
speedup of unit tests (see https://github.com/Snaipe/Criterion/issues/172)
This commit is contained in:
parent
4e7011bba6
commit
0d366fb556
1 changed files with 9 additions and 3 deletions
12
tests/pool.c
12
tests/pool.c
|
@ -27,7 +27,7 @@ ParameterizedTestParameters(pool, basic)
|
|||
{ 1, 4096, 150, &memtype_heap },
|
||||
{ 1, 128, 8, &memtype_hugepage },
|
||||
{ 1, 4, 8192, &memtype_hugepage },
|
||||
{ 1, 1 << 13,4, &memtype_heap }
|
||||
{ 1, 1 << 13, 4, &memtype_heap }
|
||||
};
|
||||
|
||||
return cr_make_param_array(struct param, params, ARRAY_LEN(params));
|
||||
|
@ -48,11 +48,17 @@ ParameterizedTest(struct param *p, pool, basic)
|
|||
|
||||
memset(ptr, 1, p->block_size); /* check that we dont get a seg fault */
|
||||
|
||||
for (int i = 1; i < p->pool_size; i++) {
|
||||
int i;
|
||||
for (i = 1; i < p->pool_size; i++) {
|
||||
ptrs[i] = pool_get(&pool);
|
||||
cr_assert_neq(ptrs[i], NULL);
|
||||
|
||||
if (ptrs[i] == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i < p->pool_size)
|
||||
cr_assert_neq(ptrs[i], NULL);
|
||||
|
||||
ptr = pool_get(&pool);
|
||||
cr_assert_eq(ptr, NULL);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue