提交 026f3732 编写于 作者: C chuaizhzh

fix failed testcase

Change-Id: I3fc5207a8a33ed55aa87dbeed4f3cab980d825ce
上级 c1a64e5b
...@@ -22,6 +22,9 @@ using namespace testing::ext; ...@@ -22,6 +22,9 @@ using namespace testing::ext;
// delete test file and dir // delete test file and dir
void DeleteTestFiles() void DeleteTestFiles()
{ {
if (access(TOP_DIR "/DIR_NEW", F_OK) == 0) {
RemoveDir(TOP_DIR "/DIR_NEW");
}
if (access(TOP_DIR "/" DIR0, F_OK) == 0) { if (access(TOP_DIR "/" DIR0, F_OK) == 0) {
RemoveDir(TOP_DIR "/" DIR0); RemoveDir(TOP_DIR "/" DIR0);
} }
......
...@@ -324,6 +324,7 @@ HWTEST_F(FileSystemTest, testOpenEisdir, Function | MediumTest | Level2) ...@@ -324,6 +324,7 @@ HWTEST_F(FileSystemTest, testOpenEisdir, Function | MediumTest | Level2)
fd = open(DIR0, O_RDWR, 0777); fd = open(DIR0, O_RDWR, 0777);
EXPECT_EQ(fd, -1) << "> Should open failed"; EXPECT_EQ(fd, -1) << "> Should open failed";
EXPECT_EQ(errno, EISDIR); EXPECT_EQ(errno, EISDIR);
close(fd);
} }
/** /**
......
...@@ -50,7 +50,7 @@ HWTEST_F(ProcessTest, testLineBigExit, Function | MediumTest | Level2) ...@@ -50,7 +50,7 @@ HWTEST_F(ProcessTest, testLineBigExit, Function | MediumTest | Level2)
} }
Msleep(50); Msleep(50);
exitCode = 0; exitCode = 0;
ASSERT_EQ(CheckProcStatus(pid, &exitCode), 1); ASSERT_EQ(CheckProcStatus(pid, &exitCode, 0), 1);
ASSERT_EQ(exitCode, reInt[i]); ASSERT_EQ(exitCode, reInt[i]);
} }
} }
...@@ -160,7 +160,7 @@ HWTEST_F(ProcessTest, testLineExit, Function | MediumTest | Level2) ...@@ -160,7 +160,7 @@ HWTEST_F(ProcessTest, testLineExit, Function | MediumTest | Level2)
} }
Msleep(50); Msleep(50);
exitCode = 0; exitCode = 0;
ASSERT_EQ(CheckProcStatus(pid, &exitCode), 1); ASSERT_EQ(CheckProcStatus(pid, &exitCode, 0), 1);
ASSERT_EQ(exitCode, reInt[i]); ASSERT_EQ(exitCode, reInt[i]);
} }
} }
...@@ -270,7 +270,7 @@ HWTEST_F(ProcessTest, testExit, Function | MediumTest | Level2) ...@@ -270,7 +270,7 @@ HWTEST_F(ProcessTest, testExit, Function | MediumTest | Level2)
} }
Msleep(50); Msleep(50);
exitCode = 0; exitCode = 0;
ASSERT_EQ(CheckProcStatus(pid, &exitCode), 1); ASSERT_EQ(CheckProcStatus(pid, &exitCode, 0), 1);
ASSERT_EQ(exitCode, reInt[i]); ASSERT_EQ(exitCode, reInt[i]);
} }
} }
...@@ -343,7 +343,7 @@ int FunctionAssertFalse(void) ...@@ -343,7 +343,7 @@ int FunctionAssertFalse(void)
} }
Msleep(50); Msleep(50);
int exitCode = 0; int exitCode = 0;
int reInt = CheckProcStatus(pid, &exitCode); int reInt = CheckProcStatus(pid, &exitCode, 0);
if ((reInt == 2) && (exitCode == SIGABRT)) { if ((reInt == 2) && (exitCode == SIGABRT)) {
LOG("> Success"); LOG("> Success");
return 1; return 1;
...@@ -368,7 +368,7 @@ HWTEST_F(ProcessTest, testAssertFalse, Function | MediumTest | Level3) ...@@ -368,7 +368,7 @@ HWTEST_F(ProcessTest, testAssertFalse, Function | MediumTest | Level3)
} }
Msleep(50); Msleep(50);
int exitCode = 0; int exitCode = 0;
ASSERT_EQ(CheckProcStatus(pid, &exitCode), 2); ASSERT_EQ(CheckProcStatus(pid, &exitCode, 0), 2);
ASSERT_EQ(exitCode, SIGABRT); ASSERT_EQ(exitCode, SIGABRT);
} }
...@@ -534,5 +534,6 @@ HWTEST_F(ProcessTest, testWaitPidTest, Function | MediumTest | Level3) ...@@ -534,5 +534,6 @@ HWTEST_F(ProcessTest, testWaitPidTest, Function | MediumTest | Level3)
EXPECT_EQ(expectPid, 1); EXPECT_EQ(expectPid, 1);
EXPECT_EQ(pidChild, 0); EXPECT_EQ(pidChild, 0);
Msleep(50); Msleep(50);
WaitProcExitedOK(pid);
DeleteGlobalVariable(); DeleteGlobalVariable();
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册