Add uncrustify github workflow (#659)

* Add uncrustify github workflow

* Fix exclusion pattern

* fix find expression

* exclude uncrustify files

* Uncrustify common demo and test files

* exlude white space checking files

* Fix EOL whitespace checker

* Remove whitespaces from EOL

* Fix space at EOL

* Fix find spaces at EOL

Co-authored-by: Archit Aggarwal <architag@amazon.com>
This commit is contained in:
alfred gedeon 2021-07-22 14:23:48 -07:00 committed by GitHub
parent dd80d615b5
commit ae92d8c6ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
191 changed files with 17540 additions and 17102 deletions

View file

@ -33,31 +33,32 @@
void vNondetSetCurrentTCB( void );
void vSetGlobalVariables( void );
void vPrepareTaskLists( void );
TaskHandle_t *pxNondetSetTaskHandle( void );
char *pcNondetSetString( size_t xSizeLength );
TaskHandle_t * pxNondetSetTaskHandle( void );
char * pcNondetSetString( size_t xSizeLength );
void harness()
{
TaskFunction_t pxTaskCode;
char * pcName;
configSTACK_DEPTH_TYPE usStackDepth = STACK_DEPTH;
void * pvParameters;
TaskHandle_t * pxCreatedTask;
TaskFunction_t pxTaskCode;
char * pcName;
configSTACK_DEPTH_TYPE usStackDepth = STACK_DEPTH;
void * pvParameters;
TaskHandle_t * pxCreatedTask;
UBaseType_t uxPriority;
UBaseType_t uxPriority;
__CPROVER_assume( uxPriority < configMAX_PRIORITIES );
vNondetSetCurrentTCB();
vSetGlobalVariables();
vPrepareTaskLists();
vNondetSetCurrentTCB();
vSetGlobalVariables();
vPrepareTaskLists();
pxCreatedTask = pxNondetSetTaskHandle();
pcName = pcNondetSetString( configMAX_TASK_NAME_LEN );
pxCreatedTask = pxNondetSetTaskHandle();
pcName = pcNondetSetString( configMAX_TASK_NAME_LEN );
xTaskCreate(pxTaskCode,
pcName,
usStackDepth,
pvParameters,
uxPriority,
pxCreatedTask );
xTaskCreate( pxTaskCode,
pcName,
usStackDepth,
pvParameters,
uxPriority,
pxCreatedTask );
}

View file

@ -34,16 +34,17 @@
*/
void vNondetSetCurrentTCB( void )
{
pxCurrentTCB = pvPortMalloc( sizeof(TCB_t) );
pxCurrentTCB = pvPortMalloc( sizeof( TCB_t ) );
}
/*
* We just require task lists to be initialized for this proof
*/
void vPrepareTaskLists( void )
{
__CPROVER_assert_zero_allocation();
__CPROVER_assert_zero_allocation();
prvInitialiseTaskLists();
prvInitialiseTaskLists();
}
/*
@ -52,33 +53,35 @@ void vPrepareTaskLists( void )
*/
void vSetGlobalVariables( void )
{
xSchedulerRunning = nondet_basetype();
uxCurrentNumberOfTasks = nondet_ubasetype();
xSchedulerRunning = nondet_basetype();
uxCurrentNumberOfTasks = nondet_ubasetype();
}
/*
* pvPortMalloc is nondeterministic by definition, thus we do not need
* to check for NULL allocation in this function
*/
TaskHandle_t *pxNondetSetTaskHandle( void )
TaskHandle_t * pxNondetSetTaskHandle( void )
{
TaskHandle_t *pxNondetTaskHandle = pvPortMalloc( sizeof(TaskHandle_t) );
return pxNondetTaskHandle;
TaskHandle_t * pxNondetTaskHandle = pvPortMalloc( sizeof( TaskHandle_t ) );
return pxNondetTaskHandle;
}
/*
* Tries to allocate a string of size xStringLength and sets the string
* to be terminated using a nondeterministic index if allocation was successful
*/
char *pcNondetSetString( size_t xStringLength )
char * pcNondetSetString( size_t xStringLength )
{
char *pcName = pvPortMalloc( xStringLength );
char * pcName = pvPortMalloc( xStringLength );
if ( pcName != NULL ) {
size_t uNondetIndex;
__CPROVER_assume( uNondetIndex < xStringLength );
pcName[uNondetIndex] = '\0';
}
if( pcName != NULL )
{
size_t uNondetIndex;
__CPROVER_assume( uNondetIndex < xStringLength );
pcName[ uNondetIndex ] = '\0';
}
return pcName;
return pcName;
}