first commit
This commit is contained in:
commit
92cbe97616
1978 files changed
+1688498
No files matched your search
+56
@@ -0,0 +1,56 @@
|
||||
/* 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"
|
||||
|
||||
/* =========================== EXTERN VARIABLES =========================== */
|
||||
|
||||
/** @brief The pointer to buffer with packet waiting for ND resolution. This variable
|
||||
* is defined in FreeRTOS_IP.c.
|
||||
* This pointer is for internal use only. */
|
||||
NetworkBufferDescriptor_t * pxNDWaitingNetworkBuffer;
|
||||
|
||||
BaseType_t NetworkInterfaceOutputFunction_Stub_Called = 0;
|
||||
|
||||
/* ======================== Stub Callback Functions ========================= */
|
||||
|
||||
BaseType_t NetworkInterfaceOutputFunction_Stub( struct xNetworkInterface * pxDescriptor,
|
||||
NetworkBufferDescriptor_t * const pxNetworkBuffer,
|
||||
BaseType_t xReleaseAfterSend )
|
||||
{
|
||||
NetworkInterfaceOutputFunction_Stub_Called++;
|
||||
return pdFALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Receive and analyse a RA ( Router Advertisement ) message.
|
||||
* If the reply is satisfactory, the end-point will do SLAAC: choose an IP-address using the
|
||||
* prefix offered, and completed with random bits. It will start testing if another device
|
||||
* already exists that uses the same IP-address.
|
||||
*
|
||||
* @param[in] pxNetworkBuffer The buffer that contains the message.
|
||||
*/
|
||||
void vReceiveRA( const NetworkBufferDescriptor_t * pxNetworkBuffer )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Receive a NA ( Neighbour Advertisement ) message to see if a chosen IP-address is already in use.
|
||||
*
|
||||
* @param[in] pxNetworkBuffer The buffer that contains the message.
|
||||
*/
|
||||
void vReceiveNA( const NetworkBufferDescriptor_t * pxNetworkBuffer )
|
||||
{
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
+2318
File diff suppressed because it is too large.
Load diff
+115
@@ -0,0 +1,115 @@
|
||||
# Include filepaths for source and include.
|
||||
include( ${MODULE_ROOT_DIR}/test/unit-test/TCPFilePaths.cmake )
|
||||
|
||||
# ==================== Define your project name (edit) ========================
|
||||
set( project_name "FreeRTOS_ND" )
|
||||
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_IPv6.h"
|
||||
"${CMAKE_BINARY_DIR}/Annexed_TCP/FreeRTOS_ICMP.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_IPv6_Utils.h"
|
||||
"${CMAKE_BINARY_DIR}/Annexed_TCP/FreeRTOS_Routing.h"
|
||||
"${CMAKE_BINARY_DIR}/Annexed_TCP/FreeRTOS_Sockets.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}"
|
||||
)
|
||||
Reference in new issue
Block a user