From 72960bc7d4c8f7eb7687827d1c1545b1eb5fdb71 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 13 Aug 2020 11:33:47 +0200 Subject: libtest: Change T_step() and T_assert_step() Normally, the expected test step must be a compile time constant. Allow variable expected test steps for the T_step() and T_assert_step(). This can be used for parameterized test loops with individual fixtures. Remove the ability to use custom failure messages due to some implementation constraints. Update #3199. --- cpukit/libtest/t-test.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cpukit/libtest') diff --git a/cpukit/libtest/t-test.c b/cpukit/libtest/t-test.c index 4d68a83fff..3f9046a891 100644 --- a/cpukit/libtest/t-test.c +++ b/cpukit/libtest/t-test.c @@ -550,6 +550,17 @@ void T_plan(unsigned int planned_steps) expected); } +void +T_check_step(const T_check_context *t, unsigned int expected) +{ + T_check_context tt; + + tt = *t; + tt.flags |= T_CHECK_STEP(expected); + T_check(&tt, true, "actual step is not equal to expected step (%u)", + expected); +} + void T_case_register(T_case_context *tc) { -- cgit v1.2.3