diff options
Diffstat (limited to 'testsuites/sptests/spcontext01/init.c')
-rw-r--r-- | testsuites/sptests/spcontext01/init.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testsuites/sptests/spcontext01/init.c b/testsuites/sptests/spcontext01/init.c index f26bc55168..e1af302c7a 100644 --- a/testsuites/sptests/spcontext01/init.c +++ b/testsuites/sptests/spcontext01/init.c @@ -160,12 +160,39 @@ static void test(test_context *self) wait_for_finish(); } +static void test_context_is_executing(void) +{ +#if defined(RTEMS_SMP) + Context_Control context; + bool is_executing; + + memset(&context, 0, sizeof(context)); + + is_executing = _CPU_Context_Get_is_executing(&context); + rtems_test_assert(!is_executing); + + _CPU_Context_Set_is_executing(&context, true); + is_executing = _CPU_Context_Get_is_executing(&context); + rtems_test_assert(is_executing); + + _CPU_Context_Set_is_executing(&context, false); + is_executing = _CPU_Context_Get_is_executing(&context); + rtems_test_assert(!is_executing); + + _CPU_Context_Set_is_executing(&context, true); + _CPU_Context_Initialize(&context, NULL, 0, 0, NULL, false, NULL); + is_executing = _CPU_Context_Get_is_executing(&context); + rtems_test_assert(is_executing); +#endif +} + static void Init(rtems_task_argument arg) { test_context *self = &test_instance; TEST_BEGIN(); + test_context_is_executing(); test(self); TEST_END(); |