mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-04 09:01:40 +01:00 
			
		
		
		
	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
		
			
				
	
	
		
			36 lines
		
	
	
		
			916 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			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_
 |