blob: 42bb22cfd48c843d4956153e32f76ff0de4804d6 [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
Patrick Williams03907ee2022-05-01 06:28:52 -05008The patch needs a rework according to comments in the merge request.
9
Patrick Williamsc124f4f2015-09-15 14:41:29 -050010Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
Brad Bishop316dfdd2018-06-25 12:45:53 -040011Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Patrick Williams03907ee2022-05-01 06:28:52 -050012Upstream-Status: Inappropriate [https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/137]
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013
Brad Bishopc342db32019-05-15 21:57:59 -040014Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
William A. Kennington IIIac69b482021-06-02 12:28:27 -070015Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com>
Brad Bishopc342db32019-05-15 21:57:59 -040016---
William A. Kennington IIIac69b482021-06-02 12:28:27 -070017 Makefile.am | 9 +++
Brad Bishopc342db32019-05-15 21:57:59 -040018 runsuite.c | 1 +
19 runtest.c | 2 +
20 runxmlconf.c | 1 +
William A. Kennington IIIac69b482021-06-02 12:28:27 -070021 testapi.c | 122 ++++++++++++++++++++++++++-------------
22 testchar.c | 156 +++++++++++++++++++++++++++++++++++---------------
Brad Bishopc342db32019-05-15 21:57:59 -040023 testdict.c | 1 +
24 testlimits.c | 1 +
25 testrecurse.c | 2 +
26 9 files changed, 210 insertions(+), 85 deletions(-)
27
28diff --git a/Makefile.am b/Makefile.am
William A. Kennington IIIac69b482021-06-02 12:28:27 -070029index 05d1671f..ae622745 100644
Brad Bishopc342db32019-05-15 21:57:59 -040030--- a/Makefile.am
31+++ b/Makefile.am
William A. Kennington IIIac69b482021-06-02 12:28:27 -070032@@ -198,6 +198,15 @@ runxmlconf_LDADD= $(LDADDS)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033 #testOOM_DEPENDENCIES = $(DEPS)
34 #testOOM_LDADD= $(LDADDS)
35
36+install-ptest:
37+ @(if [ -d .libs ] ; then cd .libs; fi; \
Brad Bishop316dfdd2018-06-25 12:45:53 -040038+ install $(check_PROGRAMS) $(DESTDIR))
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039+ cp -r $(srcdir)/test $(DESTDIR)
40+ cp -r $(srcdir)/result $(DESTDIR)
41+ cp -r $(srcdir)/python $(DESTDIR)
42+ cp Makefile $(DESTDIR)
43+ sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
44+
Brad Bishop316dfdd2018-06-25 12:45:53 -040045 runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
46 testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050047 [ -d test ] || $(LN_S) $(srcdir)/test .
Brad Bishopc342db32019-05-15 21:57:59 -040048diff --git a/runsuite.c b/runsuite.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070049index d24b5ec3..f7ff2521 100644
Brad Bishopc342db32019-05-15 21:57:59 -040050--- a/runsuite.c
51+++ b/runsuite.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070052@@ -1147,6 +1147,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053
54 if (logfile != NULL)
55 fclose(logfile);
56+ printf("%s: runsuite\n\n", (ret == 0) ? "PASS" : "FAIL");
57 return(ret);
58 }
59 #else /* !SCHEMAS */
Brad Bishopc342db32019-05-15 21:57:59 -040060diff --git a/runtest.c b/runtest.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070061index ffa98d04..470f95cb 100644
Brad Bishopc342db32019-05-15 21:57:59 -040062--- a/runtest.c
63+++ b/runtest.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070064@@ -4508,6 +4508,7 @@ launchTests(testDescPtr tst) {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080065 xmlCharEncCloseFunc(ebcdicHandler);
Brad Bishopc342db32019-05-15 21:57:59 -040066 xmlCharEncCloseFunc(eucJpHandler);
67
Patrick Williamsc124f4f2015-09-15 14:41:29 -050068+ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
69 return(err);
70 }
71
William A. Kennington IIIac69b482021-06-02 12:28:27 -070072@@ -4588,6 +4589,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050073 xmlCleanupParser();
74 xmlMemoryDump();
75
76+ printf("%s: runtest\n\n", (ret == 0) ? "PASS" : "FAIL");
77 return(ret);
78 }
79
Brad Bishopc342db32019-05-15 21:57:59 -040080diff --git a/runxmlconf.c b/runxmlconf.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070081index 70f61017..e882b3a1 100644
Brad Bishopc342db32019-05-15 21:57:59 -040082--- a/runxmlconf.c
83+++ b/runxmlconf.c
84@@ -595,6 +595,7 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050085
86 if (logfile != NULL)
87 fclose(logfile);
88+ printf("%s: runxmlconf\n", (ret == 0) ? "PASS" : "FAIL");
89 return(ret);
90 }
91
Brad Bishopc342db32019-05-15 21:57:59 -040092diff --git a/testapi.c b/testapi.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -070093index ff8b470d..52b51d78 100644
Brad Bishopc342db32019-05-15 21:57:59 -040094--- a/testapi.c
95+++ b/testapi.c
96@@ -1246,49 +1246,91 @@ static int
Patrick Williamsc124f4f2015-09-15 14:41:29 -050097 testlibxml2(void)
98 {
99 int test_ret = 0;
Brad Bishopc342db32019-05-15 21:57:59 -0400100-
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500101- test_ret += test_HTMLparser();
102- test_ret += test_HTMLtree();
103- test_ret += test_SAX2();
104- test_ret += test_c14n();
105- test_ret += test_catalog();
106- test_ret += test_chvalid();
107- test_ret += test_debugXML();
108- test_ret += test_dict();
109- test_ret += test_encoding();
110- test_ret += test_entities();
111- test_ret += test_hash();
112- test_ret += test_list();
113- test_ret += test_nanoftp();
114- test_ret += test_nanohttp();
115- test_ret += test_parser();
116- test_ret += test_parserInternals();
117- test_ret += test_pattern();
118- test_ret += test_relaxng();
119- test_ret += test_schemasInternals();
120- test_ret += test_schematron();
121- test_ret += test_tree();
122- test_ret += test_uri();
123- test_ret += test_valid();
124- test_ret += test_xinclude();
125- test_ret += test_xmlIO();
126- test_ret += test_xmlautomata();
127- test_ret += test_xmlerror();
128- test_ret += test_xmlmodule();
129- test_ret += test_xmlreader();
130- test_ret += test_xmlregexp();
131- test_ret += test_xmlsave();
132- test_ret += test_xmlschemas();
133- test_ret += test_xmlschemastypes();
134- test_ret += test_xmlstring();
135- test_ret += test_xmlunicode();
136- test_ret += test_xmlwriter();
137- test_ret += test_xpath();
138- test_ret += test_xpathInternals();
139- test_ret += test_xpointer();
Brad Bishopc342db32019-05-15 21:57:59 -0400140+ int ret = 0;
141+
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500142+ test_ret += (ret = test_HTMLparser());
143+ printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL");
144+ test_ret += (ret = test_HTMLtree());
145+ printf("%s: HTMLtree\n", (ret == 0) ? "PASS" : "FAIL");
146+ test_ret += (ret = test_SAX2());
147+ printf("%s: SAX2\n", (ret == 0) ? "PASS" : "FAIL");
148+ test_ret += (ret = test_c14n());
149+ printf("%s: c14n\n", (ret == 0) ? "PASS" : "FAIL");
150+ test_ret += (ret = test_catalog());
151+ printf("%s: catalog\n", (ret == 0) ? "PASS" : "FAIL");
152+ test_ret += (ret = test_chvalid());
153+ printf("%s: chvalid\n", (ret == 0) ? "PASS" : "FAIL");
154+ test_ret += (ret = test_debugXML());
155+ printf("%s: debugXML\n", (ret == 0) ? "PASS" : "FAIL");
156+ test_ret += (ret = test_dict());
157+ printf("%s: dict\n", (ret == 0) ? "PASS" : "FAIL");
158+ test_ret += (ret = test_encoding());
159+ printf("%s: encoding\n", (ret == 0) ? "PASS" : "FAIL");
160+ test_ret += (ret = test_entities());
161+ printf("%s: entities\n", (ret == 0) ? "PASS" : "FAIL");
162+ test_ret += (ret = test_hash());
163+ printf("%s: hash\n", (ret == 0) ? "PASS" : "FAIL");
164+ test_ret += (ret = test_list());
165+ printf("%s: list\n", (ret == 0) ? "PASS" : "FAIL");
166+ test_ret += (ret = test_nanoftp());
167+ printf("%s: nanoftp\n", (ret == 0) ? "PASS" : "FAIL");
168+ test_ret += (ret = test_nanohttp());
169+ printf("%s: nanohttp\n", (ret == 0) ? "PASS" : "FAIL");
170+ test_ret += (ret = test_parser());
171+ printf("%s: parser\n", (ret == 0) ? "PASS" : "FAIL");
172+ test_ret += (ret = test_parserInternals());
173+ printf("%s: parserInternals\n", (ret == 0) ? "PASS" : "FAIL");
174+ test_ret += (ret = test_pattern());
175+ printf("%s: pattern\n", (ret == 0) ? "PASS" : "FAIL");
176+ test_ret += (ret = test_relaxng());
177+ printf("%s: relaxng\n", (ret == 0) ? "PASS" : "FAIL");
178+ test_ret += (ret = test_schemasInternals());
179+ printf("%s: schemasInternals\n", (ret == 0) ? "PASS" : "FAIL");
180+ test_ret += (ret = test_schematron());
181+ printf("%s: schematron\n", (ret == 0) ? "PASS" : "FAIL");
182+ test_ret += (ret = test_tree());
183+ printf("%s: tree\n", (ret == 0) ? "PASS" : "FAIL");
184+ test_ret += (ret = test_uri());
185+ printf("%s: uri\n", (ret == 0) ? "PASS" : "FAIL");
186+ test_ret += (ret = test_valid());
187+ printf("%s: valid\n", (ret == 0) ? "PASS" : "FAIL");
188+ test_ret += (ret = test_xinclude());
189+ printf("%s: xinclude\n", (ret == 0) ? "PASS" : "FAIL");
190+ test_ret += (ret = test_xmlIO());
191+ printf("%s: xmlIO\n", (ret == 0) ? "PASS" : "FAIL");
192+ test_ret += (ret = test_xmlautomata());
193+ printf("%s: xmlautomata\n", (ret == 0) ? "PASS" : "FAIL");
194+ test_ret += (ret = test_xmlerror());
195+ printf("%s: xmlerror\n", (ret == 0) ? "PASS" : "FAIL");
196+ test_ret += (ret = test_xmlmodule());
197+ printf("%s: xmlmodule\n", (ret == 0) ? "PASS" : "FAIL");
198+ test_ret += (ret = test_xmlreader());
199+ printf("%s: xmlreader\n", (ret == 0) ? "PASS" : "FAIL");
200+ test_ret += (ret = test_xmlregexp());
201+ printf("%s: xmlregexp\n", (ret == 0) ? "PASS" : "FAIL");
202+ test_ret += (ret = test_xmlsave());
203+ printf("%s: xmlsave\n", (ret == 0) ? "PASS" : "FAIL");
204+ test_ret += (ret = test_xmlschemas());
205+ printf("%s: xmlschemas\n", (ret == 0) ? "PASS" : "FAIL");
206+ test_ret += (ret = test_xmlschemastypes());
207+ printf("%s: xmlschemastypes\n", (ret == 0) ? "PASS" : "FAIL");
208+ test_ret += (ret = test_xmlstring());
209+ printf("%s: xmlstring\n", (ret == 0) ? "PASS" : "FAIL");
210+ test_ret += (ret = test_xmlunicode());
211+ printf("%s: xmlunicode\n", (ret == 0) ? "PASS" : "FAIL");
212+ test_ret += (ret = test_xmlwriter());
213+ printf("%s: xmlwriter\n", (ret == 0) ? "PASS" : "FAIL");
214+ test_ret += (ret = test_xpath());
215+ printf("%s: xpath\n", (ret == 0) ? "PASS" : "FAIL");
216+ test_ret += (ret = test_xpathInternals());
217+ printf("%s: xpathInternals\n", (ret == 0) ? "PASS" : "FAIL");
218+ test_ret += (ret = test_xpointer());
219+ printf("%s: xpointer\n", (ret == 0) ? "PASS" : "FAIL");
220
221 printf("Total: %d functions, %d tests, %d errors\n",
222 function_tests, call_tests, test_ret);
223+
224+ printf("%s: testapi\n\n", (test_ret == 0) ? "PASS" : "FAIL");
225 return(test_ret);
226 }
227
Brad Bishopc342db32019-05-15 21:57:59 -0400228diff --git a/testchar.c b/testchar.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700229index 6866a175..7bce0132 100644
Brad Bishopc342db32019-05-15 21:57:59 -0400230--- a/testchar.c
231+++ b/testchar.c
232@@ -23,7 +23,7 @@ static void errorHandler(void *unused, xmlErrorPtr err) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500233 char document1[100] = "<doc>XXXX</doc>";
234 char document2[100] = "<doc foo='XXXX'/>";
235
236-static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
237+static int testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
238 int len, char *data, int forbid1, int forbid2) {
239 int i;
240 xmlDocPtr res;
Brad Bishopc342db32019-05-15 21:57:59 -0400241@@ -37,33 +37,41 @@ static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500242 res = xmlReadMemory(document, len, "test", NULL, 0);
243
244 if ((i == forbid1) || (i == forbid2)) {
245- if ((lastError == 0) || (res != NULL))
246+ if ((lastError == 0) || (res != NULL)) {
247 fprintf(stderr,
248 "Failed to detect invalid char for Byte 0x%02X: %c\n",
249 i, i);
250+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800251+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500252 }
253
254 else if ((i == '<') || (i == '&')) {
255- if ((lastError == 0) || (res != NULL))
256+ if ((lastError == 0) || (res != NULL)) {
257 fprintf(stderr,
258 "Failed to detect illegal char %c for Byte 0x%02X\n", i, i);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800259+ return(1);
260+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500261 }
262 else if (((i < 0x20) || (i >= 0x80)) &&
263 (i != 0x9) && (i != 0xA) && (i != 0xD)) {
264- if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL))
265+ if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) {
266 fprintf(stderr,
267 "Failed to detect invalid char for Byte 0x%02X\n", i);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800268+ return(1);
269+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500270 }
271 else if (res == NULL) {
272 fprintf(stderr,
273 "Failed to parse valid char for Byte 0x%02X : %c\n", i, i);
274+ return(1);
275 }
276 if (res != NULL)
277 xmlFreeDoc(res);
278 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800279+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500280 }
281
282-static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
283+static int testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
284 int len, char *data) {
285 int i, j;
286 xmlDocPtr res;
Brad Bishopc342db32019-05-15 21:57:59 -0400287@@ -80,10 +88,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500288
289 /* if first bit of first char is set, then second bit must too */
290 if ((i & 0x80) && ((i & 0x40) == 0)) {
291- if ((lastError == 0) || (res != NULL))
292+ if ((lastError == 0) || (res != NULL)) {
293 fprintf(stderr,
294 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
295 i, j);
296+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800297+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500298 }
299
300 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400301@@ -91,10 +101,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500302 * bits must be 10
303 */
304 else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
305- if ((lastError == 0) || (res != NULL))
306+ if ((lastError == 0) || (res != NULL)) {
307 fprintf(stderr,
308 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
309 i, j);
310+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800311+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500312 }
313
314 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400315@@ -102,10 +114,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500316 * than 0x80, i.e. one of bits 5 to 1 of i must be set
317 */
318 else if ((i & 0x80) && ((i & 0x1E) == 0)) {
319- if ((lastError == 0) || (res != NULL))
320+ if ((lastError == 0) || (res != NULL)) {
321 fprintf(stderr,
322 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
323 i, j);
324+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800325+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500326 }
327
328 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400329@@ -113,10 +127,12 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500330 * at least 3 bytes, but we give only 2 !
331 */
332 else if ((i & 0xE0) == 0xE0) {
333- if ((lastError == 0) || (res != NULL))
334+ if ((lastError == 0) || (res != NULL)) {
335 fprintf(stderr,
336 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
337 i, j);
338+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800339+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500340 }
341
342 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400343@@ -125,11 +141,13 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500344 else if ((lastError != 0) || (res == NULL)) {
345 fprintf(stderr,
346 "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800347+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500348 }
349 if (res != NULL)
350 xmlFreeDoc(res);
351 }
352 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800353+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500354 }
355
356 /**
Brad Bishopc342db32019-05-15 21:57:59 -0400357@@ -141,9 +159,10 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500358 * CDATA in text or in attribute values.
359 */
360
361-static void testDocumentRanges(void) {
362+static int testDocumentRanges(void) {
363 xmlParserCtxtPtr ctxt;
364 char *data;
365+ int test_ret = 0;
366
367 /*
368 * Set up a parsing context using the first document as
Brad Bishopc342db32019-05-15 21:57:59 -0400369@@ -152,7 +171,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500370 ctxt = xmlNewParserCtxt();
371 if (ctxt == NULL) {
372 fprintf(stderr, "Failed to allocate parser context\n");
373- return;
374+ return(1);
375 }
376
377 printf("testing 1 byte char in document: 1");
Brad Bishopc342db32019-05-15 21:57:59 -0400378@@ -163,7 +182,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500379 data[2] = ' ';
380 data[3] = ' ';
381 /* test 1 byte injection at beginning of area */
382- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
383+ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
384 data, -1, -1);
385 printf(" 2");
386 fflush(stdout);
Brad Bishopc342db32019-05-15 21:57:59 -0400387@@ -172,7 +191,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500388 data[2] = ' ';
389 data[3] = ' ';
390 /* test 1 byte injection at end of area */
391- testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
392+ test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
393 data + 3, -1, -1);
394
395 printf(" 3");
Brad Bishopc342db32019-05-15 21:57:59 -0400396@@ -183,7 +202,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500397 data[2] = ' ';
398 data[3] = ' ';
399 /* test 1 byte injection at beginning of area */
400- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
401+ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
402 data, '\'', -1);
403 printf(" 4");
404 fflush(stdout);
Brad Bishopc342db32019-05-15 21:57:59 -0400405@@ -192,7 +211,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500406 data[2] = ' ';
407 data[3] = ' ';
408 /* test 1 byte injection at end of area */
409- testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
410+ test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
411 data + 3, '\'', -1);
412 printf(" done\n");
413
Brad Bishopc342db32019-05-15 21:57:59 -0400414@@ -204,7 +223,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500415 data[2] = ' ';
416 data[3] = ' ';
417 /* test 2 byte injection at beginning of area */
418- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
419+ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
420 data);
421 printf(" 2");
422 fflush(stdout);
Brad Bishopc342db32019-05-15 21:57:59 -0400423@@ -213,7 +232,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500424 data[2] = ' ';
425 data[3] = ' ';
426 /* test 2 byte injection at end of area */
427- testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
428+ test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
429 data + 2);
430
431 printf(" 3");
Brad Bishopc342db32019-05-15 21:57:59 -0400432@@ -224,7 +243,7 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500433 data[2] = ' ';
434 data[3] = ' ';
435 /* test 2 byte injection at beginning of area */
436- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
437+ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
438 data);
439 printf(" 4");
440 fflush(stdout);
Brad Bishopc342db32019-05-15 21:57:59 -0400441@@ -233,14 +252,15 @@ static void testDocumentRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500442 data[2] = ' ';
443 data[3] = ' ';
444 /* test 2 byte injection at end of area */
445- testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
446+ test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
447 data + 2);
448 printf(" done\n");
449
450 xmlFreeParserCtxt(ctxt);
451+ return(test_ret);
452 }
453
454-static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
455+static int testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
456 int i = 0;
457 int len, c;
458
Brad Bishopc342db32019-05-15 21:57:59 -0400459@@ -255,19 +275,25 @@ static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500460 c = xmlCurrentChar(ctxt, &len);
461 if ((i == 0) || (i >= 0x80)) {
462 /* we must see an error there */
463- if (lastError != XML_ERR_INVALID_CHAR)
464+ if (lastError != XML_ERR_INVALID_CHAR) {
465 fprintf(stderr,
466 "Failed to detect invalid char for Byte 0x%02X\n", i);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800467+ return(1);
468+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500469 } else if (i == 0xD) {
470- if ((c != 0xA) || (len != 1))
471+ if ((c != 0xA) || (len != 1)) {
472 fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i);
473+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800474+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500475 } else if ((c != i) || (len != 1)) {
476 fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800477+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500478 }
479 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800480+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500481 }
482
483-static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
484+static int testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
485 int i, j;
486 int len, c;
487
Brad Bishopc342db32019-05-15 21:57:59 -0400488@@ -284,10 +310,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500489
490 /* if first bit of first char is set, then second bit must too */
491 if ((i & 0x80) && ((i & 0x40) == 0)) {
492- if (lastError != XML_ERR_INVALID_CHAR)
493+ if (lastError != XML_ERR_INVALID_CHAR) {
494 fprintf(stderr,
495 "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
496 i, j);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800497+ return(1);
498+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500499 }
500
501 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400502@@ -295,10 +323,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500503 * bits must be 10
504 */
505 else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
506- if (lastError != XML_ERR_INVALID_CHAR)
507+ if (lastError != XML_ERR_INVALID_CHAR) {
508 fprintf(stderr,
509 "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
510 i, j, c);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800511+ return(1);
512+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500513 }
514
515 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400516@@ -306,10 +336,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500517 * than 0x80, i.e. one of bits 5 to 1 of i must be set
518 */
519 else if ((i & 0x80) && ((i & 0x1E) == 0)) {
520- if (lastError != XML_ERR_INVALID_CHAR)
521+ if (lastError != XML_ERR_INVALID_CHAR) {
522 fprintf(stderr,
523 "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
524 i, j, c);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800525+ return(1);
526+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500527 }
528
529 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400530@@ -317,10 +349,12 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500531 * at least 3 bytes, but we give only 2 !
532 */
533 else if ((i & 0xE0) == 0xE0) {
534- if (lastError != XML_ERR_INVALID_CHAR)
535+ if (lastError != XML_ERR_INVALID_CHAR) {
536 fprintf(stderr,
537 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
538 i, j);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800539+ return(1);
540+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500541 }
542
543 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400544@@ -329,6 +363,7 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500545 else if ((lastError != 0) || (len != 2)) {
546 fprintf(stderr,
547 "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j);
548+ return(1);
549 }
550
551 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400552@@ -338,12 +373,14 @@ static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500553 fprintf(stderr,
554 "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n",
555 i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c);
556+ return(1);
557 }
558 }
559 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800560+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500561 }
562
563-static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
564+static int testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
565 int i, j, k, K;
566 int len, c;
567 unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
Brad Bishopc342db32019-05-15 21:57:59 -0400568@@ -368,20 +405,24 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500569 * at least 4 bytes, but we give only 3 !
570 */
571 if ((i & 0xF0) == 0xF0) {
572- if (lastError != XML_ERR_INVALID_CHAR)
573+ if (lastError != XML_ERR_INVALID_CHAR) {
574 fprintf(stderr,
575 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
576 i, j, K, data[3]);
577+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800578+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500579 }
580
581 /*
582 * The second and the third bytes must start with 10
583 */
584 else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) {
585- if (lastError != XML_ERR_INVALID_CHAR)
586+ if (lastError != XML_ERR_INVALID_CHAR) {
587 fprintf(stderr,
588 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
589 i, j, K);
590+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800591+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500592 }
593
594 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400595@@ -390,10 +431,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500596 * the 6th byte of data[1] must be set
597 */
598 else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) {
599- if (lastError != XML_ERR_INVALID_CHAR)
600+ if (lastError != XML_ERR_INVALID_CHAR) {
601 fprintf(stderr,
602 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
603 i, j, K);
604+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800605+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500606 }
607
608 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400609@@ -401,10 +444,12 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500610 */
611 else if (((value > 0xD7FF) && (value <0xE000)) ||
612 ((value > 0xFFFD) && (value <0x10000))) {
613- if (lastError != XML_ERR_INVALID_CHAR)
614+ if (lastError != XML_ERR_INVALID_CHAR) {
615 fprintf(stderr,
616 "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n",
617 value, i, j, K);
618+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800619+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500620 }
621
622 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400623@@ -414,6 +459,7 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500624 fprintf(stderr,
625 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
626 i, j, K);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800627+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500628 }
629
630 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400631@@ -423,13 +469,15 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500632 fprintf(stderr,
633 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
634 i, j, data[2], value, c);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800635+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500636 }
637 }
638 }
639 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800640+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500641 }
642
643-static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
644+static int testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
645 int i, j, k, K, l, L;
646 int len, c;
647 unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
Brad Bishopc342db32019-05-15 21:57:59 -0400648@@ -458,10 +506,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500649 * at least 5 bytes, but we give only 4 !
650 */
651 if ((i & 0xF8) == 0xF8) {
652- if (lastError != XML_ERR_INVALID_CHAR)
653+ if (lastError != XML_ERR_INVALID_CHAR) {
654 fprintf(stderr,
655 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
656 i, j, K, data[3]);
657+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800658+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500659 }
660
661 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400662@@ -469,10 +519,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500663 */
664 else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) ||
665 ((L & 0xC0) != 0x80)) {
666- if (lastError != XML_ERR_INVALID_CHAR)
667+ if (lastError != XML_ERR_INVALID_CHAR) {
668 fprintf(stderr,
669 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
670 i, j, K, L);
671+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800672+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500673 }
674
675 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400676@@ -481,10 +533,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500677 * the 6 or 5th byte of j must be set
678 */
679 else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) {
680- if (lastError != XML_ERR_INVALID_CHAR)
681+ if (lastError != XML_ERR_INVALID_CHAR) {
682 fprintf(stderr,
683 "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
684 i, j, K, L);
685+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800686+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500687 }
688
689 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400690@@ -493,10 +547,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500691 else if (((value > 0xD7FF) && (value <0xE000)) ||
692 ((value > 0xFFFD) && (value <0x10000)) ||
693 (value > 0x10FFFF)) {
694- if (lastError != XML_ERR_INVALID_CHAR)
695+ if (lastError != XML_ERR_INVALID_CHAR) {
696 fprintf(stderr,
697 "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
698 value, i, j, K, L);
699+ return(1);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800700+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500701 }
702
703 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400704@@ -506,6 +562,7 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500705 fprintf(stderr,
706 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
707 i, j, K);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800708+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500709 }
710
711 /*
Brad Bishopc342db32019-05-15 21:57:59 -0400712@@ -515,11 +572,13 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500713 fprintf(stderr,
714 "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
715 i, j, data[2], value, c);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800716+ return(1);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500717 }
718 }
719 }
720 }
721 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800722+ return(0);
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500723 }
724
725 /**
Brad Bishopc342db32019-05-15 21:57:59 -0400726@@ -530,11 +589,12 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500727 * cover the full range of UTF-8 chars accepted by XML-1.0
728 */
729
730-static void testCharRanges(void) {
731+static int testCharRanges(void) {
732 char data[5];
733 xmlParserCtxtPtr ctxt;
734 xmlParserInputBufferPtr buf;
735 xmlParserInputPtr input;
736+ int test_ret = 0;
737
738 memset(data, 0, 5);
739
Brad Bishopc342db32019-05-15 21:57:59 -0400740@@ -545,17 +605,19 @@ static void testCharRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500741 ctxt = xmlNewParserCtxt();
742 if (ctxt == NULL) {
743 fprintf(stderr, "Failed to allocate parser context\n");
744- return;
745+ return(1);
746 }
747 buf = xmlParserInputBufferCreateStatic(data, sizeof(data),
748 XML_CHAR_ENCODING_NONE);
749 if (buf == NULL) {
750 fprintf(stderr, "Failed to allocate input buffer\n");
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800751+ test_ret = 1;
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500752 goto error;
753 }
754 input = xmlNewInputStream(ctxt);
755 if (input == NULL) {
756 xmlFreeParserInputBuffer(buf);
Brad Bishop1a4b7ee2018-12-16 17:11:34 -0800757+ test_ret = 1;
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500758 goto error;
759 }
760 input->filename = NULL;
Brad Bishopc342db32019-05-15 21:57:59 -0400761@@ -567,25 +629,28 @@ static void testCharRanges(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500762
763 printf("testing char range: 1");
764 fflush(stdout);
765- testCharRangeByte1(ctxt, data);
766+ test_ret += testCharRangeByte1(ctxt, data);
767 printf(" 2");
768 fflush(stdout);
769- testCharRangeByte2(ctxt, data);
770+ test_ret += testCharRangeByte2(ctxt, data);
771 printf(" 3");
772 fflush(stdout);
773- testCharRangeByte3(ctxt, data);
774+ test_ret += testCharRangeByte3(ctxt, data);
775 printf(" 4");
776 fflush(stdout);
777- testCharRangeByte4(ctxt, data);
778+ test_ret += testCharRangeByte4(ctxt, data);
779 printf(" done\n");
780 fflush(stdout);
781
782 error:
783 xmlFreeParserCtxt(ctxt);
784+ return(test_ret);
785 }
786
787 int main(void) {
788
789+ int ret = 0;
790+
791 /*
792 * this initialize the library and check potential ABI mismatches
793 * between the version it was compiled for and the actual shared
Brad Bishopc342db32019-05-15 21:57:59 -0400794@@ -602,8 +667,9 @@ int main(void) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500795 /*
796 * Run the tests
797 */
798- testCharRanges();
799- testDocumentRanges();
800+ ret += testCharRanges();
801+ ret += testDocumentRanges();
802+ printf("%s: testchar\n\n", (ret == 0) ? "PASS" : "FAIL");
803
804 /*
805 * Cleanup function for the XML library.
Brad Bishopc342db32019-05-15 21:57:59 -0400806diff --git a/testdict.c b/testdict.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700807index 40bebd05..114b9347 100644
Brad Bishopc342db32019-05-15 21:57:59 -0400808--- a/testdict.c
809+++ b/testdict.c
810@@ -440,5 +440,6 @@ int main(void)
811 clean_strings();
812 xmlCleanupParser();
813 xmlMemoryDump();
814+ printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL");
815 return(ret);
816 }
817diff --git a/testlimits.c b/testlimits.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700818index 059116a6..f0bee68d 100644
Brad Bishopc342db32019-05-15 21:57:59 -0400819--- a/testlimits.c
820+++ b/testlimits.c
821@@ -1634,5 +1634,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500822 xmlCleanupParser();
823 xmlMemoryDump();
824
825+ printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL");
826 return(ret);
827 }
Brad Bishopc342db32019-05-15 21:57:59 -0400828diff --git a/testrecurse.c b/testrecurse.c
William A. Kennington IIIac69b482021-06-02 12:28:27 -0700829index 0cbe25a6..3ecadb40 100644
Brad Bishopc342db32019-05-15 21:57:59 -0400830--- a/testrecurse.c
831+++ b/testrecurse.c
832@@ -892,6 +892,7 @@ launchTests(testDescPtr tst) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500833 err++;
834 }
835 }
836+ printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
837 return(err);
838 }
839
Brad Bishopc342db32019-05-15 21:57:59 -0400840@@ -961,5 +962,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500841 xmlCleanupParser();
842 xmlMemoryDump();
843
844+ printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL");
845 return(ret);
846 }
Brad Bishopc342db32019-05-15 21:57:59 -0400847--
William A. Kennington IIIac69b482021-06-02 12:28:27 -07008482.25.1
Brad Bishopc342db32019-05-15 21:57:59 -0400849