summaryrefslogtreecommitdiffstats
path: root/cpukit/libtest
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-01-27 16:41:00 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-01-27 19:08:29 +0100
commit426b6cdba9f0584addcf032c4294815b9d737737 (patch)
tree01b6ef2832753a1c1a740631ac162c410f387ae3 /cpukit/libtest
parentcacheimpl.h: Avoid potential dead code (diff)
downloadrtems-426b6cdba9f0584addcf032c4294815b9d737737.tar.bz2
libtest: Use dependency injection
This helps static analyzers.
Diffstat (limited to 'cpukit/libtest')
-rw-r--r--cpukit/libtest/t-test.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/cpukit/libtest/t-test.c b/cpukit/libtest/t-test.c
index 26521728f4..0f19f22c31 100644
--- a/cpukit/libtest/t-test.c
+++ b/cpukit/libtest/t-test.c
@@ -1002,6 +1002,8 @@ T_check_steps(unsigned int planned_steps, unsigned int steps,
}
}
+static void T_do_pop_fixture(T_context *);
+
static void
T_do_case_end(T_context *ctx, const T_case_context *tc)
{
@@ -1013,7 +1015,7 @@ T_do_case_end(T_context *ctx, const T_case_context *tc)
T_time_string ts;
while (ctx->fixtures != NULL) {
- T_pop_fixture();
+ T_do_pop_fixture(ctx);
}
T_call_destructors(ctx);
@@ -1237,15 +1239,13 @@ T_push_fixture(T_fixture_node *node, const T_fixture *fixture)
return context;
}
-void
-T_pop_fixture(void)
+static void
+T_do_pop_fixture(T_context *ctx)
{
- T_context *ctx;
T_fixture_node *node;
const T_fixture *fixture;
T_fixture_node *next;
- ctx = &T_instance;
node = ctx->fixtures;
next = node->next;
ctx->fixtures = next;
@@ -1274,6 +1274,12 @@ T_pop_fixture(void)
memset(node, 0, sizeof(*node));
}
+void
+T_pop_fixture(void)
+{
+ T_do_pop_fixture(&T_instance);
+}
+
size_t
T_get_scope(const char * const * const *desc, char *buf, size_t n,
const size_t *second_indices)