1 /* Include Unity header */ 2 #include "unity.h" 3 4 /* Include standard libraries */ 5 #include <stdlib.h> 6 #include <string.h> 7 #include <stdint.h> 8 9 #include "FreeRTOSIPConfig.h" 10 11 #include "mock_FreeRTOS_IP.h" 12 #include "mock_FreeRTOS_IP_Timers.h" 13 #include "mock_FreeRTOS_IP_Private.h" 14 #include "mock_task.h" 15 #include "mock_NetworkBufferManagement.h" 16 #include "mock_NetworkInterface.h" 17 18 #include "FreeRTOS_ARP.h" 19 20 #include "catch_assert.h" 21 test_FreeRTOS_OutputARPRequest_MinimumPacketSizeLessThanARPPacket(void)22void test_FreeRTOS_OutputARPRequest_MinimumPacketSizeLessThanARPPacket( void ) 23 { 24 uint8_t ucBuffer[ sizeof( ARPPacket_t ) + ipBUFFER_PADDING + ipconfigETHERNET_MINIMUM_PACKET_BYTES ]; 25 NetworkBufferDescriptor_t xNetworkBuffer; 26 uint32_t ulIPAddress = 0xAAAAAAAA; 27 28 xNetworkBuffer.pucEthernetBuffer = ucBuffer; 29 xNetworkBuffer.xDataLength = sizeof( ARPPacket_t ); 30 31 /* =================================================== */ 32 pxGetNetworkBufferWithDescriptor_ExpectAndReturn( sizeof( ARPPacket_t ), 0, &xNetworkBuffer ); 33 xIsCallingFromIPTask_IgnoreAndReturn( pdTRUE ); 34 xNetworkInterfaceOutput_ExpectAndReturn( &xNetworkBuffer, pdTRUE, pdPASS ); 35 FreeRTOS_OutputARPRequest( ulIPAddress ); 36 /* =================================================== */ 37 } 38