IssueNo:#I3IMWT

Description:use posix instead of lwip self
Feature or Bugfix:Bugfix
Binary Source:No
This commit is contained in:
YOUR_NAME
2021-04-13 17:48:11 +08:00
parent d7789ce6a2
commit e4ce40d386
14 changed files with 257 additions and 137 deletions
+3
View File
@@ -32,7 +32,10 @@
#ifndef LWIP_TEST_H
#define LWIP_TEST_H
#include "lwip/arch.h"
#include "lwip/sockets.h"
#include <sys/socket.h>
#include <arpa/inet.h>
#include "log.h"
#include "securec.h"
+14 -2
View File
@@ -30,14 +30,19 @@
*/
#include "lwip_test.h"
#include "lwipopts.h"
#include <arch/sys_arch.h>
#include <lwip/sys.h>
#define MSG "Hi, I am UDP"
#define TEST_CASE 120
static char g_buf[BUF_SIZE + 1] = { 0 };
extern sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stackSize, int prio);
int UdpTest(void)
void UdpTestTask(void *p)
{
(void)p;
LogPrintln("net_socket_test_002.c enter");
g_testCase = TEST_CASE;
int sfd;
@@ -111,6 +116,13 @@ int UdpTest(void)
/* close socket */
ret = closesocket(sfd);
LWIP_ASSERT("socket invalid param.", ret != -1);
return LWIP_TEST_RET_OK;
return;
}
int UdpTest()
{
int ret = sys_thread_new("udp_test", UdpTestTask, NULL,
STACK_TEST_SIZE, TCPIP_THREAD_PRIO);
ICUNIT_ASSERT_NOT_EQUAL(ret, -1, 23);
return ret;
}
+11 -2
View File
@@ -310,8 +310,9 @@ static struct netif *CreateBtNetIf()
return btNetif;
}
int UdpTestNetif(void)
static void UdpTestNetifTask(void *p)
{
(void)p;
LogPrintln("net_socket_test_011.c enter");
g_testCase = TEST_CASE;
int sfd;
@@ -363,7 +364,15 @@ int UdpTestNetif(void)
/* close socket */
ret = closesocket(sfd);
LWIP_ASSERT("socket invalid param.", ret != -1);
return LWIP_TEST_RET_OK;
return;
}
int UdpTestNetif()
{
int ret = sys_thread_new("udp_test_netif", UdpTestNetifTask, NULL,
STACK_TEST_SIZE, TCPIP_THREAD_PRIO);
ICUNIT_ASSERT_NOT_EQUAL(ret, -1, 23);
return ret;
}
static void ArpPackageProc(struct netif *netif, struct pbuf *p)
+1 -1
View File
@@ -119,7 +119,7 @@ static void LwipTestTimeoutCallback(void const *argument)
osTimerId_t g_lwipTestTimerId = NULL;
void LwipTestStartTimer(uint32 timeout)
void LwipTestStartTimer(uint32_t timeout)
{
osStatus_t status;
if (g_lwipTestTimerId != NULL) {