Skip to contentSkip to conversation

write04.c: use TST_EXP_FAIL() macro

PATCH Applied Avinesh Kumar 2 participants 2 messages Jul 14, 2022 – Sep 1, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 write04.c: use TST_EXP_FAIL() macro

---
 testcases/kernel/syscalls/write/write04.c | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)
testcases/kernel/syscalls/write/write04.c +1 -14
index a765d91b7..565fddfb7 100644
@@ -30,20 +30,7 @@ static void verify_write(void)
 {
 	char wbuf[8 * page_size];
 
-	TEST(write(wfd, wbuf, sizeof(wbuf)));
-
-	if (TST_RET != -1) {
-		tst_res(TFAIL, "write() succeeded unexpectedly");
-		return;
-	}
-
-	if (TST_ERR != EAGAIN) {
-		tst_res(TFAIL | TTERRNO,
-			"write() failed unexpectedly, expected EAGAIN");
-		return;
-	}
-
-	tst_res(TPASS | TTERRNO, "write() failed expectedly");
+	TST_EXP_FAIL(write(wfd, wbuf, sizeof(wbuf)), EAGAIN);
 }
 
 static void setup(void)
Signature · 5 lines
2.36.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Applied
#1 lore raw

Hi Avinesh,

merged, thanks!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp