diff mbox series

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

Message ID 20240425020308.25367-3-wegao@suse.com
State New
Headers show
Series lib: Add TST_EXP_PASS_PTR_{NULL,VOID} macros | expand

Commit Message

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

Comments

Petr Vorel April 25, 2024, 11:42 a.m. UTC | #1
Hi Wei,

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr
diff mbox series

Patch

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 = {