tests/test_json.c

changeset 1032
aaad28e23dac
parent 1015
a0922b925d2a
child 1033
e3009345984b
--- a/tests/test_json.c	Fri Dec 20 15:00:31 2024 +0100
+++ b/tests/test_json.c	Fri Dec 20 15:15:18 2024 +0100
@@ -42,6 +42,7 @@
         CX_TEST_ASSERT(json.vbuf == json.vbuf_internal);
         CX_TEST_ASSERT(json.vbuf_size == 0);
         CX_TEST_ASSERT(json.vbuf_capacity >= 8);
+        cxJsonDestroy(&json);
     }
 }
 
@@ -137,6 +138,7 @@
             cxJsonAsCxString(object),
             CX_STR("{\n\t\"object\":null\n}"))
         );
+        cxJsonValueFree(obj);
     }
     cxJsonDestroy(&json);
 }
@@ -365,6 +367,7 @@
         CX_TEST_ASSERT(result == CX_JSON_NO_ERROR);
         CX_TEST_ASSERT(cxJsonIsNumber(v));
         CX_TEST_ASSERT(cxJsonAsDouble(v) == 0.000815);
+        cxJsonValueFree(v);
 
         cxJsonFill(&json, "1.23E4 ");
         result = cxJsonNext(&json, &v);
@@ -372,7 +375,6 @@
         CX_TEST_ASSERT(cxJsonIsNumber(v));
         CX_TEST_ASSERT(cxJsonAsInteger(v) == 12300);
         CX_TEST_ASSERT(cxJsonAsDouble(v) == 12300.0);
-
         cxJsonValueFree(v);
     }
     cxJsonDestroy(&json);

mercurial