NumberParser::parseUnsigned should not parse negative numbers

The function should abort if a negative number (e.g. "-123") is passed as input
This commit is contained in:
Pascal Bach
2014-04-28 16:14:17 +02:00
parent 695ba1b0ee
commit d9a594e184
2 changed files with 8 additions and 0 deletions

View File

@@ -272,6 +272,12 @@ void NumberParserTest::testParseError()
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parseUnsigned("-123");
failmsg("must throw SyntaxException");
} catch (SyntaxException&) { }
try
{
NumberParser::parseHex("z23");