diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-30 17:10:04 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-07-30 17:10:04 +0000 |
commit | 7e260d67ad4fb494461ccac35a3a6dca71f7e1e8 (patch) | |
tree | 84671b35bc41f9ccf3e3149ba6d9c03e4cdc8767 /testsuites/sptests | |
parent | Enable data cache. (diff) | |
download | rtems-7e260d67ad4fb494461ccac35a3a6dca71f7e1e8.tar.bz2 |
2009-07-30 Joel Sherrill <joel.sherrill@OARcorp.com>
* sp42/Makefile.am, sp42/init.c, sp42/sp42.scn: Test was testing the
wrong thing in a cpp macro. Added contents to screen file and add
documentation file.
* sp42/sp42.doc: New file.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r-- | testsuites/sptests/ChangeLog | 7 | ||||
-rw-r--r-- | testsuites/sptests/sp42/Makefile.am | 1 | ||||
-rw-r--r-- | testsuites/sptests/sp42/init.c | 33 | ||||
-rw-r--r-- | testsuites/sptests/sp42/sp42.doc | 38 | ||||
-rw-r--r-- | testsuites/sptests/sp42/sp42.scn | 47 |
5 files changed, 116 insertions, 10 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog index eee980e4c9..5cc80ffe10 100644 --- a/testsuites/sptests/ChangeLog +++ b/testsuites/sptests/ChangeLog @@ -1,5 +1,12 @@ 2009-07-30 Joel Sherrill <joel.sherrill@OARcorp.com> + * sp42/Makefile.am, sp42/init.c, sp42/sp42.scn: Test was testing the + wrong thing in a cpp macro. Added contents to screen file and add + documentation file. + * sp42/sp42.doc: New file. + +2009-07-30 Joel Sherrill <joel.sherrill@OARcorp.com> + * spintrcritical16/spintrcritical16.doc: Remove junk and typos. 2009-07-30 Joel Sherrill <joel.sherrill@OARcorp.com> diff --git a/testsuites/sptests/sp42/Makefile.am b/testsuites/sptests/sp42/Makefile.am index efcb6f3e76..49fa0a0638 100644 --- a/testsuites/sptests/sp42/Makefile.am +++ b/testsuites/sptests/sp42/Makefile.am @@ -8,6 +8,7 @@ rtems_tests_PROGRAMS = sp42 sp42_SOURCES = init.c dist_rtems_tests_DATA = sp42.scn +dist_rtems_tests_DATA += sp42.doc include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg include $(top_srcdir)/../automake/compile.am diff --git a/testsuites/sptests/sp42/init.c b/testsuites/sptests/sp42/init.c index 54e24080f9..a99ee7942b 100644 --- a/testsuites/sptests/sp42/init.c +++ b/testsuites/sptests/sp42/init.c @@ -32,8 +32,7 @@ void do_test( * Somewhat randomly sorted to ensure than if discipline is FIFO, run-time * behavior won't be the same when released. */ -#if (RTEMS_MAXIMUM_PRIORITY >= 64) -rtems_task_priority Priorities[MAX_TASKS] = { +rtems_task_priority Priorities_High[MAX_TASKS] = { 37, 37, 37, 37, /* backward - more 2-n */ 2, 2, 2, 2, /* forward - multiple are on 2-n chain */ 4, 3, /* forward - search forward arbitrary */ @@ -41,8 +40,8 @@ rtems_task_priority Priorities[MAX_TASKS] = { 38, 37, /* backward - search backward arbitrary */ 34, 34, 34, 34, /* backward - multple on 2-n chain */ }; -#else -rtems_task_priority Priorities[MAX_TASKS] = { + +rtems_task_priority Priorities_Low[MAX_TASKS] = { 13, 13, 13, 13, /* backward - more 2-n */ 2, 2, 2, 2, /* forward - multiple are on 2-n chain */ 4, 3, /* forward - search forward arbitrary */ @@ -50,8 +49,8 @@ rtems_task_priority Priorities[MAX_TASKS] = { 14, 13, /* backward - search backward arbitrary */ 12, 12, 12, 12, /* backward - multple on 2-n chain */ }; -#endif +rtems_task_priority *Priorities; rtems_id Semaphore; rtems_id Task_id[ MAX_TASKS ]; @@ -149,11 +148,25 @@ rtems_task Init( rtems_task_argument argument ) { - puts( "\n\n*** START OF TEST 40 ***" ); + puts( "\n\n*** START OF TEST 42 ***" ); + + if (RTEMS_MAXIMUM_PRIORITY == 255) + Priorities = Priorities_High; + else if (RTEMS_MAXIMUM_PRIORITY == 15) + Priorities = Priorities_Low; + else { + puts( "Test only supports 256 or 16 configured priority levels" ); + rtems_test_exit( 0 ); + } + + if ( sizeof(Priorities_Low) / sizeof(rtems_task_priority) != MAX_TASKS ) { + puts( "Priorities_Low table does not have right number of entries" ); + rtems_test_exit( 0 ); + } - if ( sizeof( Priorities ) / sizeof( rtems_task_priority ) != MAX_TASKS ) { - puts( "Priorities table does not have right number of entries" ); - exit( 0 ); + if ( sizeof(Priorities_High) / sizeof(rtems_task_priority) != MAX_TASKS ) { + puts( "Priorities_High table does not have right number of entries" ); + rtems_test_exit( 0 ); } puts( "Exercising blocking discipline w/extract in FIFO order " ); @@ -171,7 +184,7 @@ rtems_task Init( do_test( RTEMS_PRIORITY, FALSE ); puts( "*** END OF TEST 42 ***" ); - exit(0); + rtems_test_exit(0); } /**************** START OF CONFIGURATION INFORMATION ****************/ diff --git a/testsuites/sptests/sp42/sp42.doc b/testsuites/sptests/sp42/sp42.doc new file mode 100644 index 0000000000..9b7f6abfc9 --- /dev/null +++ b/testsuites/sptests/sp42/sp42.doc @@ -0,0 +1,38 @@ +# +# $Id$ +# +# COPYRIGHT (c) 1989-2009. +# On-Line Applications Research Corporation (OAR). +# +# The license and distribution terms for this file may be +# found in the file LICENSE in this distribution or at +# http://www.rtems.com/license/LICENSE. +# + +This file describes the directives and concepts tested by this test set. + +test set name: sp42 + +directives: + + rtems_semaphore_create + rtems_semaphore_obtain + rtems_semaphore_release + rtems_semaphore_delete + rtems_task_create + rtems_task_delete + rtems_task_start + really exercising various Thread Queue capabilities: + _Thread_queue_Enqueue_FIFO + _Thread_queue_Enqueue_priority + _Thread_queue_Dequeue_FIFO + _Thread_queue_Dequeue_priority + +concepts: + ++ This test is very carefully constructed to exercise the data structure + used to implement the priority blocking chains in the Thread Queue. The + task priorities used force forward and reverse searches and use of the + 2-n chains ++ This test also ensures that the dequeues are performed in the correct + order. diff --git a/testsuites/sptests/sp42/sp42.scn b/testsuites/sptests/sp42/sp42.scn index e69de29bb2..01adcf729d 100644 --- a/testsuites/sptests/sp42/sp42.scn +++ b/testsuites/sptests/sp42/sp42.scn @@ -0,0 +1,47 @@ +*** START OF TEST 42 *** +Exercising blocking discipline w/extract in FIFO order +Exercising blocking discipline w/unblock in FIFO order +TA00 - unblocked - OK +TA01 - unblocked - OK +TA02 - unblocked - OK +TA03 - unblocked - OK +TA04 - unblocked - OK +TA05 - unblocked - OK +TA06 - unblocked - OK +TA07 - unblocked - OK +TA08 - unblocked - OK +TA09 - unblocked - OK +TA10 - unblocked - OK +TA11 - unblocked - OK +TA12 - unblocked - OK +TA13 - unblocked - OK +TA14 - unblocked - OK +TA15 - unblocked - OK +TA16 - unblocked - OK +TA17 - unblocked - OK +TA18 - unblocked - OK +TA19 - unblocked - OK +<pause - screen 2> +Exercising blocking discipline w/extract in priority order +Exercising blocking discipline w/unblock in priority order +TA04 - unblocked - OK +TA05 - unblocked - OK +TA06 - unblocked - OK +TA07 - unblocked - OK +TA09 - unblocked - OK +TA10 - unblocked - OK +TA11 - unblocked - OK +TA12 - unblocked - OK +TA13 - unblocked - OK +TA08 - unblocked - OK +TA16 - unblocked - OK +TA17 - unblocked - OK +TA18 - unblocked - OK +TA19 - unblocked - OK +TA00 - unblocked - OK +TA01 - unblocked - OK +TA02 - unblocked - OK +TA03 - unblocked - OK +TA15 - unblocked - OK +TA14 - unblocked - OK +*** END OF TEST 42 *** |