Skip to content

Commit

Permalink
sbrk02.c: Use TST_EXP_FAIL_PTR_VOID
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Gao <[email protected]>
Reviewed-by: Petr Vorel <[email protected]>
Reviewed-by: Andrea Cervesato <[email protected]>
  • Loading branch information
Wei Gao via ltp authored and acerv committed Jan 14, 2025
1 parent 17489f7 commit ea6be49
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions testcases/kernel/syscalls/sbrk/sbrk02.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,8 @@ static long increment = INC;

static void run(void)
{
TESTPTR(sbrk(increment));

if (TST_RET_PTR != (void *)-1) {
tst_res(TFAIL, "sbrk(%ld) unexpectedly passed and returned %p, "
"expected (void *)-1 with errno=%d",
increment, TST_RET_PTR, ENOMEM);
return;
}

if (TST_ERR == ENOMEM)
tst_res(TPASS | TTERRNO, "sbrk(%ld) failed as expected", increment);
else
tst_res(TFAIL | TTERRNO, "sbrk(%ld) failed but unexpected errno, "
"expected errno=%d - %s",
increment, ENOMEM, strerror(ENOMEM));
TST_EXP_FAIL_PTR_VOID(sbrk(increment), ENOMEM,
"sbrk(%ld) returned %p", increment, TST_RET_PTR);
}

static void setup(void)
Expand Down

0 comments on commit ea6be49

Please sign in to comment.