diff options
-rw-r--r-- | testsuites/validation/tc-intr-non-smp.c | 107 |
1 files changed, 67 insertions, 40 deletions
diff --git a/testsuites/validation/tc-intr-non-smp.c b/testsuites/validation/tc-intr-non-smp.c index 506f867c9d..231ba6bfa2 100644 --- a/testsuites/validation/tc-intr-non-smp.c +++ b/testsuites/validation/tc-intr-non-smp.c @@ -65,73 +65,100 @@ * * @ingroup RTEMSTestSuiteTestsuitesValidationNonSmp * - * @brief Tests some @ref RTEMSAPIClassicIntr directives. + * @brief Tests some @ref RTEMSAPIClassicIntr interfaces. * * This test case performs the following actions: * - * - Validate rtems_interrupt_local_disable() and - * rtems_interrupt_local_enable(). + * - Validate some interrupt lock macros. * - * - Check that maskable interrupts are enabled before the call to - * rtems_interrupt_local_disable() and disabled afterwards. + * - Check that RTEMS_INTERRUPT_LOCK_DECLARE() expands to white space only. * - * - Check that maskable interrupts are disabled before the call to - * rtems_interrupt_local_disable() and disabled afterwards. + * - Check that RTEMS_INTERRUPT_LOCK_DEFINE() expands to white space only. * - * - Check that maskable interrupt status is restored by the call to - * rtems_interrupt_local_enable() according to the ``_isr_cookie`` - * parameter. In this case maskable interrupts are still disabled - * afterwards. + * - Check that RTEMS_INTERRUPT_LOCK_MEMBER() expands to white space only. * - * - Check that maskable interrupt status is restored by the call to - * rtems_interrupt_local_enable() according to the ``_isr_cookie`` - * parameter. In this case maskable interrupts are enabled afterwards. + * - Check that RTEMS_INTERRUPT_LOCK_REFERENCE() expands to white space only. + * + * - Check that rtems_interrupt_lock_destroy() expands to white space only. + * + * - Check that RTEMS_INTERRUPT_LOCK_INITIALIZER() expands to an empty + * structure initializer. + * + * - Check that rtems_interrupt_lock_initialize() expands to white space + * only. + * + * - Check that rtems_interrupt_lock_acquire_isr() expands to a code block + * which marks the second parameter as used. + * + * - Check that rtems_interrupt_lock_release_isr() expands to a code block + * which marks the second parameter as used. * * @{ */ /** - * @brief Validate rtems_interrupt_local_disable() and - * rtems_interrupt_local_enable(). + * @brief Validate some interrupt lock macros. */ static void RtemsIntrValIntrNonSmp_Action_0( void ) { - rtems_interrupt_level level; - rtems_interrupt_level level_2; + const char *s; + + /* + * Check that RTEMS_INTERRUPT_LOCK_DECLARE() expands to white space only. + */ + s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_DECLARE( x, y ) ); + T_true( IsWhiteSpaceOnly( s ) ); + + /* + * Check that RTEMS_INTERRUPT_LOCK_DEFINE() expands to white space only. + */ + s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_DEFINE( x, y, z ) ); + T_true( IsWhiteSpaceOnly( s ) ); + + /* + * Check that RTEMS_INTERRUPT_LOCK_MEMBER() expands to white space only. + */ + s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_MEMBER( x ) ); + T_true( IsWhiteSpaceOnly( s ) ); + + /* + * Check that RTEMS_INTERRUPT_LOCK_REFERENCE() expands to white space only. + */ + s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_REFERENCE( x, y ) ); + T_true( IsWhiteSpaceOnly( s ) ); + + /* + * Check that rtems_interrupt_lock_destroy() expands to white space only. + */ + s = RTEMS_XSTRING( rtems_interrupt_lock_destroy( x ) ); + T_true( IsWhiteSpaceOnly( s ) ); /* - * Check that maskable interrupts are enabled before the call to - * rtems_interrupt_local_disable() and disabled afterwards. + * Check that RTEMS_INTERRUPT_LOCK_INITIALIZER() expands to an empty + * structure initializer. */ - T_true( AreInterruptsEnabled() ); - rtems_interrupt_local_disable( level ); - T_false( AreInterruptsEnabled() ); + s = RTEMS_XSTRING( RTEMS_INTERRUPT_LOCK_INITIALIZER( x ) ); + T_true( IsEqualIgnoreWhiteSpace( s, "{}" ) ); /* - * Check that maskable interrupts are disabled before the call to - * rtems_interrupt_local_disable() and disabled afterwards. + * Check that rtems_interrupt_lock_initialize() expands to white space only. */ - T_false( AreInterruptsEnabled() ); - rtems_interrupt_local_disable( level_2 ); - T_false( AreInterruptsEnabled() ); + s = RTEMS_XSTRING( rtems_interrupt_lock_initialize( x, y ) ); + T_true( IsWhiteSpaceOnly( s ) ); /* - * Check that maskable interrupt status is restored by the call to - * rtems_interrupt_local_enable() according to the ``_isr_cookie`` parameter. - * In this case maskable interrupts are still disabled afterwards. + * Check that rtems_interrupt_lock_acquire_isr() expands to a code block + * which marks the second parameter as used. */ - T_false( AreInterruptsEnabled() ); - rtems_interrupt_local_enable( level_2 ); - T_false( AreInterruptsEnabled() ); + s = RTEMS_XSTRING( rtems_interrupt_lock_acquire_isr( x, y ) ); + T_true( IsEqualIgnoreWhiteSpace( s, "do{(void)y;}while(0)" ) ); /* - * Check that maskable interrupt status is restored by the call to - * rtems_interrupt_local_enable() according to the ``_isr_cookie`` parameter. - * In this case maskable interrupts are enabled afterwards. + * Check that rtems_interrupt_lock_release_isr() expands to a code block + * which marks the second parameter as used. */ - T_false( AreInterruptsEnabled() ); - rtems_interrupt_local_enable( level ); - T_true( AreInterruptsEnabled() ); + s = RTEMS_XSTRING( rtems_interrupt_lock_release_isr( x, y ) ); + T_true( IsEqualIgnoreWhiteSpace( s, "do{(void)y;}while(0)" ) ); } /** |