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/tm02 | |
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/tm02')
-rw-r--r-- | testsuites/tmtests/tm02/Makefile.am | 1 | ||||
-rw-r--r-- | testsuites/tmtests/tm02/task1.c | 28 | ||||
-rw-r--r-- | testsuites/tmtests/tm02/tm02.doc | 4 |
3 files changed, 28 insertions, 5 deletions
diff --git a/testsuites/tmtests/tm02/Makefile.am b/testsuites/tmtests/tm02/Makefile.am index 3bec68473d..ba6ad0fc74 100644 --- a/testsuites/tmtests/tm02/Makefile.am +++ b/testsuites/tmtests/tm02/Makefile.am @@ -13,6 +13,7 @@ include $(top_srcdir)/../automake/leaf.am OPERATION_COUNT = @OPERATION_COUNT@ AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) AM_CPPFLAGS += -I$(top_srcdir)/../support/include +AM_CPPFLAGS += -DTM02 LINK_OBJS = $(tm02_OBJECTS) LINK_LIBS = $(tm02_LDLIBS) diff --git a/testsuites/tmtests/tm02/task1.c b/testsuites/tmtests/tm02/task1.c index e27e4a0188..4d9b6d176e 100644 --- a/testsuites/tmtests/tm02/task1.c +++ b/testsuites/tmtests/tm02/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,29 @@ #define CONFIGURE_INIT #include "system.h" +#if defined(TM02) const char rtems_test_name[] = "TIME TEST 2"; +#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_FIFO) +#define ATTR_DESC "counting/FIFO" + +#elif defined(TM31) +const char rtems_test_name[] = "TIME TEST 31"; +#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY) +#define ATTR_DESC "counting/priority" + +#elif defined(TM33) +const char rtems_test_name[] = "TIME TEST 33"; +#define SEMAPHORE_ATTRIBUTES RTEMS_BINARY_SEMAPHORE +#define ATTR_DESC "binary/FIFO" + +#elif defined(TM35) +const char rtems_test_name[] = "TIME TEST 35"; +#define SEMAPHORE_ATTRIBUTES (RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY) +#define ATTR_DESC "binary/priority" + +#else +#error "Unknown test configuration" +#endif rtems_id High_id; rtems_id Low_id; @@ -110,7 +132,7 @@ void test_init(void) status = rtems_semaphore_create( rtems_build_name( 'S', 'M', '1', ' '), 0, - RTEMS_DEFAULT_ATTRIBUTES, + SEMAPHORE_ATTRIBUTES, RTEMS_NO_PRIORITY, &Semaphore_id ); @@ -149,7 +171,7 @@ rtems_task Low_task( end_time = benchmark_timer_read(); put_time( - "rtems_semaphore_obtain: not available caller blocks", + "rtems_semaphore_obtain: " ATTR_DESC " not available caller blocks", end_time, operation_count - 1, 0, diff --git a/testsuites/tmtests/tm02/tm02.doc b/testsuites/tmtests/tm02/tm02.doc index 32f2b2d6c2..ed9aac09ac 100644 --- a/testsuites/tmtests/tm02/tm02.doc +++ b/testsuites/tmtests/tm02/tm02.doc @@ -8,8 +8,8 @@ This test benchmarks the following operations: - + rtems_semaphore_obtain + + rtems_semaphore_obtain: counting/FIFO not available, caller blocks For more information 1. tmtests/include/timesys.h -2. tmtests/README
\ No newline at end of file +2. tmtests/README |