FreeRTOS-Kernel/FreeRTOS-Plus/Test/CBMC/proofs/SkipNameField/SkipNameField_harness.c
Aniruddha Kanhere cb7edd2323
Sync with a:FR (#75)
* AFR sync

* AFR sync: CBMC

* AFR sync: CBMC: remove .bak files

* AFR sync: CBMC: more cleanup

* Corrected CBMC proofs

* Corrected CBMC patches

* Corrected CBMC patches-1

* Corrected CBMC patches-2

* remove .bak files (3)

Co-authored-by: Yuhui Zheng <10982575+yuhui-zheng@users.noreply.github.com>
2020-05-28 10:11:58 -07:00

54 lines
1.4 KiB
C

/* Standard includes. */
#include <stdint.h>
/* FreeRTOS includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "list.h"
#include "semphr.h"
/* FreeRTOS+TCP includes. */
#include "FreeRTOS_IP.h"
#include "FreeRTOS_Sockets.h"
#include "FreeRTOS_IP_Private.h"
#include "FreeRTOS_UDP_IP.h"
#include "FreeRTOS_DNS.h"
#include "NetworkBufferManagement.h"
#include "NetworkInterface.h"
#include "IPTraceMacroDefaults.h"
#include "cbmc.h"
/****************************************************************
* Signature of function under test
****************************************************************/
size_t prvSkipNameField( const uint8_t *pucByte, size_t uxLength );
/****************************************************************
* Proof of prvSkipNameField function contract
****************************************************************/
void harness() {
__CPROVER_assert(NETWORK_BUFFER_SIZE < CBMC_MAX_OBJECT_SIZE,
"NETWORK_BUFFER_SIZE < CBMC_MAX_OBJECT_SIZE");
size_t uxLength;
uint8_t *pucByte = malloc( uxLength );
/* Preconditions */
__CPROVER_assume(uxLength < CBMC_MAX_OBJECT_SIZE);
__CPROVER_assume(uxLength <= NETWORK_BUFFER_SIZE);
__CPROVER_assume(pucByte != NULL);
size_t index = prvSkipNameField( pucByte, uxLength );
/* Postconditions */
__CPROVER_assert(index <= uxLength,
"prvSkipNameField: index <= uxLength");
}