mirror of
https://github.com/FreeRTOS/FreeRTOS-Plus-TCP
synced 2025-10-24 03:32:36 +08:00

* Fixed build issues and updated branch to latest target branch changes * Updating to latest target branch changes
39 lines
1.2 KiB
C
39 lines
1.2 KiB
C
/* Include Unity header */
|
|
#include "unity.h"
|
|
|
|
/* Include standard libraries */
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stdint.h>
|
|
|
|
#include "FreeRTOSIPConfig.h"
|
|
|
|
#include "mock_FreeRTOS_IP.h"
|
|
#include "mock_FreeRTOS_IP_Timers.h"
|
|
#include "mock_FreeRTOS_IP_Private.h"
|
|
#include "mock_task.h"
|
|
#include "mock_NetworkBufferManagement.h"
|
|
#include "mock_NetworkInterface.h"
|
|
#include "mock_ARP_DataLenLessThanMinPacket_list_macros.h"
|
|
|
|
#include "FreeRTOS_ARP.h"
|
|
|
|
#include "catch_assert.h"
|
|
|
|
void test_FreeRTOS_OutputARPRequest_MinimumPacketSizeLessThanARPPacket( void )
|
|
{
|
|
uint8_t ucBuffer[ sizeof( ARPPacket_t ) + ipBUFFER_PADDING + ipconfigETHERNET_MINIMUM_PACKET_BYTES ];
|
|
NetworkBufferDescriptor_t xNetworkBuffer;
|
|
uint32_t ulIPAddress = 0xAAAAAAAA;
|
|
|
|
xNetworkBuffer.pucEthernetBuffer = ucBuffer;
|
|
xNetworkBuffer.xDataLength = sizeof( ARPPacket_t );
|
|
|
|
/* =================================================== */
|
|
pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, &xNetworkBuffer );
|
|
xIsCallingFromIPTask_IgnoreAndReturn( pdTRUE );
|
|
xNetworkInterfaceOutput_ExpectAndReturn( &xNetworkBuffer, pdTRUE, pdPASS );
|
|
FreeRTOS_OutputARPRequest( ulIPAddress );
|
|
/* =================================================== */
|
|
}
|