]> granicus.if.org Git - json-c/commitdiff
Fix memory leaks in test_double_serializer, and make sure all tests return 0 at the...
authorEric Haszlakiewicz <erh+git@nimenees.com>
Sat, 23 Nov 2019 17:05:28 +0000 (12:05 -0500)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Sat, 23 Nov 2019 17:05:28 +0000 (12:05 -0500)
tests/test_charcase.c
tests/test_double_serializer.c
tests/test_locale.c
tests/test_parse.c
tests/test_visit.c

index cb2456b1ca7009fb2fcd8305137efbbf1124b91a..e20ca33229612f04e6ef69ea776a6cd53c2fb09f 100644 (file)
@@ -14,6 +14,8 @@ int main(int argc, char **argv)
        MC_SET_DEBUG(1);
 
        test_case_parse();
+
+       return 0;
 }
 
 /* make sure only lowercase forms are parsed in strict mode */
index 2cec24fb76a625aad68ed1c7a226384cb1ca593d..ddace8e4c0f1fcce14c1429ad6b4d2c403769e78 100644 (file)
@@ -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;
 }
index 7d6541ae93162f2c433cff2dad1db8d996966559..be02727eea03db7ad9d61d8da94e51b1f557bdc1 100644 (file)
@@ -58,5 +58,7 @@ int main(int argc, char **argv)
 
        printf("new_obj.to_string()=%s\n", json_object_to_json_string_ext(new_obj,JSON_C_TO_STRING_NOZERO));
        json_object_put(new_obj);
+
+       return 0;
 }
 
index 8f3c922e2543dbc515c72a4019f6532942956ee4..0c8fc4b8215c9233c8cabec2e748e98abdb0491a 100644 (file)
@@ -26,6 +26,8 @@ int main(void)
        puts(separator);
        test_incremental_parse();
        puts(separator);
+
+       return 0;
 }
 
 static json_c_visit_userfunc clear_serializer;
index f2ffe8c0988178d72fed11f3e193815e663f8d7c..4046133c0b2a20772c3bcd1187c4193d24d04029 100644 (file)
@@ -49,6 +49,8 @@ int main(void)
        printf("================================\n\n");
 
        json_object_put(jso);
+
+       return 0;
 }