Tests the task mode constants and function-like macros of the Classic API.
More...
|
| T_TEST_CASE (RtemsModeValModes) |
|
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.
- 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().