Upgrade to current upstream scanf implementation.

Also add a basic test.

Change-Id: Icc0e68a5716b9579244f6eb8bac1ab5a24eda85a
This commit is contained in:
Elliott Hughes
2014-03-12 17:10:41 -07:00
parent 0e79338d12
commit 603332fc4c
5 changed files with 219 additions and 40 deletions

View File

@@ -372,3 +372,14 @@ TEST(stdio, putc) {
ASSERT_EQ(EOF, putc('x', fp));
fclose(fp);
}
TEST(stdio, sscanf) {
char s1[123];
int i1;
double d1;
char s2[123];
ASSERT_EQ(3, sscanf(" hello 123 1.23 ", "%s %i %lf %s", s1, &i1, &d1, s2));
ASSERT_STREQ("hello", s1);
ASSERT_EQ(123, i1);
ASSERT_EQ(1.23, d1);
}