Skip to content

Commit

Permalink
Proof include fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Skptak committed Aug 20, 2023
1 parent 7b155b1 commit e98ca67
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions test/cbmc/include/get_time_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#ifndef GET_TIME_STUB_H_
#define GET_TIME_STUB_H_

#include <stdint.h>

/**
* Application defined callback to retrieve the current time in milliseconds.
*
Expand Down
11 changes: 5 additions & 6 deletions test/cbmc/proofs/HTTPClient_Send/HTTPClient_Send_harness.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
* @brief Implements the proof harness for HTTPClient_Send function.
*/

#include "core_http_client.h"
#include "get_time_stub.h"
#include "core_http_client.h"
#include "http_cbmc_state.h"
#include "transport_interface_stubs.h"

Expand Down Expand Up @@ -61,11 +61,10 @@ void HTTPClient_Send_harness()
{
/* Ideally, we want to set the function pointers below with
* __CPROVER_assume() but doing so makes CBMC run out of memory. */
pTransportInterface->send = nondet_bool() ? NULL
: TransportInterfaceSendStub;
pTransportInterface->recv = nondet_bool()
? NULL
: TransportInterfaceReceiveStub;
/* clang-format off */
pTransportInterface->send = nondet_bool() ? NULL : TransportInterfaceSendStub;
pTransportInterface->recv = nondet_bool() ? NULL : TransportInterfaceReceiveStub;
/* clang-format on */
}

if( pResponse != NULL )
Expand Down
4 changes: 3 additions & 1 deletion test/cbmc/stubs/get_time_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
* @file get_time_stub.c
* @brief A stub to mock the retrieval of current time.
*/
#include "get_time_stub.h"
/* LibC Includes */
#include "stdint.h"

#include "get_time_stub.h"

uint32_t GetCurrentTimeStub( void )
{
/* The HTTP relies on this timestamp in order to complete the network send
Expand Down

0 comments on commit e98ca67

Please sign in to comment.