All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] [COMMITTED] sched_rr_get_interval03: Make use of TST_EXP_FAIL()
@ 2021-06-11 14:38 Cyril Hrubis
  0 siblings, 0 replies; only message in thread
From: Cyril Hrubis @ 2021-06-11 14:38 UTC (permalink / raw)
  To: ltp

In order to simplify the code a bit.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 .../sched_rr_get_interval03.c                      | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c
index cee9245e6..a61541b8a 100644
--- a/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c
+++ b/testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c
@@ -78,18 +78,8 @@ static void run(unsigned int i)
 	else
 		ts = tst_ts_get(tc->tp);
 
-	TEST(tv->sched_rr_get_interval(*tc->pid, ts));
-
-	if (TST_RET != -1) {
-		tst_res(TFAIL, "sched_rr_get_interval() passed unexpectedly");
-		return;
-	}
-
-	if (tc->exp_errno == TST_ERR)
-		tst_res(TPASS | TTERRNO, "sched_rr_get_interval() failed as expected");
-	else
-		tst_res(TFAIL | TTERRNO, "sched_rr_get_interval() failed unexpectedly: %s",
-			tst_strerrno(tc->exp_errno));
+	TST_EXP_FAIL(tv->sched_rr_get_interval(*tc->pid, ts), tc->exp_errno,
+	             "sched_rr_get_interval(%i, %p)", *tc->pid, ts);
 }
 
 static struct tst_test test = {
-- 
2.31.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-11 14:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 14:38 [LTP] [PATCH] [COMMITTED] sched_rr_get_interval03: Make use of TST_EXP_FAIL() Cyril Hrubis

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.