Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
289b208c
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看板
提交
289b208c
编写于
9月 18, 2021
作者:
O
openharmony_ci
提交者:
Gitee
9月 18, 2021
浏览文件
操作
浏览文件
下载
差异文件
!628 【kernel_lite】【master】修改mem模块失败的用例
Merge pull request !628 from limeng/kernel_lite_20210916_01_Master
上级
83dc0207
d53fa46a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
45 addition
and
27 deletion
+45
-27
kernel_lite/mem_posix/src/MmapApiTest.cpp
kernel_lite/mem_posix/src/MmapApiTest.cpp
+20
-11
kernel_lite/mem_posix/src/MprotectApiTest.cpp
kernel_lite/mem_posix/src/MprotectApiTest.cpp
+12
-7
kernel_lite/mem_posix/src/MremapApiTest.cpp
kernel_lite/mem_posix/src/MremapApiTest.cpp
+13
-9
未找到文件。
kernel_lite/mem_posix/src/MmapApiTest.cpp
浏览文件 @
289b208c
...
...
@@ -348,7 +348,8 @@ HWTEST_F(MmapApiTest, testMmapFilePrivate, Function | MediumTest | Level3)
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -393,7 +394,8 @@ HWTEST_F(MmapApiTest, testMmapFileShare, Function | MediumTest | Level3)
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -433,7 +435,8 @@ HWTEST_F(MmapApiTest, testMmapFileShareOnlyRead, Function | MediumTest | Level1)
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -475,7 +478,8 @@ HWTEST_F(MmapApiTest, testMmapFileShareOnlyWrite, Function | MediumTest | Level3
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -521,7 +525,8 @@ HWTEST_F(MmapApiTest, testMmapFilePrivateExec, Function | MediumTest | Level4)
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -567,7 +572,8 @@ HWTEST_F(MmapApiTest, testMmapFileShareExec, Function | MediumTest | Level4)
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -610,7 +616,8 @@ HWTEST_F(MmapApiTest, testMmapFileShareNoExec, Function | MediumTest | Level2)
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -743,7 +750,8 @@ HWTEST_F(MmapApiTest, testMmapWriteBack, Function | MediumTest | Level3)
EXPECT_TRUE
(
failure
==
0
)
<<
"i = "
<<
i
<<
", rBuffer = "
<<
rBuffer
[
i
];
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
/**
...
...
@@ -783,8 +791,8 @@ HWTEST_F(MmapApiTest, testMmapEACCES, Function | MediumTest | Level3)
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
}
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
/**
...
...
@@ -888,7 +896,8 @@ HWTEST_F(MmapApiTest, testMmapEINVAL, Function | MediumTest | Level3)
}
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
/**
...
...
kernel_lite/mem_posix/src/MprotectApiTest.cpp
浏览文件 @
289b208c
...
...
@@ -252,7 +252,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileAddReadPerm, Function | MediumTest | L
WaitProcExitedOK
(
pid
);
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -308,7 +309,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileAddWritePerm, Function | MediumTest |
EXPECT_TRUE
(
buf
[
0
]
==
testChar
)
<<
"ERROR: buf[0] != testChar"
;
EXPECT_TRUE
(
buf
[
1
]
==
(
testChar
+
3
))
<<
"ERROR: buf[1] != (testChar + 3)"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -350,7 +352,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileAddExecutePerm, Function | MediumTest
WaitProcExitedOK
(
pid
);
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -394,7 +397,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileDelWritePerm, Function | MediumTest |
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -437,7 +441,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileDelExecutePerm, Function | MediumTest
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -465,8 +470,8 @@ HWTEST_F(MprotectApiTest, testMprotectEACCES, Function | MediumTest | Level4)
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
/**
...
...
kernel_lite/mem_posix/src/MremapApiTest.cpp
浏览文件 @
289b208c
...
...
@@ -97,7 +97,7 @@ HWTEST_F(MremapApiTest, testMremapAnonExpand, Function | MediumTest | Level2)
exit
(
0
);
}
else
{
WaitProcExitedOK
(
pid
);
EXPECT_TRUE
(
munmap
(
mem
,
expandSize
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
munmap
(
mem
,
expandSize
)
==
0
)
<<
"ERROR: munmap() != 0"
<<
errno
;
}
}
...
...
@@ -135,7 +135,7 @@ HWTEST_F(MremapApiTest, testMremapAnonShrink, Function | MediumTest | Level3)
exit
(
0
);
}
else
{
ExpectProcCrashed
(
pid
);
EXPECT_TRUE
(
munmap
(
mem
,
shrinkSize
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
munmap
(
mem
,
shrinkSize
)
==
0
)
<<
"ERROR: munmap() != 0"
<<
errno
;
}
}
...
...
@@ -179,7 +179,7 @@ HWTEST_F(MremapApiTest, testMremapAnonExpandFixAddr, Function | MediumTest | Lev
exit
(
0
);
}
else
{
WaitProcExitedOK
(
pid
);
EXPECT_TRUE
(
munmap
(
mem
,
expandSize
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
munmap
(
mem
,
expandSize
)
==
0
)
<<
"ERROR: munmap() != 0"
<<
errno
;
}
}
...
...
@@ -219,7 +219,7 @@ HWTEST_F(MremapApiTest, testMremapAnonShrinkFixAddr, Function | MediumTest | Lev
exit
(
0
);
}
else
{
ExpectProcCrashed
(
pid
);
EXPECT_TRUE
(
munmap
(
mem
,
shrinkSize
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
munmap
(
mem
,
shrinkSize
)
==
0
)
<<
"ERROR: munmap() != 0"
<<
errno
;
}
}
...
...
@@ -270,7 +270,8 @@ HWTEST_F(MremapApiTest, testMremapFileExpand, Function | MediumTest | Level2)
WaitProcExitedOK
(
pid
);
EXPECT_TRUE
(
munmap
(
mem
,
expandSize
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -319,7 +320,8 @@ HWTEST_F(MremapApiTest, testMremapFileShrink, Function | MediumTest | Level3)
ExpectProcCrashed
(
pid
);
EXPECT_TRUE
(
munmap
(
mem
,
shrinkSize
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -373,7 +375,8 @@ HWTEST_F(MremapApiTest, testMremapFileExpandFixAddr, Function | MediumTest | Lev
WaitProcExitedOK
(
pid
);
EXPECT_TRUE
(
munmap
(
mem
,
expandSize
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -426,7 +429,8 @@ HWTEST_F(MremapApiTest, testMremapFileShrinkFixAddr, Function | MediumTest | Lev
EXPECT_TRUE
(
munmap
(
mem
,
shrinkSize
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
close
(
fd
)
!=
-
1
)
<<
"ERROR: close() == -1"
;
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
;
Msleep
(
1000
);
EXPECT_TRUE
(
remove
(
file
)
==
0
)
<<
"ERROR: remove() != 0"
<<
errno
;
}
}
...
...
@@ -465,6 +469,6 @@ HWTEST_F(MremapApiTest, testMremapEINVAL, Function | MediumTest | Level4)
EXPECT_TRUE
(
munmap
(
mem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
if
(
newMem
!=
MAP_FAILED
&&
newMem
!=
mem
)
{
EXPECT_TRUE
(
munmap
(
newMem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
;
EXPECT_TRUE
(
munmap
(
newMem
,
len
)
==
0
)
<<
"ERROR: munmap() != 0"
<<
errno
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录