Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8099c00d
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看板
提交
8099c00d
编写于
5月 17, 2021
作者:
N
nanxiansen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
内核子系统fs/net模块修复不稳定用例:FsOtherTest.cpp#testStatvfs/ActsNetTest.cpp
Change-Id: I2ede1b8b38429569759d9b380e61a2874723034d
上级
c14c50a6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
28 addition
and
15 deletion
+28
-15
kernel_lite/fs_posix/src/FsOtherTest.cpp
kernel_lite/fs_posix/src/FsOtherTest.cpp
+0
-2
kernel_lite/net_posix/src/ActsNetTest.cpp
kernel_lite/net_posix/src/ActsNetTest.cpp
+28
-13
未找到文件。
kernel_lite/fs_posix/src/FsOtherTest.cpp
浏览文件 @
8099c00d
...
...
@@ -224,8 +224,6 @@ HWTEST_F(FileSystemTest, testStatvfs, Function | MediumTest | Level2)
EXPECT_EQ
(
vfsBuf
.
f_bsize
,
fsBuf
.
f_bsize
);
EXPECT_EQ
(
vfsBuf
.
f_blocks
,
fsBuf
.
f_blocks
);
EXPECT_EQ
(
vfsBuf
.
f_bfree
,
fsBuf
.
f_bfree
);
EXPECT_EQ
(
vfsBuf
.
f_bavail
,
fsBuf
.
f_bavail
);
EXPECT_EQ
(
vfsBuf
.
f_files
,
fsBuf
.
f_files
);
EXPECT_EQ
(
vfsBuf
.
f_ffree
,
fsBuf
.
f_ffree
);
EXPECT_EQ
(
vfsBuf
.
f_namemax
,
fsBuf
.
f_namelen
);
...
...
kernel_lite/net_posix/src/ActsNetTest.cpp
浏览文件 @
8099c00d
...
...
@@ -39,9 +39,9 @@ using namespace testing::ext;
#define PROTOCOL_COUNT 36
#define TEST_FD_COUNT 10
#define STACK_PORT 22
77
#define PEER_PORT 22
77
#define BUF_SIZE (10
24 * 8
)
#define STACK_PORT 22
88
#define PEER_PORT 22
88
#define BUF_SIZE (10
0
)
static
const
char
*
g_udpMsg
=
"Hi, this is UDP"
;
static
const
char
*
g_srvMsg
=
"Hi, this is TCP server"
;
static
const
char
*
g_cliMsg
=
"Hello, this is TCP client"
;
...
...
@@ -235,17 +235,23 @@ static void* SampleTcpServerTask(void *p)
EXPECT_EQ
(
len
*
srvMsgLen
,
(
unsigned
int
)
ret
);
WAIT
();
memset_s
(
buf
,
BUF_SIZE
,
0
,
BUF_SIZE
);
static
char
bufrec
[
BUF_SIZE
+
1
]
=
{
0
};
memset_s
(
bufrec
,
BUF_SIZE
,
0
,
BUF_SIZE
);
memset_s
(
&
msg
,
sizeof
(
msg
),
0
,
sizeof
(
msg
));
msg
.
msg_name
=
&
clnAddr
;
msg
.
msg_namelen
=
sizeof
(
clnAddr
);
msg
.
msg_iov
=
iov
;
msg
.
msg_iovlen
=
1
;
iov
[
0
].
iov_base
=
buf
;
iov
[
0
].
iov_len
=
sizeof
(
buf
);
iov
[
0
].
iov_base
=
buf
rec
;
iov
[
0
].
iov_len
=
sizeof
(
buf
rec
);
ret
=
recvmsg
(
clnFd
,
&
msg
,
0
);
printf
(
"[tcp server]recvmsg on socket %d:%d, msg[%s]
\n
"
,
clnFd
,
ret
,
buf
);
EXPECT_EQ
(
len
*
strlen
(
g_cliMsg
),
(
unsigned
int
)
ret
);
if
(
len
*
strlen
(
g_cliMsg
)
==
(
unsigned
int
)
ret
)
{
bufrec
[
ret
]
=
0
;
printf
(
"[tcp server]recvmsg on socket %d:%d, msg[%s]
\n
"
,
clnFd
,
ret
,
buf
);
}
else
{
EXPECT_TRUE
(
false
);
printf
(
"[tcp server] recvmsg on socket %d: %d
\n
"
,
clnFd
,
ret
);
}
ret
=
shutdown
(
clnFd
,
SHUT_RDWR
);
printf
(
"[tcp server]shutdown
\n
"
);
...
...
@@ -324,17 +330,23 @@ static void* SampleTcpClientTask(void *p)
EXPECT_EQ
(
len
*
cliMsgLen
,
(
unsigned
int
)
ret
);
WAIT
();
memset_s
(
buf
,
BUF_SIZE
,
0
,
BUF_SIZE
);
static
char
bufrec
[
BUF_SIZE
+
1
]
=
{
0
};
memset_s
(
bufrec
,
BUF_SIZE
,
0
,
BUF_SIZE
);
memset_s
(
&
msg
,
sizeof
(
msg
),
0
,
sizeof
(
msg
));
msg
.
msg_name
=
&
clnAddr
;
msg
.
msg_namelen
=
sizeof
(
clnAddr
);
msg
.
msg_iov
=
iov
;
msg
.
msg_iovlen
=
1
;
iov
[
0
].
iov_base
=
buf
;
iov
[
0
].
iov_len
=
sizeof
(
buf
);
iov
[
0
].
iov_base
=
buf
rec
;
iov
[
0
].
iov_len
=
sizeof
(
buf
rec
);
ret
=
recvmsg
(
clnFd
,
&
msg
,
0
);
printf
(
"[tcp client]recvmsg, ret=%d, msg[%s]
\n
"
,
ret
,
buf
);
EXPECT_EQ
(
len
*
strlen
(
g_srvMsg
),
(
unsigned
int
)
ret
);
if
(
len
*
strlen
(
g_srvMsg
)
==
(
unsigned
int
)
ret
)
{
bufrec
[
ret
]
=
0
;
printf
(
"[tcp client]recvmsg, ret=%d, msg[%s]
\n
"
,
ret
,
bufrec
);
}
else
{
EXPECT_TRUE
(
false
);
printf
(
"[tcp clien]recvmsg, ret=%d
\n
"
,
ret
);
}
ret
=
shutdown
(
clnFd
,
SHUT_RDWR
);
printf
(
"[tcp client]shutdown
\n
"
);
...
...
@@ -369,6 +381,8 @@ static void* TcpServerLoopTask(void *p)
EXPECT_NE
(
-
1
,
ret
)
<<
"[***---][tcp server loop] close fd index["
<<
i
<<
"]"
;
i
--
;
}
ret
=
close
(
srvFd
);
EXPECT_NE
(
-
1
,
ret
);
return
nullptr
;
}
...
...
@@ -637,6 +651,7 @@ static int PollServerForFork(int timeoutSec)
close
(
fds
[
i
].
fd
);
}
}
close
(
srvFd
);
return
ret
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录