on master help sign in
Clean up the test harness a little
21dab46Neil Mitchell
gen/test.c+10−6
@@ -324,14 +324,18 @@ document* hexml_document_parse(const char* s, int slen)
324 return d;
324 return d;
325}
325}
326
326
327+/////////////////////////////////////////////////////////////////////
328+// TEST HARNESS (temporary)
329+
327int main()
330int main()
328{
331{
329− const document* d = hexml_document_parse("<test foo='123 xyz'><inner /> value</test>", -1);
332+ const document* d = hexml_document_parse("<test foo='123 xyz'><inner /> value</test>", -1);
330− char buf[1000];
333+ char buf[1000];
331− int len = hexml_node_render(d, hexml_document_node(d), buf, sizeof(buf));
334+ int len = hexml_node_render(d, hexml_document_node(d), buf, sizeof(buf));
332− buf[len] = 0;
335+ buf[len] = 0;
333− printf("Result = %s\n", buf);
336+ printf("Result = %s\n", buf);
337+ printf("Used nodes = %i, attribtes = %i\n", d->nodes.used_front, d->attrs.used);
334− return 0;
338+ return 0;
335}
339}
336
340
337/*
341/*