Changeset 51a95ff9 in rtems


Ignore:
Timestamp:
Oct 7, 2014, 10:43:18 PM (6 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
eb7f306d
Parents:
4efdc8e9
git-author:
Joel Sherrill <joel.sherrill@…> (10/07/14 22:43:18)
git-committer:
Joel Sherrill <joel.sherrill@…> (10/09/14 15:11:57)
Message:

samples/unlimited: Fix printf() warning and clean up

Location:
testsuites/samples/unlimited
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • testsuites/samples/unlimited/init.c

    r4efdc8e9 r51a95ff9  
    5656rtems_task test_task(
    5757  rtems_task_argument my_number
    58   )
     58)
    5959{
    6060  rtems_event_set out;
     61  unsigned int    my_n = (unsigned int) my_number;
    6162
    62   printf( "task %" PRIdrtems_task_argument " has started.\n",  my_number);
     63  printf( "task %u has started.\n",  my_n);
    6364
    6465  rtems_event_receive(1, RTEMS_WAIT | RTEMS_EVENT_ANY, 0, &out);
    6566
    66   printf( "task %" PRIdrtems_task_argument " ending.\n",  my_number);
     67  printf( "task %u ending.\n",  my_n);
    6768
    6869  rtems_task_delete(RTEMS_SELF);
    6970}
    7071
    71 void destory_all_tasks(
     72void destroy_all_tasks(
    7273  const char *who
    7374)
     
    7980   */
    8081
    81   for (task = 0; task < MAX_TASKS; task++)
    82     if (task_id[task])
    83     {
    84       printf(" %s : signal task %08" PRIxrtems_id " to delete, ", who, task_id[task]);
     82  for (task = 0; task < MAX_TASKS; task++) {
     83    if (task_id[task]) {
     84      printf(
     85        " %s : signal task %08" PRIxrtems_id " to delete, ",
     86         who,
     87         task_id[task]
     88      );
    8589      fflush(stdout);
    8690      rtems_event_send(task_id[task], 1);
    8791      task_id[task] = 0;
    8892    }
     93  }
    8994}
    9095
    9196bool status_code_bad(
    9297  rtems_status_code status_code
    93   )
     98)
    9499{
    95100  if (status_code != RTEMS_SUCCESSFUL)
  • testsuites/samples/unlimited/system.h

    r4efdc8e9 r51a95ff9  
    2525
    2626void
    27 destory_all_tasks(
     27destroy_all_tasks(
    2828  const char *who
    2929);
  • testsuites/samples/unlimited/test1.c

    r4efdc8e9 r51a95ff9  
    100100  }
    101101
    102   destory_all_tasks("TEST1");
     102  destroy_all_tasks("TEST1");
    103103
    104104  the_information->auto_extend = auto_extend;
  • testsuites/samples/unlimited/test2.c

    r4efdc8e9 r51a95ff9  
    9696            "         task created = %" PRIi32 ", required number = %i\n",
    9797            task_count, (TASK_ALLOCATION_SIZE * 5) - TASK_INDEX_OFFSET);
    98     destory_all_tasks("TEST2");
     98    destroy_all_tasks("TEST2");
    9999    exit( 1 );
    100100  }
     
    113113                "         task number = %" PRIi32 "\n",
    114114                remove_task);
    115         destory_all_tasks("TEST2");
     115        destroy_all_tasks("TEST2");
    116116        exit( 1 );
    117117      }
     
    123123      removed_ids[task++] = task_id[remove_task];
    124124
    125       printf(" TEST2 : block %" PRIi32 " remove, signal task %08" PRIxrtems_id ", ", block, task_id[remove_task]);
     125      printf(" TEST2 : block %" PRIi32 " remove, signal task %08"
     126               PRIxrtems_id ", ", block, task_id[remove_task]);
    126127      rtems_event_send(task_id[remove_task], 1);
    127128      task_id[remove_task] = 0;
     
    145146    {
    146147      printf( " FAIL2 : no free task id slot.\n");
    147       destory_all_tasks("TEST2");
     148      destroy_all_tasks("TEST2");
    148149      exit( 1 );
    149150    }
     
    165166              "         task number = %" PRIi32 "\n",
    166167              id_slot);
    167       destory_all_tasks("TEST2");
    168       exit( 1 );
    169     }
    170 
    171     printf("number = %3" PRIi32 ", id = %08" PRIxrtems_id ", starting, ", task_count, task_id[id_slot]);
     168      destroy_all_tasks("TEST2");
     169      exit( 1 );
     170    }
     171
     172    printf("number = %3" PRIi32 ", id = %08" PRIxrtems_id ", starting, ",
     173           task_count, task_id[id_slot]);
    172174
    173175    result = rtems_task_start(task_id[id_slot],
     
    180182              "        task number = %" PRIi32 "\n",
    181183              id_slot);
    182       destory_all_tasks("TEST2");
     184      destroy_all_tasks("TEST2");
    183185      exit( 1 );
    184186    }
     
    191193
    192194    /*
    193      *  Search the removed ids to see if it existed, clear the removed id when found
     195     *  Search the removed ids to see if it existed, clear the removed id
     196     *  when found
    194197     */
    195198
     
    213216        if ((task_id[id_slot] == task_id[allocated_id]) && (id_slot != allocated_id))
    214217        {
    215           printf( " FAIL2 : the new id is the same as an id already allocated -\n"
    216                   "         task id = %08" PRIxrtems_id "\n",
    217                   task_id[id_slot]);
     218          printf(
     219            " FAIL2 : the new id is the same as an id already allocated -\n"
     220            "         task id = %08" PRIxrtems_id "\n",
     221            task_id[id_slot]);
    218222          exit( 1 );
    219223        }
     
    228232  }
    229233
    230   destory_all_tasks("TEST2");
     234  destroy_all_tasks("TEST2");
    231235
    232236  printf( " TEST2 : completed\n" );
  • testsuites/samples/unlimited/test3.c

    r4efdc8e9 r51a95ff9  
    145145  }
    146146
    147   destory_all_tasks("TEST3");
     147  destroy_all_tasks("TEST3");
    148148
    149149  printf( " TEST3 : completed\n" );
Note: See TracChangeset for help on using the changeset viewer.