first commit

This commit is contained in:
fewikay committed 2026-10-16 13:08:06 +02:00
commit 92cbe97616
1978 files changed
+1688498

No files matched your search

@@ -0,0 +1,74 @@
/* Include Unity header */
#include <unity.h>
/* Include standard libraries */
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "FreeRTOS.h"
#include "task.h"
#include "list.h"
#include "FreeRTOS_IP.h"
#include "FreeRTOS_IP_Private.h"
/* ======================== Stub Callback Functions ========================= */
/*
* @brief Send a neighbour solicitation.
* @param[in] pxIPAddress: A network buffer big enough to hold the ICMP packet.
* @param[in,out] pxMACAddress: When found, the array of 6 bytes will be filled
* with the MAC-address.
* @param[in,out] ppxEndPoint: The pointer to a pointer will point to an
* end-point to which the device has responded.
*
* @note Look for ulIPAddress in the ND cache. If the IP address exists, copy the
* associated MAC address into pxMACAddress, refresh the ND cache entry's
* age, and return eResolutionCacheHit. If the IP address does not exist in the ND
* cache return eResolutionCacheMiss. If the packet cannot be sent for any reason
* (maybe DHCP is still in process, or the addressing needs a gateway but there
* isn't a gateway defined) then return eResolutionFailed.
*/
eResolutionLookupResult_t eNDGetCacheEntry( IPv6_Address_t * pxIPAddress,
MACAddress_t * const pxMACAddress,
struct xNetworkEndPoint ** ppxEndPoint )
{
memset( pxMACAddress, 0, sizeof( MACAddress_t ) );
return eResolutionCacheHit;
}
/**
* @brief Create an IPv16 address, based on a prefix.
*
* @param[out] pxIPAddress: The location where the new IPv6 address
* will be stored.
* @param[in] pxPrefix: The prefix to be used.
* @param[in] uxPrefixLength: The length of the prefix.
* @param[in] xDoRandom: A non-zero value if the bits after the
* prefix should have a random value.
*
* @return pdPASS if the operation was successful. Or pdFAIL in
* case xApplicationGetRandomNumber()
* returned an error.
*/
BaseType_t FreeRTOS_CreateIPv6Address( IPv6_Address_t * pxIPAddress,
const IPv6_Address_t * pxPrefix,
size_t uxPrefixLength,
BaseType_t xDoRandom )
{
}
/**
* @brief Send a neighbour solicitation.
* @param[in] pxNetworkBuffer: A network buffer big enough to hold the ICMP packet.
* @param[in] pxIPAddress: The IPv6 address of the target device.
*
* @note Send out an ND request for the IPv6 address contained in pxNetworkBuffer, and
* add an entry into the ND table that indicates that an ND reply is
* outstanding so re-transmissions can be generated.
*/
void vNDSendNeighbourSolicitation( NetworkBufferDescriptor_t * const pxNetworkBuffer,
const IPv6_Address_t * pxIPAddress )
{
}
@@ -0,0 +1,111 @@
# Include filepaths for source and include.
include( ${MODULE_ROOT_DIR}/test/unit-test/TCPFilePaths.cmake )
# ==================== Define your project name (edit) ========================
set( project_name "FreeRTOS_RA" )
message( STATUS "${project_name}" )
# ===================== Create your mock here (edit) ========================
set(mock_list "")
# list the files to mock here
list(APPEND mock_list
"${MODULE_ROOT_DIR}/test/FreeRTOS-Kernel/include/task.h"
"${MODULE_ROOT_DIR}/test/FreeRTOS-Kernel/include/list.h"
"${MODULE_ROOT_DIR}/test/FreeRTOS-Kernel/include/queue.h"
"${MODULE_ROOT_DIR}/test/FreeRTOS-Kernel/include/event_groups.h"
"${CMAKE_BINARY_DIR}/Annexed_TCP/FreeRTOS_IP.h"
"${CMAKE_BINARY_DIR}/Annexed_TCP/FreeRTOS_IP_Private.h"
"${CMAKE_BINARY_DIR}/Annexed_TCP/FreeRTOS_IP_Timers.h"
"${CMAKE_BINARY_DIR}/Annexed_TCP/FreeRTOS_IP_Utils.h"
"${CMAKE_BINARY_DIR}/Annexed_TCP/FreeRTOS_Routing.h"
"${CMAKE_BINARY_DIR}/Annexed_TCP/NetworkBufferManagement.h"
)
set(mock_include_list "")
# list the directories your mocks need
list(APPEND mock_include_list
.
${TCP_INCLUDE_DIRS}
${MODULE_ROOT_DIR}/test/FreeRTOS-Kernel/include
${MODULE_ROOT_DIR}/test/unit-test/ConfigFiles
${MODULE_ROOT_DIR}/test/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix
${MODULE_ROOT_DIR}/test/unit-test/${project_name}
)
set(mock_define_list "")
#list the definitions of your mocks to control what to be included
list(APPEND mock_define_list
""
)
# ================= Create the library under test here (edit) ==================
set(real_source_files "")
# list the files you would like to test here
list(APPEND real_source_files
${CMAKE_BINARY_DIR}/Annexed_TCP_Sources/${project_name}.c
)
set(real_include_directories "")
# list the directories the module under test includes
list(APPEND real_include_directories
.
${TCP_INCLUDE_DIRS}
${MODULE_ROOT_DIR}/test/unit-test/ConfigFiles
${MODULE_ROOT_DIR}/test/FreeRTOS-Kernel/include
${MODULE_ROOT_DIR}/test/FreeRTOS-Kernel/portable/ThirdParty/GCC/Posix
${CMOCK_DIR}/vendor/unity/src
${MODULE_ROOT_DIR}/test/unit-test/${project_name}
)
# ===================== Create UnitTest Code here (edit) =====================
set(test_include_directories "")
# list the directories your test needs to include
list(APPEND test_include_directories
.
${CMOCK_DIR}/vendor/unity/src
${TCP_INCLUDE_DIRS}
${MODULE_ROOT_DIR}/test/unit-test/${project_name}
${CMAKE_BINARY_DIR}/Annexed_TCP_Sources
)
# ============================= (end edit) ===================================
set(mock_name "${project_name}_mock")
set(real_name "${project_name}_real")
create_mock_list(${mock_name}
"${mock_list}"
"${MODULE_ROOT_DIR}/test/unit-test/cmock/project.yml"
"${mock_include_list}"
"${mock_define_list}"
)
create_real_library(${real_name}
"${real_source_files}"
"${real_include_directories}"
"${mock_name}"
)
set( utest_link_list "" )
list(APPEND utest_link_list
-l${mock_name}
lib${real_name}.a
)
set( utest_dep_list "" )
list(APPEND utest_dep_list
${real_name}
)
set(utest_name "${project_name}_utest")
set(utest_source "${project_name}/${project_name}_utest.c")
create_test(${utest_name}
${utest_source}
"${utest_link_list}"
"${utest_dep_list}"
"${test_include_directories}"
)