Ignore:
Timestamp:
Nov 15, 1999, 9:25:53 PM (20 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
e672263
Parents:
0f88857
Message:

+ Added check that a task could be sent to a dormant state

then sta_tsk used to restart the task to its initial state.

+ Added calls to ref_tsk to yellow paths for suspended and

ready but not running tasks.

+ Fixed output file to correctly state test name
+ Added priority of preempt to the header file. Allows ref_tsk verification.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/itrontests/itrontask03/init.c

    r0f88857 r06380cfe  
    1  /*  Init
     1/*  Init
    22 *
    33 *  This routine is the initialization task for this test program.
     
    2121#include "system.h"
    2222#include <stdio.h>
     23#include <assert.h>
    2324
    2425void ITRON_Init( void )
     
    2627  ER                status;
    2728  T_CTSK            pk_ctsk;
    28 
    29   puts( "\n\n*** ITRON TASK TEST 3 ***" );
     29  T_RTSK            pk_rtsk;
    3030
    3131  pk_ctsk.exinf    = NULL;
    3232  pk_ctsk.tskatr   = TA_HLNG;
    3333  pk_ctsk.stksz    = RTEMS_MINIMUM_STACK_SIZE;
     34  pk_ctsk.itskpri  = PREEMPT_PRIORITY;
     35  pk_ctsk.task     = Preempt_task;
    3436
    35   pk_ctsk.itskpri  = 1;
    36   pk_ctsk.task     = Preempt_task;
     37  puts( "\n\n*** ITRON TASK TEST 3 ***" );
     38
     39  /*
     40   *  Create and start the Preempt task the first time.
     41   *  Verify that it is dormant when it comes back.
     42   */
     43
     44  puts( "INIT - Create and Start PREEMPT" );
     45  status = chg_pri( TSK_SELF, (PREEMPT_PRIORITY+2) );
     46  directive_failed( status, "chg_pri of SELF" );
     47 
    3748  status = cre_tsk(  PREEMPT_TASK_ID, &pk_ctsk );
    3849  directive_failed( status, "cre_tsk of RTEMS_PREEMPT" );
     50
    3951  status  = sta_tsk( PREEMPT_TASK_ID, 0 );
    4052  directive_failed( status, "sta_tsk of RTEMS_PREEMPT" );
     53  puts( "INIT - rot_rdq - no tasks at this priority" );
     54  status = rot_rdq( 1 );
     55  directive_failed( status, "rot_rdq" );
    4156
     57  puts( "INIT - ref_tsk PREEMPT - Validate DORMANT STATE" );
     58  status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID );
     59  directive_failed( status, "INIT - ref_tsk of RTEMS_PREEMPT");
     60  assert( pk_rtsk.tskstat == TTS_DMT );
     61 
     62  /*
     63   * Restart the Preempt Task.
     64   */
     65
     66  status  = sta_tsk( PREEMPT_TASK_ID, 0 );
     67  directive_failed( status, "sta_tsk of RTEMS_PREEMPT" );
    4268  puts( "INIT - rot_rdq - yielding processor" );
    4369  status = rot_rdq( 1 );
    4470  directive_failed( status, "rot_rdq" );
     71  puts( "INIT - ref_tsk PREEMPT - Validate no longer exists" );
     72  status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID );
     73  assert( status == E_NOEXS );
    4574
     75  status = chg_pri( TSK_SELF, PREEMPT_PRIORITY );
     76  directive_failed( status, "chg_pri of SELF" );
     77 
     78  /*
     79   * XXX
     80   */
     81       
    4682  pk_ctsk.itskpri  = 3;
    4783  pk_ctsk.task     = Task_1;
     
    6399  status  = sta_tsk( TA3_ID, 0 );
    64100  directive_failed( status, "sta_tsk of TA3" );
     101  puts( "INIT - ref_tsk TA1 - Validate READY STATE" );
     102  status = ref_tsk( &pk_rtsk, TA1_ID);
     103  directive_failed( status, "INIT - ref_tsk of TA1");
     104  assert( pk_rtsk.tskstat == TTS_RDY );
    65105
    66106  puts( "INIT - suspending TA2 while middle task on a ready chain" );
    67107  status = sus_tsk( TA2_ID  );
    68108  directive_failed( status, "sus_tsk of TA2" );
     109  status = ref_tsk( &pk_rtsk, TA2_ID);
     110  directive_failed( status, "INIT - ref_tsk of TA2");
     111  assert( pk_rtsk.tskstat == TTS_SUS );
    69112
    70113  status = ter_tsk( TA1_ID );
     
    90133 
    91134  exd_tsk();
    92   directive_failed( 0, "exd_tsk" );
     135  assert(0);
    93136}
    94137
     138
     139
     140
     141
     142
Note: See TracChangeset for help on using the changeset viewer.