summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-18 16:47:20 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-12-01 14:25:15 +0100
commit8e0a8cdd9dce7c73deae8a3ba64cb95d12156a9d (patch)
tree7ef91cec58fb7dab1a3a8ac28883487d8a689950
parentd02616b3f3a35068df778028d0836ed7eaa45c5d (diff)
testsuites/validation/tc-intr-non-smp.c
-rw-r--r--testsuites/validation/tc-intr-non-smp.c107
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)" ) );
}
/**