[LTP] [PATCH] getrlimit01: use TST_EXP_PASS() macro

Avinesh Kumar akumar@suse.de
Mon Nov 21 12:51:28 CET 2022


Signed-off-by: Avinesh Kumar <akumar@suse.de>
---
 testcases/kernel/syscalls/getrlimit/getrlimit01.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit01.c b/testcases/kernel/syscalls/getrlimit/getrlimit01.c
index 2a480dfa7..bea37ab1c 100644
--- a/testcases/kernel/syscalls/getrlimit/getrlimit01.c
+++ b/testcases/kernel/syscalls/getrlimit/getrlimit01.c
@@ -47,17 +47,9 @@ static void verify_getrlimit(unsigned int i)
 	struct rlimit rlim;
 	struct tcase *tc = &tcases[i];
 
-	TEST(getrlimit(tc->res, &rlim));
-
-	if (TST_RET == -1) {
-		tst_res(TFAIL | TTERRNO,
-			"getrlimit() test %s failed",
-			tc->res_str);
-	} else {
-		tst_res(TPASS,
-			"getrlimit() test %s success",
-			tc->res_str);
-	}
+	TST_EXP_PASS(getrlimit(tc->res, &rlim),
+				"getrlimit() test for resource type %s:",
+				tc->res_str);
 }
 
 static struct tst_test test = {
-- 
2.38.1



More information about the ltp mailing list