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

!68 修改Sscanf用例crash的问题

Merge pull request !68 from chuaizhzh/Sscanf_20210324
...@@ -151,9 +151,10 @@ HWTEST_F(IoTest, testSscanfChar, Function | MediumTest | Level1) ...@@ -151,9 +151,10 @@ HWTEST_F(IoTest, testSscanfChar, Function | MediumTest | Level1)
EXPECT_EQ(ret, 1) << "> sscanf fail, errno = " << errno; EXPECT_EQ(ret, 1) << "> sscanf fail, errno = " << errno;
EXPECT_EQ(c, 'a'); EXPECT_EQ(c, 'a');
ret = sscanf("hello", "%5c", &c); char c2[10] = {0};
ret = sscanf("helloworld", "%5c", c2);
EXPECT_EQ(ret, 1) << "> sscanf fail, errno = " << errno; EXPECT_EQ(ret, 1) << "> sscanf fail, errno = " << errno;
EXPECT_EQ(c, 'h'); EXPECT_EQ(c2, "hello");
ret = sscanf("(a) and |b|", "(%c) and |%c%*c|", &c, &c1); ret = sscanf("(a) and |b|", "(%c) and |%c%*c|", &c, &c1);
EXPECT_EQ(ret, 2) << "> sscanf fail, errno = " << errno; EXPECT_EQ(ret, 2) << "> sscanf fail, errno = " << errno;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册