Merge pull request #129 from pah/bug/compare-uint64-double
Failing comparisons between certain (Ui|I)nt64 numbers
This commit is contained in:
commit
2a4e055590
@ -662,7 +662,7 @@ public:
|
|||||||
return StringEqual(rhs);
|
return StringEqual(rhs);
|
||||||
|
|
||||||
case kNumberType:
|
case kNumberType:
|
||||||
if (IsDouble() || rhs.GetDouble())
|
if (IsDouble() || rhs.IsDouble())
|
||||||
return GetDouble() == rhs.GetDouble(); // May convert one operand from integer to double.
|
return GetDouble() == rhs.GetDouble(); // May convert one operand from integer to double.
|
||||||
else
|
else
|
||||||
return data_.n.u64 == rhs.data_.n.u64;
|
return data_.n.u64 == rhs.data_.n.u64;
|
||||||
|
@ -135,6 +135,11 @@ TEST(Value, equalto_operator) {
|
|||||||
TestEqual(x, y);
|
TestEqual(x, y);
|
||||||
TestEqual(y, z);
|
TestEqual(y, z);
|
||||||
TestEqual(z, x);
|
TestEqual(z, x);
|
||||||
|
|
||||||
|
// Issue #129: compare Uint64
|
||||||
|
x.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFF0));
|
||||||
|
y.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF));
|
||||||
|
TestUnequal(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Value>
|
template <typename Value>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user