Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
74a82038
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
74a82038
编写于
12月 07, 2021
作者:
O
openharmony_ci
提交者:
Gitee
12月 07, 2021
浏览文件
操作
浏览文件
下载
差异文件
!1309 【Openharmony_1.01_release】【communication_lite】继承master修改同步11月的修改lwip模块_L0修改
Merge pull request !1309 from yelin10/myfeature
上级
23d0b453
18aaa70c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
30 deletion
+31
-30
communication_lite/lwip_hal/src/lwip_func_test.c
communication_lite/lwip_hal/src/lwip_func_test.c
+31
-30
未找到文件。
communication_lite/lwip_hal/src/lwip_func_test.c
浏览文件 @
74a82038
...
...
@@ -38,7 +38,7 @@
#define LWIP_TEST_FAIL (-1)
#define DEF_TASK_STACK 2000
#define DEF_TASK_PRIORITY 20
#define ONE_SECOND 1
00
#define ONE_SECOND 1
#define TIMEOUT 4
#define TEST_FD_COUNT 10
...
...
@@ -56,7 +56,7 @@ static int g_selectTimeout = 2;
static
void
WaitClient
(
void
)
{
while
(
1
)
{
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
if
(
g_clientWait
)
{
break
;
}
...
...
@@ -68,7 +68,7 @@ static void WaitClient(void)
static
void
WaitServer
(
void
)
{
while
(
1
)
{
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
if
(
g_serverWait
)
{
break
;
}
...
...
@@ -129,13 +129,12 @@ static void CommTcpClientTask(void)
lwip_close
(
clnFd
);
return
;
}
int
sleepSecond
=
1
;
int
count
=
4
;
char
dataBuf
[
50
]
=
{
0
};
char
sendMsgList
[
5
][
50
]
=
{
"Hi, I'm client,FD:[%d]"
,
"client:123456789abcdefg,FD:[%d]"
,
"client:!!@@##$$%%^^&&**(()),FD:[%d]"
,
"client:(((112233445566778899))),FD:[%d]"
,
"bye"
};
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
sleep
(
sleepSecond
);
sleep
(
ONE_SECOND
);
memset_s
(
dataBuf
,
sizeof
(
dataBuf
),
0
,
sizeof
(
dataBuf
));
rst
=
sprintf_s
(
dataBuf
,
sizeof
(
dataBuf
),
sendMsgList
[
i
],
clnFd
);
if
(
rst
<
0
)
{
...
...
@@ -500,7 +499,7 @@ LITE_TEST_CASE(LwipFuncTestSuite, testTcp, Function | MediumTest | Level2)
printf
(
"[testTcp]create client task fail!
\n
"
);
}
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
int
timeout
=
TIMEOUT
;
g_serverWait
=
1
;
g_clientWait
=
1
;
...
...
@@ -510,11 +509,11 @@ LITE_TEST_CASE(LwipFuncTestSuite, testTcp, Function | MediumTest | Level2)
break
;
}
timeout
--
;
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
printf
(
"[testTcp] wait[1]...
\n
"
);
}
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
timeout
=
TIMEOUT
;
g_serverWait
=
1
;
g_clientWait
=
1
;
...
...
@@ -524,11 +523,11 @@ LITE_TEST_CASE(LwipFuncTestSuite, testTcp, Function | MediumTest | Level2)
break
;
}
timeout
--
;
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
printf
(
"[testTcp] wait[2]...
\n
"
);
}
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
timeout
=
TIMEOUT
;
g_serverWait
=
1
;
g_clientWait
=
1
;
...
...
@@ -538,10 +537,10 @@ LITE_TEST_CASE(LwipFuncTestSuite, testTcp, Function | MediumTest | Level2)
break
;
}
timeout
--
;
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
printf
(
"[testTcp] wait[3]...
\n
"
);
}
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
timeout
=
TIMEOUT
;
g_serverWait
=
1
;
g_clientWait
=
1
;
...
...
@@ -551,11 +550,15 @@ LITE_TEST_CASE(LwipFuncTestSuite, testTcp, Function | MediumTest | Level2)
break
;
}
timeout
--
;
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
printf
(
"[testTcp] wait[4]...
\n
"
);
}
TEST_ASSERT_EQUAL_INT
(
1
,
g_clientResult
);
TEST_ASSERT_EQUAL_INT
(
1
,
g_serverResult
);
sleep
(
ONE_SECOND
);
g_serverWait
=
1
;
g_clientWait
=
1
;
}
/**
...
...
@@ -639,7 +642,7 @@ LITE_TEST_CASE(LwipFuncTestSuite, testSelectTimeout, Function | MediumTest | Lev
printf
(
"create select server task fail!
\n
"
);
}
else
{
while
(
g_selectFlag
)
{
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
printf
(
"wait select server finish...
\n
"
);
}
TEST_ASSERT_EQUAL_INT
(
-
2
,
g_selectResult
);
...
...
@@ -648,10 +651,10 @@ LITE_TEST_CASE(LwipFuncTestSuite, testSelectTimeout, Function | MediumTest | Lev
/**
* @tc.number : SUB_COMMUNICATION_LWIP_SDK_0600
* @tc.name : test select with
multi clients
* @tc.name : test select with
one client
* @tc.desc : [C- SOFTWARE -0200]
*/
LITE_TEST_CASE
(
LwipFuncTestSuite
,
testSelect
MultiClients
,
Function
|
MediumTest
|
Level2
)
LITE_TEST_CASE
(
LwipFuncTestSuite
,
testSelect
OneClient
,
Function
|
MediumTest
|
Level2
)
{
osThreadAttr_t
tSelect
;
tSelect
.
name
=
"SelectServerTask"
;
...
...
@@ -665,27 +668,25 @@ LITE_TEST_CASE(LwipFuncTestSuite, testSelectMultiClients, Function | MediumTest
g_selectTimeout
=
5
;
osThreadId_t
serverTaskId
=
osThreadNew
((
osThreadFunc_t
)
SelectServerTask
,
NULL
,
&
tSelect
);
TEST_ASSERT_NOT_NULL
(
serverTaskId
);
sleep
(
ONE_SECOND
);
if
(
serverTaskId
==
NULL
)
{
printf
(
"create select server task fail!
\n
"
);
}
else
{
osThreadAttr_t
tClient
[
2
]
;
osThreadAttr_t
tClient
;
osThreadId_t
clientTaskId
;
char
taskName
[
2
][
8
]
=
{
"client1"
,
"client2"
};
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
tClient
[
i
].
name
=
taskName
[
i
];
tClient
[
i
].
attr_bits
=
0U
;
tClient
[
i
].
cb_mem
=
NULL
;
tClient
[
i
].
cb_size
=
0U
;
tClient
[
i
].
stack_mem
=
NULL
;
tClient
[
i
].
stack_size
=
DEF_TASK_STACK
;
tClient
[
i
].
priority
=
DEF_TASK_PRIORITY
;
clientTaskId
=
osThreadNew
((
osThreadFunc_t
)
CommTcpClientTask
,
NULL
,
&
tClient
[
i
]);
TEST_ASSERT_NOT_NULL
(
clientTaskId
);
}
tClient
.
name
=
"CommTcpClientTask"
;
tClient
.
attr_bits
=
0U
;
tClient
.
cb_mem
=
NULL
;
tClient
.
cb_size
=
0U
;
tClient
.
stack_mem
=
NULL
;
tClient
.
stack_size
=
DEF_TASK_STACK
;
tClient
.
priority
=
DEF_TASK_PRIORITY
;
clientTaskId
=
osThreadNew
((
osThreadFunc_t
)
CommTcpClientTask
,
NULL
,
&
tClient
);
TEST_ASSERT_NOT_NULL
(
clientTaskId
);
g_selectFlag
=
1
;
while
(
g_selectFlag
)
{
osDelay
(
ONE_SECOND
);
sleep
(
ONE_SECOND
);
printf
(
"wait select server finish...
\n
"
);
}
TEST_ASSERT_EQUAL_INT
(
0
,
g_selectResult
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录