All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avinesh Kumar <akumar@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] syscalls/mmap08: Use macro TST_EXP_FAIL_PTR_VOID()
Date: Mon, 29 Apr 2024 21:48:20 +0200	[thread overview]
Message-ID: <20240429194821.9112-1-akumar@suse.de> (raw)

Signed-off-by: Avinesh Kumar <akumar@suse.de>
---
 testcases/kernel/syscalls/mmap/mmap08.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/testcases/kernel/syscalls/mmap/mmap08.c b/testcases/kernel/syscalls/mmap/mmap08.c
index 5c9fd782c..befd73e14 100644
--- a/testcases/kernel/syscalls/mmap/mmap08.c
+++ b/testcases/kernel/syscalls/mmap/mmap08.c
@@ -27,16 +27,7 @@ static void setup(void)
 
 static void run(void)
 {
-	TESTPTR(mmap(NULL, page_sz, PROT_WRITE, MAP_FILE | MAP_SHARED, fd, 0));
-
-	if (TST_RET_PTR != MAP_FAILED) {
-		tst_res(TFAIL, "mmap() passed unexpectedly");
-		SAFE_MUNMAP(TST_RET_PTR, page_sz);
-	} else if (TST_ERR == EBADF) {
-		tst_res(TPASS, "mmap() failed with EBADF");
-	} else {
-		tst_res(TFAIL | TERRNO, "mmap() failed with an invalid errno");
-	}
+	TST_EXP_FAIL_PTR_VOID(mmap(NULL, page_sz, PROT_WRITE, MAP_FILE | MAP_SHARED, fd, 0), EBADF);
 }
 
 static void cleanup(void)
-- 
2.44.0


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

             reply	other threads:[~2024-04-29 19:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 19:48 Avinesh Kumar [this message]
2024-05-07 16:53 ` [LTP] [PATCH] syscalls/mmap08: Use macro TST_EXP_FAIL_PTR_VOID() Petr Vorel
2024-05-13 13:08   ` [LTP] [PATCH v2] " Avinesh Kumar
2024-05-13 13:18     ` Petr Vorel

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=20240429194821.9112-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.