diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-19 08:25:44 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-11-23 15:18:39 +0100 |
commit | eed69c47b85fd8d81cb01a5ffd929d54558a7a49 (patch) | |
tree | 33d30d4e85de590dfed46554a5dbc4f9ab5eee71 | |
parent | 9aa371017c6c666ac91ed1b9f082ec58164775ea (diff) |
testsuites/validation/tc-modes.c
-rw-r--r-- | testsuites/validation/tc-modes.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/testsuites/validation/tc-modes.c b/testsuites/validation/tc-modes.c index e3cd306bdc..e864dcb817 100644 --- a/testsuites/validation/tc-modes.c +++ b/testsuites/validation/tc-modes.c @@ -121,6 +121,17 @@ * is equal to RTEMS_INTERRUPT_MASK this proves that each constant and 0xff * has a unique value. * + * - Calculate the bitwise or of all non-default task mode constants. + * + * - Check that the count of set bits in the calculated value is equal to the + * count of non-default task mode constants. Since each non-default task + * mode constants except is a power of this proves that each constant has a + * unique value. + * + * - Validate RTEMS_INTERRUPT_LEVEL(). + * + * - Check the result of RTEMS_INTERRUPT_LEVEL() for a sample value. + * * @{ */ @@ -296,17 +307,57 @@ static void RtemsModeValModes_Action_4( void ) } /** + * @brief Calculate the bitwise or of all non-default task mode constants. + */ +static void RtemsModeValModes_Action_5( void ) +{ + rtems_mode modes; + + modes = 0; + modes |= RTEMS_NO_ASR; + modes |= RTEMS_NO_PREEMPT; + modes |= RTEMS_TIMESLICE; + + /* + * Check that the count of set bits in the calculated value is equal to the + * count of non-default task mode constants. Since each non-default task + * mode constants except is a power of this proves that each constant has a + * unique value. + */ + T_step_eq_int( 15, PopCount( modes ), 3 ); +} + +/** + * @brief Validate RTEMS_INTERRUPT_LEVEL(). + */ +static void RtemsModeValModes_Action_6( void ) +{ + /* Nothing to do */ + + /* + * Check the result of RTEMS_INTERRUPT_LEVEL() for a sample value. + */ + T_step_eq_u32( + 16, + RTEMS_INTERRUPT_LEVEL( UINT32_MAX ), + RTEMS_INTERRUPT_MASK + ); +} + +/** * @fn void T_case_body_RtemsModeValModes( void ) */ T_TEST_CASE( RtemsModeValModes ) { - T_plan( 15 ); + T_plan( 17 ); RtemsModeValModes_Action_0(); RtemsModeValModes_Action_1(); RtemsModeValModes_Action_2(); RtemsModeValModes_Action_3(); RtemsModeValModes_Action_4(); + RtemsModeValModes_Action_5(); + RtemsModeValModes_Action_6(); } /** @} */ |