Changeset 6a4ccdf in rtems


Ignore:
Timestamp:
Mar 11, 2011, 8:26:59 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
95fc0a6
Parents:
89ed8a9
Message:

2011-03-11 Joel Sherrill <joel.sherrilL@…>

  • sp08/Makefile.am, sp08/init.c, sp08/sp08.scn, sp09/screen07.c, sp09/sp09.scn: Improve coverage. Change mode while system not up and broadcast a message that is too large.
  • sp08/system.h, sp08/task1.c: Removed.
Location:
testsuites/sptests
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/ChangeLog

    r89ed8a9 r6a4ccdf  
     12011-03-11      Joel Sherrill <joel.sherrilL@OARcorp.com>
     2
     3        * sp08/Makefile.am, sp08/init.c, sp08/sp08.scn, sp09/screen07.c,
     4        sp09/sp09.scn: Improve coverage. Change mode while system not up and
     5        broadcast a message that is too large.
     6        * sp08/system.h, sp08/task1.c: Removed.
     7
    182011-03-11      Joel Sherrill <joel.sherrilL@OARcorp.com>
    29
  • testsuites/sptests/sp08/Makefile.am

    r89ed8a9 r6a4ccdf  
    33##
    44
    5 MANAGERS = io semaphore clock
    6 
    75rtems_tests_PROGRAMS = sp08
    8 sp08_SOURCES = init.c task1.c system.h
     6sp08_SOURCES = init.c
    97
    108dist_rtems_tests_DATA = sp08.scn
     
    1412include $(top_srcdir)/../automake/compile.am
    1513include $(top_srcdir)/../automake/leaf.am
    16 
    17 sp08_LDADD = $(MANAGERS_NOT_WANTED:%=$(PROJECT_LIB)/no-%.rel)
    1814
    1915AM_CPPFLAGS += -I$(top_srcdir)/../support/include
  • testsuites/sptests/sp08/init.c

    r89ed8a9 r6a4ccdf  
    1 /*  Init
    2  *
    3  *  This routine is the initialization task for this test program.
    4  *  It is a user initialization task and has the responsibility for creating
    5  *  and starting the tasks that make up the test.  If the time of day
    6  *  clock is required for the test, it should also be set to a known
    7  *  value by this function.
    8  *
    9  *  Input parameters:
    10  *    argument - task argument
    11  *
    12  *  Output parameters:  NONE
    13  *
    14  *  COPYRIGHT (c) 1989-1999.
     1/*
     2 *  COPYRIGHT (c) 1989-2011.
    153 *  On-Line Applications Research Corporation (OAR).
    164 *
     
    2614#endif
    2715
    28 #define CONFIGURE_INIT
    29 #include "system.h"
     16#include <tmacros.h>
     17
     18#define PRIxModes_Control       PRIx32
     19#define PRIxrtems_mode          PRIxModes_Control
     20
     21#define put_mode( _comment, _output_mode ) \
     22   printf( "%s %08" PRIxrtems_mode "\n", _comment, _output_mode );
    3023
    3124rtems_task Init(
     
    3326)
    3427{
     28  rtems_mode        previous_mode;
    3529  rtems_status_code status;
    3630
    3731  puts( "\n\n*** TEST 8 ***" );
    3832
    39   Task_name[ 1 ] =  rtems_build_name( 'T', 'A', '1', ' ' );
    40 
    41   status = rtems_task_create(
    42     Task_name[ 1 ],
    43     1,
    44     RTEMS_MINIMUM_STACK_SIZE * 2,
    45     RTEMS_DEFAULT_MODES,
    46     RTEMS_DEFAULT_ATTRIBUTES,
    47     &Task_id[ 1 ]
    48   );
    49   directive_failed( status, "rtems_task_create of TA1" );
    50 
    51   status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
    52   directive_failed( status, "rtems_task_start of TA1" );
    53 
    54   status = rtems_task_delete( RTEMS_SELF );
    55   directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
     33/* BEGINNING OF RTEMS_ASR */
     34
     35  status = rtems_task_mode( RTEMS_ASR, RTEMS_ASR_MASK, &previous_mode );
     36  directive_failed( status, "rtems_task_mode" );
     37  put_mode(
     38    "TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode: ",
     39    previous_mode
     40  );
     41
     42  status = rtems_task_mode(
     43    RTEMS_NO_ASR,
     44    RTEMS_ASR_MASK,
     45    &previous_mode
     46  );
     47  directive_failed( status, "rtems_task_mode" );
     48  put_mode(
     49    "TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode: ",
     50    previous_mode
     51  );
     52
     53  status = rtems_task_mode(
     54    RTEMS_NO_ASR,
     55    RTEMS_ASR_MASK,
     56    &previous_mode
     57  );
     58  directive_failed( status, "rtems_task_mode" );
     59  put_mode(
     60    "TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode: ",
     61    previous_mode
     62  );
     63
     64  status = rtems_task_mode(
     65    RTEMS_ASR,
     66    RTEMS_ASR_MASK,
     67    &previous_mode
     68  );
     69  directive_failed( status, "rtems_task_mode" );
     70  put_mode(
     71    "TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode: ",
     72    previous_mode
     73  );
     74
     75/* END OF RTEMS_ASR */
     76
     77/* BEGINNING OF RTEMS_TIMESLICE */
     78
     79  status = rtems_task_mode(
     80    RTEMS_NO_TIMESLICE,
     81    RTEMS_TIMESLICE_MASK,
     82    &previous_mode
     83  );
     84  directive_failed( status, "rtems_task_mode" );
     85  put_mode(
     86    "TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode: ",
     87    previous_mode
     88  );
     89
     90  status = rtems_task_mode(
     91    RTEMS_TIMESLICE,
     92    RTEMS_TIMESLICE_MASK,
     93    &previous_mode
     94  );
     95  directive_failed( status, "rtems_task_mode" );
     96  put_mode(
     97    "TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode: ",
     98    previous_mode
     99  );
     100
     101  status = rtems_task_mode(
     102    RTEMS_TIMESLICE,
     103    RTEMS_TIMESLICE_MASK,
     104    &previous_mode
     105  );
     106  directive_failed( status, "rtems_task_mode" );
     107  put_mode(
     108    "TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode: ",
     109    previous_mode
     110  );
     111
     112  status = rtems_task_mode(
     113    RTEMS_NO_TIMESLICE,
     114    RTEMS_TIMESLICE_MASK,
     115    &previous_mode
     116  );
     117  directive_failed( status, "rtems_task_mode" );
     118  put_mode(
     119    "TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode: ",
     120    previous_mode
     121  );
     122
     123/* END OF RTEMS_TIMESLICE */
     124
     125/* BEGINNING OF RTEMS_PREEMPT */
     126
     127  status = rtems_task_mode(
     128    RTEMS_PREEMPT,
     129    RTEMS_PREEMPT_MASK,
     130    &previous_mode
     131  );
     132  directive_failed( status, "rtems_task_mode" );
     133  put_mode(
     134    "TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode: ",
     135    previous_mode
     136  );
     137
     138  status = rtems_task_mode(
     139    RTEMS_NO_PREEMPT,
     140    RTEMS_PREEMPT_MASK,
     141    &previous_mode
     142  );
     143  directive_failed( status, "rtems_task_mode" );
     144  put_mode(
     145    "TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode: ",
     146    previous_mode
     147  );
     148
     149  status = rtems_task_mode(
     150    RTEMS_NO_PREEMPT,
     151    RTEMS_PREEMPT_MASK,
     152    &previous_mode
     153  );
     154  directive_failed( status, "rtems_task_mode" );
     155  put_mode(
     156    "TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode: ",
     157    previous_mode
     158  );
     159
     160  status = rtems_task_mode(
     161    RTEMS_PREEMPT,
     162    RTEMS_PREEMPT_MASK,
     163    &previous_mode
     164  );
     165  directive_failed( status, "rtems_task_mode" );
     166  put_mode(
     167    "TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode: ",
     168    previous_mode
     169  );
     170
     171/* END OF RTEMS_PREEMPT */
     172
     173/* BEGINNING OF RTEMS_INTERRUPT_LEVEL */
     174
     175  status = rtems_task_mode(
     176    RTEMS_INTERRUPT_LEVEL(3),
     177    RTEMS_INTERRUPT_MASK,
     178    &previous_mode
     179  );
     180  directive_failed( status, "rtems_task_mode" );
     181  put_mode(
     182    "TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 3 ) - previous mode: ",
     183    previous_mode
     184  );
     185
     186  status = rtems_task_mode(
     187    RTEMS_INTERRUPT_LEVEL(5),
     188    RTEMS_INTERRUPT_MASK,
     189    &previous_mode
     190  );
     191  directive_failed( status, "rtems_task_mode" );
     192  put_mode(
     193    "TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 5 ) - previous mode: ",
     194    previous_mode
     195  );
     196
     197/* END OF RTEMS_INTERRUPT_LEVEL */
     198
     199/* BEGINNING OF COMBINATIONS */
     200
     201  status = rtems_task_mode(
     202    RTEMS_INTERRUPT_LEVEL(3) | RTEMS_NO_ASR |
     203      RTEMS_TIMESLICE | RTEMS_NO_PREEMPT,
     204    RTEMS_INTERRUPT_MASK | RTEMS_ASR_MASK |
     205      RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK,
     206    &previous_mode
     207  );
     208  directive_failed( status, "rtems_task_mode" );
     209  put_mode(
     210    "TA1 - rtems_task_mode - set all modes        - previous mode: ",
     211    previous_mode
     212  );
     213
     214  status = rtems_task_mode(
     215    RTEMS_INTERRUPT_LEVEL(3) | RTEMS_NO_ASR |
     216      RTEMS_TIMESLICE | RTEMS_NO_PREEMPT,
     217    RTEMS_INTERRUPT_MASK | RTEMS_ASR_MASK |
     218      RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK,
     219    &previous_mode
     220  );
     221  directive_failed( status, "rtems_task_mode" );
     222  put_mode(
     223    "TA1 - rtems_task_mode - set all modes        - previous mode: ",
     224    previous_mode
     225  );
     226
     227  status = rtems_task_mode(
     228    RTEMS_INTERRUPT_LEVEL(0) | RTEMS_ASR | RTEMS_NO_TIMESLICE | RTEMS_PREEMPT,
     229    RTEMS_INTERRUPT_MASK | RTEMS_ASR_MASK |
     230    RTEMS_TIMESLICE_MASK | RTEMS_PREEMPT_MASK,
     231    &previous_mode
     232  );
     233  directive_failed( status, "rtems_task_mode" );
     234  put_mode(
     235    "TA1 - rtems_task_mode - clear all modes      - previous mode: ",
     236    previous_mode
     237  );
     238
     239/* END OF COMBINATIONS */
     240
     241/* BEGINNING OF CURRENT MODE */
     242
     243  status = rtems_task_mode(
     244    RTEMS_CURRENT_MODE,
     245    RTEMS_CURRENT_MODE,
     246    &previous_mode
     247  );
     248  directive_failed( status, "rtems_task_mode" );
     249  put_mode(
     250    "TA1 - rtems_task_mode - get current mode     - previous mode: ",
     251    previous_mode
     252  );
     253
     254/* END OF CURRENT MODE */
     255
     256/* TEST BEING IN A SYSTEM STATE OTHER THAN UP */
     257  puts( "TA1 - FORCE system state to before multitasking" );
     258  _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
     259
     260  puts( "TA1 - enable preemption mode" );
     261  status = rtems_task_mode(
     262    RTEMS_PREEMPT,
     263    RTEMS_PREEMPT_MASK,
     264    &previous_mode
     265  );
     266  directive_failed( status, "rtems_task_mode" );
     267  put_mode(
     268    "TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode: ",
     269    previous_mode
     270  );
     271
     272  puts( "TA1 - disable preemption mode" );
     273  status = rtems_task_mode(
     274    RTEMS_NO_PREEMPT,
     275    RTEMS_PREEMPT_MASK,
     276    &previous_mode
     277  );
     278  directive_failed( status, "rtems_task_mode" );
     279
     280  puts( "TA1 - Restore system state" );
     281  _System_state_Set( SYSTEM_STATE_UP );
     282
     283/* END OF TEST BEING IN A SYSTEM STATE OTHER THAN UP */
     284
     285  puts( "*** END OF TEST 8 ***" );
     286  rtems_test_exit( 0 );
    56287}
     288
     289/* configuration information */
     290#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
     291#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
     292
     293#define CONFIGURE_MAXIMUM_TASKS             1
     294#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
     295
     296#define CONFIGURE_INIT
     297#include <rtems/confdefs.h>
     298/* end of file */
  • testsuites/sptests/sp08/sp08.scn

    r89ed8a9 r6a4ccdf  
     1
     2
    13*** TEST 8 ***
    2 TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode:  00000000
    3 TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode:  00000000
    4 TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode:  00000400
    5 TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode:  00000400
    6 TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode:  00000000
    7 TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode:  00000000
    8 TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode:  00000200
    9 TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode:  00000200
    10 TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode:  00000000
     4TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode:  00000100
     5TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode:  00000100
     6TA1 - rtems_task_mode - RTEMS_NO_ASR               - previous mode:  00000500
     7TA1 - rtems_task_mode - RTEMS_ASR                  - previous mode:  00000500
     8TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode:  00000100
     9TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode:  00000100
     10TA1 - rtems_task_mode - RTEMS_TIMESLICE            - previous mode:  00000300
     11TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE         - previous mode:  00000300
     12TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode:  00000100
    1113TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode:  00000000
    1214TA1 - rtems_task_mode - RTEMS_NO_PREEMPT           - previous mode:  00000100
    1315TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode:  00000100
    1416TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 3 ) - previous mode:  00000000
    15 TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 5 ) - previous mode:  00000003
    16 TA1 - rtems_task_mode - set all modes        - previous mode:  00000005
    17 TA1 - rtems_task_mode - set all modes        - previous mode:  00000703
    18 TA1 - rtems_task_mode - clear all modes      - previous mode:  00000703
     17TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 5 ) - previous mode:  00000000
     18TA1 - rtems_task_mode - set all modes        - previous mode:  00000000
     19TA1 - rtems_task_mode - set all modes        - previous mode:  00000700
     20TA1 - rtems_task_mode - clear all modes      - previous mode:  00000700
    1921TA1 - rtems_task_mode - get current mode     - previous mode:  00000000
     22TA1 - FORCE system state to before multitasking
     23TA1 - enable preemption mode
     24TA1 - rtems_task_mode - RTEMS_PREEMPT              - previous mode:  00000000
     25TA1 - disable preemption mode
     26TA1 - Restore system state
    2027*** END OF TEST 8 ***
    21 
    22 NOTE: The interrupt level lines will be different on CPUs with few levels.
     280  size = 0x000404f6 .
     29not load section .debug_frame: addr = 0x00000000  size = 0x00004820 .
     30not load section .debug_str: addr = 0x00000000  size = 0x0000f673 .
     31not load section .debug_loc: addr = 0x00000000  size = 0x0001c59c .
     32not load section .debug_pubtypes: addr = 0x00000000  size = 0x0005eac5 .
     33not load section .debug_ranges: addr = 0x00000000  size = 0x000015e0 .
     34not load section .ARM.attributes: addr = 0x00000000  size = 0x00000010 .
     35call ARMul_InitSymTable,kernel filename is sp08.ralf.
     36start addr is set to 0x00000058 by exec file.
  • testsuites/sptests/sp09/screen07.c

    r89ed8a9 r6a4ccdf  
    350350  puts( "TA1 - rtems_message_queue_urgent - RTEMS_INVALID_ID" );
    351351
    352   status = rtems_message_queue_broadcast( Queue_id[ 1 ], NULL, MESSAGE_SIZE, &count );
     352  status = rtems_message_queue_broadcast(
     353     Queue_id[ 1 ], NULL, MESSAGE_SIZE, &count );
    353354  fatal_directive_status(
    354355    status,
     
    356357    "rtems_message_queue_broadcast with NULL count"
    357358  );
    358   puts( "TA1 - rtems_message_queue_broadcast - NULL buffer - RTEMS_INVALID_ADDRESS" );
    359 
    360   status = rtems_message_queue_broadcast( Queue_id[ 1 ], buffer, MESSAGE_SIZE, NULL );
     359  puts(
     360    "TA1 - rtems_message_queue_broadcast - NULL buffer - RTEMS_INVALID_ADDRESS"
     361  );
     362
     363  status = rtems_message_queue_broadcast(
     364     Queue_id[ 1 ], buffer, MESSAGE_SIZE + 1, &count );
     365  fatal_directive_status(
     366    status,
     367    RTEMS_INVALID_SIZE,
     368    "rtems_message_queue_broadcast with too large"
     369  );
     370  puts(
     371    "TA1 - rtems_message_queue_broadcast - too large - RTEMS_INVALID_SIZE"
     372  );
     373
     374  status = rtems_message_queue_broadcast(
     375      Queue_id[ 1 ], buffer, MESSAGE_SIZE, NULL );
    361376  fatal_directive_status(
    362377    status,
  • testsuites/sptests/sp09/sp09.scn

    r89ed8a9 r6a4ccdf  
    152152TA1 - rtems_message_queue_urgent - RTEMS_INVALID_ID
    153153TA1 - rtems_message_queue_broadcast - NULL buffer - RTEMS_INVALID_ADDRESS
     154TA1 - rtems_message_queue_broadcast - too large - RTEMS_INVALID_SIZE
    154155TA1 - rtems_message_queue_broadcast - NULL count - RTEMS_INVALID_ADDRESS
    155156<pause - screen 8>
     
    175176TA3 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL
    176177<pause - screen 9>
    177 TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER
    178 TA1 - rtems_interrupt_catch - bad handler RTEMS_INVALID_ADDRESS
    179 TA1 - rtems_interrupt_catch - old isr RTEMS_INVALID_ADDRESS
     178TA1 - rtems_interrupt_catch - bad handler RTEMS_INVALID_ADDRESS -- SKIPPED
     179TA1 - rtems_interrupt_catch - old isr RTEMS_INVALID_ADDRESS - SKIPPED
    180180TA1 - rtems_signal_send - RTEMS_INVALID_ID
    181181TA1 - rtems_signal_send - RTEMS_INVALID_NUMBER
Note: See TracChangeset for help on using the changeset viewer.