fix:修复函数返回错误等问题

Signed-off-by: zhangdengyu <zhangdengyu2@huawei.com>
This commit is contained in:
zhangdengyu
2022-09-24 17:04:38 +08:00
parent 453c376198
commit 043e84dfcb
34 changed files with 82 additions and 79 deletions

View File

@@ -33,12 +33,10 @@
static int TestCase(void)
{
int ret;
int *test = NULL;
int status = 0;
pid_t pid = fork();
ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, INVALID_PROCESS_ID, pid);
if (pid == 0) {
*test = 0x1;
exit(0);
}
@@ -54,7 +52,6 @@ static int TestCase(void)
pid = fork();
ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, INVALID_PROCESS_ID, pid);
if (pid == 0) {
*test = 0x1;
exit(0);
}

View File

@@ -35,19 +35,15 @@
static int TestThread(void)
{
int *test = nullptr;
int ret;
pid_t pid = fork();
ICUNIT_ASSERT_WITHIN_EQUAL(pid, 0, INVALID_PROCESS_ID, pid);
if (pid == 0) {
*test = 0x1;
while (1) {
}
}
*test = 0x1;
ret = waitpid(pid, NULL, 0);
ICUNIT_ASSERT_EQUAL(ret, pid, ret);
@@ -56,7 +52,6 @@ static int TestThread(void)
static int TestCase(void)
{
int *test = nullptr;
int count = 5;
int status = 0;
int ret;