提交 39588e2e 编写于 作者: J jwx1265790

Fix testcase failed

Issue: https://gitee.com/openharmony/third_party_musl/issues/I7TP1Y

test: libc-test
Signed-off-by: Njwx1265790 <2510840462@qq.com>
上级 b8c0b494
......@@ -40,22 +40,24 @@ void forkpty_0100(void)
fp = fopen("test1.txt", "w+");
fwrite(sign_r, sizeof(char), strlen(sign_r), fp);
fclose(fp);
exit(EXIT_SUCCESS);
} else {
wait(NULL);
fp = fopen("test2.txt", "w+");
fwrite(sign_r, sizeof(char), strlen(sign_r), fp);
fclose(fp);
FILE *fp1 = fopen("test1.txt", "r");
FILE *fp2 = fopen("test2.txt", "r");
fread(list1, sizeof(list1), 1, fp1);
fread(list2, sizeof(list2), 1, fp2);
EXPECT_EQ("forkpty_0100", list1[0], '1');
EXPECT_EQ("forkpty_0100", list2[0], '1');
fclose(fp1);
fclose(fp2);
remove("test1.txt");
remove("test2.txt");
}
sleep(1);
FILE *fp1 = fopen("test1.txt", "r");
FILE *fp2 = fopen("test2.txt", "r");
fread(list1, sizeof(list1), 1, fp1);
fread(list2, sizeof(list2), 1, fp2);
EXPECT_EQ("forkpty_0100", list1[0], '1');
EXPECT_EQ("forkpty_0100", list2[0], '1');
fclose(fp1);
fclose(fp2);
remove("test1.txt");
remove("test2.txt");
}
int main(int argc, char *argv[])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册