diff options
author | Glenn Humphrey <glenn.humphrey@oarcorp.com> | 2007-10-18 19:36:29 +0000 |
---|---|---|
committer | Glenn Humphrey <glenn.humphrey@oarcorp.com> | 2007-10-18 19:36:29 +0000 |
commit | 3d2bf71da0b60faa35034580dc4fd53948f63f53 (patch) | |
tree | 0f168846dd5588babd94bee97628f630d0c4e32b /c/src/ada-tests/sptests/sp20 | |
parent | Update. (diff) | |
download | rtems-3d2bf71da0b60faa35034580dc4fd53948f63f53.tar.bz2 |
2007-10-18 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* sptests/sp09/sp09.scn, sptests/sp09/sptest.adb,
sptests/sp13/sp13.scn, sptests/sp13/sptest.adb,
sptests/sp16/sp16.scn, sptests/sp16/sptest.adb,
sptests/sp16/sptest.ads, sptests/sp20/sp20.scn,
sptests/sp20/sptest.adb, sptests/sp20/sptest.ads: Updated tests to
match the current C tests and regenerated the .scn files.
Diffstat (limited to '')
-rw-r--r-- | c/src/ada-tests/sptests/sp20/sp20.scn | 13 | ||||
-rw-r--r-- | c/src/ada-tests/sptests/sp20/sptest.adb | 58 | ||||
-rw-r--r-- | c/src/ada-tests/sptests/sp20/sptest.ads | 24 |
3 files changed, 75 insertions, 20 deletions
diff --git a/c/src/ada-tests/sptests/sp20/sp20.scn b/c/src/ada-tests/sptests/sp20/sp20.scn index f1a75283fe..5411361d76 100644 --- a/c/src/ada-tests/sptests/sp20/sp20.scn +++ b/c/src/ada-tests/sptests/sp20/sp20.scn @@ -14,11 +14,24 @@ TA4 - (16#42010004#) period 2 TA5 - rate_monotonic_create id = 16#42010005# TA5 - rate_monotonic_ident id = 16#42010005# TA5 - (16#42010005#) period 100 +TA6 - rate_monotonic_create id = 16#42010006# +TA6 - rate_monotonic_ident id = 16#42010006# +TA6 - (16#42010006#) period 0 TA5 - PERIODS CHECK OK (1) TA5 - PERIODS CHECK OK (2) TA5 - PERIODS CHECK OK (3) TA5 - PERIODS CHECK OK (4) TA5 - PERIODS CHECK OK (5) +TA6 - Actual: 10 Expected: 10 - OK +TA6 - Actual: 20 Expected: 20 - OK +TA6 - Actual: 30 Expected: 30 - OK +TA6 - Actual: 40 Expected: 40 - OK +TA6 - Actual: 50 Expected: 50 - OK +TA6 - Actual: 60 Expected: 60 - OK +TA6 - Actual: 70 Expected: 70 - OK +TA6 - Actual: 80 Expected: 80 - OK +TA6 - Actual: 90 Expected: 90 - OK +TA6 - Actual: 100 Expected: 100 - OK TA5 - PERIODS CHECK OK (6) TA5 - PERIODS CHECK OK (7) TA5 - PERIODS CHECK OK (8) diff --git a/c/src/ada-tests/sptests/sp20/sptest.adb b/c/src/ada-tests/sptests/sp20/sptest.adb index 8b7c9958dc..1f73df5d83 100644 --- a/c/src/ada-tests/sptests/sp20/sptest.adb +++ b/c/src/ada-tests/sptests/sp20/sptest.adb @@ -47,8 +47,9 @@ package body SPTEST is SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); + SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME( 'T', 'A', '6', ' ' ); - for INDEX in 1 .. 5 + for INDEX in 1 .. 6 loop SPTEST.COUNT( INDEX ) := 0; @@ -66,12 +67,12 @@ package body SPTEST is end loop; - for INDEX in 1 .. 5 + for INDEX in 1 .. 6 loop RTEMS.TASK_START( SPTEST.TASK_ID( INDEX ), - SPTEST.TASK_1_THROUGH_5'ACCESS, + SPTEST.TASK_1_THROUGH_6'ACCESS, RTEMS.TASK_ARGUMENT( INDEX ), STATUS ); @@ -86,10 +87,10 @@ package body SPTEST is --PAGE -- --- TASK_1_THROUGH_5 +-- TASK_1_THROUGH_6 -- - procedure TASK_1_THROUGH_5 ( + procedure TASK_1_THROUGH_6 ( ARGUMENT : in RTEMS.TASK_ARGUMENT ) is RMID : RTEMS.ID; @@ -97,6 +98,9 @@ package body SPTEST is PASS : RTEMS.UNSIGNED32; FAILED : RTEMS.UNSIGNED32; STATUS : RTEMS.STATUS_CODES; + TIME : array( 0 .. 10 ) of RTEMS.INTERVAL; + PERIOD : RTEMS.INTERVAL; + MEASURE : RTEMS.INTERVAL; begin RTEMS.RATE_MONOTONIC_CREATE( ARGUMENT, RMID, STATUS ); @@ -183,8 +187,7 @@ package body SPTEST is SPTEST.GET_ALL_COUNTERS; - for INDEX in 1 .. 4 - loop + for INDEX in 1 .. 4 loop if SPTEST.TEMPORARY_COUNT( INDEX ) /= SPTEST.ITERATIONS( INDEX ) then @@ -230,12 +233,51 @@ package body SPTEST is end loop; + when 6 => + -- test changing periods + for INDEX in 0 .. 10 loop + PERIOD := RTEMS.INTERVAL( ( INDEX + 1 ) * 10 ); + RTEMS.RATE_MONOTONIC_PERIOD( RMID, PERIOD, STATUS); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "rate_monotonic_period of TA6" + ); + + -- timestamp + RTEMS.CLOCK_GET( + RTEMS.CLOCK_GET_TICKS_SINCE_BOOT, + Time( INDEX )'ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "clock_get of TA6" + ); + end loop; + + for INDEX in 1 .. 10 loop + MEASURE := TIME( INDEX ) - TIME( INDEX - 1 ); + PERIOD := RTEMS.INTERVAL( INDEX * 10 ); + TEXT_IO.PUT( "TA6 - Actual: " ); + UNSIGNED32_IO.PUT( MEASURE, WIDTH => 3, BASE => 10 ); + TEXT_IO.PUT( " Expected: " ); + UNSIGNED32_IO.PUT( PERIOD, WIDTH => 3, BASE => 10 ); + if PERIOD = MEASURE then + TEXT_IO.PUT_LINE( " - OK" ); + else + TEXT_IO.PUT_LINE( " - FAILED" ); + end if; + end loop; + + RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "task_suspend of TA6" + ); + when others => NULL; end case; - end TASK_1_THROUGH_5; + end TASK_1_THROUGH_6; --PAGE -- diff --git a/c/src/ada-tests/sptests/sp20/sptest.ads b/c/src/ada-tests/sptests/sp20/sptest.ads index 95a3259fe4..43220a388c 100644 --- a/c/src/ada-tests/sptests/sp20/sptest.ads +++ b/c/src/ada-tests/sptests/sp20/sptest.ads @@ -29,30 +29,30 @@ package SPTEST is -- by this test. -- - TASK_ID : array ( 1 .. 5 ) of RTEMS.ID; - TASK_NAME : array ( 1 .. 5 ) of RTEMS.NAME; + TASK_ID : array ( 1 .. 6 ) of RTEMS.ID; + TASK_NAME : array ( 1 .. 6 ) of RTEMS.NAME; -- -- These arrays contain the parameters which define the execution -- characteristics and periods of each instantiation of the --- copies of the RTEMS task TASKS_1_THROUGH_5. +-- copies of the RTEMS task TASKS_1_THROUGH_6. -- - PERIODS : constant array ( 1 .. 5 ) - of RTEMS.UNSIGNED32 := ( 2, 2, 2, 2, 100 ); + PERIODS : constant array ( 1 .. 6 ) + of RTEMS.UNSIGNED32 := ( 2, 2, 2, 2, 100, 0 ); - ITERATIONS : constant array ( 1 .. 5 ) - of RTEMS.UNSIGNED32 := ( 50, 50, 50, 50, 1 ); + ITERATIONS : constant array ( 1 .. 6 ) + of RTEMS.UNSIGNED32 := ( 50, 50, 50, 50, 1, 10 ); - PRIORITIES : constant array ( 1 .. 5 ) - of RTEMS.UNSIGNED32 := ( 1, 1, 3, 4, 5 ); + PRIORITIES : constant array ( 1 .. 6 ) + of RTEMS.UNSIGNED32 := ( 1, 1, 3, 4, 5, 1 ); -- -- The following type defines the array used to manage the -- execution counts of each task's period. -- - type COUNT_ARRAY is array ( 1 .. 5 ) of RTEMS.UNSIGNED32; + type COUNT_ARRAY is array ( 1 .. 6 ) of RTEMS.UNSIGNED32; -- -- These arrays contains the number of periods successfully completed @@ -79,14 +79,14 @@ package SPTEST is ); -- --- TASK_1_THROUGH_5 +-- TASK_1_THROUGH_6 -- -- DESCRIPTION: -- -- These RTEMS tasks test the Rate Monotonic Manager. -- - procedure TASK_1_THROUGH_5 ( + procedure TASK_1_THROUGH_6 ( ARGUMENT : in RTEMS.TASK_ARGUMENT ); |