tests/test_json.c

changeset 1601
e47078681a6f
parent 1600
a1a728d7ebfd
child 1602
7329821fd768
--- a/tests/test_json.c	Sun Dec 14 14:29:27 2025 +0100
+++ b/tests/test_json.c	Sun Dec 14 15:41:02 2025 +0100
@@ -1772,7 +1772,7 @@
 
     // write it to a buffer
     CxBuffer buf;
-    cxBufferInit(&buf, NULL, 512, NULL, CX_BUFFER_DEFAULT);
+    cxBufferInit(&buf, NULL, NULL, 512, CX_BUFFER_DEFAULT);
     int result = cxJsonWrite(&buf, obj, cxBufferWriteFunc, writer);
     cxBufferTerminate(&buf); // makes debugging easier
     CX_TEST_ASSERT(result == 0);
@@ -1913,7 +1913,7 @@
         CxJsonWriter writer = cxJsonWriterPretty(true);
         writer.indent = 8;
         CxBuffer buf;
-        cxBufferInit(&buf, NULL, 512, NULL, CX_BUFFER_DEFAULT);
+        cxBufferInit(&buf, NULL, NULL, 512, CX_BUFFER_DEFAULT);
         int result = cxJsonWrite(&buf, obj, cxBufferWriteFunc, &writer);
         cxBufferTerminate(&buf); // makes debugging easier
         CX_TEST_ASSERT(result == 0);
@@ -1934,7 +1934,7 @@
     CxJsonValue* num = cxJsonCreateNumber(NULL, 3.141592653589793);
     CxJsonWriter writer = cxJsonWriterCompact();
     CxBuffer buf;
-    cxBufferInit(&buf, NULL, 32, NULL, 0);
+    cxBufferInit(&buf, NULL, NULL, 32, 0);
     CX_TEST_DO {
         // test default settings (6 digits)
         CX_TEST_ASSERT(0 == cxJsonWrite(&buf, num, cxBufferWriteFunc, &writer));
@@ -2000,7 +2000,7 @@
         "hello\twörld\r\nthis is\\a \"string\"\b in \a string\f");
     CxJsonWriter writer = cxJsonWriterCompact();
     CxBuffer buf;
-    cxBufferInit(&buf, NULL, 128, NULL, 0);
+    cxBufferInit(&buf, NULL, NULL, 128, 0);
     CX_TEST_DO {
         CX_TEST_ASSERT(0 == cxJsonWrite(&buf, str, cxBufferWriteFunc, &writer));
         CX_TEST_ASSERT(0 == cx_strcmp(cx_strn(buf.space, buf.size),
@@ -2016,7 +2016,7 @@
         "hello\twörld\r\nthis is\\a \"string\"\b in \a string\f", CX_JSON_TRUE);
     CxJsonWriter writer = cxJsonWriterCompact();
     CxBuffer buf;
-    cxBufferInit(&buf, NULL, 128, NULL, 0);
+    cxBufferInit(&buf, NULL, NULL, 128, 0);
     CX_TEST_DO {
         CX_TEST_ASSERT(0 == cxJsonWrite(&buf, obj, cxBufferWriteFunc, &writer));
         CX_TEST_ASSERT(0 == cx_strcmp(cx_strn(buf.space, buf.size),
@@ -2030,7 +2030,7 @@
     CxJsonValue* str = cxJsonCreateString(NULL,"test/solidus");
     CxJsonWriter writer = cxJsonWriterCompact();
     CxBuffer buf;
-    cxBufferInit(&buf, NULL, 16, NULL, 0);
+    cxBufferInit(&buf, NULL, NULL, 16, 0);
     CX_TEST_DO {
         // default: do not escape
         CX_TEST_ASSERT(0 == cxJsonWrite(&buf, str, cxBufferWriteFunc, &writer));
@@ -2048,7 +2048,7 @@
 
 CX_TEST(test_json_write_nothing) {
     CxBuffer buf;
-    cxBufferInit(&buf, NULL, 16, NULL, 0);
+    cxBufferInit(&buf, NULL, NULL, 16, 0);
     CX_TEST_DO {
         CxJsonValue nothing;
         nothing.type = CX_JSON_NOTHING;

mercurial