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-11-23 15:18:38 +0100
commit0530a624d7094cd30f3ffb4db583defd36e32627 (patch)
treed99427b476704133e7a711622684960edd5eca77
parent547d0f88cf81aefad8f2e93fc5c39c5323eacd08 (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)" ) );
}
/**