]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/WIN32-MingW/code_coverage_additions.c
Added uxTaskGetStackHighWaterMark2(), which is the same as uxTaskGetStackHighWaterMar...
[freertos] / FreeRTOS / Demo / WIN32-MingW / code_coverage_additions.c
1 /*\r
2  * FreeRTOS Kernel V10.1.1\r
3  * Copyright (C) 2018 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
6  * this software and associated documentation files (the "Software"), to deal in\r
7  * the Software without restriction, including without limitation the rights to\r
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
9  * the Software, and to permit persons to whom the Software is furnished to do so,\r
10  * subject to the following conditions:\r
11  *\r
12  * The above copyright notice and this permission notice shall be included in all\r
13  * copies or substantial portions of the Software.\r
14  *\r
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
21  *\r
22  * http://www.FreeRTOS.org\r
23  * http://aws.amazon.com/freertos\r
24  *\r
25  * 1 tab == 4 spaces!\r
26  */\r
27 \r
28 /*\r
29  * Contains sundry tests to exercise code that is not touched by the standard\r
30  * demo tasks (which are predominantly test tasks).  Some tests are incldued\r
31  * here because they can only be executed when configASSERT() is not defined.\r
32  */\r
33 \r
34 #include "FreeRTOS.h"\r
35 #include "task.h"\r
36 #include "timers.h"\r
37 #include "event_groups.h"\r
38 #include "semphr.h"\r
39 #include "stream_buffer.h"\r
40 #include "message_buffer.h"\r
41 \r
42 /*-----------------------------------------------------------*/\r
43 \r
44 /*\r
45  * Try creating static objects with one of the mandatory parameters set to NULL.\r
46  * This can't be done in the standard demos as asserts() will get hit.\r
47  */\r
48 static BaseType_t prvStaticAllocationsWithNullBuffers( void );\r
49 \r
50 /*\r
51  * Code coverage analysis is performed with tracing turned off, so this\r
52  * function executes the trace specific utility functions that would not\r
53  * otherwise be executed..\r
54  */\r
55 static BaseType_t prvTraceUtils( void );\r
56 \r
57 /*\r
58  * The queue peek standard demo does not cover the case where an attempt to peek\r
59  * times out, so test that case.\r
60  */\r
61 static BaseType_t prvPeekTimeout( void );\r
62 \r
63 /*\r
64  * Calls various interrupt safe functions designed to query the state of a\r
65  * queue.\r
66  */\r
67 static BaseType_t prvQueueQueryFromISR( void );\r
68 \r
69 /*\r
70  * Hits a few paths in tasks state and status query functions not otherwise hit\r
71  * by standard demo and test files.\r
72  */\r
73 static BaseType_t prvTaskQueryFunctions( void );\r
74 \r
75 /*\r
76  * None of the standard demo tasks use the task tags - exercise them here.\r
77  */\r
78 static BaseType_t prvTaskTags( void );\r
79 \r
80 /*\r
81  * Exercises a few of the query functions that are not otherwise exercised in\r
82  * the standard demo and test functions.\r
83  */\r
84 static BaseType_t prvTimerQuery( void );\r
85 \r
86 /*-----------------------------------------------------------*/\r
87 \r
88 static BaseType_t prvStaticAllocationsWithNullBuffers( void )\r
89 {\r
90 uint32_t ulReturned = 0;\r
91 BaseType_t xReturn = pdPASS;\r
92 UBaseType_t uxDummy = 10;\r
93 \r
94         /* Don't expect to create any of the objects as a NULL parameter is always\r
95         passed in place of a required buffer.  Hence if all passes then none of the\r
96         |= will be against 0, and ulReturned will still be zero at the end of this\r
97         function. */\r
98         ulReturned |= ( uint32_t ) xEventGroupCreateStatic( NULL );\r
99 \r
100         /* Try creating a task twice, once with puxStackBuffer NULL, and once with\r
101         pxTaskBuffer NULL. */\r
102         ulReturned |= ( uint32_t ) xTaskCreateStatic( NULL, /* Task to run, not needed as the task is not created. */\r
103                                                                                                   "Dummy", /* Task name. */\r
104                                                                                                   configMINIMAL_STACK_SIZE,\r
105                                                                                                   NULL,\r
106                                                                                                   tskIDLE_PRIORITY,\r
107                                                                                                   NULL,\r
108                                                                                                   ( StaticTask_t * ) &xReturn ); /* Dummy value just to pass a non NULL value in - won't get used. */\r
109 \r
110         ulReturned |= ( uint32_t ) xTaskCreateStatic( NULL, /* Task to run, not needed as the task is not created. */\r
111                                                                                                   "Dummy", /* Task name. */\r
112                                                                                                   configMINIMAL_STACK_SIZE,\r
113                                                                                                   NULL,\r
114                                                                                                   tskIDLE_PRIORITY,\r
115                                                                                                   ( StackType_t  * ) &xReturn, /* Dummy value just to pass a non NULL value in - won't get used. */\r
116                                                                                                   NULL );\r
117 \r
118         ulReturned |= ( uint32_t ) xQueueCreateStatic( uxDummy,\r
119                                                                                                    uxDummy,\r
120                                                                                                    ( uint8_t * ) &xReturn, /* Dummy value just to pass a non NULL value in - won't get used. */\r
121                                                                                                    NULL );\r
122 \r
123         /* Try creating a stream buffer twice, once with pucStreamBufferStorageArea\r
124         set to NULL, and once with pxStaticStreamBuffer set to NULL. */\r
125         ulReturned |= ( uint32_t ) xStreamBufferCreateStatic( uxDummy,\r
126                                                                                                                   uxDummy,\r
127                                                                                                                   NULL,\r
128                                                                                                                   ( StaticStreamBuffer_t  * ) &xReturn ); /* Dummy value just to pass a non NULL value in - won't get used. */\r
129 \r
130         ulReturned |= ( uint32_t ) xStreamBufferCreateStatic( uxDummy,\r
131                                                                                                                   uxDummy,\r
132                                                                                                                   ( uint8_t * ) &xReturn, /* Dummy value just to pass a non NULL value in - won't get used. */\r
133                                                                                                                   NULL );\r
134 \r
135         /* Try to create a task with a stack that is too large to be allocated. */\r
136         if( xTaskCreate( NULL, "TooLarge", configTOTAL_HEAP_SIZE, NULL, tskIDLE_PRIORITY, NULL ) != errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY )\r
137         {\r
138                 xReturn = pdFAIL;\r
139         }\r
140 \r
141         if( ulReturned != 0 )\r
142         {\r
143                 /* Something returned a non-NULL value. */\r
144                 xReturn = pdFAIL;\r
145         }\r
146 \r
147         return xReturn;\r
148 }\r
149 /*-----------------------------------------------------------*/\r
150 \r
151 static BaseType_t prvTraceUtils( void )\r
152 {\r
153 EventGroupHandle_t xEventGroup;\r
154 QueueHandle_t xQueue;\r
155 BaseType_t xReturn = pdPASS;\r
156 const UBaseType_t xNumber = ( UBaseType_t ) 100, xQueueLength = ( UBaseType_t ) 1;\r
157 UBaseType_t uxValue;\r
158 TaskHandle_t xTaskHandle;\r
159 StreamBufferHandle_t xStreamBuffer;\r
160 MessageBufferHandle_t xMessageBuffer;\r
161 \r
162         /* Exercise the event group trace utilities. */\r
163         xEventGroup = xEventGroupCreate();\r
164 \r
165         if( xEventGroup != NULL )\r
166         {\r
167                 vEventGroupSetNumber( xEventGroup, xNumber );\r
168                 if( uxEventGroupGetNumber( NULL ) != 0 )\r
169                 {\r
170                         xReturn = pdFAIL;\r
171                 }\r
172                 if( uxEventGroupGetNumber( xEventGroup ) != xNumber )\r
173                 {\r
174                         xReturn = pdFAIL;\r
175                 }\r
176 \r
177                 vEventGroupDelete( xEventGroup );\r
178         }\r
179         else\r
180         {\r
181                 xReturn = pdFAIL;\r
182         }\r
183 \r
184         /* Exercise the queue trace utilities. */\r
185         xQueue = xQueueCreate( xQueueLength, ( UBaseType_t ) sizeof( uxValue ) );\r
186         if( xQueue != NULL )\r
187         {\r
188                 vQueueSetQueueNumber( xQueue, xNumber );\r
189                 if( uxQueueGetQueueNumber( xQueue ) != xNumber )\r
190                 {\r
191                         xReturn = pdFAIL;\r
192                 }\r
193                 if( ucQueueGetQueueType( xQueue ) != queueQUEUE_TYPE_BASE )\r
194                 {\r
195                         xReturn = pdFAIL;\r
196                 }\r
197 \r
198                 vQueueDelete( xQueue );\r
199         }\r
200         else\r
201         {\r
202                 xReturn = pdFAIL;\r
203         }\r
204 \r
205         /* Exercise the task trace utilities.  Value of 100 is arbitrary, just want\r
206         to check the value that is set is also read back. */\r
207         uxValue = 100;\r
208         xTaskHandle = xTaskGetCurrentTaskHandle();\r
209         vTaskSetTaskNumber( xTaskHandle, uxValue );\r
210         if( uxTaskGetTaskNumber( xTaskHandle ) != uxValue )\r
211         {\r
212                 xReturn = pdFAIL;\r
213         }\r
214         if( uxTaskGetTaskNumber( NULL ) != 0 )\r
215         {\r
216                 xReturn = pdFAIL;\r
217         }\r
218 \r
219         /* Timer trace util functions are exercised in prvTimerQuery(). */\r
220 \r
221 \r
222         /* Exercise the stream buffer utilities.  Try creating with a trigger level\r
223         of 0, it should then get capped to 1. */\r
224         xStreamBuffer = xStreamBufferCreate( sizeof( uint32_t ), 0 );\r
225         if( xStreamBuffer != NULL )\r
226         {\r
227                 vStreamBufferSetStreamBufferNumber( xStreamBuffer, uxValue );\r
228                 if( uxStreamBufferGetStreamBufferNumber( xStreamBuffer ) != uxValue )\r
229                 {\r
230                         xReturn = pdFALSE;\r
231                 }\r
232                 if( ucStreamBufferGetStreamBufferType( xStreamBuffer ) != 0 )\r
233                 {\r
234                         /* "Is Message Buffer" flag should have been 0. */\r
235                         xReturn = pdFALSE;\r
236                 }\r
237 \r
238                 vStreamBufferDelete( xStreamBuffer );\r
239         }\r
240         else\r
241         {\r
242                 xReturn = pdFALSE;\r
243         }\r
244 \r
245         xMessageBuffer = xMessageBufferCreate( sizeof( uint32_t ) );\r
246         if( xMessageBuffer != NULL )\r
247         {\r
248                 if( ucStreamBufferGetStreamBufferType( xMessageBuffer ) == 0 )\r
249                 {\r
250                         /* "Is Message Buffer" flag should have been 1. */\r
251                         xReturn = pdFALSE;\r
252                 }\r
253 \r
254                 vMessageBufferDelete( xMessageBuffer );\r
255         }\r
256         else\r
257         {\r
258                 xReturn = pdFALSE;\r
259         }\r
260 \r
261         return xReturn;\r
262 }\r
263 /*-----------------------------------------------------------*/\r
264 \r
265 static BaseType_t prvPeekTimeout( void )\r
266 {\r
267 QueueHandle_t xHandle;\r
268 const UBaseType_t xQueueLength = 1;\r
269 BaseType_t xReturn = pdPASS;\r
270 TickType_t xBlockTime = ( TickType_t ) 2;\r
271 UBaseType_t uxReceived;\r
272 \r
273         /* Create the queue just to try peeking it while it is empty. */\r
274         xHandle = xQueueCreate( xQueueLength, ( UBaseType_t ) sizeof( xQueueLength ) );\r
275 \r
276         if( xHandle != NULL )\r
277         {\r
278                 if( uxQueueMessagesWaiting( xHandle ) != 0 )\r
279                 {\r
280                         xReturn = pdFAIL;\r
281                 }\r
282 \r
283                 /* Ensure peeking from the queue times out as the queue is empty. */\r
284                 if( xQueuePeek( xHandle, &uxReceived, xBlockTime ) != pdFALSE )\r
285                 {\r
286                         xReturn = pdFAIL;\r
287                 }\r
288 \r
289                 vQueueDelete( xHandle );\r
290         }\r
291         else\r
292         {\r
293                 xReturn = pdFAIL;\r
294         }\r
295 \r
296         return xReturn;\r
297 }\r
298 /*-----------------------------------------------------------*/\r
299 \r
300 static BaseType_t prvQueueQueryFromISR( void )\r
301 {\r
302 BaseType_t xReturn = pdPASS, xValue = 1;\r
303 const UBaseType_t xISRQueueLength = ( UBaseType_t ) 1;\r
304 const char *pcISRQueueName = "ISRQueue";\r
305 QueueHandle_t xISRQueue = NULL;\r
306 \r
307         xISRQueue = xQueueCreate( xISRQueueLength, ( UBaseType_t ) sizeof( BaseType_t ) );\r
308 \r
309         if( xISRQueue != NULL )\r
310         {\r
311                 vQueueAddToRegistry( xISRQueue, pcISRQueueName );\r
312                 if( strcmp( pcQueueGetName( xISRQueue ), pcISRQueueName ) )\r
313                 {\r
314                         xReturn = pdFAIL;\r
315                 }\r
316 \r
317                 /* Expect the queue to be empty here. */\r
318                 if(     uxQueueMessagesWaitingFromISR( xISRQueue ) != 0 )\r
319                 {\r
320                         xReturn = pdFAIL;\r
321                 }\r
322 \r
323                 if( xQueueIsQueueEmptyFromISR( xISRQueue ) != pdTRUE )\r
324                 {\r
325                         xReturn = pdFAIL;\r
326                 }\r
327 \r
328                 if( xQueueIsQueueFullFromISR( xISRQueue ) != pdFALSE )\r
329                 {\r
330                         xReturn = pdFAIL;\r
331                 }\r
332 \r
333                 /* Now fill the queue - it only has one space. */\r
334                 if( xQueueSendFromISR( xISRQueue, &xValue, NULL ) != pdPASS )\r
335                 {\r
336                         xReturn = pdFAIL;\r
337                 }\r
338 \r
339                 /* Check it now reports as full. */\r
340                 if(     uxQueueMessagesWaitingFromISR( xISRQueue ) != 1 )\r
341                 {\r
342                         xReturn = pdFAIL;\r
343                 }\r
344 \r
345                 if( xQueueIsQueueEmptyFromISR( xISRQueue ) != pdFALSE )\r
346                 {\r
347                         xReturn = pdFAIL;\r
348                 }\r
349 \r
350                 if( xQueueIsQueueFullFromISR( xISRQueue ) != pdTRUE )\r
351                 {\r
352                         xReturn = pdFAIL;\r
353                 }\r
354 \r
355                 vQueueDelete( xISRQueue );\r
356         }\r
357         else\r
358         {\r
359                 xReturn = pdFAIL;\r
360         }\r
361 \r
362         return xReturn;\r
363 }\r
364 /*-----------------------------------------------------------*/\r
365 \r
366 static BaseType_t prvTaskQueryFunctions( void )\r
367 {\r
368 static TaskStatus_t xStatus, *pxStatusArray;\r
369 TaskHandle_t xTimerTask, xIdleTask;\r
370 BaseType_t xReturn = pdPASS;\r
371 UBaseType_t uxNumberOfTasks, uxReturned, ux;\r
372 uint32_t ulTotalRunTime1, ulTotalRunTime2;\r
373 const uint32_t ulRunTimeTollerance = ( uint32_t ) 0xfff;\r
374 \r
375         /* Obtain task status with the stack high water mark and without the\r
376         state. */\r
377         vTaskGetInfo( NULL, &xStatus, pdTRUE, eRunning );\r
378 \r
379         if( uxTaskGetStackHighWaterMark( NULL ) != xStatus.usStackHighWaterMark )\r
380         {\r
381                 xReturn = pdFAIL;\r
382         }\r
383 \r
384         if( uxTaskGetStackHighWaterMark2( NULL ) != ( configSTACK_DEPTH_TYPE ) xStatus.usStackHighWaterMark )\r
385         {\r
386                 xReturn = pdFAIL;\r
387         }\r
388 \r
389         /* Now obtain a task status without the high water mark but with the state,\r
390         which in the case of the idle task should be Read. */\r
391         xTimerTask = xTimerGetTimerDaemonTaskHandle();\r
392         vTaskSuspend( xTimerTask ); /* Should never suspend Timer task normally!. */\r
393         vTaskGetInfo( xTimerTask, &xStatus, pdFALSE, eInvalid );\r
394         if( xStatus.eCurrentState != eSuspended )\r
395         {\r
396                 xReturn = pdFAIL;\r
397         }\r
398         if( xStatus.uxBasePriority != uxTaskPriorityGetFromISR( xTimerTask ) )\r
399         {\r
400                 xReturn = pdFAIL;\r
401         }\r
402         if( xStatus.uxBasePriority != ( configMAX_PRIORITIES - 1 ) )\r
403         {\r
404                 xReturn = pdFAIL;\r
405         }\r
406         xTaskResumeFromISR( xTimerTask );\r
407         vTaskGetInfo( xTimerTask, &xStatus, pdTRUE, eInvalid );\r
408         if( ( xStatus.eCurrentState != eReady ) && ( xStatus.eCurrentState != eBlocked ) )\r
409         {\r
410                 xReturn = pdFAIL;\r
411         }\r
412         if( uxTaskGetStackHighWaterMark( xTimerTask ) != xStatus.usStackHighWaterMark )\r
413         {\r
414                 xReturn = pdFAIL;\r
415         }\r
416         if( uxTaskGetStackHighWaterMark2( xTimerTask ) != ( configSTACK_DEPTH_TYPE ) xStatus.usStackHighWaterMark )\r
417         {\r
418                 xReturn = pdFAIL;\r
419         }\r
420 \r
421         /* Attempting to abort a delay in the idle task should be guaranteed to\r
422         fail as the idle task should never block. */\r
423         xIdleTask = xTaskGetIdleTaskHandle();\r
424         if( xTaskAbortDelay( xIdleTask ) != pdFAIL )\r
425         {\r
426                 xReturn = pdFAIL;\r
427         }\r
428 \r
429         /* Create an array of task status objects large enough to hold information\r
430         on the number of tasks at this time - note this may change at any time if\r
431         higher priority tasks are executing and creating tasks. */\r
432         uxNumberOfTasks = uxTaskGetNumberOfTasks();\r
433         pxStatusArray = ( TaskStatus_t * ) pvPortMalloc( uxNumberOfTasks * sizeof( TaskStatus_t ) );\r
434 \r
435         if( pxStatusArray != NULL )\r
436         {\r
437                 /* Pass part of the array into uxTaskGetSystemState() to ensure it doesn't\r
438                 try using more space than there is available. */\r
439                 uxReturned = uxTaskGetSystemState( pxStatusArray, uxNumberOfTasks / ( UBaseType_t ) 2, NULL );\r
440                 if( uxReturned != ( UBaseType_t ) 0 )\r
441                 {\r
442                         xReturn = pdFAIL;\r
443                 }\r
444 \r
445                 /* Now do the same but passing in the complete array size, this is done\r
446                 twice to check for a difference in the total run time. */\r
447                 uxTaskGetSystemState( pxStatusArray, uxNumberOfTasks, &ulTotalRunTime1 );\r
448                 memset( ( void * ) pxStatusArray, 0xaa, uxNumberOfTasks * sizeof( TaskStatus_t ) );\r
449                 uxReturned = uxTaskGetSystemState( pxStatusArray, uxNumberOfTasks, &ulTotalRunTime2 );\r
450                 if( ( ulTotalRunTime2 - ulTotalRunTime1 ) > ulRunTimeTollerance )\r
451                 {\r
452                         xReturn = pdFAIL;\r
453                 }\r
454 \r
455                 /* Basic santity check of array contents. */\r
456                 for( ux = 0; ux < uxReturned; ux++ )\r
457                 {\r
458                         if( pxStatusArray[ ux ].eCurrentState >= ( UBaseType_t ) eInvalid )\r
459                         {\r
460                                 xReturn = pdFAIL;\r
461                         }\r
462                         if( pxStatusArray[ ux ].uxCurrentPriority >= ( UBaseType_t ) configMAX_PRIORITIES )\r
463                         {\r
464                                 xReturn = pdFAIL;\r
465                         }\r
466                 }\r
467 \r
468                 vPortFree( pxStatusArray );\r
469         }\r
470         else\r
471         {\r
472                 xReturn = pdFAIL;\r
473         }\r
474 \r
475         return xReturn;\r
476 }\r
477 /*-----------------------------------------------------------*/\r
478 \r
479 static BaseType_t prvDummyTagFunction( void *pvParameter )\r
480 {\r
481         return ( BaseType_t ) pvParameter;\r
482 }\r
483 /*-----------------------------------------------------------*/\r
484 \r
485 static BaseType_t prvTaskTags( void )\r
486 {\r
487 BaseType_t xReturn = pdPASS, xParameter = ( BaseType_t ) 0xDEADBEEF;\r
488 TaskHandle_t xTask;\r
489 \r
490         /* First try with the handle of a different task.  Use the timer task for\r
491         convenience. */\r
492         xTask = xTimerGetTimerDaemonTaskHandle();\r
493 \r
494         vTaskSetApplicationTaskTag( xTask, prvDummyTagFunction );\r
495         if( xTaskGetApplicationTaskTag( xTask ) != prvDummyTagFunction )\r
496         {\r
497                 xReturn = pdFAIL;\r
498         }\r
499         else\r
500         {\r
501                 if( xTaskCallApplicationTaskHook( xTask, ( void * ) xParameter ) != xParameter )\r
502                 {\r
503                         xReturn = pdFAIL;\r
504                 }\r
505                 if( xTaskCallApplicationTaskHook( xTask, ( void * ) NULL ) != pdFAIL )\r
506                 {\r
507                         xReturn = pdFAIL;\r
508                 }\r
509         }\r
510 \r
511         /* Now try with a NULL handle, so using this task. */\r
512         vTaskSetApplicationTaskTag( NULL, NULL );\r
513         if( xTaskGetApplicationTaskTag( NULL ) != NULL )\r
514         {\r
515                 xReturn = pdFAIL;\r
516         }\r
517 \r
518         vTaskSetApplicationTaskTag( NULL, prvDummyTagFunction );\r
519         if( xTaskGetApplicationTaskTag( NULL ) != prvDummyTagFunction )\r
520         {\r
521                 xReturn = pdFAIL;\r
522         }\r
523         else\r
524         {\r
525                 if( xTaskCallApplicationTaskHook( NULL, ( void * ) xParameter ) != xParameter )\r
526                 {\r
527                         xReturn = pdFAIL;\r
528                 }\r
529                 if( xTaskCallApplicationTaskHook( NULL, ( void * ) NULL ) != pdFAIL )\r
530                 {\r
531                         xReturn = pdFAIL;\r
532                 }\r
533         }\r
534 \r
535         vTaskSetApplicationTaskTag( NULL, NULL );\r
536         if( xTaskGetApplicationTaskTag( NULL ) != NULL )\r
537         {\r
538                 xReturn = pdFAIL;\r
539         }\r
540 \r
541         return xReturn;\r
542 }\r
543 /*-----------------------------------------------------------*/\r
544 \r
545 static BaseType_t prvTimerQuery( void )\r
546 {\r
547 TimerHandle_t xTimer;\r
548 BaseType_t xReturn = pdPASS;\r
549 const char *pcTimerName = "TestTimer";\r
550 const TickType_t xTimerPeriod = ( TickType_t ) 100;\r
551 const UBaseType_t uxTimerNumber = ( UBaseType_t ) 55;\r
552 \r
553         xTimer = xTimerCreate(  pcTimerName,\r
554                                                         xTimerPeriod,\r
555                                                         pdFALSE,\r
556                                                         ( void * ) xTimerPeriod,\r
557                                                         NULL ); /* Not actually going to start timer so NULL callback is ok. */\r
558 \r
559         if( xTimer != NULL )\r
560         {\r
561                 if( xTimerGetPeriod( xTimer ) != xTimerPeriod )\r
562                 {\r
563                         xReturn = pdFAIL;\r
564                 }\r
565 \r
566                 if( strcmp( pcTimerGetName( xTimer ), pcTimerName ) != 0 )\r
567                 {\r
568                         xReturn = pdFAIL;\r
569                 }\r
570 \r
571                 vTimerSetTimerNumber( xTimer, uxTimerNumber );\r
572                 if( uxTimerGetTimerNumber( xTimer ) != uxTimerNumber )\r
573                 {\r
574                         xReturn = pdFAIL;\r
575                 }\r
576 \r
577                 xTimerDelete( xTimer, portMAX_DELAY );\r
578         }\r
579         else\r
580         {\r
581                 xReturn = pdFAIL;\r
582         }\r
583 \r
584         return xReturn;\r
585 }\r
586 /*-----------------------------------------------------------*/\r
587 \r
588 BaseType_t xRunCodeCoverageTestAdditions( void )\r
589 {\r
590 BaseType_t xReturn = pdPASS;\r
591 \r
592         xReturn &= prvStaticAllocationsWithNullBuffers();\r
593         xReturn &= prvTraceUtils();\r
594         xReturn &= prvPeekTimeout();\r
595         xReturn &= prvQueueQueryFromISR();\r
596         xReturn &= prvTaskQueryFunctions();\r
597         xReturn &= prvTaskTags();\r
598         xReturn &= prvTimerQuery();\r
599 \r
600         return xReturn;\r
601 }\r
602 /*-----------------------------------------------------------*/\r
603 \r