Permalink
Browse files

Merge pull request #1373 from lelit/issue1368

Add test case on kParseNumbersAsStringsFlag being able to load big ints
  • Loading branch information...
miloyip committed Oct 8, 2018
2 parents 663f076 + 91d50c8 commit 67fac85e96220f69076121d569abd15471abb6bf
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/unittest/readertest.cpp
@@ -1975,6 +1975,17 @@ TEST(Reader, NumbersAsStrings) {
Reader reader;
EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
}
{
char n1e319[321]; // '1' followed by 319 '0'
n1e319[0] = '1';
for (int i = 1; i < 320; i++)
n1e319[i] = '0';
n1e319[320] = '\0';
StringStream s(n1e319);
NumbersAsStringsHandler h(n1e319);
Reader reader;
EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
}
}
template <unsigned extraFlags>

0 comments on commit 67fac85

Please sign in to comment.