summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/sptests/ChangeLog12
-rw-r--r--testsuites/sptests/sp07/init.c8
-rw-r--r--testsuites/sptests/sp12/init.c12
-rw-r--r--testsuites/sptests/sp12/pridrv.c8
-rw-r--r--testsuites/sptests/sp12/pritask.c4
-rw-r--r--testsuites/sptests/sp12/system.h4
-rw-r--r--testsuites/sptests/sp16/system.h4
-rw-r--r--testsuites/sptests/sp25/system.h4
-rw-r--r--testsuites/sptests/sp26/task1.c4
-rw-r--r--testsuites/sptests/sp28/init.c6
-rw-r--r--testsuites/sptests/sp29/init.c2
-rw-r--r--testsuites/sptests/sp35/priinv.c12
-rw-r--r--testsuites/sptests/sp42/init.c11
13 files changed, 61 insertions, 30 deletions
diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog
index c92f6939ef..bbfcc1905d 100644
--- a/testsuites/sptests/ChangeLog
+++ b/testsuites/sptests/ChangeLog
@@ -1,3 +1,15 @@
+2008-12-14 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * sp07/init.c, sp12/init.c, sp12/pridrv.c, sp12/pritask.c,
+ sp12/system.h, sp16/system.h, sp25/system.h, sp26/task1.c,
+ sp28/init.c, sp29/init.c, sp35/priinv.c, sp42/init.c: Run all tests
+ successfully with maxixum number of priorities as 16 instead of 256.
+ This was done by temporarily modifying the score priority.h maximum.
+ This allowed testing of all API code to ensure that it worked
+ properly with a reduced number of priorities. Most modifications were
+ to switch from hard-coded maximum to using the API provided methods
+ to determine maximum number of priority levels.
+
2008-12-04 Joel Sherrill <joel.sherrill@oarcorp.com>
* sp46/sp46.scn: Add screen missed earlier.
diff --git a/testsuites/sptests/sp07/init.c b/testsuites/sptests/sp07/init.c
index f26efaa9ec..0d34a58699 100644
--- a/testsuites/sptests/sp07/init.c
+++ b/testsuites/sptests/sp07/init.c
@@ -11,7 +11,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -132,9 +132,10 @@ rtems_task Init(
);
directive_failed( status, "rtems_task_create of TA2" );
+#define TA3_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 4)
status = rtems_task_create(
Task_name[ 3 ],
- 250,
+ TA3_PRIORITY,
RTEMS_MINIMUM_STACK_SIZE * 2,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
@@ -142,9 +143,10 @@ rtems_task Init(
);
directive_failed( status, "rtems_task_create of TA3" );
+#define TA4_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 1)
status = rtems_task_create(
Task_name[ 4 ],
- 254,
+ TA4_PRIORITY,
RTEMS_MINIMUM_STACK_SIZE * 2,
RTEMS_DEFAULT_MODES,
RTEMS_DEFAULT_ATTRIBUTES,
diff --git a/testsuites/sptests/sp12/init.c b/testsuites/sptests/sp12/init.c
index 5a59e5a0bb..f68e9d477e 100644
--- a/testsuites/sptests/sp12/init.c
+++ b/testsuites/sptests/sp12/init.c
@@ -11,7 +11,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -79,14 +79,14 @@ rtems_task Init(
Priority_test_driver( 0 );
puts( "INIT - Backward priority queue test" );
- Priority_test_driver( 32 );
+ Priority_test_driver( (RTEMS_MAXIMUM_PRIORITY / 2) + 1 );
rtems_test_pause();
puts( "INIT - Binary Semaphore and Priority Inheritance Test" );
status = rtems_semaphore_delete( Semaphore_id[ 2 ] );
- directive_failed( status, "rtems_semaphore_delete of SM2" );
+ directive_failed( status, "rtems_semaphore_delete of SM2 #1" );
puts( "INIT - rtems_semaphore_create - allocated binary semaphore" );
status = rtems_semaphore_create(
@@ -104,7 +104,7 @@ rtems_test_pause();
puts( "INIT - rtems_semaphore_delete - allocated binary semaphore" );
status = rtems_semaphore_delete( Semaphore_id[ 2 ] );
- directive_failed( status, "rtems_semaphore_delete of SM2" );
+ directive_failed( status, "rtems_semaphore_delete of SM2 #2" );
status = rtems_semaphore_create(
Semaphore_name[ 2 ],
@@ -115,12 +115,12 @@ rtems_test_pause();
);
directive_failed( status, "rtems_semaphore_create of priority inherit SM2" );
- Priority_test_driver( 64 );
+ Priority_test_driver( PRIORITY_INHERIT_BASE_PRIORITY );
rtems_test_pause();
status = rtems_semaphore_delete( Semaphore_id[ 2 ] );
- directive_failed( status, "rtems_semaphore_delete of SM2" );
+ directive_failed( status, "rtems_semaphore_delete of SM2 #3" );
status = rtems_semaphore_create(
Semaphore_name[ 2 ],
diff --git a/testsuites/sptests/sp12/pridrv.c b/testsuites/sptests/sp12/pridrv.c
index bcf04f9373..1bd4491909 100644
--- a/testsuites/sptests/sp12/pridrv.c
+++ b/testsuites/sptests/sp12/pridrv.c
@@ -11,7 +11,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -28,7 +28,7 @@ void Priority_test_driver(
)
{
rtems_task_priority previous_priority;
- uint32_t index;
+ uint32_t index;
rtems_status_code status;
for ( index = 1 ; index <= 5 ; index++ ) {
@@ -76,7 +76,7 @@ void Priority_test_driver(
status = rtems_task_wake_after( TICKS_PER_SECOND );
directive_failed( status, "rtems_task_wake_after loop" );
- if ( priority_base == 64 ) {
+ if ( priority_base == PRIORITY_INHERIT_BASE_PRIORITY ) {
if ( index == 4 ) {
status = rtems_task_set_priority(
Priority_task_id[ 5 ],
@@ -110,7 +110,7 @@ void Priority_test_driver(
}
}
- if ( priority_base == 64 ) {
+ if ( priority_base == PRIORITY_INHERIT_BASE_PRIORITY ) {
puts( "PDRV - rtems_task_resume - PRI5" );
status = rtems_task_resume( Priority_task_id[ 5 ] );
directive_failed( status, "rtems_task_resume" );
diff --git a/testsuites/sptests/sp12/pritask.c b/testsuites/sptests/sp12/pritask.c
index 8aa3a0aea4..bd20f181eb 100644
--- a/testsuites/sptests/sp12/pritask.c
+++ b/testsuites/sptests/sp12/pritask.c
@@ -7,7 +7,7 @@
*
* Output parameters: NONE
*
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -46,7 +46,7 @@ rtems_task Priority_task(
);
directive_failed( status, "rtems_semaphore_obtain of SM2" );
- if ( its_priority < 64 ) {
+ if ( its_priority < PRIORITY_INHERIT_BASE_PRIORITY ) {
printf( "PRI%d - WHY AM I HERE? (pri=%d)", its_index, its_priority );
rtems_test_exit( 0 );
}
diff --git a/testsuites/sptests/sp12/system.h b/testsuites/sptests/sp12/system.h
index 38dc80193f..a57e71e381 100644
--- a/testsuites/sptests/sp12/system.h
+++ b/testsuites/sptests/sp12/system.h
@@ -3,7 +3,7 @@
* This include file contains information that is included in every
* function in the test set.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -15,6 +15,8 @@
#include <tmacros.h>
+#define PRIORITY_INHERIT_BASE_PRIORITY 5
+
/* functions */
rtems_task Init(
diff --git a/testsuites/sptests/sp16/system.h b/testsuites/sptests/sp16/system.h
index a6fba316a3..a0600a6fa3 100644
--- a/testsuites/sptests/sp16/system.h
+++ b/testsuites/sptests/sp16/system.h
@@ -3,7 +3,7 @@
* This include file contains information that is included in every
* function in the test set.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -68,7 +68,7 @@ TEST_EXTERN uint8_t Area_2[4096] CPU_STRUCTURE_ALIGNMENT;
TEST_EXTERN uint8_t Area_3[4096] CPU_STRUCTURE_ALIGNMENT;
TEST_EXTERN uint8_t Area_4[8192] CPU_STRUCTURE_ALIGNMENT;
-#define BASE_PRIORITY 140
+#define BASE_PRIORITY ((RTEMS_MAXIMUM_PRIORITY / 2) + 1)
#define Put_address_from_area_1( _to_be_printed ) \
printf( "0x%08lx", \
diff --git a/testsuites/sptests/sp25/system.h b/testsuites/sptests/sp25/system.h
index 9e24e7c49d..29f7f93161 100644
--- a/testsuites/sptests/sp25/system.h
+++ b/testsuites/sptests/sp25/system.h
@@ -3,7 +3,7 @@
* This include file contains information that is included in every
* function in the test set.
*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -52,7 +52,7 @@ TEST_EXTERN uint8_t Area_1[32000] CPU_STRUCTURE_ALIGNMENT;
TEST_EXTERN uint8_t Area_1[64000] CPU_STRUCTURE_ALIGNMENT;
#endif
-#define BASE_PRIORITY 140
+#define BASE_PRIORITY ((RTEMS_MAXIMUM_PRIORITY / 2) + 1)
#define Put_address_from_area_1( _to_be_printed ) \
printf( "0x%08lx", \
diff --git a/testsuites/sptests/sp26/task1.c b/testsuites/sptests/sp26/task1.c
index 6f2de0d9d5..86f04fe840 100644
--- a/testsuites/sptests/sp26/task1.c
+++ b/testsuites/sptests/sp26/task1.c
@@ -1,5 +1,5 @@
/*
- * COPYRIGHT (c) 1989-1999.
+ * COPYRIGHT (c) 1989-2008.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -85,7 +85,7 @@ createTask (char c, rtems_id *tid)
rtems_status_code sc;
sc = rtems_task_create (rtems_build_name('S','u','b',c),
- 100,
+ RTEMS_MAXIMUM_PRIORITY - 1,
RTEMS_MINIMUM_STACK_SIZE * 4,
RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
diff --git a/testsuites/sptests/sp28/init.c b/testsuites/sptests/sp28/init.c
index 89f8c2a5ad..ce7c5e738e 100644
--- a/testsuites/sptests/sp28/init.c
+++ b/testsuites/sptests/sp28/init.c
@@ -96,7 +96,7 @@ starttask (int arg)
rtems_status_code sc;
sc = rtems_task_create(rtems_build_name ('S', 'R', 'V', arg + 'A'),
- 100,
+ RTEMS_MAXIMUM_PRIORITY - 1,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
@@ -280,7 +280,7 @@ void test_delete_from_other_task(void)
directive_failed( sc, "add for other task case" );
sc = rtems_task_create(rtems_build_name ('O', 'T', 'H', 'R'),
- 100,
+ RTEMS_MAXIMUM_PRIORITY - 1,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
@@ -327,7 +327,7 @@ void test_delete_as_side_effect(void)
test_dtor_ran = 0;
sc = rtems_task_create(rtems_build_name ('O', 'T', 'H', 'R'),
- 100,
+ RTEMS_MAXIMUM_PRIORITY - 1,
RTEMS_MINIMUM_STACK_SIZE,
RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
diff --git a/testsuites/sptests/sp29/init.c b/testsuites/sptests/sp29/init.c
index d40200b0c3..ffe40bd6e0 100644
--- a/testsuites/sptests/sp29/init.c
+++ b/testsuites/sptests/sp29/init.c
@@ -49,7 +49,7 @@ startTask (rtems_id arg)
rtems_status_code sc;
sc = rtems_task_create (rtems_build_name ('S', 'R', 'V', 'A'),
- 100,
+ RTEMS_MAXIMUM_PRIORITY - 1,
RTEMS_MINIMUM_STACK_SIZE * 2,
RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0),
RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL,
diff --git a/testsuites/sptests/sp35/priinv.c b/testsuites/sptests/sp35/priinv.c
index ec677c33e0..6d1e4506cb 100644
--- a/testsuites/sptests/sp35/priinv.c
+++ b/testsuites/sptests/sp35/priinv.c
@@ -410,9 +410,10 @@ rtems_task Init(rtems_task_argument ignored)
/* -- Medium-prio Test Tasks --- */
for (i = 0; i < NofMediumTask_C; i++) {
+#define MEDIUM_PRIORITY ((RTEMS_MAXIMUM_PRIORITY / 2) + 1)
status = rtems_task_create(
rtems_build_name('M','E','D','0'+i), /* Name */
- 100, /* Priority */
+ MEDIUM_PRIORITY, /* Priority */
RTEMS_MINIMUM_STACK_SIZE*2, /* Stack size (8KB) */
RTEMS_DEFAULT_MODES | RTEMS_NO_ASR, /* Mode */
RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, /* Attributes */
@@ -425,9 +426,10 @@ rtems_task Init(rtems_task_argument ignored)
}
/* -- High-prio Test Task --- */
+#define HIGH_PRIORITY ((RTEMS_MAXIMUM_PRIORITY / 2))
status = rtems_task_create(
rtems_build_name('H','I','G','H'), /* Name */
- 10, /* Priority */
+ HIGH_PRIORITY, /* Priority */
RTEMS_MINIMUM_STACK_SIZE*2, /* Stack size (8KB) */
RTEMS_DEFAULT_MODES | RTEMS_NO_ASR, /* Mode */
RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, /* Attributes */
@@ -439,9 +441,10 @@ rtems_task Init(rtems_task_argument ignored)
directive_failed( status, "rtems_task_start (HIGH)" );
/* -- Low-prio Test Task --- */
+#define LOW_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 1)
status = rtems_task_create(
rtems_build_name('L','O','W',' '), /* Name */
- 200, /* Priority */
+ LOW_PRIORITY, /* Priority */
RTEMS_MINIMUM_STACK_SIZE*2, /* Stack size (8KB) */
RTEMS_DEFAULT_MODES | RTEMS_NO_ASR, /* Mode */
RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, /* Attributes */
@@ -453,9 +456,10 @@ rtems_task Init(rtems_task_argument ignored)
directive_failed( status, "rtems_task_start (LOW)" );
/* -- HW Simulator Task --- */
+#define HWTASK_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 2)
status = rtems_task_create(
rtems_build_name('H','W','S','M'), /* Name */
- 240, /* Priority */
+ HWTASK_PRIORITY, /* Priority */
RTEMS_MINIMUM_STACK_SIZE*2, /* Stack size (8KB) */
RTEMS_DEFAULT_MODES | RTEMS_NO_ASR, /* Mode */
RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, /* Attributes */
diff --git a/testsuites/sptests/sp42/init.c b/testsuites/sptests/sp42/init.c
index 66934a594d..da02b1cbb6 100644
--- a/testsuites/sptests/sp42/init.c
+++ b/testsuites/sptests/sp42/init.c
@@ -25,6 +25,7 @@
* 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] = {
37, 37, 37, 37, /* backward - more 2-n */
2, 2, 2, 2, /* forward - multiple are on 2-n chain */
@@ -33,6 +34,16 @@ 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] = {
+ 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 */
+ 3, 3, 3, 3, /* forward - more 2-n */
+ 14, 13, /* backward - search backward arbitrary */
+ 12, 12, 12, 12, /* backward - multple on 2-n chain */
+};
+#endif
rtems_id Semaphore;