diff options
author | Glenn Humphrey <glenn.humphrey@oarcorp.com> | 2007-10-10 20:58:48 +0000 |
---|---|---|
committer | Glenn Humphrey <glenn.humphrey@oarcorp.com> | 2007-10-10 20:58:48 +0000 |
commit | ba3e1a4fafa6c5f1c1ad731d33c84e41ccba870b (patch) | |
tree | 0501bf07547f0ffe4383fb97a5fd4373a10ee19a /c/src/ada-tests/sptests/sp09/sptest.adb | |
parent | 2007-10-10 Glenn Humphrey <glenn.humphrey@OARcorp.com> (diff) | |
download | rtems-ba3e1a4fafa6c5f1c1ad731d33c84e41ccba870b.tar.bz2 |
2007-10-10 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* configure.ac, samples/base_sp/base_sp.scn, samples/base_sp/config.h,
samples/base_sp/sptest.adb, samples/hello/config.h,
samples/ticker/config.h, samples/ticker/ticker.scn,
sptests/Makefile.am, sptests/sp01/sp01.scn, sptests/sp02/config.h,
sptests/sp02/sp02.scn, sptests/sp03/config.h, sptests/sp03/sp03.scn,
sptests/sp04/sp04.scn, sptests/sp04/sptest.adb,
sptests/sp05/config.h, sptests/sp05/sp05.scn, sptests/sp06/config.h,
sptests/sp07/config.h, sptests/sp07/sp07.scn,
sptests/sp07/sptest.adb, sptests/sp07/sptest.ads,
sptests/sp08/config.h, sptests/sp08/sp08.scn,
sptests/sp09/Makefile.am, sptests/sp09/config.h,
sptests/sp09/sp09.scn, sptests/sp09/sptest.adb,
sptests/sp09/sptest.ads, sptests/sp11/config.h,
sptests/sp11/sp11.scn, sptests/sp12/config.h, sptests/sp12/sp12.scn,
sptests/sp13/config.h, sptests/sp13/sp13.scn,
sptests/sp13/sptest.adb, sptests/sp14/config.h,
sptests/sp14/sp14.scn, sptests/sp15/config.h, sptests/sp15/sp15.scn,
sptests/sp16/config.h, sptests/sp16/sp16.scn,
sptests/sp16/sptest.adb, sptests/sp17/config.h,
sptests/sp19/config.h, sptests/sp19/sp19.scn, sptests/sp20/config.h,
sptests/sp20/sp20.scn, sptests/sp22/config.h, sptests/sp22/sp22.scn,
sptests/sp23/config.h, sptests/sp23/sp23.scn, sptests/sp24/config.h,
sptests/sp24/sp24.scn, sptests/sp25/config.h, sptests/sp25/sp25.scn,
support/init.c, support/test_support.adb, support/test_support.ads,
tmtests/tm09/config.h, tmtests/tm20/tmtest.adb,
tmtests/tmoverhd/dummy_rtems.adb, tmtests/tmoverhd/dummy_rtems.ads,
tmtests/tmoverhd/tmtest.adb, tmtests/tmoverhd/tmtest.ads: Updated
tests so that they would all compile and run without errors. Some
tests that are no longer valid using the current binding were
removed. Also updated the .scn files to reflect the current test
output.
* sptests/sp21/.cvsignore, sptests/sp21/Makefile.am,
sptests/sp21/config.h, sptests/sp21/sp21.adb, sptests/sp21/sp21.scn,
sptests/sp21/sptest.adb, sptests/sp21/sptest.ads,
sptests/spsize/.cvsignore, sptests/spsize/Makefile.am,
sptests/spsize/spsize.adb, sptests/spsize/sptest.adb,
sptests/spsize/sptest.ads: Removed.
Diffstat (limited to '')
-rw-r--r-- | c/src/ada-tests/sptests/sp09/sptest.adb | 397 |
1 files changed, 133 insertions, 264 deletions
diff --git a/c/src/ada-tests/sptests/sp09/sptest.adb b/c/src/ada-tests/sptests/sp09/sptest.adb index ddd67030e6..d2d6429663 100644 --- a/c/src/ada-tests/sptests/sp09/sptest.adb +++ b/c/src/ada-tests/sptests/sp09/sptest.adb @@ -10,7 +10,7 @@ -- -- -- --- COPYRIGHT (c) 1989-1997. +-- COPYRIGHT (c) 1989-2007. -- On-Line Applications Research Corporation (OAR). -- -- The license and distribution terms for this file may in @@ -69,22 +69,6 @@ package body SPTEST is SPTEST.PERIOD_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); --- RTEMS.TASK_CREATE( --- SPTEST.TASK_NAME( 1 ), --- 4, --- 10, --- RTEMS.DEFAULT_MODES, --- RTEMS.DEFAULT_ATTRIBUTES, --- SPTEST.TASK_ID( 1 ), --- STATUS --- ); --- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( --- STATUS, --- RTEMS.INVALID_SIZE, --- "TASK_CREATE WITH ILLEGAL STACK SIZE" --- ); - TEXT_IO.PUT_LINE( "INIT - task_create - INVALID_SIZE -- NOT CHECKED" ); - RTEMS.TASK_CREATE( SPTEST.TASK_NAME( 1 ), 0, @@ -154,20 +138,6 @@ package body SPTEST is --PAGE -- --- SERVICE_ROUTINE --- - - procedure SERVICE_ROUTINE ( - IGNORED : in RTEMS.VECTOR_NUMBER - ) is - begin - - NULL; - - end SERVICE_ROUTINE; - ---PAGE --- -- SCREEN_1 -- @@ -187,20 +157,24 @@ package body SPTEST is ); TEXT_IO.PUT_LINE( "TA1 - task_delete - INVALID_ID" ); --- RTEMS.TASK_GET_NOTE( RTEMS.SELF, --- RTEMS.NOTEPAD_INDEX'LAST + 10, --- NOTEPAD_VALUE, --- STATUS --- ); --- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( --- STATUS, --- RTEMS.INVALID_NUMBER, --- "TASK_GET_NOTE WITH ILLEGAL NOTEPAD" --- ); --- TEXT_IO.PUT_LINE( "TA1 - task_get_note - INVALID_NUMBER" ); - TEXT_IO.PUT_LINE( - "TA1 - task_get_note - INVALID_NUMBER -- constraint error" - ); + begin + RTEMS.TASK_GET_NOTE( RTEMS.SELF, + RTEMS.NOTEPAD_INDEX'LAST + 10, + NOTEPAD_VALUE, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NUMBER, + "TASK_GET_NOTE WITH ILLEGAL NOTEPAD" + ); + TEXT_IO.PUT_LINE( "TA1 - task_get_note - INVALID_NUMBER" ); + exception + when others => + TEXT_IO.PUT_LINE( + "TA1 - task_get_note - INVALID_NUMBER -- constraint error" + ); + end; RTEMS.TASK_GET_NOTE( 100, @@ -252,11 +226,19 @@ package body SPTEST is TEXT_IO.PUT_LINE( "TA1 - task_ident - local INVALID_NAME" ); RTEMS.TASK_IDENT( 100, 2, SPTEST.JUNK_ID, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NODE, - "TASK_IDENT WITH ILLEGAL NODE" - ); + if TEST_SUPPORT.Is_Configured_Multiprocessing then + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NODE, + "TASK_IDENT WITH ILLEGAL NODE" + ); + else + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "TASK_IDENT WITH ILLEGAL NODE" + ); + end if; TEXT_IO.PUT_LINE( "TA1 - task_ident - INVALID_NODE" ); RTEMS.TASK_RESTART( 100, 0, STATUS ); @@ -283,18 +265,22 @@ package body SPTEST is ); TEXT_IO.PUT_LINE( "TA1 - task_resume - INCORRECT_STATE" ); --- RTEMS.TASK_SET_PRIORITY( RTEMS.SELF, 512, PREVIOUS_PRIORITY, STATUS ); --- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( --- STATUS, --- RTEMS.INVALID_PRIORITY, --- "TASK_SET_PRIORITY WITH ILLEGAL PRIORITY" --- ); --- TEXT_IO.PUT_LINE( --- "TA1 - task_set_priority - INVALID_PRIORITY" --- ); - TEXT_IO.PUT_LINE( - "TA1 - task_set_priority - INVALID_PRIORITY -- constraint error" - ); + begin + RTEMS.TASK_SET_PRIORITY( RTEMS.SELF, 512, PREVIOUS_PRIORITY, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_PRIORITY, + "TASK_SET_PRIORITY WITH ILLEGAL PRIORITY" + ); + TEXT_IO.PUT_LINE( + "TA1 - task_set_priority - INVALID_PRIORITY" + ); + exception + when others => + TEXT_IO.PUT_LINE( + "TA1 - task_set_priority - INVALID_PRIORITY -- constraint error" + ); + end; RTEMS.TASK_SET_PRIORITY( 100, 8, PREVIOUS_PRIORITY, STATUS ); TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( @@ -304,20 +290,24 @@ package body SPTEST is ); TEXT_IO.PUT_LINE( "TA1 - task_set_priority - INVALID_ID" ); --- RTEMS.TASK_SET_NOTE( RTEMS.SELF, --- RTEMS.NOTEPAD_INDEX'LAST + 10, --- NOTEPAD_VALUE, --- STATUS --- ); --- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( --- STATUS, --- RTEMS.INVALID_NUMBER, --- "TASK_SET_NOTE WITH ILLEGAL NOTEPAD" --- ); --- TEXT_IO.PUT_LINE( "TA1 - task_set_note - INVALID_NUMBER" ); - TEXT_IO.PUT_LINE( - "TA1 - task_set_note - INVALID_NUMBER -- constraint error" - ); + begin + RTEMS.TASK_SET_NOTE( RTEMS.SELF, + RTEMS.NOTEPAD_INDEX'LAST + 10, + NOTEPAD_VALUE, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NUMBER, + "TASK_SET_NOTE WITH ILLEGAL NOTEPAD" + ); + TEXT_IO.PUT_LINE( "TA1 - task_set_note - INVALID_NUMBER" ); + exception + when others => + TEXT_IO.PUT_LINE( + "TA1 - task_set_note - INVALID_NUMBER -- constraint error" + ); + end; RTEMS.TASK_SET_NOTE( 100, @@ -583,7 +573,7 @@ package body SPTEST is RTEMS.TASK_CREATE( TASK_NAME, 1, - RTEMS.CONFIGURATION.WORK_SPACE_SIZE, + TEST_SUPPORT.WORK_SPACE_SIZE, RTEMS.DEFAULT_MODES, RTEMS.DEFAULT_ATTRIBUTES, SPTEST.JUNK_ID, @@ -762,20 +752,22 @@ package body SPTEST is ); TEXT_IO.PUT_LINE( "TA1 - task_create - 11 - TOO_MANY" ); - RTEMS.TASK_CREATE( - TASK_NAME, - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.GLOBAL, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.MP_NOT_CONFIGURED, - "TASK_CREATE OF GLOBAL TASK IN SINGLE CPU SYSTEM" - ); + if TEST_SUPPORT.Is_Configured_Multiprocessing then + RTEMS.TASK_CREATE( + TASK_NAME, + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.GLOBAL, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.MP_NOT_CONFIGURED, + "TASK_CREATE OF GLOBAL TASK IN SINGLE CPU SYSTEM" + ); + end if; TEXT_IO.PUT_LINE( "TA1 - task_create - MP_NOT_CONFIGURED" ); end SCREEN_3; @@ -911,7 +903,7 @@ package body SPTEST is RTEMS.SEMAPHORE_CREATE( SPTEST.SEMAPHORE_NAME( 2 ), 1, - RTEMS.BINARY_SEMAPHORE, + (RTEMS.BINARY_SEMAPHORE or RTEMS.PRIORITY or RTEMS.INHERIT_PRIORITY), RTEMS.NO_PRIORITY, SPTEST.SEMAPHORE_ID( 2 ), STATUS @@ -987,19 +979,21 @@ package body SPTEST is ); TEXT_IO.PUT_LINE("TA1 - semaphore_create - INVALID_NUMBER"); - RTEMS.SEMAPHORE_CREATE( - SPTEST.SEMAPHORE_NAME( 3 ), - 1, - RTEMS.GLOBAL, - RTEMS.NO_PRIORITY, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.MP_NOT_CONFIGURED, - "SEMAPHORE_CREATE OF MP_NOT_CONFIGURED" - ); + if TEST_SUPPORT.Is_Configured_Multiprocessing then + RTEMS.SEMAPHORE_CREATE( + SPTEST.SEMAPHORE_NAME( 3 ), + 1, + RTEMS.GLOBAL, + RTEMS.NO_PRIORITY, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.MP_NOT_CONFIGURED, + "SEMAPHORE_CREATE OF MP_NOT_CONFIGURED" + ); + end if; TEXT_IO.PUT_LINE("TA1 - semaphore_create - MP_NOT_CONFIGURED"); RTEMS.SEMAPHORE_DELETE( 100, STATUS ); @@ -1239,19 +1233,21 @@ package body SPTEST is "TA1 - message_queue_create - Q 1 - INVALID_NAME" ); - RTEMS.MESSAGE_QUEUE_CREATE( - SPTEST.QUEUE_NAME( 1 ), - 1, - 16, - RTEMS.GLOBAL, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.MP_NOT_CONFIGURED, - "MESSAGE_QUEUE_CREATE OF MP NOT CONFIGURED" - ); + if TEST_SUPPORT.Is_Configured_Multiprocessing then + RTEMS.MESSAGE_QUEUE_CREATE( + SPTEST.QUEUE_NAME( 1 ), + 1, + 16, + RTEMS.GLOBAL, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.MP_NOT_CONFIGURED, + "MESSAGE_QUEUE_CREATE OF MP NOT CONFIGURED" + ); + end if; TEXT_IO.PUT_LINE( "TA1 - message_queue_create - Q 1 - MP_NOT_CONFIGURED"); @@ -1643,56 +1639,10 @@ package body SPTEST is procedure SCREEN_9 is - CONVERTED : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - OLD_SERVICE_ROUTINE : RTEMS.ADDRESS; + CONVERTED : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; begin --- RTEMS.INTERRUPT_CATCH( --- SPTEST.SERVICE_ROUTINE'ACCESS, --- 500, --- OLD_SERVICE_ROUTINE, --- STATUS --- ); --- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( --- STATUS, --- RTEMS.INVALID_NUMBER, --- "INTERRUPT_CATCH WITH INVALID VECTOR" --- ); --- TEXT_IO.PUT_LINE( "TA1 - interrupt_catch - INVALID_NUMBER" ); - TEXT_IO.PUT_LINE( - "TA1 - interrupt_catch - INVALID_NUMBER -- constraint error" - ); - - RTEMS.INTERRUPT_CATCH( - RTEMS.NULL_ADDRESS, - 3, - OLD_SERVICE_ROUTINE, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ADDRESS, - "INTERRUPT_CATCH WITH INVALID HANDLER" - ); - TEXT_IO.PUT_LINE( "TA1 - interrupt_catch - INVALID_ADDRESS" ); - - RTEMS.SIGNAL_SEND( 100, RTEMS.SIGNAL_1, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "SIGNAL_SEND WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - signal_send - INVALID_ID" ); - - RTEMS.SIGNAL_SEND( RTEMS.SELF, RTEMS.SIGNAL_16, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_DEFINED, - "SIGNAL_SEND WITH NO HANDLER" - ); - TEXT_IO.PUT_LINE( "TA1 - signal_send - NOT_DEFINED" ); - RTEMS.PORT_CREATE( 0, SPTEST.INTERNAL_PORT_AREA'ADDRESS, @@ -2077,20 +2027,22 @@ package body SPTEST is "TA1 - partition_create - length < buffer size - INVALID_SIZE" ); - RTEMS.PARTITION_CREATE( - SPTEST.PARTITION_NAME( 1 ), - SPTEST.PARTITION_GOOD_AREA'ADDRESS, - 128, - 64, - RTEMS.GLOBAL, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.MP_NOT_CONFIGURED, - "PARTITION_CREATE OF GLOBAL" - ); + if TEST_SUPPORT.Is_Configured_Multiprocessing then + RTEMS.PARTITION_CREATE( + SPTEST.PARTITION_NAME( 1 ), + SPTEST.PARTITION_GOOD_AREA'ADDRESS, + 128, + 64, + RTEMS.GLOBAL, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.MP_NOT_CONFIGURED, + "PARTITION_CREATE OF GLOBAL" + ); + end if; TEXT_IO.PUT_LINE("TA1 - partition_create - MP_NOT_CONFIGURED"); RTEMS.PARTITION_CREATE( @@ -2323,7 +2275,7 @@ package body SPTEST is RTEMS.REGION_CREATE( SPTEST.REGION_NAME( 1 ), SPTEST.REGION_GOOD_AREA'ADDRESS, - 16#40#, + 34, 34, RTEMS.DEFAULT_ATTRIBUTES, SPTEST.JUNK_ID, @@ -2653,89 +2605,6 @@ package body SPTEST is TIME : RTEMS.TIME_OF_DAY; STATUS : RTEMS.STATUS_CODES; begin - - RTEMS.IO_CLOSE( - RTEMS.DEVICE_MAJOR_NUMBER'LAST, - 0, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NUMBER, - "IO_CLOSE WITH BAD MAJOR NUMBER" - ); - TEXT_IO.PUT_LINE("TA1 - io_close - INVALID_NUMBER"); - - RTEMS.IO_CONTROL( - RTEMS.DEVICE_MAJOR_NUMBER'LAST, - 0, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NUMBER, - "IO_CONTROL WITH BAD MAJOR NUMBER" - ); - TEXT_IO.PUT_LINE( - "TA1 - io_control - INVALID_NUMBER" - ); - - RTEMS.IO_INITIALIZE( - RTEMS.DEVICE_MAJOR_NUMBER'LAST, - 0, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NUMBER, - "IO_INITIALIZE WITH BAD MAJOR NUMBER" - ); - TEXT_IO.PUT_LINE( - "TA1 - io_initialize - INVALID_NUMBER" - ); - - RTEMS.IO_OPEN( - RTEMS.DEVICE_MAJOR_NUMBER'LAST, - 0, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NUMBER, - "IO_OPEN WITH BAD MAJOR NUMBER" - ); - TEXT_IO.PUT_LINE( "TA1 - io_open - INVALID_NUMBER" ); - - RTEMS.IO_READ( - RTEMS.DEVICE_MAJOR_NUMBER'LAST, - 0, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NUMBER, - "IO_READ WITH BAD MAJOR NUMBER" - ); - TEXT_IO.PUT_LINE( "TA1 - io_read - INVALID_NUMBER" ); - - RTEMS.IO_WRITE( - RTEMS.DEVICE_MAJOR_NUMBER'LAST, - 0, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NUMBER, - "IO_WRITE WITH BAD MAJOR NUMBER" - ); - TEXT_IO.PUT_LINE( "TA1 - io_write - INVALID_NUMBER" ); - TIME := ( 2000, 12, 31, 23, 59, 59, 0 ); RTEMS.CLOCK_SET( TIME, STATUS ); TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); |