[LTP] [PATCH 03/10] syscalls/accept: Make use of TEST_MACROS
Cyril Hrubis
chrubis@suse.cz
Fri Nov 13 14:14:21 CET 2020
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
testcases/kernel/syscalls/accept/accept01.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/testcases/kernel/syscalls/accept/accept01.c b/testcases/kernel/syscalls/accept/accept01.c
index 4e30906f2..141400e54 100644
--- a/testcases/kernel/syscalls/accept/accept01.c
+++ b/testcases/kernel/syscalls/accept/accept01.c
@@ -95,21 +95,8 @@ void verify_accept(unsigned int nr)
{
struct test_case *tcase = &tcases[nr];
- TEST(accept(*tcase->fd, tcase->sockaddr, &tcase->salen));
-
- if (TST_RET != -1) {
- tst_res(TFAIL, "%s: returned %li, expected -1",
- tcase->desc, TST_RET);
- return;
- }
-
- if (TST_ERR != tcase->experrno) {
- tst_res(TFAIL | TTERRNO, "%s: expected errno %s, got ",
- tcase->desc, tst_strerrno(tcase->experrno));
- return;
- }
-
- tst_res(TPASS | TTERRNO, "%s successful", tcase->desc);
+ TEST_FAIL(accept(*tcase->fd, tcase->sockaddr, &tcase->salen),
+ tcase->experrno, "%s", tcase->desc);
}
static struct tst_test test = {
--
2.26.2
More information about the ltp
mailing list