esp-idf/components/lwip/test_afl_host/esp32_mock.h
Darian Leung e08d574a5d lwip: Update AFL host test mock
This commit updates and refactors the AFL host test mock as follows:
- Isolates the mock so that it only relies on lwip component and linux stdlib headers
- Grouped all mock functions in 'esp32_mock.h/c'
- Updates the lwip esp32 port files to include 'esp32_mock.h' when building for linux
- Use host stdlib headers instead of xtensa stdlib headers
2022-04-29 15:11:44 +08:00

36 lines
916 B
C

/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _ESP32_MOCK_H_
#define _ESP32_MOCK_H_
#include <stdint.h>
#include <unistd.h>
/* ------------------------------------------------- ESP32 Port Mock ---------------------------------------------------
*
* ------------------------------------------------------------------------------------------------------------------ */
// --------------------- lwipopts.h ------------------------
#define ESP_TASK_TCPIP_STACK
#define ESP_TASK_TCPIP_PRIO
uint32_t esp_random(void);
// --------------------- sys_arch.h ------------------------
// Required to get linux assert.h to work ???
#define __ASSERT_FUNC __ASSERT_FUNCTION
typedef void * SemaphoreHandle_t;
typedef void * TaskHandle_t;
typedef void * QueueHandle_t;
#define vTaskDelay(ms) usleep((m)*0)
#endif // _ESP32_MOCK_H_