1
0
mirror of https://github.com/FreeRTOS/FreeRTOS-Plus-TCP synced 2025-10-24 12:02:37 +08:00
Files
FreeRTOS-Plus-TCP/test/unit-test/FreeRTOS_ARP_DataLenLessThanMinPacket/FreeRTOS_ARP_DataLenLessThanMinPacket_utest.c
Aniruddha Kanhere a4124602cc Merge changes to main.
This commit brings in the refactoring and restructuring changes
from IntegrationTesting1 branch to the main branch.
It also includes additional unit tests for 100% coverage.
The rationale behind not creating a PR is that the conflicts were too
huge to be resolved correctly. Thus, a force push to the main branch is
being done.
2022-05-26 12:42:45 -07:00

38 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 "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 );
/* =================================================== */
}