Changeset 3d2bf71 in rtems


Ignore:
Timestamp:
Oct 18, 2007, 7:36:29 PM (12 years ago)
Author:
Glenn Humphrey <glenn.humphrey@…>
Branches:
4.10, 4.11, 4.9, master
Children:
6a5990e
Parents:
2fc47c6
Message:

2007-10-18 Glenn Humphrey <glenn.humphrey@…>

  • 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.
Location:
c/src/ada-tests
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • c/src/ada-tests/ChangeLog

    r2fc47c6 r3d2bf71  
     12007-10-18      Glenn Humphrey <glenn.humphrey@OARcorp.com>
     2
     3        * sptests/sp09/sp09.scn, sptests/sp09/sptest.adb,
     4        sptests/sp13/sp13.scn, sptests/sp13/sptest.adb,
     5        sptests/sp16/sp16.scn, sptests/sp16/sptest.adb,
     6        sptests/sp16/sptest.ads, sptests/sp20/sp20.scn,
     7        sptests/sp20/sptest.adb, sptests/sp20/sptest.ads: Updated tests to
     8        match the current C tests and regenerated the .scn files.
     9
    1102007-10-10      Glenn Humphrey <glenn.humphrey@OARcorp.com>
    211
  • c/src/ada-tests/sptests/sp09/sp09.scn

    r2fc47c6 r3d2bf71  
    102102TA1 - message_queue_delete - local INVALID_ID
    103103TA1 - message_queue_ident - INVALID_NAME
     104TA1 - message_queue_get_number_pending - INVALID_ID
    104105TA1 - message_queue_flush - INVALID_ID
    105106TA1 - message_queue_receive - INVALID_ID
     
    237238TA1 - clock_get       -  0: 0: 0    1/ 1/1992
    238239TA1 - timer_fire_when -  8:30:45    2/ 5/1990 - before INVALID_CLOCK
     240TA1 - timer_server_fire_after - INCORRECT_STATE
     241TA1 - timer_server_fire_when - INCORRECT_STATE
     242TA1 - timer_initiate_server - INVALID_PRIORITY
     243TA1 - timer_initiate_server
     244TA1 - timer_server_fire_after - INVALID_ID
     245TA1 - timer_server_fire_when - INVALID_ID
     246TA1 - timer_server_fire_after - INVALID_NUMBER
     247TA1 - timer_server_fire_when -  8:30:45    2/ 5/1987 - INVALID_CLOCK
     248TA1 - clock_get       -  0: 0: 0    1/ 1/1992
     249TA1 - timer_server_fire_when -  8:30:45    2/ 5/1990 - before INVALID_CLOCK
    239250*** END OF TEST 9 ***
  • c/src/ada-tests/sptests/sp09/sptest.adb

    r2fc47c6 r3d2bf71  
    13181318      TEXT_IO.PUT_LINE( "TA1 - message_queue_ident - INVALID_NAME" );
    13191319
     1320      RTEMS.MESSAGE_QUEUE_GET_NUMBER_PENDING( 100, COUNT, STATUS );
     1321      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     1322        STATUS,
     1323        RTEMS.INVALID_ID,
     1324        "MESSAGE_QUEUE_GET_NUMBER_PENDING WITH ILLEGAL ID"
     1325      );
     1326      TEXT_IO.PUT_LINE( "TA1 - message_queue_get_number_pending - INVALID_ID" );
     1327
    13201328      RTEMS.MESSAGE_QUEUE_FLUSH( 100, COUNT, STATUS );
    13211329      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     
    28832891      TEXT_IO.NEW_LINE;
    28842892
     2893      RTEMS.TIMER_SERVER_FIRE_AFTER(
     2894         0, 5, SPTEST.DELAYED_SUBPROGRAM'ACCESS, RTEMS.NULL_ADDRESS, STATUS
     2895      );
     2896      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     2897        STATUS,
     2898        RTEMS.INCORRECT_STATE,
     2899        "TIMER_SERVER_FIRE_AFTER INCORRECT STATE"
     2900      );
     2901      TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_after - INCORRECT_STATE" );
     2902
     2903      RTEMS.TIMER_SERVER_FIRE_WHEN(
     2904         0, TIME, SPTEST.DELAYED_SUBPROGRAM'ACCESS, RTEMS.NULL_ADDRESS, STATUS
     2905      );
     2906      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     2907        STATUS,
     2908        RTEMS.INCORRECT_STATE,
     2909        "TIMER_SERVER_FIRE_WHEN INCORRECT STATE"
     2910      );
     2911      TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_when - INCORRECT_STATE" );
     2912
     2913      RTEMS.timer_initiate_server( 0, 0, 0, STATUS );
     2914      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     2915        STATUS,
     2916        RTEMS.INVALID_PRIORITY,
     2917        "timer_initiate_server invalid priority"
     2918      );
     2919      TEXT_IO.PUT_LINE( "TA1 - timer_initiate_server - INVALID_PRIORITY" );
     2920
     2921      RTEMS.timer_initiate_server(
     2922-- XXX ask Joel
     2923--         RTEMS.TIMER_SERVER_DEFAULT_PRIORITY, 0, 0, STATUS
     2924         -1, 0, 0, STATUS
     2925      );
     2926      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "timer_initiate_server" );
     2927      TEXT_IO.PUT_LINE( "TA1 - timer_initiate_server" );
     2928
     2929      RTEMS.TIMER_SERVER_FIRE_AFTER(
     2930        16#010100#,
     2931        5 * TEST_SUPPORT.TICKS_PER_SECOND,
     2932        SPTEST.DELAYED_SUBPROGRAM'ACCESS,
     2933        RTEMS.NULL_ADDRESS,
     2934        STATUS
     2935      );
     2936      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     2937        STATUS,
     2938        RTEMS.INVALID_ID,
     2939        "TIMER_SERVER_FIRE_AFTER ILLEGAL ID"
     2940      );
     2941      TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_after - INVALID_ID" );
     2942
     2943      TIME := ( 1994, 12, 31, 9, 0, 0, 0 );
     2944      RTEMS.TIMER_SERVER_FIRE_WHEN(
     2945         16#010100#,
     2946         TIME,
     2947         SPTEST.DELAYED_SUBPROGRAM'ACCESS,
     2948         RTEMS.NULL_ADDRESS,
     2949         STATUS
     2950      );
     2951      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     2952        STATUS,
     2953        RTEMS.INVALID_ID,
     2954        "TIMER_SERVER_FIRE_WHEN WITH ILLEGAL ID"
     2955      );
     2956      TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_when - INVALID_ID" );
     2957
     2958      RTEMS.TIMER_SERVER_FIRE_AFTER(
     2959         SPTEST.TIMER_ID( 1 ),
     2960         0,
     2961         SPTEST.DELAYED_SUBPROGRAM'ACCESS,
     2962         RTEMS.NULL_ADDRESS,
     2963         STATUS
     2964      );
     2965      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     2966        STATUS,
     2967        RTEMS.INVALID_NUMBER,
     2968        "TIMER_SERVER_FIRE_AFTER WITH 0 TICKS"
     2969      );
     2970      TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_after - INVALID_NUMBER" );
     2971
     2972      TIME := ( 1987, 2, 5, 8, 30, 45, 0 );
     2973      RTEMS.TIMER_SERVER_FIRE_WHEN(
     2974         SPTEST.TIMER_ID( 1 ),
     2975         TIME,
     2976         SPTEST.DELAYED_SUBPROGRAM'ACCESS,
     2977         RTEMS.NULL_ADDRESS,
     2978         STATUS
     2979      );
     2980      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     2981        STATUS,
     2982        RTEMS.INVALID_CLOCK,
     2983        "TIMER_SERVER_FIRE_WHEN WITH ILLEGAL TIME"
     2984      );
     2985      TEST_SUPPORT.PRINT_TIME(
     2986        "TA1 - timer_server_fire_when - ",
     2987        TIME,
     2988        " - INVALID_CLOCK"
     2989      );
     2990      TEXT_IO.NEW_LINE;
     2991
     2992      RTEMS.CLOCK_GET( RTEMS.CLOCK_GET_TOD, TIME'ADDRESS, STATUS );
     2993      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "clock_set" );
     2994      TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get       - ", TIME, "" );
     2995      TEXT_IO.NEW_LINE;
     2996
     2997      TIME := ( 1990, 2, 5, 8, 30, 45, 0 );
     2998      RTEMS.TIMER_SERVER_FIRE_WHEN(
     2999         SPTEST.TIMER_ID( 1 ),
     3000         TIME,
     3001         SPTEST.DELAYED_SUBPROGRAM'ACCESS,
     3002         RTEMS.NULL_ADDRESS,
     3003         STATUS
     3004      );
     3005      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     3006        STATUS,
     3007        RTEMS.INVALID_CLOCK,
     3008        "TIMER_SERVER_FIRE_WHEN BEFORE CURRENT TIME"
     3009      );
     3010      TEST_SUPPORT.PRINT_TIME(
     3011        "TA1 - timer_server_fire_when - ",
     3012        TIME,
     3013        " - before INVALID_CLOCK"
     3014      );
     3015      TEXT_IO.NEW_LINE;
     3016
    28853017   end SCREEN_14;
    28863018
  • c/src/ada-tests/sptests/sp13/sp13.scn

    r2fc47c6 r3d2bf71  
    5353TA1 - message_queue_urgent - BUFFER 3 TO Q 2
    5454TA1 - message_queue_delete - delete queue 2
     55TA1 - message_queue_get_number_pending - check Q 3
     56TA1 -   0 messages are pending on Q 3
    5557TA1 - message_queue_flush - empty Q 3
    5658TA1 -   0 messages were flushed from Q 3
    5759TA1 - message_queue_send - BUFFER 1 TO Q 3
    5860TA1 - message_queue_send - BUFFER 2 TO Q 3
     61TA1 - message_queue_broadcast - NO BUFFER TO Q1
     62TA1 - number of tasks awakened =   0
     63TA1 - message_queue_get_number_pending - check Q 3
     64TA1 -   2 messages are pending on Q 3
    5965TA1 - message_queue_send - BUFFER 3 TO Q 3
    6066TA1 - message_queue_flush - Q 3
     
    6470TA1 - message_queue_flush - Q 3
    6571TA1 - 100 messages were flushed from Q 3
     72<pause>
     73TA1 - create message queue of 20 bytes on queue 1
     74TA1 - message_queue_delete - delete queue 1
     75<pause>
     76TA1 - message_queue_create - variable sizes
     77TA1 - message_queue_create and send - variable sizes
    6678*** END OF TEST 13 ***
  • c/src/ada-tests/sptests/sp13/sptest.adb

    r2fc47c6 r3d2bf71  
    2626with TEXT_IO;
    2727with UNSIGNED32_IO;
     28use type RTEMS.STATUS_CODES;
    2829
    2930package body SPTEST is
     31
     32   type BIG_BUFFER_TYPE is array (1 .. 2048) of RTEMS.UNSIGNED8;
     33
    3034
    3135--PAGE
     
    217221      ARGUMENT : in     RTEMS.TASK_ARGUMENT
    218222   ) is
    219       QID            : RTEMS.ID;
    220       BUFFER         : SPTEST.BUFFER;
    221       BUFFER_POINTER : RTEMS.ADDRESS;
    222       COUNT          : RTEMS.UNSIGNED32;
    223       MESSAGE_SIZE   : RTEMS.UNSIGNED32;
    224       STATUS         : RTEMS.STATUS_CODES;
     223      QID                        : RTEMS.ID;
     224      BIG_SEND_BUFFER            : BIG_BUFFER_TYPE;
     225      BIG_SEND_BUFFER_POINTER    : RTEMS.ADDRESS := BIG_SEND_BUFFER'ADDRESS;
     226      BIG_RECEIVE_BUFFER         : BIG_BUFFER_TYPE;
     227      BIG_RECEIVE_BUFFER_POINTER : RTEMS.ADDRESS := BIG_RECEIVE_BUFFER'ADDRESS;
     228      BUFFER                     : SPTEST.BUFFER;
     229      BUFFER_POINTER             : RTEMS.ADDRESS := BUFFER'ADDRESS;
     230      COUNT                      : RTEMS.UNSIGNED32;
     231      MESSAGE_SIZE               : RTEMS.UNSIGNED32;
     232      STATUS                     : RTEMS.STATUS_CODES;
     233      SIZE                       : RTEMS.UNSIGNED32;
    225234   begin
    226 
    227       BUFFER_POINTER := BUFFER'ADDRESS;
    228235
    229236      RTEMS.MESSAGE_QUEUE_IDENT(
     
    432439      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" );
    433440   
     441      TEXT_IO.PUT_LINE( "TA1 - message_queue_get_number_pending - check Q 3" );
     442      RTEMS.MESSAGE_QUEUE_GET_NUMBER_PENDING(
     443         SPTEST.QUEUE_ID( 3 ), COUNT, STATUS
     444      );
     445      TEST_SUPPORT.DIRECTIVE_FAILED(
     446         STATUS, "MESSAGE_QUEUE_GET_NUMBER_PENDING"
     447      );
     448      TEXT_IO.PUT( "TA1 - " );
     449      UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 );
     450      TEXT_IO.PUT_LINE( " messages are pending on Q 3" );
     451   
    434452      TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - empty Q 3" );
    435453      RTEMS.MESSAGE_QUEUE_FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS );
     
    459477      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" );
    460478
     479      -- this broadcast should have no effect on the queue
     480      SPTEST.FIlL_BUFFER( "NO BUFFER TO Q1 ", BUFFER );
     481      TEXT_IO.PUT_LINE( "TA1 - message_queue_broadcast - NO BUFFER TO Q1" );
     482      RTEMS.MESSAGE_QUEUE_BROADCAST(
     483         SPTEST.QUEUE_ID( 1 ),
     484         BUFFER_POINTER,
     485         16,
     486         COUNT,
     487         STATUS
     488      );
     489      TEXT_IO.PUT( "TA1 - number of tasks awakened = " );
     490      UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 );
     491      TEXT_IO.NEW_LINE;
     492   
     493      TEXT_IO.PUT_LINE( "TA1 - message_queue_get_number_pending - check Q 3" );
     494      RTEMS.MESSAGE_QUEUE_GET_NUMBER_PENDING(
     495         SPTEST.QUEUE_ID( 3 ), COUNT, STATUS
     496      );
     497      TEST_SUPPORT.DIRECTIVE_FAILED(
     498         STATUS, "MESSAGE_QUEUE_GET_NUMBER_PENDING"
     499      );
     500      TEXT_IO.PUT( "TA1 - " );
     501      UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 );
     502      TEXT_IO.PUT_LINE( " messages are pending on Q 3" );
     503
    461504      SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 3 ", BUFFER );
    462505      TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 3" );
     
    504547      UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 );
    505548      TEXT_IO.PUT_LINE( " messages were flushed from Q 3" );
     549
     550TEST_SUPPORT.PAUSE;
    506551     
     552      TEXT_IO.PUT_LINE( "TA1 - create message queue of 20 bytes on queue 1" );
     553      RTEMS.MESSAGE_QUEUE_CREATE(
     554         SPTEST.QUEUE_NAME( 1 ),
     555         100,
     556         20,
     557         RTEMS.DEFAULT_ATTRIBUTES,
     558         SPTEST.QUEUE_ID( 1 ),
     559         STATUS
     560      );
     561      TEST_SUPPORT.DIRECTIVE_FAILED(
     562         STATUS, "MESSAGE_QUEUE_CREATE of Q1; 20 bytes each"
     563      );
     564      RTEMS.MESSAGE_QUEUE_SEND(
     565         SPTEST.QUEUE_ID( 1 ), BIG_SEND_BUFFER_POINTER, 40, STATUS
     566      );
     567      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     568         STATUS, RTEMS.INVALID_SIZE, "expected INVALID_SIZE"
     569      );
     570
     571      TEXT_IO.PUT_LINE( "TA1 - message_queue_delete - delete queue 1" );
     572      RTEMS.MESSAGE_QUEUE_DELETE( SPTEST.QUEUE_ID( 1 ), STATUS );
     573      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" );
     574
     575TEST_SUPPORT.PAUSE;
     576
     577      TEXT_IO.PUT_LINE( "TA1 - message_queue_create - variable sizes " );
     578      for QUEUE_SIZE in 1 .. 1029 loop
     579          RTEMS.MESSAGE_QUEUE_CREATE(
     580              SPTEST.QUEUE_NAME( 1 ),
     581              2,            -- just 2 msgs each
     582              RTEMS.UNSIGNED32( QUEUE_SIZE ),
     583              RTEMS.DEFAULT_ATTRIBUTES,
     584              QUEUE_ID( 1 ),
     585              STATUS
     586          );
     587          if STATUS /= RTEMS.SUCCESSFUL then
     588              TEXT_IO.PUT( "TA1 - msq que size: " );
     589              UNSIGNED32_IO.PUT(
     590                 RTEMS.UNSIGNED32( QUEUE_SIZE ), WIDTH => 3, BASE => 10
     591              );
     592              TEXT_IO.NEW_LINE;
     593              TEST_SUPPORT.DIRECTIVE_FAILED(
     594                 STATUS, "message_queue_create of Q1"
     595              );
     596          end if;
     597
     598          RTEMS.MESSAGE_QUEUE_DELETE( SPTEST.QUEUE_ID( 1 ), STATUS );
     599          TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "message_queue_delete" );
     600      end loop;
     601
     602      TEXT_IO.PUT_LINE(
     603         "TA1 - message_queue_create and send - variable sizes "
     604      );
     605      for QUEUE_SIZE in 1 .. 1029 loop
     606
     607          RTEMS.MESSAGE_QUEUE_CREATE(
     608              SPTEST.QUEUE_NAME( 1 ),
     609              2,            -- just 2 msgs each
     610              RTEMS.UNSIGNED32( QUEUE_SIZE ),
     611              RTEMS.DEFAULT_ATTRIBUTES,
     612              SPTEST.QUEUE_ID( 1 ),
     613              STATUS
     614          );
     615          TEST_SUPPORT.DIRECTIVE_FAILED( status, "message_queue_create of Q1" );
     616
     617          BIG_SEND_BUFFER := (others => CHARACTER'POS( 'A' ));
     618          BIG_RECEIVE_BUFFER := (others => CHARACTER'POS( 'Z' ));
     619
     620          -- send a msg too big
     621          RTEMS.MESSAGE_QUEUE_SEND(
     622             SPTEST.QUEUE_ID( 1 ),
     623             BIG_SEND_BUFFER_POINTER,
     624             RTEMS.UNSIGNED32( QUEUE_SIZE + 1 ),
     625             STATUS
     626          );
     627          TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     628             STATUS, RTEMS.INVALID_SIZE, "message_queue_send too large"
     629          );
     630
     631          -- send a msg that is just right
     632          RTEMS.MESSAGE_QUEUE_SEND(
     633             SPTEST.QUEUE_ID( 1 ),
     634             BIG_SEND_BUFFER_POINTER,
     635             RTEMS.UNSIGNED32( QUEUE_SIZE ),
     636             STATUS
     637          );
     638          TEST_SUPPORT.DIRECTIVE_FAILED(
     639             STATUS, "message_queue_send exact size"
     640          );
     641
     642          -- now read and verify the message just sent
     643          RTEMS.MESSAGE_QUEUE_RECEIVE(
     644             SPTEST.QUEUE_ID( 1 ),
     645             BIG_RECEIVE_BUFFER_POINTER,
     646             RTEMS.DEFAULT_OPTIONS,
     647             1 * TEST_SUPPORT.TICKS_PER_SECOND,
     648             SIZE,
     649             STATUS
     650          );
     651          TEST_SUPPORT.DIRECTIVE_FAILED(
     652             STATUS, "message_queue_receive exact size"
     653          );
     654          if SIZE /= RTEMS.UNSIGNED32( QUEUE_SIZE ) then
     655              TEXT_IO.PUT(
     656                 "TA1 - exact size size match failed for queue_size = "
     657              );
     658              UNSIGNED32_IO.PUT(
     659                 RTEMS.UNSIGNED32( QUEUE_SIZE ), WIDTH => 3, BASE => 10
     660              );
     661              TEXT_IO.NEW_LINE;
     662          end if;
     663
     664          if (BIG_SEND_BUFFER( BIG_SEND_BUFFER'FIRST .. Integer( SIZE )) /=
     665            BIG_RECEIVE_BUFFER( BIG_RECEIVE_BUFFER'FIRST .. Integer( SIZE ))) then
     666              TEXT_IO.PUT_LINE("TA1 - exact size data match failed");
     667          end if;
     668
     669          for I in Integer( SIZE + 1 ) .. BIG_RECEIVE_BUFFER'LAST loop
     670              if BIG_RECEIVE_BUFFER( I ) /= CHARACTER'POS( 'Z' ) then
     671                  TEXT_IO.PUT_LINE("TA1 - exact size overrun match failed");
     672              end if;
     673          end loop;
     674
     675          -- all done with this one; delete it
     676          RTEMS.MESSAGE_QUEUE_DELETE( SPTEST.QUEUE_ID( 1 ), STATUS );
     677          TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "message_queue_delete" );
     678      end loop;
     679
    507680      TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" );
    508681      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
  • c/src/ada-tests/sptests/sp16/sp16.scn

    r2fc47c6 r3d2bf71  
    22TA1 - region_ident - rnid => 16#32010001#
    33TA1 - region_get_segment - wait on 100 byte segment from region 2
    4 TA1 - got segment from region 2 -   16#30#
     4TA1 - got segment from region 2 -   16#70#
    55TA1 - region_get_segment - wait on 3K segment from region 3
    6 TA1 - got segment from region 3 -   16#30#
     6TA1 - got segment from region 3 -   16#70#
    77TA1 - region_get_segment - get 3080 byte segment from region 1 - NO_WAIT
    8 TA1 - got segment from region 1 -   16#20#
     8TA1 - got segment from region 1 -   16#60#
    99TA1 - task_wake_after - yield processor
    1010TA2 - region_get_segment - wait on 2K segment from region 1
    1111TA3 - region_get_segment - wait on 3950 byte segment from region 2
    1212<pause>
    13 TA1 - region_return_segment - return segment to region 1 -   16#20#
     13TA1 - region_return_segment - return segment to region 1 -   16#60#
    1414TA1 - region_get_segment - wait 10 seconds for 3K segment from region 1
    15 TA2 - got segment from region 1 -   16#20#
    16 TA2 - region_return_segment - return segment to region 1 -   16#20#
     15TA2 - got segment from region 1 -   16#60#
     16TA2 - region_return_segment - return segment to region 1 -   16#60#
    1717TA2 - task_set_priority - make self highest priority task
    1818TA2 - region_get_segment - wait on 3950 byte segment from region 2
    19 TA1 - got segment from region 1 -   16#20#
    20 TA1 - region_return_segment - return segment to region 2 -   16#30#
    21 TA2 - got segment from region 2 -   16#30#
    22 TA2 - region_return_segment - return segment to region 2 -   16#30#
     19TA1 - got segment from region 1 -   16#60#
     20TA1 - region_return_segment - return segment to region 2 -   16#70#
     21TA2 - got segment from region 2 -   16#70#
     22TA2 - region_return_segment - return segment to region 2 -   16#70#
    2323TA2 - task_delete - delete self
    2424TA1 - task_wake_after - yield processor
    25 TA3 - got segment from region 2 -   16#30#
     25TA3 - got segment from region 2 -   16#70#
    2626TA3 - region_get_segment - wait on 2K segment from region 3
    2727TA1 - task_delete - delete TA3
     
    3030TA4 - region_get_segment - wait on 1.5K segment from region 1
    3131TA5 - region_get_segment - wait on 1.5K segment from region 1
    32 TA1 - region_return_segment - return segment to region 1 -   16#20#
     32TA1 - region_return_segment - return segment to region 1 -   16#60#
    3333TA1 - task_wake_after - yield processor
    34 TA4 - got and returned   16#20#
    35 TA5 - got and returned  16#6A0#
     34TA4 - got and returned   16#60#
     35TA5 - got and returned  16#6E0#
    3636TA1 - region_get_segment - wait 10 seconds for 3K segment from region 1
    37 TA1 - got segment from region 1 -   16#20#
    38 TA1 - task_wake_after - sleep 1 second
     37TA1 - got segment from region 1 -   16#60#
     38TA1 - task_wake_after - yield processor
    3939TA5 - region_get_segment - wait on 3K segment from region 1
    4040TA4 - region_get_segment - wait on 3K segment from region 1
    4141TA1 - task_delete - delete TA4
    42 TA1 - region_return_segment - return segment to region 1 -   16#20#
     42TA1 - region_return_segment - return segment to region 1 -   16#60#
    4343TA1 - task_wake_after - yield processor
    44 TA5 - got segment from region 1 -   16#20#
    45 TA5 - region_return_segment - return segment to region 1 -   16#20#
     44TA5 - got segment from region 1 -   16#60#
     45TA5 - region_return_segment - return segment to region 1 -   16#60#
    4646TA5 - task_delete - delete self
    4747TA1 - region_delete - delete region 1
     48TA1 - region_get_segment - get 3K segment from region 4
     49TA1 - got segment from region 4 -   16#70#
     50TA1 - region_get_segment - attempt to get 3K segment from region 4
     51TA1 - task_get_note - UNSATISFIED
     52TA1 - region_extend - extend region 4 by 4K
     53TA1 - region_get_segment - attempt to get 3K segment from region 4
     54TA1 - got 3K segment from region 4 -  16#CF0#
     55TA1 - return_segment - return segment to region 4 -   16#70#
     56TA1 - region_return_segment - return segment to region 4 -  16#CF0#
     57TA1 - region_delete - delete region 4
    4858*** END OF TEST 16 ***
  • c/src/ada-tests/sptests/sp16/sptest.adb

    r2fc47c6 r3d2bf71  
    107107
    108108      SPTEST.REGION_NAME( 1 ) := RTEMS.BUILD_NAME(  'R', 'N', '1', ' ' );
    109       SPTEST.REGION_NAME( 2 ) := RTEMS.BUILD_NAME(  'R', 'N', '1', ' ' );
    110       SPTEST.REGION_NAME( 3 ) := RTEMS.BUILD_NAME(  'R', 'N', '1', ' ' );
     109      SPTEST.REGION_NAME( 2 ) := RTEMS.BUILD_NAME(  'R', 'N', '2', ' ' );
     110      SPTEST.REGION_NAME( 3 ) := RTEMS.BUILD_NAME(  'R', 'N', '3', ' ' );
     111      SPTEST.REGION_NAME( 4 ) := RTEMS.BUILD_NAME(  'R', 'N', '4', ' ' );
    111112
    112113      RTEMS.REGION_CREATE(
     
    143144      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN3" );
    144145
    145  
     146      RTEMS.REGION_CREATE(
     147         SPTEST.REGION_NAME( 4 ),
     148         SPTEST.AREA_4'ADDRESS,
     149         4096,
     150         128,
     151         RTEMS.DEFAULT_ATTRIBUTES,
     152         SPTEST.REGION_ID( 4 ),
     153         STATUS
     154      );
     155      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN4" );
     156
    146157      RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
    147158      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
     
    203214
    204215   end PUT_ADDRESS_FROM_AREA_3;
     216
     217--PAGE
     218--
     219--  PUT_ADDRESS_FROM_AREA_4
     220--
     221
     222   procedure PUT_ADDRESS_FROM_AREA_4 (
     223      TO_BE_PRINTED : in     RTEMS.ADDRESS
     224   ) is
     225   begin
     226
     227      UNSIGNED32_IO.PUT(
     228         RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_4'ADDRESS ),
     229         WIDTH => 8,
     230         BASE => 16
     231      );
     232
     233   end PUT_ADDRESS_FROM_AREA_4;
    205234
    206235--PAGE
     
    399428      TEXT_IO.NEW_LINE;
    400429
    401       TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 1 second" );
     430      TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" );
    402431      RTEMS.TASK_WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS );
    403432      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
     
    426455      RTEMS.REGION_DELETE( SPTEST.REGION_ID( 1 ), STATUS );
    427456      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE OF RN1" );
     457--XXX
     458      TEXT_IO.PUT_LINE(
     459         "TA1 - region_get_segment - get 3K segment from region 4"
     460      );
     461      RTEMS.REGION_GET_SEGMENT(
     462        SPTEST.REGION_ID( 4 ),
     463        3072,
     464        RTEMS.DEFAULT_OPTIONS,
     465        RTEMS.NO_TIMEOUT,
     466        segment_address_1,
     467        STATUS
     468      );
     469      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "region_get_segment" );
     470      TEXT_IO.PUT( "TA1 - got segment from region 4 - " );
     471      PUT_ADDRESS_FROM_AREA_4( segment_address_1 );
     472      TEXT_IO.NEW_LINE;
     473
     474      TEXT_IO.PUT_LINE(
     475       "TA1 - region_get_segment - attempt to get 3K segment from region 4"
     476      );
     477      RTEMS.REGION_GET_SEGMENT(
     478        SPTEST.REGION_ID( 4 ),
     479        3072,
     480        RTEMS.NO_WAIT,
     481        RTEMS.NO_TIMEOUT,
     482        SEGMENT_ADDRESS_2,
     483        STATUS
     484      );
     485      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
     486        STATUS,
     487        RTEMS.UNSATISFIED,
     488        "task_get_segment with no memory left"
     489      );
     490      TEXT_IO.PUT_LINE( "TA1 - task_get_note - UNSATISFIED" );
     491
     492      TEXT_IO.PUT_LINE( "TA1 - region_extend - extend region 4 by 4K" );
     493      RTEMS.REGION_EXTEND(
     494        SPTEST.REGION_ID( 4 ),
     495        SPTEST.AREA_4( 4096 )'ADDRESS,
     496        4096,
     497        STATUS
     498      );
     499      TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_extend" );
     500
     501      TEXT_IO.PUT_LINE(
     502       "TA1 - region_get_segment - attempt to get 3K segment from region 4"
     503      );
     504      RTEMS.REGION_GET_SEGMENT(
     505        SPTEST.REGION_ID( 4 ),
     506        3072,
     507        RTEMS.NO_WAIT,
     508        RTEMS.NO_TIMEOUT,
     509        segment_address_3,
     510        STATUS
     511      );
     512      TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_get_segment" );
     513      TEXT_IO.PUT( "TA1 - got 3K segment from region 4 - " );
     514      PUT_ADDRESS_FROM_AREA_4( segment_address_3 );
     515      TEXT_IO.NEW_LINE;
     516
     517      TEXT_IO.PUT(
     518        "TA1 - return_segment - return segment to region 4 - "
     519      );
     520      PUT_ADDRESS_FROM_AREA_4( segment_address_1 );
     521      RTEMS.REGION_RETURN_SEGMENT( SPTEST.REGION_ID( 4 ), segment_address_1, STATUS );
     522      TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_return_segment" );
     523      TEXT_IO.NEW_LINE;
     524
     525      TEXT_IO.PUT(
     526        "TA1 - region_return_segment - return segment to region 4 - "
     527      );
     528      PUT_ADDRESS_FROM_AREA_4( segment_address_3 );
     529      RTEMS.REGION_RETURN_SEGMENT( SPTEST.REGION_ID( 4 ), segment_address_3, STATUS );
     530      TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_return_segment" );
     531      TEXT_IO.NEW_LINE;
     532
     533      TEXT_IO.PUT_LINE( "TA1 - region_delete - delete region 4" );
     534      RTEMS.REGION_DELETE( SPTEST.REGION_ID( 4 ), STATUS );
     535      TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_delete" );
    428536
    429537      TEXT_IO.PUT_LINE( "*** END OF TEST 16 ***" );
  • c/src/ada-tests/sptests/sp16/sptest.ads

    r2fc47c6 r3d2bf71  
    3838--
    3939
    40    REGION_ID   : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID;
    41    REGION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME;
     40   REGION_ID   : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID;
     41   REGION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME;
    4242
    4343--
     
    6262   AREA_3 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8;
    6363   for AREA_3'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
     64
     65   AREA_4 : array ( RTEMS.UNSIGNED32 range 0 .. 8191 ) of RTEMS.UNSIGNED8;
     66   for AREA_4'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT;
    6467
    6568--
  • c/src/ada-tests/sptests/sp20/sp20.scn

    r2fc47c6 r3d2bf71  
    1515TA5 - rate_monotonic_ident id = 16#42010005#
    1616TA5  - (16#42010005#) period 100
     17TA6 - rate_monotonic_create id = 16#42010006#
     18TA6 - rate_monotonic_ident id = 16#42010006#
     19TA6  - (16#42010006#) period 0
    1720TA5 - PERIODS CHECK OK (1)
    1821TA5 - PERIODS CHECK OK (2)
     
    2023TA5 - PERIODS CHECK OK (4)
    2124TA5 - PERIODS CHECK OK (5)
     25TA6 - Actual:  10  Expected:  10 - OK
     26TA6 - Actual:  20  Expected:  20 - OK
     27TA6 - Actual:  30  Expected:  30 - OK
     28TA6 - Actual:  40  Expected:  40 - OK
     29TA6 - Actual:  50  Expected:  50 - OK
     30TA6 - Actual:  60  Expected:  60 - OK
     31TA6 - Actual:  70  Expected:  70 - OK
     32TA6 - Actual:  80  Expected:  80 - OK
     33TA6 - Actual:  90  Expected:  90 - OK
     34TA6 - Actual: 100  Expected: 100 - OK
    2235TA5 - PERIODS CHECK OK (6)
    2336TA5 - PERIODS CHECK OK (7)
  • c/src/ada-tests/sptests/sp20/sptest.adb

    r2fc47c6 r3d2bf71  
    4848      SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME(  'T', 'A', '4', ' ' );
    4949      SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME(  'T', 'A', '5', ' ' );
    50 
    51       for INDEX in 1 .. 5
     50      SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME(  'T', 'A', '6', ' ' );
     51
     52      for INDEX in 1 .. 6
    5253      loop
    5354
     
    6768      end loop;
    6869
    69       for INDEX in 1 .. 5
     70      for INDEX in 1 .. 6
    7071      loop
    7172
    7273         RTEMS.TASK_START(
    7374            SPTEST.TASK_ID( INDEX ),
    74             SPTEST.TASK_1_THROUGH_5'ACCESS,
     75            SPTEST.TASK_1_THROUGH_6'ACCESS,
    7576            RTEMS.TASK_ARGUMENT( INDEX ),
    7677            STATUS
     
    8788--PAGE
    8889--
    89 --  TASK_1_THROUGH_5
    90 --
    91 
    92    procedure TASK_1_THROUGH_5 (
     90--  TASK_1_THROUGH_6
     91--
     92
     93   procedure TASK_1_THROUGH_6 (
    9394      ARGUMENT : in     RTEMS.TASK_ARGUMENT
    9495   ) is
     
    9899      FAILED    : RTEMS.UNSIGNED32;
    99100      STATUS    : RTEMS.STATUS_CODES;
     101      TIME      : array( 0 .. 10 ) of RTEMS.INTERVAL;
     102      PERIOD    : RTEMS.INTERVAL;
     103      MEASURE   : RTEMS.INTERVAL;
    100104   begin
    101105
     
    184188               SPTEST.GET_ALL_COUNTERS;
    185189
    186                for INDEX in 1 .. 4
    187                loop
     190               for INDEX in 1 .. 4 loop
    188191
    189192                  if SPTEST.TEMPORARY_COUNT( INDEX ) /=
     
    231234            end loop;
    232235 
     236         when 6 =>
     237            -- test changing periods
     238            for INDEX in 0 .. 10 loop
     239               PERIOD := RTEMS.INTERVAL( ( INDEX + 1 ) * 10 );
     240               RTEMS.RATE_MONOTONIC_PERIOD( RMID, PERIOD, STATUS);
     241               TEST_SUPPORT.DIRECTIVE_FAILED(
     242                  STATUS, "rate_monotonic_period of TA6"
     243               );
     244
     245               -- timestamp
     246               RTEMS.CLOCK_GET(
     247                  RTEMS.CLOCK_GET_TICKS_SINCE_BOOT,
     248                  Time( INDEX )'ADDRESS,
     249                  STATUS
     250               );
     251               TEST_SUPPORT.DIRECTIVE_FAILED(
     252                  STATUS, "clock_get of TA6"
     253               );
     254            end loop;
     255
     256            for INDEX in 1 .. 10 loop
     257               MEASURE := TIME( INDEX ) - TIME( INDEX - 1 );
     258               PERIOD := RTEMS.INTERVAL( INDEX * 10 );
     259               TEXT_IO.PUT( "TA6 - Actual: " );
     260               UNSIGNED32_IO.PUT( MEASURE, WIDTH => 3, BASE => 10 );
     261               TEXT_IO.PUT( "  Expected: " );
     262               UNSIGNED32_IO.PUT( PERIOD, WIDTH => 3, BASE => 10 );
     263               if PERIOD = MEASURE then
     264                  TEXT_IO.PUT_LINE( " - OK" );
     265               else
     266                  TEXT_IO.PUT_LINE( " - FAILED" );
     267               end if;
     268            end loop;
     269
     270            RTEMS.TASK_SUSPEND( RTEMS.SELF, STATUS );
     271            TEST_SUPPORT.DIRECTIVE_FAILED(
     272               STATUS, "task_suspend of TA6"
     273            );
     274
    233275         when others =>
    234276            NULL;
     
    236278      end case;
    237279
    238    end TASK_1_THROUGH_5;
     280   end TASK_1_THROUGH_6;
    239281
    240282--PAGE
  • c/src/ada-tests/sptests/sp20/sptest.ads

    r2fc47c6 r3d2bf71  
    3030--
    3131
    32    TASK_ID   : array ( 1 .. 5 ) of RTEMS.ID;
    33    TASK_NAME : array ( 1 .. 5 ) of RTEMS.NAME;
     32   TASK_ID   : array ( 1 .. 6 ) of RTEMS.ID;
     33   TASK_NAME : array ( 1 .. 6 ) of RTEMS.NAME;
    3434
    3535--
    3636--  These arrays contain the parameters which define the execution
    3737--  characteristics and periods of each instantiation of the
    38 --  copies of the RTEMS task TASKS_1_THROUGH_5.
     38--  copies of the RTEMS task TASKS_1_THROUGH_6.
    3939--
    4040
    41    PERIODS : constant array ( 1 .. 5 )
    42      of RTEMS.UNSIGNED32 := ( 2, 2, 2, 2, 100 );
     41   PERIODS : constant array ( 1 .. 6 )
     42     of RTEMS.UNSIGNED32 := ( 2, 2, 2, 2, 100, 0 );
    4343
    44    ITERATIONS : constant array ( 1 .. 5 )
    45      of RTEMS.UNSIGNED32 := ( 50, 50, 50, 50, 1 );
     44   ITERATIONS : constant array ( 1 .. 6 )
     45     of RTEMS.UNSIGNED32 := ( 50, 50, 50, 50, 1, 10 );
    4646
    47    PRIORITIES : constant array ( 1 .. 5 )
    48      of RTEMS.UNSIGNED32 := ( 1, 1, 3, 4, 5 );
     47   PRIORITIES : constant array ( 1 .. 6 )
     48     of RTEMS.UNSIGNED32 := ( 1, 1, 3, 4, 5, 1 );
    4949
    5050--
     
    5353--
    5454
    55    type COUNT_ARRAY is array ( 1 .. 5 ) of RTEMS.UNSIGNED32;
     55   type COUNT_ARRAY is array ( 1 .. 6 ) of RTEMS.UNSIGNED32;
    5656
    5757--
     
    8080
    8181--
    82 --  TASK_1_THROUGH_5
     82--  TASK_1_THROUGH_6
    8383--
    8484--  DESCRIPTION:
     
    8787--
    8888
    89    procedure TASK_1_THROUGH_5 (
     89   procedure TASK_1_THROUGH_6 (
    9090      ARGUMENT : in     RTEMS.TASK_ARGUMENT
    9191   );
Note: See TracChangeset for help on using the changeset viewer.