diff options
author | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-07-10 14:20:39 -0500 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@oarcorp.com> | 2014-07-14 19:31:00 -0500 |
commit | b6343c61002b421e4d578e9868bedc1f0f0b43d7 (patch) | |
tree | 5c26dfacce2523537cb201e5f07de599cf454901 /testsuites/tmtests/tm03/task1.c | |
parent | capture01: Add include of assert.h. (diff) | |
download | rtems-b6343c61002b421e4d578e9868bedc1f0f0b43d7.tar.bz2 |
Enhance Semaphore Blocking and Readying Time Test Cases
tm02 and tm03 were modified to be reused for multiple configurations
of RTEMS Classic API Semaphores. This added tm31-36. The messages for
tm02 and tm03 were modified to indicate the semaphore attributes.
tm31 - tm36 were added. This resulted in the following cases:
tm02 - rtems_semaphore_obtain: Counting/FIFO not available caller blocks
tm03 - rtems_semaphore_release: Counting/FIFO task readied preempts caller
tm31 - rtems_semaphore_obtain: Counting/priority not available caller blocks
tm32 - rtems_semaphore_release: Counting/priority task readied preempts caller
tm33 - rtems_semaphore_obtain: Binary/FIFO not available caller blocks
tm34 - rtems_semaphore_release: Binary/FIFO task readied preempts caller
tm35 - rtems_semaphore_obtain: Binary/priority not available caller blocks
tm36 - rtems_semaphore_release: Binary/priority task readied preempts caller
Diffstat (limited to 'testsuites/tmtests/tm03/task1.c')
-rw-r--r-- | testsuites/tmtests/tm03/task1.c | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/testsuites/tmtests/tm03/task1.c b/testsuites/tmtests/tm03/task1.c index 9cd8de8cdb..42126ac8a5 100644 --- a/testsuites/tmtests/tm03/task1.c +++ b/testsuites/tmtests/tm03/task1.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 1989-2013. + * COPYRIGHT (c) 1989-2014. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -14,7 +14,30 @@ #define CONFIGURE_INIT #include "system.h" +#if defined(TM03) const char rtems_test_name[] = "TIME TEST 3"; +#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_FIFO) +#define ATTR_DESC "counting/FIFO" + +#elif defined(TM32) +const char rtems_test_name[] = "TIME TEST 32"; +#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY) +#define ATTR_DESC "counting/priority" + +#elif defined(TM34) +const char rtems_test_name[] = "TIME TEST 34"; +#define SEMAPHORE_ATTRIBUTES RTEMS_BINARY_SEMAPHORE +#define ATTR_DESC "binary/FIFO" + +#elif defined(TM36) +const char rtems_test_name[] = "TIME TEST 36"; +#define SEMAPHORE_ATTRIBUTES (RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY) +#define ATTR_DESC "binary/priority" + +#else +#error "Unknown test configuration" +#endif + rtems_id Semaphore_id; rtems_task test_init( @@ -72,7 +95,7 @@ rtems_task test_init( status = rtems_semaphore_create( rtems_build_name( 'S', 'M', '1', '\0'), 0, - RTEMS_DEFAULT_ATTRIBUTES, + SEMAPHORE_ATTRIBUTES, RTEMS_NO_PRIORITY, &Semaphore_id ); @@ -140,7 +163,7 @@ rtems_task High_task( end_time = benchmark_timer_read(); put_time( - "rtems_semaphore_release: task readied preempts caller", + "rtems_semaphore_release: " ATTR_DESC " task readied preempts caller", end_time, operation_count - 1, 0, |