提交 ff19f1fb 编写于 作者: O openharmony_ci 提交者: Gitee

!164...

!164 修改了FileSystemTest.testRenameDir用例在修改文件名字时用例报错误码为17的情况;修改了ProcessTest.testExit和testAssertFalse用例出错的情况
Merge pull request !164 from chuaizhzh/kernel_lite_20210426_02
......@@ -22,6 +22,9 @@ using namespace testing::ext;
// delete test file and dir
void DeleteTestFiles()
{
if (access(TOP_DIR "/DIR_NEW", F_OK) == 0) {
RemoveDir(TOP_DIR "/DIR_NEW");
}
if (access(TOP_DIR "/" DIR0, F_OK) == 0) {
RemoveDir(TOP_DIR "/" DIR0);
}
......
......@@ -324,6 +324,7 @@ HWTEST_F(FileSystemTest, testOpenEisdir, Function | MediumTest | Level2)
fd = open(DIR0, O_RDWR, 0777);
EXPECT_EQ(fd, -1) << "> Should open failed";
EXPECT_EQ(errno, EISDIR);
close(fd);
}
/**
......
......@@ -50,7 +50,7 @@ HWTEST_F(ProcessTest, testLineBigExit, Function | MediumTest | Level2)
}
Msleep(50);
exitCode = 0;
ASSERT_EQ(CheckProcStatus(pid, &exitCode), 1);
ASSERT_EQ(CheckProcStatus(pid, &exitCode, 0), 1);
ASSERT_EQ(exitCode, reInt[i]);
}
}
......@@ -160,7 +160,7 @@ HWTEST_F(ProcessTest, testLineExit, Function | MediumTest | Level2)
}
Msleep(50);
exitCode = 0;
ASSERT_EQ(CheckProcStatus(pid, &exitCode), 1);
ASSERT_EQ(CheckProcStatus(pid, &exitCode, 0), 1);
ASSERT_EQ(exitCode, reInt[i]);
}
}
......@@ -270,7 +270,7 @@ HWTEST_F(ProcessTest, testExit, Function | MediumTest | Level2)
}
Msleep(50);
exitCode = 0;
ASSERT_EQ(CheckProcStatus(pid, &exitCode), 1);
ASSERT_EQ(CheckProcStatus(pid, &exitCode, 0), 1);
ASSERT_EQ(exitCode, reInt[i]);
}
}
......@@ -343,7 +343,7 @@ int FunctionAssertFalse(void)
}
Msleep(50);
int exitCode = 0;
int reInt = CheckProcStatus(pid, &exitCode);
int reInt = CheckProcStatus(pid, &exitCode, 0);
if ((reInt == 2) && (exitCode == SIGABRT)) {
LOG("> Success");
return 1;
......@@ -368,7 +368,7 @@ HWTEST_F(ProcessTest, testAssertFalse, Function | MediumTest | Level3)
}
Msleep(50);
int exitCode = 0;
ASSERT_EQ(CheckProcStatus(pid, &exitCode), 2);
ASSERT_EQ(CheckProcStatus(pid, &exitCode, 0), 2);
ASSERT_EQ(exitCode, SIGABRT);
}
......@@ -534,5 +534,6 @@ HWTEST_F(ProcessTest, testWaitPidTest, Function | MediumTest | Level3)
EXPECT_EQ(expectPid, 1);
EXPECT_EQ(pidChild, 0);
Msleep(50);
WaitProcExitedOK(pid);
DeleteGlobalVariable();
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册