From: Avinesh Kumar <akumar@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/getdents02: Fix make check warnings and use TST_EXP macro
Date: Tue, 20 Aug 2024 15:32:57 +0200 [thread overview]
Message-ID: <20240820133259.182384-1-akumar@suse.de> (raw)
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
next reply other threads:[~2024-08-20 13:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 13:32 Avinesh Kumar [this message]
2024-09-17 9:30 ` [LTP] [PATCH] syscalls/getdents02: Fix make check warnings and use TST_EXP macro Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240820133259.182384-1-akumar@suse.de \
--to=akumar@suse.de \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox