diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-08-14 09:56:51 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-08-18 07:08:51 +0200 |
commit | c7289484348fc33f77dc99e74a8d0a298144514d (patch) | |
tree | f4272cf0be5f41e55e5427b657d303ff071654ca /cpukit | |
parent | libtest: Use a destructor (diff) | |
download | rtems-c7289484348fc33f77dc99e74a8d0a298144514d.tar.bz2 |
libtest: Add T_push_plan() and T_pop_plan()
Update #3199.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/include/rtems/test.h | 6 | ||||
-rw-r--r-- | cpukit/libtest/t-test.c | 15 |
2 files changed, 21 insertions, 0 deletions
diff --git a/cpukit/include/rtems/test.h b/cpukit/include/rtems/test.h index ccab6c4a95..935e796bf0 100644 --- a/cpukit/include/rtems/test.h +++ b/cpukit/include/rtems/test.h @@ -2168,6 +2168,12 @@ void T_check_rsc_success(const T_check_context *, uint32_t); void T_plan(unsigned int); +extern const T_fixture T_empty_fixture; + +void T_push_plan(T_fixture_node *, unsigned int); + +void T_pop_plan(void); + void T_check_step(const T_check_context *, unsigned int); #define T_flags_step(a, flags) \ diff --git a/cpukit/libtest/t-test.c b/cpukit/libtest/t-test.c index 3f9046a891..11f1cf70e9 100644 --- a/cpukit/libtest/t-test.c +++ b/cpukit/libtest/t-test.c @@ -550,6 +550,21 @@ void T_plan(unsigned int planned_steps) expected); } +const T_fixture T_empty_fixture; + +void +T_push_plan(T_fixture_node *node, unsigned int planned_steps) +{ + T_push_fixture(node, &T_empty_fixture); + T_plan(planned_steps); +} + +void +T_pop_plan(void) +{ + T_pop_fixture(); +} + void T_check_step(const T_check_context *t, unsigned int expected) { |