1 /*
2  * FreeRTOS+TCP V3.1.0
3  * Copyright (C) 2022 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
5  * SPDX-License-Identifier: MIT
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy of
8  * this software and associated documentation files (the "Software"), to deal in
9  * the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11  * the Software, and to permit persons to whom the Software is furnished to do so,
12  * subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in all
15  * copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  * http://aws.amazon.com/freertos
25  * http://www.FreeRTOS.org
26  */
27 
28 
29 /* Include Unity header */
30 #include "unity.h"
31 
32 /* Include standard libraries */
33 #include <stdlib.h>
34 #include <string.h>
35 #include <stdint.h>
36 
37 #include "mock_task.h"
38 #include "mock_list.h"
39 #include "mock_queue.h"
40 #include "mock_event_groups.h"
41 
42 #include "mock_FreeRTOS_IP_Private.h"
43 #include "mock_FreeRTOS_IP_Utils.h"
44 #include "mock_FreeRTOS_IP_Timers.h"
45 #include "mock_FreeRTOS_TCP_IP.h"
46 #include "mock_FreeRTOS_IP.h"
47 #include "mock_FreeRTOS_ARP.h"
48 #include "mock_NetworkBufferManagement.h"
49 #include "mock_NetworkInterface.h"
50 #include "mock_FreeRTOS_DHCP.h"
51 #include "mock_FreeRTOS_Sockets.h"
52 #include "mock_FreeRTOS_DNS.h"
53 #include "mock_FreeRTOS_Stream_Buffer.h"
54 #include "mock_FreeRTOS_TCP_WIN.h"
55 #include "mock_FreeRTOS_UDP_IP.h"
56 
57 #include "FreeRTOS_ICMP.h"
58 
59 #include "FreeRTOSIPConfig.h"
60 
test_ProcessICMPPacket_PacketSizeSmall(void)61 void test_ProcessICMPPacket_PacketSizeSmall( void )
62 {
63     eFrameProcessingResult_t eResult;
64     NetworkBufferDescriptor_t * pxNetworkBuffer, xNetworkBuffer;
65 
66     pxNetworkBuffer = &xNetworkBuffer;
67     pxNetworkBuffer->xDataLength = sizeof( ICMPPacket_t ) - 1;
68 
69     eResult = ProcessICMPPacket( pxNetworkBuffer );
70 
71     TEST_ASSERT_EQUAL( eReleaseBuffer, eResult );
72 }
73