[LTP] [PATCH v2 2/3] sbrk01.c: Use TST_EXP_PASS_PTR_VOID

Wei Gao wegao@suse.com
Thu Apr 25 04:03:07 CEST 2024


Signed-off-by: Wei Gao <wegao@suse.com>
---
 testcases/kernel/syscalls/sbrk/sbrk01.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/syscalls/sbrk/sbrk01.c b/testcases/kernel/syscalls/sbrk/sbrk01.c
index bb78d9a7b..39e92094b 100644
--- a/testcases/kernel/syscalls/sbrk/sbrk01.c
+++ b/testcases/kernel/syscalls/sbrk/sbrk01.c
@@ -26,12 +26,8 @@ static void run(unsigned int i)
 {
 	struct tcase *tc = &tcases[i];
 
-	TESTPTR(sbrk(tc->increment));
-
-	if (TST_RET_PTR == (void *) -1)
-		tst_res(TFAIL | TTERRNO, "sbrk(%ld) failed", tc->increment);
-	else
-		tst_res(TPASS, "sbrk(%ld) returned %p", tc->increment, TST_RET_PTR);
+	TST_EXP_PASS_PTR_VOID(sbrk(tc->increment),
+		"sbrk(%ld) returned %p", tc->increment, TST_RET_PTR);
 }
 
 static struct tst_test test = {
-- 
2.35.3



More information about the ltp mailing list