mirror of
https://github.com/json-c/json-c.git
synced 2026-03-30 02:19:06 +08:00
Fix memory leaks in test_double_serializer, and make sure all tests return 0 at the end of main().
This commit is contained in:
@@ -86,12 +86,16 @@ int main()
|
||||
/* Test NaN handling */
|
||||
obj = json_object_new_double(zero_dot_zero / zero_dot_zero);
|
||||
printf("obj(0.0/0.0)=%s\n", json_object_to_json_string(obj));
|
||||
json_object_put(obj);
|
||||
|
||||
/* Test Infinity and -Infinity handling */
|
||||
obj = json_object_new_double(1.0/zero_dot_zero);
|
||||
printf("obj(1.0/0.0)=%s\n", json_object_to_json_string(obj));
|
||||
json_object_put(obj);
|
||||
|
||||
obj = json_object_new_double(-1.0/zero_dot_zero);
|
||||
printf("obj(-1.0/0.0)=%s\n", json_object_to_json_string(obj));
|
||||
json_object_put(obj);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user