diff options
| author | Eric Haszlakiewicz <erh+git@nimenees.com> | 2020-02-13 03:11:10 +0000 |
|---|---|---|
| committer | Eric Haszlakiewicz <erh+git@nimenees.com> | 2020-02-13 03:11:10 +0000 |
| commit | ae13ca524a0e4567489c1e5138deedd568c161b6 (patch) | |
| tree | 3ff468d2547d52043197b29e5293595681de66d9 /tests | |
| parent | 0ffdbb239549020fed121bf40c05528cfab80dad (diff) | |
| download | json-c-ae13ca524a0e4567489c1e5138deedd568c161b6.tar.gz | |
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.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_set_value.c | 10 | ||||
| -rw-r--r-- | tests/test_set_value.expected | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/test_set_value.c b/tests/test_set_value.c index 1f80b0e..50957d2 100644 --- a/tests/test_set_value.c +++ b/tests/test_set_value.c @@ -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; } diff --git a/tests/test_set_value.expected b/tests/test_set_value.expected index 6a900f9..4cbd5bc 100644 --- a/tests/test_set_value.expected +++ b/tests/test_set_value.expected @@ -3,4 +3,5 @@ INT64 PASSED BOOL PASSED DOUBLE PASSED STRING PASSED +PARSE AND SET PASSED PASSED |
