Tests the task mode constants and function-like macros of the Classic API.
More...
|
static bool | IsPowerOfTwo (rtems_mode mode) |
|
static int | PopCount (rtems_mode modes) |
|
void | T_case_body_RtemsModeValModes (void) |
|
Tests the task mode constants and function-like macros of the Classic API.
This test case performs the following actions:
- Validate the non-default task mode constants.
- Check that RTEMS_NO_ASR is a power of two representable as an integer of type rtems_mode.
- Check that RTEMS_NO_PREEMPT is a power of two representable as an integer of type rtems_mode.
- Check that RTEMS_TIMESLICE is a power of two representable as an integer of type rtems_mode.
- Validate the default task mode constants.
- Check that RTEMS_ASR is equal to zero.
- Check that RTEMS_DEFAULT_MODES is equal to zero.
- Check that RTEMS_NO_TIMESLICE is equal to zero.
- Check that RTEMS_PREEMPT is equal to zero.
- Validate RTEMS_ALL_MODE_MASKS.
- Check that the bitwise and of RTEMS_ASR_MASK and RTEMS_ALL_MODE_MASKS is equal to RTEMS_ASR_MASK.
- Check that the bitwise and of RTEMS_PREEMPT_MASK and RTEMS_ALL_MODE_MASKS is equal to RTEMS_PREEMPT_MASK.
- Check that the bitwise and of RTEMS_TIMESLICE_MASK and RTEMS_ALL_MODE_MASKS is equal to RTEMS_TIMESLICE_MASK.
- Check that the bitwise and of RTEMS_INTERRUPT_MASK and RTEMS_ALL_MODE_MASKS is equal to RTEMS_INTERRUPT_MASK.
- Validate the task mode mask constants except RTEMS_INTERRUPT_MASK.
- Check that RTEMS_ASR_MASK is a power of two representable as an integer of type rtems_mode.
- Check that RTEMS_PREEMPT_MASK is a power of two representable as an integer of type rtems_mode.
- Check that RTEMS_TIMESLICE_MASK is a power of two representable as an integer of type rtems_mode.
- Calculate the bitwise or of all task mode mask constants and 0xff.
- Check that the count of set bits in the calculated value is equal to the count of task mode mask constants except RTEMS_INTERRUPT_MASK plus eight. Since each task mode mask constants except RTEMS_INTERRUPT_MASK is a power of two and the bitwise and of 0xff and RTEMS_INTERRUPT_MASK is equal to RTEMS_INTERRUPT_MASK this proves that each constant and 0xff has a unique value.