]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Add a test for serializing the double value -1.0.
authorEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 10 Nov 2019 05:10:28 +0000 (00:10 -0500)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 10 Nov 2019 05:13:00 +0000 (00:13 -0500)
tests/test_float.c
tests/test_float.expected

index 0a87038663e76e4b04b78394f0eb4a5b11f82cc3..7c082eaa9dd56a9fc3b2eee3e1d0b86923bb07aa 100644 (file)
@@ -11,6 +11,10 @@ int main(void)
   json = json_object_new_double(1.0);
   printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
   json_object_put(json);
+
+  json = json_object_new_double(-1.0);
+  printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
+  json_object_put(json);
   json = json_object_new_double(1.23);
   printf("json = %s\n", json_object_to_json_string_ext(json, JSON_C_TO_STRING_PRETTY));
   json_object_put(json);
index 970c6543ea9799e1f1ba241e4aea780bf32a1aa0..7ca5916b0640f576433020fdd18c4bbf9708018c 100644 (file)
@@ -1,4 +1,5 @@
 json = 1.0
+json = -1.0
 json = 1.23
 json = 123456789.0
 json = 123456789.123