unittest: Add missing precision specifiers (CID 1402752)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2019-07-10 16:33:08 +02:00 committed by zdenop
parent 95733433d9
commit bdad068686

View File

@ -84,13 +84,13 @@ TEST_F(ScanutilsTest, DoesScanf) {
EXPECT_STREQ(s1, s2);
EXPECT_EQ(20, strlen(s2));
// Now read the rest of the alphabet.
r1 = fscanf(fp1, "%s", s1);
r2 = tfscanf(fp2, "%s", s2);
r1 = fscanf(fp1, "%1023s", s1);
r2 = tfscanf(fp2, "%1023s", s2);
EXPECT_EQ(r1, r2);
EXPECT_STREQ(s1, s2);
EXPECT_EQ(6, strlen(s2));
r1 = fscanf(fp1, "%s", s1);
r2 = tfscanf(fp2, "%s", s2);
r1 = fscanf(fp1, "%1023s", s1);
r2 = tfscanf(fp2, "%1023s", s2);
EXPECT_EQ(r1, r2);
EXPECT_STREQ(s1, s2);
EXPECT_EQ(2, strlen(s2));
@ -104,8 +104,8 @@ TEST_F(ScanutilsTest, DoesScanf) {
EXPECT_EQ(r1, r2);
EXPECT_EQ(i1[0], i2[0]);
// We should still see the next value and no phantoms.
r1 = fscanf(fp1, "%d %s", &i1[0], s1);
r2 = tfscanf(fp2, "%d %s", &i2[0], s2);
r1 = fscanf(fp1, "%d %1023s", &i1[0], s1);
r2 = tfscanf(fp2, "%d %1023s", &i2[0], s2);
EXPECT_EQ(r1, r2);
EXPECT_EQ(1, r2);
EXPECT_EQ(i1[0], i2[0]);