From 152c2eff6c6c9faaa3b0c8ae2972c55397bcdda8 Mon Sep 17 00:00:00 2001 From: "miloyip@gmail.com" Date: Wed, 14 Nov 2012 02:36:23 +0000 Subject: [PATCH] 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 --- include/rapidjson/document.h | 2 +- test/unittest/valuetest.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 1f490d6..ef5b301 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -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, diff --git a/test/unittest/valuetest.cpp b/test/unittest/valuetest.cpp index 4505573..1578c03 100644 --- a/test/unittest/valuetest.cpp +++ b/test/unittest/valuetest.cpp @@ -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) {