summaryrefslogtreecommitdiffstats
path: root/c/src/ada-tests/sptests/sp07
diff options
context:
space:
mode:
authorGlenn Humphrey <glenn.humphrey@oarcorp.com>2007-10-10 20:58:48 +0000
committerGlenn Humphrey <glenn.humphrey@oarcorp.com>2007-10-10 20:58:48 +0000
commitba3e1a4fafa6c5f1c1ad731d33c84e41ccba870b (patch)
tree0501bf07547f0ffe4383fb97a5fd4373a10ee19a /c/src/ada-tests/sptests/sp07
parent2007-10-10 Glenn Humphrey <glenn.humphrey@OARcorp.com> (diff)
downloadrtems-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 'c/src/ada-tests/sptests/sp07')
-rw-r--r--c/src/ada-tests/sptests/sp07/config.h4
-rw-r--r--c/src/ada-tests/sptests/sp07/sp07.scn26
-rw-r--r--c/src/ada-tests/sptests/sp07/sptest.adb151
-rw-r--r--c/src/ada-tests/sptests/sp07/sptest.ads6
4 files changed, 129 insertions, 58 deletions
diff --git a/c/src/ada-tests/sptests/sp07/config.h b/c/src/ada-tests/sptests/sp07/config.h
index 3a675dfcf6..71654e01bb 100644
--- a/c/src/ada-tests/sptests/sp07/config.h
+++ b/c/src/ada-tests/sptests/sp07/config.h
@@ -2,7 +2,7 @@
*
* This include file defines the Configuration Table for this test.
*
- * COPYRIGHT (c) 1989-1997.
+ * COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may in
@@ -30,6 +30,8 @@
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 20
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 10
+#define CONFIGURE_MAXIMUM_TASKS 5
+
#include <rtems/confdefs.h>
/* end of include file */
diff --git a/c/src/ada-tests/sptests/sp07/sp07.scn b/c/src/ada-tests/sptests/sp07/sp07.scn
index 3f171037a7..b048411960 100644
--- a/c/src/ada-tests/sptests/sp07/sp07.scn
+++ b/c/src/ada-tests/sptests/sp07/sp07.scn
@@ -1,16 +1,16 @@
*** TEST 7 ***
-TASKS_CREATE - TA1 - created.
-TASKS_CREATE - TA2 - created.
-TASKS_CREATE - TA3 - created.
-TASKS_CREATE - TA4 - created.
-TASKS_START - TA1 - started.
-TASKS_START - TA2 - started.
-TASKS_START - TA3 - started.
-TASKS_START - TA4 - started.
-TASKS_RESTART - TA3 - restarted.
+TASKS_CREATE - TA1 - created.
+TASKS_CREATE - TA2 - created.
+TASKS_CREATE - TA3 - created.
+TASKS_CREATE - TA4 - created.
+TASKS_START - TA1 - started.
+TASKS_START - TA2 - started.
+TASKS_START - TA3 - started.
+TASKS_START - TA4 - started.
+TASKS_RESTART - TA3 - restarted.
INIT - task_set_note - set TA1's NOTEPAD_8 to TA1's initial priority: 4
INIT - task_set_note - set TA2's NOTEPAD_8 to TA2's initial priority: 4
-<pause>
+<pause>
TA1 - task_set_priority - get initial priority of self: 4
TA1 - task_get_note - get NOTEPAD_8 - current priority: 4
TA1 - task_set_note - set TA2's NOTEPAD_8: 3
@@ -24,9 +24,9 @@ TA1 - task_set_priority - set TA2's priority: 1
TA2 - task_get_note - get NOTEPAD_8 - current priority: 1
TA2 - task_suspend - suspend TA1
TA2 - task_set_priority - set priority of TA1 ( blocked )
-TASKS_DELETE - TA2 deleting TA1
-TASKS_DELETE - TA2 deleting TA3
-TASKS_DELETE - TA2 deleting TA2
+TASKS_DELETE - TA2 deleting TA1
+TASKS_DELETE - TA2 deleting TA3
+TASKS_DELETE - TA2 deleting TA2
TA4 - exitting task
TASK_EXITTED - user extension invoked correctly
*** END OF TEST 7 ***
diff --git a/c/src/ada-tests/sptests/sp07/sptest.adb b/c/src/ada-tests/sptests/sp07/sptest.adb
index 5131fd57f8..2090e5cda7 100644
--- a/c/src/ada-tests/sptests/sp07/sptest.adb
+++ b/c/src/ada-tests/sptests/sp07/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
@@ -28,6 +28,89 @@ with UNSIGNED32_IO;
package body SPTEST is
+ type Task_Event_Type is (
+ Created,
+ Deleted,
+ Restarted,
+ Started
+ );
+
+ type Task_Event is record
+ The_Event : Task_Event_Type;
+ Task1 : RTEMS.Unsigned32;
+ Task2 : RTEMS.Unsigned32;
+ end record;
+
+ Task_Events : array (1 .. 10) of Task_Event;
+ Task_Events_Index : Natural := Task_Events'First;
+
+ procedure Log_Task_Event (
+ The_Event : in Task_Event_Type;
+ Task1 : in RTEMS.Unsigned32;
+ Task2 : in RTEMS.Unsigned32
+ ) is
+ begin
+ if Task_Events_Index = Task_Events'Last then
+ RTEMS.Fatal_Error_Occurred ( 1 ); -- no other choice
+ else
+ Task_Events (Task_Events_Index).The_Event := The_Event;
+ Task_Events (Task_Events_Index).Task1 := Task1;
+ Task_Events (Task_Events_Index).Task2 := Task2;
+ Task_Events_Index := Task_Events_Index + 1;
+ end if;
+ end Log_Task_Event;
+
+ procedure Flush_Task_Event_Log is
+ begin
+ for I in Task_Events'First .. Task_Events_Index - 1 loop
+
+ case Task_Events (I).The_Event is
+
+ when Created =>
+ TEXT_IO.PUT( "TASKS_CREATE - " );
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( Task_Events (I).Task1 ),
+ FALSE
+ );
+ TEXT_IO.PUT_LINE( " - created." );
+
+ when Deleted =>
+ TEXT_IO.PUT( "TASKS_DELETE - " );
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( Task_Events (I).Task1 ),
+ FALSE
+ );
+
+ TEXT_IO.PUT( " deleting " );
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( Task_Events (I).Task2 ),
+ TRUE
+ );
+
+ when Restarted =>
+ TEXT_IO.PUT( "TASKS_RESTART - " );
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( Task_Events (I).Task1 ),
+ FALSE
+ );
+ TEXT_IO.PUT_LINE( " - restarted." );
+
+ when Started =>
+ TEXT_IO.PUT( "TASKS_START - " );
+ TEST_SUPPORT.PUT_NAME(
+ SPTEST.TASK_NAME( Task_Events (I).Task1 ),
+ FALSE
+ );
+ TEXT_IO.PUT_LINE( " - started." );
+
+ end case;
+ end loop;
+
+ -- Reset the events list
+ Task_Events_Index := Task_Events'First;
+
+ end Flush_Task_Event_Log;
+
--PAGE
--
-- TCB_To_ID
@@ -146,6 +229,8 @@ package body SPTEST is
RTEMS.TASK_RESTART( SPTEST.TASK_ID( 3 ), 0, STATUS );
TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA3" );
+ Flush_Task_Event_Log;
+
RTEMS.TASK_SET_NOTE( SPTEST.TASK_ID( 1 ), 8, 4, STATUS );
TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_NOTE OF TA1" );
TEXT_IO.PUT( "INIT - task_set_note - set TA1's NOTEPAD_8" );
@@ -363,6 +448,8 @@ package body SPTEST is
) is
begin
+ Flush_Task_Event_Log;
+
TEXT_IO.PUT_LINE( "TA4 - exitting task" );
end TASK_4;
@@ -391,23 +478,22 @@ package body SPTEST is
-- TASK_CREATE_EXTENSION
--
- procedure TASK_CREATE_EXTENSION (
+ function TASK_CREATE_EXTENSION (
UNUSED : in RTEMS.TCB_POINTER;
CREATED_TASK : in RTEMS.TCB_POINTER
- ) is
+ ) return RTEMS.Boolean is
begin
if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( CREATED_TASK ) ) > 0 then
- TEXT_IO.PUT( "TASKS_CREATE - " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( CREATED_TASK ) )
- ),
- FALSE
+ Log_Task_Event (
+ Created,
+ TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( CREATED_TASK ) ),
+ 0
);
- TEXT_IO.PUT_LINE( "- created." );
end if;
+ return RTEMS.True;
+
end TASK_CREATE_EXTENSION;
--PAGE
@@ -421,23 +507,12 @@ package body SPTEST is
) is
begin
- if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ) > 0 then
- TEXT_IO.PUT( "TASKS_DELETE - " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) )
- ),
- FALSE
- );
- end if;
-
- if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) ) > 0 then
- TEXT_IO.PUT( "deleting " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) )
- ),
- TRUE
+ if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ) > 0 and
+ TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) ) > 0 then
+ Log_Task_Event (
+ Deleted,
+ TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ),
+ TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) )
);
end if;
@@ -455,14 +530,11 @@ package body SPTEST is
begin
if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RESTARTED_TASK ) ) > 0 then
- TEXT_IO.PUT( "TASKS_RESTART - " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RESTARTED_TASK ) )
- ),
- FALSE
+ Log_Task_Event (
+ Restarted,
+ TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RESTARTED_TASK ) ),
+ 0
);
- TEXT_IO.PUT_LINE( " - restarted." );
end if;
end TASK_RESTART_EXTENSION;
@@ -479,14 +551,11 @@ package body SPTEST is
begin
if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( STARTED_TASK ) ) > 0 then
- TEXT_IO.PUT( "TASKS_START - " );
- TEST_SUPPORT.PUT_NAME(
- SPTEST.TASK_NAME(
- TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( STARTED_TASK ) )
- ),
- FALSE
+ Log_Task_Event (
+ Started,
+ TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( STARTED_TASK ) ),
+ 0
);
- TEXT_IO.PUT_LINE( " - started." );
end if;
end TASK_START_EXTENSION;
diff --git a/c/src/ada-tests/sptests/sp07/sptest.ads b/c/src/ada-tests/sptests/sp07/sptest.ads
index a179f740d9..bc41a147eb 100644
--- a/c/src/ada-tests/sptests/sp07/sptest.ads
+++ b/c/src/ada-tests/sptests/sp07/sptest.ads
@@ -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
@@ -108,10 +108,10 @@ package SPTEST is
-- This subprogram is the TASK_CREATE extension for this test.
--
- procedure TASK_CREATE_EXTENSION (
+ function TASK_CREATE_EXTENSION (
UNUSED : in RTEMS.TCB_POINTER;
CREATED_TASK : in RTEMS.TCB_POINTER
- );
+ ) return RTEMS.Boolean;
--
-- TASK_DELETE_EXTENSION