mirror of
https://github.com/json-c/json-c.git
synced 2026-04-01 19:39:07 +08:00
modify partial functions and testcase, in order to support automatic conversion for int64/uint64
This commit is contained in:
@@ -15,9 +15,11 @@ int main()
|
||||
struct json_object *int1 = json_object_new_int(0);
|
||||
struct json_object *int2 = json_object_new_int(1);
|
||||
struct json_object *int3 = json_object_new_int(1);
|
||||
struct json_object *int4 = json_object_new_int(-1);
|
||||
struct json_object *uint1 = json_object_new_uint64(0);
|
||||
struct json_object *uint2 = json_object_new_uint64(1);
|
||||
struct json_object *uint3 = json_object_new_uint64(1);
|
||||
struct json_object *uint4 = json_object_new_uint64((uint64_t)INT64_MAX + 100);
|
||||
|
||||
if (!json_object_equal(int1, int2))
|
||||
printf("JSON integer comparison is correct\n");
|
||||
@@ -49,12 +51,54 @@ int main()
|
||||
else
|
||||
printf("JSON same usigned integer comparison failed\n");
|
||||
|
||||
if (json_object_equal(int2, uint2))
|
||||
printf("JSON integer & usigned integer comparison is correct\n");
|
||||
else
|
||||
printf("JSON integer & usigned integer comparison failed\n");
|
||||
|
||||
if (!json_object_equal(int2, uint4))
|
||||
printf("JSON integer & usigned integer comparison is correct\n");
|
||||
else
|
||||
printf("JSON integer & usigned integer comparison failed\n");
|
||||
|
||||
if (!json_object_equal(int4, uint2))
|
||||
printf("JSON integer & usigned integer comparison is correct\n");
|
||||
else
|
||||
printf("JSON integer & usigned integer comparison failed\n");
|
||||
|
||||
if (!json_object_equal(int4, uint4))
|
||||
printf("JSON integer & usigned integer comparison is correct\n");
|
||||
else
|
||||
printf("JSON integer & usigned integer comparison failed\n");
|
||||
|
||||
if (json_object_equal(uint2, int2))
|
||||
printf("JSON usigned integer & integer comparison is correct\n");
|
||||
else
|
||||
printf("JSON usigned integer & integer comparison failed\n");
|
||||
|
||||
if (!json_object_equal(uint2, int4))
|
||||
printf("JSON usigned integer & integer comparison is correct\n");
|
||||
else
|
||||
printf("JSON usigned integer & integer comparison failed\n");
|
||||
|
||||
if (!json_object_equal(uint4, int2))
|
||||
printf("JSON usigned integer & integer comparison is correct\n");
|
||||
else
|
||||
printf("JSON usigned integer & integer comparison failed\n");
|
||||
|
||||
if (!json_object_equal(uint4, int4))
|
||||
printf("JSON usigned integer & integer comparison is correct\n");
|
||||
else
|
||||
printf("JSON usigned integer & integer comparison failed\n");
|
||||
|
||||
json_object_put(int1);
|
||||
json_object_put(int2);
|
||||
json_object_put(int3);
|
||||
json_object_put(int4);
|
||||
json_object_put(uint1);
|
||||
json_object_put(uint2);
|
||||
json_object_put(uint3);
|
||||
json_object_put(uint4);
|
||||
|
||||
/* string tests */
|
||||
struct json_object *str1 = json_object_new_string("TESTSTRING");
|
||||
|
||||
Reference in New Issue
Block a user