Fix unsigned long printed as signed long (issue #170)

This commit is contained in:
Benoit Blanchon
2016-04-28 08:42:59 +02:00
parent f192d5c12e
commit f9f002c8f7
11 changed files with 125 additions and 78 deletions

View File

@ -125,6 +125,14 @@ TEST_F(JsonParser_Array_Tests, TwoDoubles) {
secondElementMustBe(1e2);
}
TEST_F(JsonParser_Array_Tests, UnsignedLong) {
whenInputIs("[4294967295]");
parseMustSucceed();
sizeMustBe(1);
firstElementMustBe(4294967295UL);
}
TEST_F(JsonParser_Array_Tests, TwoBooleans) {
whenInputIs("[true,false]");

View File

@ -57,6 +57,11 @@ TEST_F(JsonVariant_PrintTo_Tests, Long) {
outputMustBe("42");
}
TEST_F(JsonVariant_PrintTo_Tests, UnsignedLong) {
variant = 4294967295UL;
outputMustBe("4294967295");
}
TEST_F(JsonVariant_PrintTo_Tests, Char) {
variant = '*';
outputMustBe("42");
@ -82,4 +87,9 @@ TEST_F(JsonVariant_PrintTo_Tests, PositiveInt64) {
variant = 9223372036854775807;
outputMustBe("9223372036854775807");
}
TEST_F(JsonVariant_PrintTo_Tests, UInt64) {
variant = 18446744073709551615;
outputMustBe("18446744073709551615");
}
#endif