JSON bug fixes

GH #241: SF #620 Endless loop in JSON parser (added Buffer::setCapacity)
GH #242: SF #619 Syntax error in JSON parser (float/double trim)
This commit is contained in:
Aleksandar Fabijanic
2013-07-21 22:18:56 -05:00
parent 996ddf1b43
commit 20e1cf8821
8 changed files with 56 additions and 4 deletions

View File

@@ -1647,6 +1647,14 @@ void JSONTest::testUnicode()
}
void JSONTest::testSmallBuffer()
{
Poco::JSON::Parser parser(new Poco::JSON::ParseHandler(), 4);
std::string jsonStr = "{ \"x\" : \"123456789012345678901234567890123456789012345678901234567890\" }";
parser.parse(jsonStr);
}
std::string JSONTest::getTestFilesPath(const std::string& type)
{
std::ostringstream ostr;
@@ -1717,6 +1725,7 @@ CppUnit::Test* JSONTest::suite()
CppUnit_addTest(pSuite, JSONTest, testInvalidUnicodeJanssonFiles);
CppUnit_addTest(pSuite, JSONTest, testTemplate);
CppUnit_addTest(pSuite, JSONTest, testUnicode);
CppUnit_addTest(pSuite, JSONTest, testSmallBuffer);
return pSuite;
}