@@ -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)
Signed-off-by: Wei Gao <wegao@suse.com> --- testcases/kernel/syscalls/sbrk/sbrk02.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)