forked from Imagelibrary/rtems
libtest: Use dependency injection
This helps static analyzers.
This commit is contained in:
@@ -1002,6 +1002,8 @@ T_check_steps(unsigned int planned_steps, unsigned int steps,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void T_do_pop_fixture(T_context *);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
T_do_case_end(T_context *ctx, const T_case_context *tc)
|
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;
|
T_time_string ts;
|
||||||
|
|
||||||
while (ctx->fixtures != NULL) {
|
while (ctx->fixtures != NULL) {
|
||||||
T_pop_fixture();
|
T_do_pop_fixture(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
T_call_destructors(ctx);
|
T_call_destructors(ctx);
|
||||||
@@ -1237,15 +1239,13 @@ T_push_fixture(T_fixture_node *node, const T_fixture *fixture)
|
|||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
T_pop_fixture(void)
|
T_do_pop_fixture(T_context *ctx)
|
||||||
{
|
{
|
||||||
T_context *ctx;
|
|
||||||
T_fixture_node *node;
|
T_fixture_node *node;
|
||||||
const T_fixture *fixture;
|
const T_fixture *fixture;
|
||||||
T_fixture_node *next;
|
T_fixture_node *next;
|
||||||
|
|
||||||
ctx = &T_instance;
|
|
||||||
node = ctx->fixtures;
|
node = ctx->fixtures;
|
||||||
next = node->next;
|
next = node->next;
|
||||||
ctx->fixtures = next;
|
ctx->fixtures = next;
|
||||||
@@ -1274,6 +1274,12 @@ T_pop_fixture(void)
|
|||||||
memset(node, 0, sizeof(*node));
|
memset(node, 0, sizeof(*node));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
T_pop_fixture(void)
|
||||||
|
{
|
||||||
|
T_do_pop_fixture(&T_instance);
|
||||||
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
T_get_scope(const char * const * const *desc, char *buf, size_t n,
|
T_get_scope(const char * const * const *desc, char *buf, size_t n,
|
||||||
const size_t *second_indices)
|
const size_t *second_indices)
|
||||||
|
|||||||
Reference in New Issue
Block a user