tests/test_json.c

changeset 1112
22dc2163fffd
parent 1082
46cdc8689fc4
equal deleted inserted replaced
1111:78eeeb950883 1112:22dc2163fffd
745 cxJsonArrAddIntegers(ints, (int64_t[]){42}, 1); 745 cxJsonArrAddIntegers(ints, (int64_t[]){42}, 1);
746 746
747 // write it to a buffer 747 // write it to a buffer
748 CxBuffer buf; 748 CxBuffer buf;
749 cxBufferInit(&buf, NULL, 512, NULL, CX_BUFFER_DEFAULT); 749 cxBufferInit(&buf, NULL, 512, NULL, CX_BUFFER_DEFAULT);
750 int result = cxJsonWrite(&buf, obj, (cx_write_func) cxBufferWrite, writer); 750 int result = cxJsonWrite(&buf, obj, cxBufferWriteFunc, writer);
751 cxBufferTerminate(&buf); // makes debugging easier 751 cxBufferTerminate(&buf); // makes debugging easier
752 CX_TEST_ASSERT(result == 0); 752 CX_TEST_ASSERT(result == 0);
753 753
754 // compare the string 754 // compare the string
755 CX_TEST_ASSERT(0 == cx_strcmp(cx_strn(buf.space, buf.size), expected)); 755 CX_TEST_ASSERT(0 == cx_strcmp(cx_strn(buf.space, buf.size), expected));

mercurial