mirror of
https://github.com/json-c/json-c.git
synced 2026-03-30 10:29:06 +08:00
Issue #539: reset the serializer when json_object_set_double() is called and the current serializer is the one that json_object_new_double_s() used.
This commit is contained in:
@@ -45,8 +45,14 @@ int main(int argc, char **argv)
|
||||
assert (strcmp(json_object_get_string(tmp),SHORT)==0);
|
||||
json_object_put(tmp);
|
||||
printf("STRING PASSED\n");
|
||||
|
||||
|
||||
|
||||
tmp = json_tokener_parse("1.234");
|
||||
json_object_set_double(tmp, 12.3);
|
||||
const char *serialized = json_object_to_json_string(tmp);
|
||||
fprintf(stderr, "%s\n", serialized);
|
||||
assert(strncmp(serialized, "12.3", 4)==0);
|
||||
printf("PARSE AND SET PASSED\n");
|
||||
|
||||
printf("PASSED\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3,4 +3,5 @@ INT64 PASSED
|
||||
BOOL PASSED
|
||||
DOUBLE PASSED
|
||||
STRING PASSED
|
||||
PARSE AND SET PASSED
|
||||
PASSED
|
||||
|
||||
Reference in New Issue
Block a user