Fixed Issue 41 Incorrect parsing of unsigned int number types

git-svn-id: https://rapidjson.googlecode.com/svn/trunk@72 c5894555-1306-4e8d-425f-1f6f381ee07c
This commit is contained in:
miloyip@gmail.com 2012-11-14 02:36:23 +00:00
parent 22ddf37cf0
commit 152c2eff6c
2 changed files with 2 additions and 1 deletions

View File

@ -547,7 +547,7 @@ private:
kTrueFlag = kTrueType | kBoolFlag,
kFalseFlag = kFalseType | kBoolFlag,
kNumberIntFlag = kNumberType | kNumberFlag | kIntFlag | kInt64Flag,
kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag,
kNumberUintFlag = kNumberType | kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag,
kNumberInt64Flag = kNumberType | kNumberFlag | kInt64Flag,
kNumberUint64Flag = kNumberType | kNumberFlag | kUint64Flag,
kNumberDoubleFlag = kNumberType | kNumberFlag | kDoubleFlag,

View File

@ -189,6 +189,7 @@ TEST(Value, Uint) {
z = 2147483648u; // 2^31, cannot cast as int
EXPECT_EQ(2147483648u, z.GetUint());
EXPECT_FALSE(z.IsInt());
EXPECT_TRUE(z.IsInt64()); // Issue 41: Incorrect parsing of unsigned int number types
}
TEST(Value, Int64) {