From: Eric Haszlakiewicz Date: Sun, 10 Nov 2019 05:10:28 +0000 (-0500) Subject: Add a test for serializing the double value -1.0. X-Git-Tag: json-c-0.14-20200419~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac26ea9c5bb42bd19aa466acea830a90435d65de;p=thirdparty%2Fjson-c.git Add a test for serializing the double value -1.0. --- diff --git a/tests/test_float.c b/tests/test_float.c index 0a870386..7c082eaa 100644 --- a/tests/test_float.c +++ b/tests/test_float.c @@ -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); diff --git a/tests/test_float.expected b/tests/test_float.expected index 970c6543..7ca5916b 100644 --- a/tests/test_float.expected +++ b/tests/test_float.expected @@ -1,4 +1,5 @@ json = 1.0 +json = -1.0 json = 1.23 json = 123456789.0 json = 123456789.123