mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
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
This commit is contained in:
35
components/lwip/test_afl_host/esp32_mock.h
Normal file
35
components/lwip/test_afl_host/esp32_mock.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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_
|
Reference in New Issue
Block a user