blob: c7a90cd3dc06b52cb98a012fdb0e0f4e16a05edb [file] [log] [blame]
William A. Kennington IIIac69b482021-06-02 12:28:27 -07001From 6172ccd1e74bc181f5298f19e240234e12876abe Mon Sep 17 00:00:00 2001
2From: Tony Tascioglu <tony.tascioglu@windriver.com>
3Date: Tue, 11 May 2021 11:57:46 -0400
4Subject: [PATCH] Add 'install-ptest' rule.
5
6Print a standard result line for each test.
Patrick Williamsc124f4f2015-09-15 14:41:29 -05007
8Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
Brad Bishop316dfdd2018-06-25 12:45:53 -04009Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
William A. Kennington IIIac69b482021-06-02 12:28:27 -070010Upstream-Status: Pending
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011
Brad Bishopc342db32019-05-15 21:57:59 -040012Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
William A. Kennington IIIac69b482021-06-02 12:28:27 -070013Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com>
Brad Bishopc342db32019-05-15 21:57:59 -040014---
William A. Kennington IIIac69b482021-06-02 12:28:27 -070015 Makefile.am | 9 +++
Brad Bishopc342db32019-05-15 21:57:59 -040016 runsuite.c | 1 +
17 runtest.c | 2 +
18 runxmlconf.c | 1 +
William A. Kennington IIIac69b482021-06-02 12:28:27 -070019 testapi.c | 122 ++++++++++++++++++++++++++-------------
20 testchar.c | 156 +++++++++++++++++++++++++++++++++++---------------
Brad Bishopc342db32019-05-15 21:57:59 -040021 testdict.c | 1 +
22 testlimits.c | 1 +
23 testrecurse.c | 2 +
24 9 files changed, 210 insertions(+), 85 deletions(-)
25
26diff --git a/Makefile.am b/Makefile.am
William A. Kennington IIIac69b482021-06-02 12:28:27 -070027index 05d1671f..ae622745 100644
Brad Bishopc342db32019-05-15 21:57:59 -040028--- a/Makefile.am
29+++ b/Makefile.am
William A. Kennington IIIac69b482021-06-02 12:28:27 -070030@@ -198,6 +198,15 @@ runxmlconf_LDADD= $(LDADDS)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031 #testOOM_DEPENDENCIES = $(DEPS)
32 #testOOM_LDADD= $(LDADDS)
33
34+install-ptest:
35+ @(if [ -d .libs ] ; then cd .libs; fi; \
Brad Bishop316dfdd2018-06-25 12:45:53 -040036+ install $(check_PROGRAMS) $(DESTDIR))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037+ cp -r $(srcdir)/test $(DESTDIR)
38+ cp -r $(srcdir)/result $(DESTDIR)
39+ cp -r $(srcdir)/python $(DESTDIR)
40+ cp Makefile $(DESTDIR)
41+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
42+
Brad Bishop316dfdd2018-06-25 12:45:53 -040043 runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
44 testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050045 [ -d test ] || $(LN_S) $(srcdir)/test .
Brad Bishopc342db32019-05-15 21:57:59 -040046diff --git a/runsuite.c b/runsuite.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070047index d24b5ec3..f7ff2521 100644
Brad Bishopc342db32019-05-15 21:57:59 -040048--- a/runsuite.c
49+++ b/runsuite.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070050@@ -1147,6 +1147,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051
52 if (logfile != NULL)
53 fclose(logfile);
54+ printf("%s: runsuite\n\n", (ret == 0) ? "PASS" : "FAIL");
55 return(ret);
56 }
57 #else /* !SCHEMAS */
Brad Bishopc342db32019-05-15 21:57:59 -040058diff --git a/runtest.c b/runtest.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070059index ffa98d04..470f95cb 100644
Brad Bishopc342db32019-05-15 21:57:59 -040060--- a/runtest.c
61+++ b/runtest.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070062@@ -4508,6 +4508,7 @@ launchTests(testDescPtr tst) {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080063 xmlCharEncCloseFunc(ebcdicHandler);
Brad Bishopc342db32019-05-15 21:57:59 -040064 xmlCharEncCloseFunc(eucJpHandler);
65
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066+ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
67 return(err);
68 }
69
William A. Kennington IIIac69b482021-06-02 12:28:27 -070070@@ -4588,6 +4589,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071 xmlCleanupParser();
72 xmlMemoryDump();
73
74+ printf("%s: runtest\n\n", (ret == 0) ? "PASS" : "FAIL");
75 return(ret);
76 }
77
Brad Bishopc342db32019-05-15 21:57:59 -040078diff --git a/runxmlconf.c b/runxmlconf.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070079index 70f61017..e882b3a1 100644
Brad Bishopc342db32019-05-15 21:57:59 -040080--- a/runxmlconf.c
81+++ b/runxmlconf.c
82@@ -595,6 +595,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050083
84 if (logfile != NULL)
85 fclose(logfile);
86+ printf("%s: runxmlconf\n", (ret == 0) ? "PASS" : "FAIL");
87 return(ret);
88 }
89
Brad Bishopc342db32019-05-15 21:57:59 -040090diff --git a/testapi.c b/testapi.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070091index ff8b470d..52b51d78 100644
Brad Bishopc342db32019-05-15 21:57:59 -040092--- a/testapi.c
93+++ b/testapi.c
94@@ -1246,49 +1246,91 @@ static int
Patrick Williamsc124f4f2015-09-15 14:41:29 -050095 testlibxml2(void)
96 {
97 int test_ret = 0;
Brad Bishopc342db32019-05-15 21:57:59 -040098-
Patrick Williamsc124f4f2015-09-15 14:41:29 -050099- test_ret += test_HTMLparser();
100- test_ret += test_HTMLtree();
101- test_ret += test_SAX2();
102- test_ret += test_c14n();
103- test_ret += test_catalog();
104- test_ret += test_chvalid();
105- test_ret += test_debugXML();
106- test_ret += test_dict();
107- test_ret += test_encoding();
108- test_ret += test_entities();
109- test_ret += test_hash();
110- test_ret += test_list();
111- test_ret += test_nanoftp();
112- test_ret += test_nanohttp();
113- test_ret += test_parser();
114- test_ret += test_parserInternals();
115- test_ret += test_pattern();
116- test_ret += test_relaxng();
117- test_ret += test_schemasInternals();
118- test_ret += test_schematron();
119- test_ret += test_tree();
120- test_ret += test_uri();
121- test_ret += test_valid();
122- test_ret += test_xinclude();
123- test_ret += test_xmlIO();
124- test_ret += test_xmlautomata();
125- test_ret += test_xmlerror();
126- test_ret += test_xmlmodule();
127- test_ret += test_xmlreader();
128- test_ret += test_xmlregexp();
129- test_ret += test_xmlsave();
130- test_ret += test_xmlschemas();
131- test_ret += test_xmlschemastypes();
132- test_ret += test_xmlstring();
133- test_ret += test_xmlunicode();
134- test_ret += test_xmlwriter();
135- test_ret += test_xpath();
136- test_ret += test_xpathInternals();
137- test_ret += test_xpointer();
Brad Bishopc342db32019-05-15 21:57:59 -0400138+ int ret = 0;
139+
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500140+ test_ret += (ret = test_HTMLparser());
141+ printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL");
142+ test_ret += (ret = test_HTMLtree());
143+ printf("%s: HTMLtree\n", (ret == 0) ? "PASS" : "FAIL");
144+ test_ret += (ret = test_SAX2());
145+ printf("%s: SAX2\n", (ret == 0) ? "PASS" : "FAIL");
146+ test_ret += (ret = test_c14n());
147+ printf("%s: c14n\n", (ret == 0) ? "PASS" : "FAIL");
148+ test_ret += (ret = test_catalog());
149+ printf("%s: catalog\n", (ret == 0) ? "PASS" : "FAIL");
150+ test_ret += (ret = test_chvalid());
151+ printf("%s: chvalid\n", (ret == 0) ? "PASS" : "FAIL");
152+ test_ret += (ret = test_debugXML());
153+ printf("%s: debugXML\n", (ret == 0) ? "PASS" : "FAIL");
154+ test_ret += (ret = test_dict());
155+ printf("%s: dict\n", (ret == 0) ? "PASS" : "FAIL");
156+ test_ret += (ret = test_encoding());
157+ printf("%s: encoding\n", (ret == 0) ? "PASS" : "FAIL");
158+ test_ret += (ret = test_entities());
159+ printf("%s: entities\n", (ret == 0) ? "PASS" : "FAIL");
160+ test_ret += (ret = test_hash());
161+ printf("%s: hash\n", (ret == 0) ? "PASS" : "FAIL");
162+ test_ret += (ret = test_list());
163+ printf("%s: list\n", (ret == 0) ? "PASS" : "FAIL");
164+ test_ret += (ret = test_nanoftp());
165+ printf("%s: nanoftp\n", (ret == 0) ? "PASS" : "FAIL");
166+ test_ret += (ret = test_nanohttp());
167+ printf("%s: nanohttp\n", (ret == 0) ? "PASS" : "FAIL");
168+ test_ret += (ret = test_parser());
169+ printf("%s: parser\n", (ret == 0) ? "PASS" : "FAIL");
170+ test_ret += (ret = test_parserInternals());
171+ printf("%s: parserInternals\n", (ret == 0) ? "PASS" : "FAIL");
172+ test_ret += (ret = test_pattern());
173+ printf("%s: pattern\n", (ret == 0) ? "PASS" : "FAIL");
174+ test_ret += (ret = test_relaxng());
175+ printf("%s: relaxng\n", (ret == 0) ? "PASS" : "FAIL");
176+ test_ret += (ret = test_schemasInternals());
177+ printf("%s: schemasInternals\n", (ret == 0) ? "PASS" : "FAIL");
178+ test_ret += (ret = test_schematron());
179+ printf("%s: schematron\n", (ret == 0) ? "PASS" : "FAIL");
180+ test_ret += (ret = test_tree());
181+ printf("%s: tree\n", (ret == 0) ? "PASS" : "FAIL");
182+ test_ret += (ret = test_uri());
183+ printf("%s: uri\n", (ret == 0) ? "PASS" : "FAIL");
184+ test_ret += (ret = test_valid());
185+ printf("%s: valid\n", (ret == 0) ? "PASS" : "FAIL");
186+ test_ret += (ret = test_xinclude());
187+ printf("%s: xinclude\n", (ret == 0) ? "PASS" : "FAIL");
188+ test_ret += (ret = test_xmlIO());
189+ printf("%s: xmlIO\n", (ret == 0) ? "PASS" : "FAIL");
190+ test_ret += (ret = test_xmlautomata());
191+ printf("%s: xmlautomata\n", (ret == 0) ? "PASS" : "FAIL");
192+ test_ret += (ret = test_xmlerror());
193+ printf("%s: xmlerror\n", (ret == 0) ? "PASS" : "FAIL");
194+ test_ret += (ret = test_xmlmodule());
195+ printf("%s: xmlmodule\n", (ret == 0) ? "PASS" : "FAIL");
196+ test_ret += (ret = test_xmlreader());
197+ printf("%s: xmlreader\n", (ret == 0) ? "PASS" : "FAIL");
198+ test_ret += (ret = test_xmlregexp());
199+ printf("%s: xmlregexp\n", (ret == 0) ? "PASS" : "FAIL");
200+ test_ret += (ret = test_xmlsave());
201+ printf("%s: xmlsave\n", (ret == 0) ? "PASS" : "FAIL");
202+ test_ret += (ret = test_xmlschemas());
203+ printf("%s: xmlschemas\n", (ret == 0) ? "PASS" : "FAIL");
204+ test_ret += (ret = test_xmlschemastypes());
205+ printf("%s: xmlschemastypes\n", (ret == 0) ? "PASS" : "FAIL");
206+ test_ret += (ret = test_xmlstring());
207+ printf("%s: xmlstring\n", (ret == 0) ? "PASS" : "FAIL");
208+ test_ret += (ret = test_xmlunicode());
209+ printf("%s: xmlunicode\n", (ret == 0) ? "PASS" : "FAIL");
210+ test_ret += (ret = test_xmlwriter());
211+ printf("%s: xmlwriter\n", (ret == 0) ? "PASS" : "FAIL");
212+ test_ret += (ret = test_xpath());
213+ printf("%s: xpath\n", (ret == 0) ? "PASS" : "FAIL");
214+ test_ret += (ret = test_xpathInternals());
215+ printf("%s: xpathInternals\n", (ret == 0) ? "PASS" : "FAIL");
216+ test_ret += (ret = test_xpointer());
217+ printf("%s: xpointer\n", (ret == 0) ? "PASS" : "FAIL");
218
219 printf("Total: %d functions, %d tests, %d errors\n",
220 function_tests, call_tests, test_ret);
221+
222+ printf("%s: testapi\n\n", (test_ret == 0) ? "PASS" : "FAIL");
223 return(test_ret);
224 }
225
Brad Bishopc342db32019-05-15 21:57:59 -0400226diff --git a/testchar.c b/testchar.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700227index 6866a175..7bce0132 100644
Brad Bishopc342db32019-05-15 21:57:59 -0400228--- a/testchar.c
229+++ b/testchar.c
230@@ -23,7 +23,7 @@ static void errorHandler(void *unused, xmlErrorPtr err) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500231 char document1[100] = "<doc>XXXX</doc>";
232 char document2[100] = "<doc foo='XXXX'/>";
233
234-static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
235+static int testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
236 int len, char *data, int forbid1, int forbid2) {
237 int i;
238 xmlDocPtr res;
Brad Bishopc342db32019-05-15 21:57:59 -0400239@@ -37,33 +37,41 @@ static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500240 res = xmlReadMemory(document, len, "test", NULL, 0);
241
242 if ((i == forbid1) || (i == forbid2)) {
243- if ((lastError == 0) || (res != NULL))
244+ if ((lastError == 0) || (res != NULL)) {
245 fprintf(stderr,
246 "Failed to detect invalid char for Byte 0x%02X: %c\n",
247 i, i);
248+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800249+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500250 }
251
252 else if ((i == '<') || (i == '&')) {
253- if ((lastError == 0) || (res != NULL))
254+ if ((lastError == 0) || (res != NULL)) {
255 fprintf(stderr,
256 "Failed to detect illegal char %c for Byte 0x%02X\n", i, i);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800257+ return(1);
258+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500259 }
260 else if (((i < 0x20) || (i >= 0x80)) &&
261 (i != 0x9) && (i != 0xA) && (i != 0xD)) {
262- if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL))
263+ if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) {
264 fprintf(stderr,
265 "Failed to detect invalid char for Byte 0x%02X\n", i);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800266+ return(1);
267+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500268 }
269 else if (res == NULL) {
270 fprintf(stderr,
271 "Failed to parse valid char for Byte 0x%02X : %c\n", i, i);
272+ return(1);
273 }
274 if (res != NULL)
275 xmlFreeDoc(res);
276 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800277+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500278 }
279
280-static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
281+static int testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
282 int len, char *data) {
283 int i, j;
284 xmlDocPtr res;
Brad Bishopc342db32019-05-15 21:57:59 -0400285@@ -80,10 +88,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500286
287 /* if first bit of first char is set, then second bit must too */
288 if ((i & 0x80) && ((i & 0x40) == 0)) {
289- if ((lastError == 0) || (res != NULL))
290+ if ((lastError == 0) || (res != NULL)) {
291 fprintf(stderr,
292 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
293 i, j);
294+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800295+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500296 }
297
298 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400299@@ -91,10 +101,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500300 * bits must be 10
301 */
302 else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
303- if ((lastError == 0) || (res != NULL))
304+ if ((lastError == 0) || (res != NULL)) {
305 fprintf(stderr,
306 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
307 i, j);
308+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800309+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500310 }
311
312 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400313@@ -102,10 +114,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500314 * than 0x80, i.e. one of bits 5 to 1 of i must be set
315 */
316 else if ((i & 0x80) && ((i & 0x1E) == 0)) {
317- if ((lastError == 0) || (res != NULL))
318+ if ((lastError == 0) || (res != NULL)) {
319 fprintf(stderr,
320 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
321 i, j);
322+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800323+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500324 }
325
326 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400327@@ -113,10 +127,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500328 * at least 3 bytes, but we give only 2 !
329 */
330 else if ((i & 0xE0) == 0xE0) {
331- if ((lastError == 0) || (res != NULL))
332+ if ((lastError == 0) || (res != NULL)) {
333 fprintf(stderr,
334 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
335 i, j);
336+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800337+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500338 }
339
340 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400341@@ -125,11 +141,13 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500342 else if ((lastError != 0) || (res == NULL)) {
343 fprintf(stderr,
344 "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800345+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500346 }
347 if (res != NULL)
348 xmlFreeDoc(res);
349 }
350 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800351+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500352 }
353
354 /**
Brad Bishopc342db32019-05-15 21:57:59 -0400355@@ -141,9 +159,10 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500356 * CDATA in text or in attribute values.
357 */
358
359-static void testDocumentRanges(void) {
360+static int testDocumentRanges(void) {
361 xmlParserCtxtPtr ctxt;
362 char *data;
363+ int test_ret = 0;
364
365 /*
366 * Set up a parsing context using the first document as
Brad Bishopc342db32019-05-15 21:57:59 -0400367@@ -152,7 +171,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500368 ctxt = xmlNewParserCtxt();
369 if (ctxt == NULL) {
370 fprintf(stderr, "Failed to allocate parser context\n");
371- return;
372+ return(1);
373 }
374
375 printf("testing 1 byte char in document: 1");
Brad Bishopc342db32019-05-15 21:57:59 -0400376@@ -163,7 +182,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500377 data[2] = ' ';
378 data[3] = ' ';
379 /* test 1 byte injection at beginning of area */
380- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
381+ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
382 data, -1, -1);
383 printf(" 2");
384 fflush(stdout);
Brad Bishopc342db32019-05-15 21:57:59 -0400385@@ -172,7 +191,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500386 data[2] = ' ';
387 data[3] = ' ';
388 /* test 1 byte injection at end of area */
389- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
390+ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
391 data + 3, -1, -1);
392
393 printf(" 3");
Brad Bishopc342db32019-05-15 21:57:59 -0400394@@ -183,7 +202,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500395 data[2] = ' ';
396 data[3] = ' ';
397 /* test 1 byte injection at beginning of area */
398- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
399+ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
400 data, '\'', -1);
401 printf(" 4");
402 fflush(stdout);
Brad Bishopc342db32019-05-15 21:57:59 -0400403@@ -192,7 +211,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500404 data[2] = ' ';
405 data[3] = ' ';
406 /* test 1 byte injection at end of area */
407- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
408+ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
409 data + 3, '\'', -1);
410 printf(" done\n");
411
Brad Bishopc342db32019-05-15 21:57:59 -0400412@@ -204,7 +223,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500413 data[2] = ' ';
414 data[3] = ' ';
415 /* test 2 byte injection at beginning of area */
416- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
417+ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
418 data);
419 printf(" 2");
420 fflush(stdout);
Brad Bishopc342db32019-05-15 21:57:59 -0400421@@ -213,7 +232,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500422 data[2] = ' ';
423 data[3] = ' ';
424 /* test 2 byte injection at end of area */
425- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
426+ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
427 data + 2);
428
429 printf(" 3");
Brad Bishopc342db32019-05-15 21:57:59 -0400430@@ -224,7 +243,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500431 data[2] = ' ';
432 data[3] = ' ';
433 /* test 2 byte injection at beginning of area */
434- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
435+ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
436 data);
437 printf(" 4");
438 fflush(stdout);
Brad Bishopc342db32019-05-15 21:57:59 -0400439@@ -233,14 +252,15 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500440 data[2] = ' ';
441 data[3] = ' ';
442 /* test 2 byte injection at end of area */
443- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
444+ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
445 data + 2);
446 printf(" done\n");
447
448 xmlFreeParserCtxt(ctxt);
449+ return(test_ret);
450 }
451
452-static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
453+static int testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
454 int i = 0;
455 int len, c;
456
Brad Bishopc342db32019-05-15 21:57:59 -0400457@@ -255,19 +275,25 @@ static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500458 c = xmlCurrentChar(ctxt, &len);
459 if ((i == 0) || (i >= 0x80)) {
460 /* we must see an error there */
461- if (lastError != XML_ERR_INVALID_CHAR)
462+ if (lastError != XML_ERR_INVALID_CHAR) {
463 fprintf(stderr,
464 "Failed to detect invalid char for Byte 0x%02X\n", i);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800465+ return(1);
466+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500467 } else if (i == 0xD) {
468- if ((c != 0xA) || (len != 1))
469+ if ((c != 0xA) || (len != 1)) {
470 fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i);
471+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800472+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500473 } else if ((c != i) || (len != 1)) {
474 fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800475+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500476 }
477 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800478+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500479 }
480
481-static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
482+static int testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
483 int i, j;
484 int len, c;
485
Brad Bishopc342db32019-05-15 21:57:59 -0400486@@ -284,10 +310,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500487
488 /* if first bit of first char is set, then second bit must too */
489 if ((i & 0x80) && ((i & 0x40) == 0)) {
490- if (lastError != XML_ERR_INVALID_CHAR)
491+ if (lastError != XML_ERR_INVALID_CHAR) {
492 fprintf(stderr,
493 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
494 i, j);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800495+ return(1);
496+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500497 }
498
499 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400500@@ -295,10 +323,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500501 * bits must be 10
502 */
503 else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
504- if (lastError != XML_ERR_INVALID_CHAR)
505+ if (lastError != XML_ERR_INVALID_CHAR) {
506 fprintf(stderr,
507 "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
508 i, j, c);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800509+ return(1);
510+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500511 }
512
513 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400514@@ -306,10 +336,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500515 * than 0x80, i.e. one of bits 5 to 1 of i must be set
516 */
517 else if ((i & 0x80) && ((i & 0x1E) == 0)) {
518- if (lastError != XML_ERR_INVALID_CHAR)
519+ if (lastError != XML_ERR_INVALID_CHAR) {
520 fprintf(stderr,
521 "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
522 i, j, c);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800523+ return(1);
524+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500525 }
526
527 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400528@@ -317,10 +349,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500529 * at least 3 bytes, but we give only 2 !
530 */
531 else if ((i & 0xE0) == 0xE0) {
532- if (lastError != XML_ERR_INVALID_CHAR)
533+ if (lastError != XML_ERR_INVALID_CHAR) {
534 fprintf(stderr,
535 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
536 i, j);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800537+ return(1);
538+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500539 }
540
541 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400542@@ -329,6 +363,7 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500543 else if ((lastError != 0) || (len != 2)) {
544 fprintf(stderr,
545 "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j);
546+ return(1);
547 }
548
549 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400550@@ -338,12 +373,14 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500551 fprintf(stderr,
552 "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n",
553 i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c);
554+ return(1);
555 }
556 }
557 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800558+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500559 }
560
561-static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
562+static int testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
563 int i, j, k, K;
564 int len, c;
565 unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
Brad Bishopc342db32019-05-15 21:57:59 -0400566@@ -368,20 +405,24 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500567 * at least 4 bytes, but we give only 3 !
568 */
569 if ((i & 0xF0) == 0xF0) {
570- if (lastError != XML_ERR_INVALID_CHAR)
571+ if (lastError != XML_ERR_INVALID_CHAR) {
572 fprintf(stderr,
573 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
574 i, j, K, data[3]);
575+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800576+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500577 }
578
579 /*
580 * The second and the third bytes must start with 10
581 */
582 else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) {
583- if (lastError != XML_ERR_INVALID_CHAR)
584+ if (lastError != XML_ERR_INVALID_CHAR) {
585 fprintf(stderr,
586 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
587 i, j, K);
588+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800589+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500590 }
591
592 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400593@@ -390,10 +431,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500594 * the 6th byte of data[1] must be set
595 */
596 else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) {
597- if (lastError != XML_ERR_INVALID_CHAR)
598+ if (lastError != XML_ERR_INVALID_CHAR) {
599 fprintf(stderr,
600 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
601 i, j, K);
602+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800603+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500604 }
605
606 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400607@@ -401,10 +444,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500608 */
609 else if (((value > 0xD7FF) && (value <0xE000)) ||
610 ((value > 0xFFFD) && (value <0x10000))) {
611- if (lastError != XML_ERR_INVALID_CHAR)
612+ if (lastError != XML_ERR_INVALID_CHAR) {
613 fprintf(stderr,
614 "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n",
615 value, i, j, K);
616+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800617+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500618 }
619
620 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400621@@ -414,6 +459,7 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500622 fprintf(stderr,
623 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
624 i, j, K);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800625+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500626 }
627
628 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400629@@ -423,13 +469,15 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500630 fprintf(stderr,
631 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
632 i, j, data[2], value, c);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800633+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500634 }
635 }
636 }
637 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800638+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500639 }
640
641-static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
642+static int testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
643 int i, j, k, K, l, L;
644 int len, c;
645 unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
Brad Bishopc342db32019-05-15 21:57:59 -0400646@@ -458,10 +506,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500647 * at least 5 bytes, but we give only 4 !
648 */
649 if ((i & 0xF8) == 0xF8) {
650- if (lastError != XML_ERR_INVALID_CHAR)
651+ if (lastError != XML_ERR_INVALID_CHAR) {
652 fprintf(stderr,
653 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
654 i, j, K, data[3]);
655+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800656+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500657 }
658
659 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400660@@ -469,10 +519,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500661 */
662 else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) ||
663 ((L & 0xC0) != 0x80)) {
664- if (lastError != XML_ERR_INVALID_CHAR)
665+ if (lastError != XML_ERR_INVALID_CHAR) {
666 fprintf(stderr,
667 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
668 i, j, K, L);
669+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800670+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500671 }
672
673 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400674@@ -481,10 +533,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500675 * the 6 or 5th byte of j must be set
676 */
677 else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) {
678- if (lastError != XML_ERR_INVALID_CHAR)
679+ if (lastError != XML_ERR_INVALID_CHAR) {
680 fprintf(stderr,
681 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
682 i, j, K, L);
683+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800684+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500685 }
686
687 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400688@@ -493,10 +547,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500689 else if (((value > 0xD7FF) && (value <0xE000)) ||
690 ((value > 0xFFFD) && (value <0x10000)) ||
691 (value > 0x10FFFF)) {
692- if (lastError != XML_ERR_INVALID_CHAR)
693+ if (lastError != XML_ERR_INVALID_CHAR) {
694 fprintf(stderr,
695 "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
696 value, i, j, K, L);
697+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800698+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500699 }
700
701 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400702@@ -506,6 +562,7 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500703 fprintf(stderr,
704 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
705 i, j, K);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800706+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500707 }
708
709 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400710@@ -515,11 +572,13 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500711 fprintf(stderr,
712 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
713 i, j, data[2], value, c);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800714+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500715 }
716 }
717 }
718 }
719 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800720+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500721 }
722
723 /**
Brad Bishopc342db32019-05-15 21:57:59 -0400724@@ -530,11 +589,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500725 * cover the full range of UTF-8 chars accepted by XML-1.0
726 */
727
728-static void testCharRanges(void) {
729+static int testCharRanges(void) {
730 char data[5];
731 xmlParserCtxtPtr ctxt;
732 xmlParserInputBufferPtr buf;
733 xmlParserInputPtr input;
734+ int test_ret = 0;
735
736 memset(data, 0, 5);
737
Brad Bishopc342db32019-05-15 21:57:59 -0400738@@ -545,17 +605,19 @@ static void testCharRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500739 ctxt = xmlNewParserCtxt();
740 if (ctxt == NULL) {
741 fprintf(stderr, "Failed to allocate parser context\n");
742- return;
743+ return(1);
744 }
745 buf = xmlParserInputBufferCreateStatic(data, sizeof(data),
746 XML_CHAR_ENCODING_NONE);
747 if (buf == NULL) {
748 fprintf(stderr, "Failed to allocate input buffer\n");
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800749+ test_ret = 1;
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500750 goto error;
751 }
752 input = xmlNewInputStream(ctxt);
753 if (input == NULL) {
754 xmlFreeParserInputBuffer(buf);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800755+ test_ret = 1;
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500756 goto error;
757 }
758 input->filename = NULL;
Brad Bishopc342db32019-05-15 21:57:59 -0400759@@ -567,25 +629,28 @@ static void testCharRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500760
761 printf("testing char range: 1");
762 fflush(stdout);
763- testCharRangeByte1(ctxt, data);
764+ test_ret += testCharRangeByte1(ctxt, data);
765 printf(" 2");
766 fflush(stdout);
767- testCharRangeByte2(ctxt, data);
768+ test_ret += testCharRangeByte2(ctxt, data);
769 printf(" 3");
770 fflush(stdout);
771- testCharRangeByte3(ctxt, data);
772+ test_ret += testCharRangeByte3(ctxt, data);
773 printf(" 4");
774 fflush(stdout);
775- testCharRangeByte4(ctxt, data);
776+ test_ret += testCharRangeByte4(ctxt, data);
777 printf(" done\n");
778 fflush(stdout);
779
780 error:
781 xmlFreeParserCtxt(ctxt);
782+ return(test_ret);
783 }
784
785 int main(void) {
786
787+ int ret = 0;
788+
789 /*
790 * this initialize the library and check potential ABI mismatches
791 * between the version it was compiled for and the actual shared
Brad Bishopc342db32019-05-15 21:57:59 -0400792@@ -602,8 +667,9 @@ int main(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500793 /*
794 * Run the tests
795 */
796- testCharRanges();
797- testDocumentRanges();
798+ ret += testCharRanges();
799+ ret += testDocumentRanges();
800+ printf("%s: testchar\n\n", (ret == 0) ? "PASS" : "FAIL");
801
802 /*
803 * Cleanup function for the XML library.
Brad Bishopc342db32019-05-15 21:57:59 -0400804diff --git a/testdict.c b/testdict.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700805index 40bebd05..114b9347 100644
Brad Bishopc342db32019-05-15 21:57:59 -0400806--- a/testdict.c
807+++ b/testdict.c
808@@ -440,5 +440,6 @@ int main(void)
809 clean_strings();
810 xmlCleanupParser();
811 xmlMemoryDump();
812+ printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL");
813 return(ret);
814 }
815diff --git a/testlimits.c b/testlimits.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700816index 059116a6..f0bee68d 100644
Brad Bishopc342db32019-05-15 21:57:59 -0400817--- a/testlimits.c
818+++ b/testlimits.c
819@@ -1634,5 +1634,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500820 xmlCleanupParser();
821 xmlMemoryDump();
822
823+ printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL");
824 return(ret);
825 }
Brad Bishopc342db32019-05-15 21:57:59 -0400826diff --git a/testrecurse.c b/testrecurse.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700827index 0cbe25a6..3ecadb40 100644
Brad Bishopc342db32019-05-15 21:57:59 -0400828--- a/testrecurse.c
829+++ b/testrecurse.c
830@@ -892,6 +892,7 @@ launchTests(testDescPtr tst) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500831 err++;
832 }
833 }
834+ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
835 return(err);
836 }
837
Brad Bishopc342db32019-05-15 21:57:59 -0400838@@ -961,5 +962,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500839 xmlCleanupParser();
840 xmlMemoryDump();
841
842+ printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL");
843 return(ret);
844 }
Brad Bishopc342db32019-05-15 21:57:59 -0400845--
William A. Kennington IIIac69b482021-06-02 12:28:27 -07008462.25.1
Brad Bishopc342db32019-05-15 21:57:59 -0400847