mirror of
https://github.com/json-c/json-c.git
synced 2026-03-25 16:09:06 +08:00
The split of json_object into type-specific sub-structures is now functionally complete.
Remove all of the temporary defines, structures, old compat fuctions, extra fields, etc... that were needed during the conversion to a split set of json_object_* structures.
This commit is contained in:
@@ -20,7 +20,7 @@ int main()
|
||||
printf("obj.to_string(standard)=%s\n", json_object_to_json_string(obj));
|
||||
|
||||
printf("Test default serializer with custom userdata:\n");
|
||||
((struct json_object_base *)obj)->_userdata = udata;
|
||||
((struct json_object *)obj)->_userdata = udata;
|
||||
printf("obj.to_string(userdata)=%s\n", json_object_to_json_string(obj));
|
||||
|
||||
printf("Test explicit serializer with custom userdata:\n");
|
||||
|
||||
@@ -56,12 +56,12 @@ int main(int argc, char **argv)
|
||||
#define MID "A MID STRING"
|
||||
// 12345678901234567890123456789012....
|
||||
#define HUGE "A string longer than 32 chars as to check non local buf codepath"
|
||||
tmp = json_object_new_string(SHORT);
|
||||
assert(strcmp(json_object_get_string(tmp), SHORT) == 0);
|
||||
assert(strcmp(json_object_to_json_string(tmp), "\"" SHORT "\"") == 0);
|
||||
json_object_set_string(tmp, MID);
|
||||
tmp = json_object_new_string(MID);
|
||||
assert(strcmp(json_object_get_string(tmp), MID) == 0);
|
||||
assert(strcmp(json_object_to_json_string(tmp), "\"" MID "\"") == 0);
|
||||
json_object_set_string(tmp, SHORT);
|
||||
assert(strcmp(json_object_get_string(tmp), SHORT) == 0);
|
||||
assert(strcmp(json_object_to_json_string(tmp), "\"" SHORT "\"") == 0);
|
||||
json_object_set_string(tmp, HUGE);
|
||||
assert(strcmp(json_object_get_string(tmp), HUGE) == 0);
|
||||
assert(strcmp(json_object_to_json_string(tmp), "\"" HUGE "\"") == 0);
|
||||
|
||||
Reference in New Issue
Block a user