提交 d53fa46a 编写于 作者: L limeng

修改mem模块失败用例

Signed-off-by: Nlimeng <limeng151@huawei.com>
Change-Id: Ife335f2aab67dbe241fe02e1ef3d5e102eb6bf88
上级 3c9e9888
...@@ -348,7 +348,8 @@ HWTEST_F(MmapApiTest, testMmapFilePrivate, Function | MediumTest | Level3) ...@@ -348,7 +348,8 @@ HWTEST_F(MmapApiTest, testMmapFilePrivate, Function | MediumTest | Level3)
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -393,7 +394,8 @@ HWTEST_F(MmapApiTest, testMmapFileShare, Function | MediumTest | Level3)
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -433,7 +435,8 @@ HWTEST_F(MmapApiTest, testMmapFileShareOnlyRead, Function | MediumTest | Level1)
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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 ...@@ -475,7 +478,8 @@ HWTEST_F(MmapApiTest, testMmapFileShareOnlyWrite, Function | MediumTest | Level3
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -521,7 +525,8 @@ HWTEST_F(MmapApiTest, testMmapFilePrivateExec, Function | MediumTest | Level4)
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -567,7 +572,8 @@ HWTEST_F(MmapApiTest, testMmapFileShareExec, Function | MediumTest | Level4)
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -610,7 +616,8 @@ HWTEST_F(MmapApiTest, testMmapFileShareNoExec, Function | MediumTest | Level2)
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -743,7 +750,8 @@ HWTEST_F(MmapApiTest, testMmapWriteBack, Function | MediumTest | Level3)
EXPECT_TRUE(failure == 0) << "i = " << i << ", rBuffer = " << rBuffer[i]; EXPECT_TRUE(failure == 0) << "i = " << i << ", rBuffer = " << rBuffer[i];
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -783,8 +791,8 @@ HWTEST_F(MmapApiTest, testMmapEACCES, Function | MediumTest | Level3)
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
} }
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1";
Msleep(1000);
EXPECT_TRUE(remove(file) == 0) << "ERROR: remove() != 0"; EXPECT_TRUE(remove(file) == 0) << "ERROR: remove() != 0" << errno;
} }
/** /**
...@@ -888,7 +896,8 @@ HWTEST_F(MmapApiTest, testMmapEINVAL, Function | MediumTest | Level3) ...@@ -888,7 +896,8 @@ HWTEST_F(MmapApiTest, testMmapEINVAL, Function | MediumTest | Level3)
} }
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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;
} }
/** /**
......
...@@ -252,7 +252,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileAddReadPerm, Function | MediumTest | L ...@@ -252,7 +252,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileAddReadPerm, Function | MediumTest | L
WaitProcExitedOK(pid); WaitProcExitedOK(pid);
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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 | ...@@ -308,7 +309,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileAddWritePerm, Function | MediumTest |
EXPECT_TRUE(buf[0] == testChar) << "ERROR: buf[0] != testChar"; EXPECT_TRUE(buf[0] == testChar) << "ERROR: buf[0] != testChar";
EXPECT_TRUE(buf[1] == (testChar + 3)) << "ERROR: buf[1] != (testChar + 3)"; EXPECT_TRUE(buf[1] == (testChar + 3)) << "ERROR: buf[1] != (testChar + 3)";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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 ...@@ -350,7 +352,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileAddExecutePerm, Function | MediumTest
WaitProcExitedOK(pid); WaitProcExitedOK(pid);
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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 | ...@@ -394,7 +397,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileDelWritePerm, Function | MediumTest |
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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 ...@@ -437,7 +441,8 @@ HWTEST_F(MprotectApiTest, testMprotectFileDelExecutePerm, Function | MediumTest
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -465,8 +470,8 @@ HWTEST_F(MprotectApiTest, testMprotectEACCES, Function | MediumTest | Level4)
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1";
Msleep(1000);
EXPECT_TRUE(remove(file) == 0) << "ERROR: remove() != 0"; EXPECT_TRUE(remove(file) == 0) << "ERROR: remove() != 0" << errno;
} }
/** /**
......
...@@ -97,7 +97,7 @@ HWTEST_F(MremapApiTest, testMremapAnonExpand, Function | MediumTest | Level2) ...@@ -97,7 +97,7 @@ HWTEST_F(MremapApiTest, testMremapAnonExpand, Function | MediumTest | Level2)
exit(0); exit(0);
} else { } else {
WaitProcExitedOK(pid); 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) ...@@ -135,7 +135,7 @@ HWTEST_F(MremapApiTest, testMremapAnonShrink, Function | MediumTest | Level3)
exit(0); exit(0);
} else { } else {
ExpectProcCrashed(pid); 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 ...@@ -179,7 +179,7 @@ HWTEST_F(MremapApiTest, testMremapAnonExpandFixAddr, Function | MediumTest | Lev
exit(0); exit(0);
} else { } else {
WaitProcExitedOK(pid); 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 ...@@ -219,7 +219,7 @@ HWTEST_F(MremapApiTest, testMremapAnonShrinkFixAddr, Function | MediumTest | Lev
exit(0); exit(0);
} else { } else {
ExpectProcCrashed(pid); 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) ...@@ -270,7 +270,8 @@ HWTEST_F(MremapApiTest, testMremapFileExpand, Function | MediumTest | Level2)
WaitProcExitedOK(pid); WaitProcExitedOK(pid);
EXPECT_TRUE(munmap(mem, expandSize) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, expandSize) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -319,7 +320,8 @@ HWTEST_F(MremapApiTest, testMremapFileShrink, Function | MediumTest | Level3)
ExpectProcCrashed(pid); ExpectProcCrashed(pid);
EXPECT_TRUE(munmap(mem, shrinkSize) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, shrinkSize) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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 ...@@ -373,7 +375,8 @@ HWTEST_F(MremapApiTest, testMremapFileExpandFixAddr, Function | MediumTest | Lev
WaitProcExitedOK(pid); WaitProcExitedOK(pid);
EXPECT_TRUE(munmap(mem, expandSize) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, expandSize) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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 ...@@ -426,7 +429,8 @@ HWTEST_F(MremapApiTest, testMremapFileShrinkFixAddr, Function | MediumTest | Lev
EXPECT_TRUE(munmap(mem, shrinkSize) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, shrinkSize) == 0) << "ERROR: munmap() != 0";
EXPECT_TRUE(close(fd) != -1) << "ERROR: close() == -1"; 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) ...@@ -465,6 +469,6 @@ HWTEST_F(MremapApiTest, testMremapEINVAL, Function | MediumTest | Level4)
EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0";
if (newMem != MAP_FAILED && newMem != mem) { 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.
先完成此消息的编辑!
想要评论请 注册