Commit 6b7f3464 authored by Philipp A. Hartmann's avatar Philipp A. Hartmann

ParseErrorCode: fix typo (NumberTooBig)

parent a22f325a
...@@ -34,7 +34,7 @@ inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErro ...@@ -34,7 +34,7 @@ inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErro
case kParseErrorStringMissQuotationMark: return RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string."); case kParseErrorStringMissQuotationMark: return RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string.");
case kParseErrorStringInvalidEncoding: return RAPIDJSON_ERROR_STRING("Invalid encoidng in string."); case kParseErrorStringInvalidEncoding: return RAPIDJSON_ERROR_STRING("Invalid encoidng in string.");
case kParesErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double."); case kParseErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double.");
case kParseErrorNumberMissFraction: return RAPIDJSON_ERROR_STRING("Miss fraction part in number."); case kParseErrorNumberMissFraction: return RAPIDJSON_ERROR_STRING("Miss fraction part in number.");
case kParseErrorNumberMissExponent: return RAPIDJSON_ERROR_STRING("Miss exponent in number."); case kParseErrorNumberMissExponent: return RAPIDJSON_ERROR_STRING("Miss exponent in number.");
......
...@@ -71,7 +71,7 @@ enum ParseErrorCode { ...@@ -71,7 +71,7 @@ enum ParseErrorCode {
kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string. kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string.
kParseErrorStringInvalidEncoding, //!< Invalid encoidng in string. kParseErrorStringInvalidEncoding, //!< Invalid encoidng in string.
kParesErrorNumberTooBig, //!< Number too big to be stored in double. kParseErrorNumberTooBig, //!< Number too big to be stored in double.
kParseErrorNumberMissFraction, //!< Miss fraction part in number. kParseErrorNumberMissFraction, //!< Miss fraction part in number.
kParseErrorNumberMissExponent //!< Miss exponent in number. kParseErrorNumberMissExponent //!< Miss exponent in number.
}; };
...@@ -643,7 +643,7 @@ private: ...@@ -643,7 +643,7 @@ private:
d = (double)i64; d = (double)i64;
while (s.Peek() >= '0' && s.Peek() <= '9') { while (s.Peek() >= '0' && s.Peek() <= '9') {
if (d >= 1E307) if (d >= 1E307)
RAPIDJSON_PARSE_ERROR(kParesErrorNumberTooBig, is.Tell()); RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, is.Tell());
d = d * 10 + (s.Take() - '0'); d = d * 10 + (s.Take() - '0');
} }
} }
...@@ -695,7 +695,7 @@ private: ...@@ -695,7 +695,7 @@ private:
while (s.Peek() >= '0' && s.Peek() <= '9') { while (s.Peek() >= '0' && s.Peek() <= '9') {
exp = exp * 10 + (s.Take() - '0'); exp = exp * 10 + (s.Take() - '0');
if (exp > 308) if (exp > 308)
RAPIDJSON_PARSE_ERROR(kParesErrorNumberTooBig, is.Tell()); RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, is.Tell());
} }
} }
else else
......
...@@ -171,9 +171,9 @@ TEST(Reader, ParseNumber_Error) { ...@@ -171,9 +171,9 @@ TEST(Reader, ParseNumber_Error) {
for (int i = 1; i < 310; i++) for (int i = 1; i < 310; i++)
n1e309[i] = '0'; n1e309[i] = '0';
n1e309[310] = '\0'; n1e309[310] = '\0';
TEST_NUMBER_ERROR(kParesErrorNumberTooBig, n1e309); TEST_NUMBER_ERROR(kParseErrorNumberTooBig, n1e309);
} }
TEST_NUMBER_ERROR(kParesErrorNumberTooBig, "1e309"); TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1e309");
// Miss fraction part in number. // Miss fraction part in number.
TEST_NUMBER_ERROR(kParseErrorNumberMissFraction, "1."); TEST_NUMBER_ERROR(kParseErrorNumberMissFraction, "1.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment