public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] syscalls/getdents02: Fix make check warnings and use TST_EXP macro
@ 2024-08-20 13:32 Avinesh Kumar
  2024-09-17  9:30 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Avinesh Kumar @ 2024-08-20 13:32 UTC (permalink / raw)
  To: ltp

Signed-off-by: Avinesh Kumar <akumar@suse.de>
---
 .../kernel/syscalls/getdents/getdents02.c     | 20 ++-----------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/testcases/kernel/syscalls/getdents/getdents02.c b/testcases/kernel/syscalls/getdents/getdents02.c
index 578db9d1e..132fffcc0 100644
--- a/testcases/kernel/syscalls/getdents/getdents02.c
+++ b/testcases/kernel/syscalls/getdents/getdents02.c
@@ -24,12 +24,9 @@
 #include "tst_test.h"
 #include "getdents.h"
 
-#define DIR_MODE	(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
-			 S_IXGRP|S_IROTH|S_IXOTH)
+#define DIR_MODE	0755
 #define TEST_DIR	"test_dir"
 
-char *TCID = "getdents02";
-
 static char *dirp;
 static size_t size;
 
@@ -77,20 +74,7 @@ static void run(unsigned int i)
 {
 	struct tcase *tc = tcases + i;
 
-	TEST(tst_getdents(*tc->fd, *tc->dirp, *tc->size));
-
-	if (TST_RET != -1) {
-		tst_res(TFAIL, "getdents() returned %ld", TST_RET);
-		return;
-	}
-
-	if (TST_ERR == tc->exp_errno) {
-		tst_res(TPASS | TTERRNO, "getdents failed as expected");
-	} else if (errno == ENOSYS) {
-		tst_res(TCONF, "syscall not implemented");
-	} else {
-		tst_res(TFAIL | TTERRNO, "getdents failed unexpectedly");
-	}
+	TST_EXP_FAIL2(tst_getdents(*tc->fd, *tc->dirp, *tc->size), tc->exp_errno);
 }
 
 static struct tst_test test = {
-- 
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] syscalls/getdents02: Fix make check warnings and use TST_EXP macro
  2024-08-20 13:32 [LTP] [PATCH] syscalls/getdents02: Fix make check warnings and use TST_EXP macro Avinesh Kumar
@ 2024-09-17  9:30 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2024-09-17  9:30 UTC (permalink / raw)
  To: Avinesh Kumar; +Cc: ltp

Hi!
> +	TST_EXP_FAIL2(tst_getdents(*tc->fd, *tc->dirp, *tc->size), tc->exp_errno);

I've added a format string here so that we have slightly better messages
and pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-17  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 13:32 [LTP] [PATCH] syscalls/getdents02: Fix make check warnings and use TST_EXP macro Avinesh Kumar
2024-09-17  9:30 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox