Changeset 51a95ff9 in rtems
- Timestamp:
- 10/07/14 22:43:18 (9 years ago)
- Branches:
- 4.11, 5, 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)
- Location:
- testsuites/samples/unlimited
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/samples/unlimited/init.c
r4efdc8e9 r51a95ff9 56 56 rtems_task test_task( 57 57 rtems_task_argument my_number 58 58 ) 59 59 { 60 60 rtems_event_set out; 61 unsigned int my_n = (unsigned int) my_number; 61 62 62 printf( "task % " PRIdrtems_task_argument " has started.\n", my_number);63 printf( "task %u has started.\n", my_n); 63 64 64 65 rtems_event_receive(1, RTEMS_WAIT | RTEMS_EVENT_ANY, 0, &out); 65 66 66 printf( "task % " PRIdrtems_task_argument " ending.\n", my_number);67 printf( "task %u ending.\n", my_n); 67 68 68 69 rtems_task_delete(RTEMS_SELF); 69 70 } 70 71 71 void dest ory_all_tasks(72 void destroy_all_tasks( 72 73 const char *who 73 74 ) … … 79 80 */ 80 81 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 ); 85 89 fflush(stdout); 86 90 rtems_event_send(task_id[task], 1); 87 91 task_id[task] = 0; 88 92 } 93 } 89 94 } 90 95 91 96 bool status_code_bad( 92 97 rtems_status_code status_code 93 98 ) 94 99 { 95 100 if (status_code != RTEMS_SUCCESSFUL) -
testsuites/samples/unlimited/system.h
r4efdc8e9 r51a95ff9 25 25 26 26 void 27 dest ory_all_tasks(27 destroy_all_tasks( 28 28 const char *who 29 29 ); -
testsuites/samples/unlimited/test1.c
r4efdc8e9 r51a95ff9 100 100 } 101 101 102 dest ory_all_tasks("TEST1");102 destroy_all_tasks("TEST1"); 103 103 104 104 the_information->auto_extend = auto_extend; -
testsuites/samples/unlimited/test2.c
r4efdc8e9 r51a95ff9 96 96 " task created = %" PRIi32 ", required number = %i\n", 97 97 task_count, (TASK_ALLOCATION_SIZE * 5) - TASK_INDEX_OFFSET); 98 dest ory_all_tasks("TEST2");98 destroy_all_tasks("TEST2"); 99 99 exit( 1 ); 100 100 } … … 113 113 " task number = %" PRIi32 "\n", 114 114 remove_task); 115 dest ory_all_tasks("TEST2");115 destroy_all_tasks("TEST2"); 116 116 exit( 1 ); 117 117 } … … 123 123 removed_ids[task++] = task_id[remove_task]; 124 124 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]); 126 127 rtems_event_send(task_id[remove_task], 1); 127 128 task_id[remove_task] = 0; … … 145 146 { 146 147 printf( " FAIL2 : no free task id slot.\n"); 147 dest ory_all_tasks("TEST2");148 destroy_all_tasks("TEST2"); 148 149 exit( 1 ); 149 150 } … … 165 166 " task number = %" PRIi32 "\n", 166 167 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]); 172 174 173 175 result = rtems_task_start(task_id[id_slot], … … 180 182 " task number = %" PRIi32 "\n", 181 183 id_slot); 182 dest ory_all_tasks("TEST2");184 destroy_all_tasks("TEST2"); 183 185 exit( 1 ); 184 186 } … … 191 193 192 194 /* 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 194 197 */ 195 198 … … 213 216 if ((task_id[id_slot] == task_id[allocated_id]) && (id_slot != allocated_id)) 214 217 { 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]); 218 222 exit( 1 ); 219 223 } … … 228 232 } 229 233 230 dest ory_all_tasks("TEST2");234 destroy_all_tasks("TEST2"); 231 235 232 236 printf( " TEST2 : completed\n" ); -
testsuites/samples/unlimited/test3.c
r4efdc8e9 r51a95ff9 145 145 } 146 146 147 dest ory_all_tasks("TEST3");147 destroy_all_tasks("TEST3"); 148 148 149 149 printf( " TEST3 : completed\n" );
Note: See TracChangeset
for help on using the changeset viewer.