Skip to contentSkip to conversation

sched_rr_get_interval03: Make use of TST_EXP_FAIL()

PATCH New Cyril Hrubis 1 participant 1 message Jun 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched_rr_get_interval03: Make use of TST_EXP_FAIL()

In order to simplify the code a bit.

---
 .../sched_rr_get_interval03.c                      | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c +2 -12
index cee9245e6..a61541b8a 100644
@@ -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 = {
Signature · 1 line
2.31.1