Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1 | /* |
| 2 | * testapi.c: libxml2 API tester program. |
| 3 | * |
| 4 | * Automatically generated by gentest.py from libxml2-api.xml |
| 5 | * |
| 6 | * See Copyright for the status of this software. |
| 7 | * |
| 8 | * daniel@veillard.com |
| 9 | */ |
| 10 | |
| 11 | #include <stdio.h> |
| 12 | #include <libxml/xmlerror.h> |
| 13 | |
| 14 | static int testlibxml2(void); |
| 15 | |
| 16 | static int generic_errors = 0; |
| 17 | static int call_tests = 0; |
| 18 | |
Daniel Veillard | 348636d | 2004-11-02 22:34:52 +0000 | [diff] [blame] | 19 | static xmlChar chartab[1024] = " chartab\n"; |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 20 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 21 | static void |
| 22 | structured_errors(void *userData ATTRIBUTE_UNUSED, |
| 23 | xmlErrorPtr error ATTRIBUTE_UNUSED) { |
| 24 | generic_errors++; |
| 25 | } |
| 26 | |
| 27 | int main(void) { |
| 28 | int ret; |
| 29 | int blocks, mem; |
| 30 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 31 | xmlInitParser(); |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 32 | xmlRelaxNGInitTypes(); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 33 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 34 | LIBXML_TEST_VERSION |
| 35 | |
| 36 | xmlSetStructuredErrorFunc(NULL, structured_errors); |
| 37 | |
| 38 | ret = testlibxml2(); |
| 39 | |
| 40 | xmlCleanupParser(); |
| 41 | blocks = xmlMemBlocks(); |
| 42 | mem = xmlMemUsed(); |
| 43 | if ((blocks != 0) || (mem != 0)) { |
| 44 | printf("testapi leaked %d bytes in %d blocks\n", mem, blocks); |
| 45 | } |
| 46 | xmlMemoryDump(); |
| 47 | |
| 48 | return (ret != 0); |
| 49 | } |
| 50 | |
| 51 | #include <libxml/HTMLparser.h> |
| 52 | #include <libxml/HTMLtree.h> |
| 53 | #include <libxml/c14n.h> |
| 54 | #include <libxml/catalog.h> |
| 55 | #include <libxml/chvalid.h> |
| 56 | #include <libxml/dict.h> |
| 57 | #include <libxml/encoding.h> |
| 58 | #include <libxml/entities.h> |
| 59 | #include <libxml/hash.h> |
| 60 | #include <libxml/list.h> |
| 61 | #include <libxml/nanoftp.h> |
| 62 | #include <libxml/nanohttp.h> |
| 63 | #include <libxml/parser.h> |
| 64 | #include <libxml/pattern.h> |
| 65 | #include <libxml/relaxng.h> |
| 66 | #include <libxml/schemasInternals.h> |
| 67 | #include <libxml/tree.h> |
| 68 | #include <libxml/uri.h> |
| 69 | #include <libxml/valid.h> |
| 70 | #include <libxml/xinclude.h> |
| 71 | #include <libxml/xmlIO.h> |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 72 | #include <libxml/xmlerror.h> |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 73 | #include <libxml/xmlreader.h> |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 74 | #include <libxml/xmlsave.h> |
| 75 | #include <libxml/xmlschemas.h> |
| 76 | #include <libxml/xmlschemastypes.h> |
| 77 | #include <libxml/xmlstring.h> |
| 78 | #include <libxml/xmlwriter.h> |
| 79 | #include <libxml/xpath.h> |
| 80 | #include <libxml/xpointer.h> |
| 81 | static int test_HTMLparser(void); |
| 82 | static int test_HTMLtree(void); |
| 83 | static int test_c14n(void); |
| 84 | static int test_catalog(void); |
| 85 | static int test_chvalid(void); |
| 86 | static int test_dict(void); |
| 87 | static int test_encoding(void); |
| 88 | static int test_entities(void); |
| 89 | static int test_hash(void); |
| 90 | static int test_list(void); |
| 91 | static int test_nanoftp(void); |
| 92 | static int test_nanohttp(void); |
| 93 | static int test_parser(void); |
| 94 | static int test_pattern(void); |
| 95 | static int test_relaxng(void); |
| 96 | static int test_schemasInternals(void); |
| 97 | static int test_tree(void); |
| 98 | static int test_uri(void); |
| 99 | static int test_valid(void); |
| 100 | static int test_xinclude(void); |
| 101 | static int test_xmlIO(void); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 102 | static int test_xmlerror(void); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 103 | static int test_xmlreader(void); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 104 | static int test_xmlsave(void); |
| 105 | static int test_xmlschemas(void); |
| 106 | static int test_xmlschemastypes(void); |
| 107 | static int test_xmlstring(void); |
| 108 | static int test_xmlwriter(void); |
| 109 | static int test_xpath(void); |
| 110 | static int test_xpointer(void); |
| 111 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 112 | #define gen_nb_userdata 3 |
| 113 | |
| 114 | static void *gen_userdata(int no) { |
| 115 | if (no == 0) return((void *) &call_tests); |
| 116 | if (no == 1) return((void *) -1); |
| 117 | return(NULL); |
| 118 | } |
| 119 | static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED) { |
| 120 | } |
| 121 | |
| 122 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 123 | #define gen_nb_int 4 |
| 124 | |
| 125 | static int gen_int(int no) { |
| 126 | if (no == 0) return(0); |
| 127 | if (no == 1) return(1); |
| 128 | if (no == 2) return(122); |
| 129 | return(-1); |
| 130 | } |
| 131 | |
| 132 | static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED) { |
| 133 | } |
| 134 | |
| 135 | #define gen_nb_const_char_ptr 4 |
| 136 | |
| 137 | static const char *gen_const_char_ptr(int no) { |
| 138 | if (no == 0) return("foo"); |
| 139 | if (no == 1) return("<foo/>"); |
| 140 | if (no == 2) return("test/ent2"); |
| 141 | return(NULL); |
| 142 | } |
| 143 | static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED) { |
| 144 | } |
| 145 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 146 | #define gen_nb_xmlChar_ptr 2 |
| 147 | |
| 148 | static xmlChar *gen_xmlChar_ptr(int no) { |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 149 | if (no == 0) return(&chartab[0]); |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 150 | return(NULL); |
| 151 | } |
| 152 | static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED) { |
| 153 | } |
| 154 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 155 | #define gen_nb_const_xmlChar_ptr 5 |
| 156 | |
| 157 | static const xmlChar *gen_const_xmlChar_ptr(int no) { |
| 158 | if (no == 0) return((const xmlChar *) "foo"); |
| 159 | if (no == 1) return((const xmlChar *) "<foo/>"); |
| 160 | if (no == 2) return((const xmlChar *) "nøne"); |
| 161 | if (no == 3) return((const xmlChar *) " 2ab "); |
| 162 | return(NULL); |
| 163 | } |
| 164 | static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED) { |
| 165 | } |
| 166 | |
| 167 | #define gen_nb_filepath 8 |
| 168 | |
| 169 | static const char *gen_filepath(int no) { |
| 170 | if (no == 0) return("missing.xml"); |
| 171 | if (no == 1) return("<foo/>"); |
| 172 | if (no == 2) return("test/ent2"); |
| 173 | if (no == 3) return("test/valid/REC-xml-19980210.xml"); |
| 174 | if (no == 4) return("test/valid/xhtml1-strict.dtd"); |
| 175 | if (no == 5) return("http://missing.example.org/"); |
| 176 | if (no == 6) return("http://missing. example.org/"); |
| 177 | return(NULL); |
| 178 | } |
| 179 | static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED) { |
| 180 | } |
| 181 | |
| 182 | #define gen_nb_fileoutput 6 |
| 183 | |
| 184 | static const char *gen_fileoutput(int no) { |
| 185 | if (no == 0) return("/missing.xml"); |
| 186 | if (no == 1) return("<foo/>"); |
| 187 | if (no == 2) return("ftp://missing.example.org/foo"); |
| 188 | if (no == 3) return("http://missing.example.org/"); |
| 189 | if (no == 4) return("http://missing. example.org/"); |
| 190 | return(NULL); |
| 191 | } |
| 192 | static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED) { |
| 193 | } |
| 194 | |
| 195 | #define gen_nb_xmlParserCtxtPtr 2 |
| 196 | static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no) { |
| 197 | if (no == 0) return(xmlNewParserCtxt()); |
| 198 | return(NULL); |
| 199 | } |
| 200 | static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val) { |
| 201 | if (val != NULL) |
| 202 | xmlFreeParserCtxt(val); |
| 203 | } |
| 204 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 205 | #define gen_nb_xmlValidCtxtPtr 2 |
| 206 | static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no) { |
| 207 | if (no == 0) return(xmlNewValidCtxt()); |
| 208 | return(NULL); |
| 209 | } |
| 210 | static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val) { |
| 211 | if (val != NULL) |
| 212 | xmlFreeValidCtxt(val); |
| 213 | } |
| 214 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 215 | #define gen_nb_xmlDocPtr 3 |
| 216 | static xmlDocPtr gen_xmlDocPtr(int no) { |
| 217 | if (no == 0) return(xmlNewDoc(BAD_CAST "1.0")); |
| 218 | if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0)); |
| 219 | return(NULL); |
| 220 | } |
| 221 | static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val) { |
| 222 | if (val != NULL) |
| 223 | xmlFreeDoc(val); |
| 224 | } |
| 225 | |
| 226 | #define gen_nb_xmlNodePtr 2 |
| 227 | static xmlNodePtr gen_xmlNodePtr(int no) { |
| 228 | if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL)); |
| 229 | return(NULL); |
| 230 | } |
| 231 | static void des_xmlNodePtr(int no ATTRIBUTE_UNUSED, xmlNodePtr val) { |
| 232 | if (val != NULL) { |
| 233 | xmlUnlinkNode(val); |
| 234 | xmlFreeNode(val); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | #define gen_nb_xmlNodePtr_in 3 |
| 239 | static xmlNodePtr gen_xmlNodePtr_in(int no) { |
| 240 | if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL)); |
| 241 | if (no == 0) return(xmlNewText(BAD_CAST "text")); |
| 242 | return(NULL); |
| 243 | } |
| 244 | static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED) { |
| 245 | } |
| 246 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 247 | #define gen_nb_xmlTextWriterPtr 2 |
| 248 | static xmlTextWriterPtr gen_xmlTextWriterPtr(int no) { |
| 249 | if (no == 0) return(xmlNewTextWriterFilename("test.out", 0)); |
| 250 | return(NULL); |
| 251 | } |
| 252 | static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val) { |
| 253 | if (val != NULL) xmlFreeTextWriter(val); |
| 254 | } |
| 255 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 256 | #define gen_nb_xmlTextReaderPtr 4 |
| 257 | static xmlTextReaderPtr gen_xmlTextReaderPtr(int no) { |
| 258 | if (no == 0) return(xmlNewTextReaderFilename("test/ent2")); |
| 259 | if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml")); |
| 260 | if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd")); |
| 261 | return(NULL); |
| 262 | } |
| 263 | static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val) { |
| 264 | if (val != NULL) xmlFreeTextReader(val); |
| 265 | } |
| 266 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 267 | #define gen_nb_xmlBufferPtr 2 |
| 268 | static xmlBufferPtr gen_xmlBufferPtr(int no) { |
| 269 | if (no == 0) return(xmlBufferCreate()); |
| 270 | return(NULL); |
| 271 | } |
| 272 | static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val) { |
| 273 | if (val != NULL) { |
| 274 | xmlBufferFree(val); |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | #define gen_nb_xmlListPtr 2 |
| 279 | static xmlListPtr gen_xmlListPtr(int no) { |
| 280 | if (no == 0) return(xmlListCreate(NULL, NULL)); |
| 281 | return(NULL); |
| 282 | } |
| 283 | static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val) { |
| 284 | if (val != NULL) { |
| 285 | xmlListDelete(val); |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | #define gen_nb_xmlHashTablePtr 2 |
| 290 | static xmlHashTablePtr gen_xmlHashTablePtr(int no) { |
| 291 | if (no == 0) return(xmlHashCreate(10)); |
| 292 | return(NULL); |
| 293 | } |
| 294 | static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val) { |
| 295 | if (val != NULL) { |
| 296 | xmlHashFree(val, NULL); |
| 297 | } |
| 298 | } |
| 299 | |
| 300 | #include <libxml/xpathInternals.h> |
| 301 | |
| 302 | #define gen_nb_xmlXPathObjectPtr 5 |
| 303 | static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no) { |
| 304 | if (no == 0) return(xmlXPathNewString(BAD_CAST "string object")); |
| 305 | if (no == 1) return(xmlXPathNewFloat(1.1)); |
| 306 | if (no == 2) return(xmlXPathNewBoolean(1)); |
| 307 | if (no == 3) return(xmlXPathNewNodeSet(NULL)); |
| 308 | return(NULL); |
| 309 | } |
| 310 | static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val) { |
| 311 | if (val != NULL) { |
| 312 | xmlXPathFreeObject(val); |
| 313 | } |
| 314 | } |
| 315 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 316 | |
| 317 | static void desret_int(int val ATTRIBUTE_UNUSED) { |
| 318 | } |
| 319 | static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) { |
| 320 | } |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 321 | static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) { |
| 322 | } |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 323 | static void desret_xmlChar_ptr(xmlChar *val) { |
| 324 | if (val != NULL) |
| 325 | xmlFree(val); |
| 326 | } |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 327 | static void desret_xmlDocPtr(xmlDocPtr val) { |
| 328 | xmlFreeDoc(val); |
| 329 | } |
| 330 | static void desret_xmlNodePtr(xmlNodePtr val) { |
| 331 | xmlUnlinkNode(val); |
| 332 | xmlFreeNode(val); |
| 333 | } |
| 334 | |
| 335 | /** |
| 336 | * testlibxml2: |
| 337 | * |
| 338 | * Main entry point of the tester for the full libxml2 module, |
| 339 | * it calls all the tester entry point for each module. |
| 340 | * |
| 341 | * Returns the number of error found |
| 342 | */ |
| 343 | static int |
| 344 | testlibxml2(void) |
| 345 | { |
| 346 | int ret = 0; |
| 347 | |
| 348 | ret += test_HTMLparser(); |
| 349 | ret += test_HTMLtree(); |
| 350 | ret += test_c14n(); |
| 351 | ret += test_catalog(); |
| 352 | ret += test_chvalid(); |
| 353 | ret += test_dict(); |
| 354 | ret += test_encoding(); |
| 355 | ret += test_entities(); |
| 356 | ret += test_hash(); |
| 357 | ret += test_list(); |
| 358 | ret += test_nanoftp(); |
| 359 | ret += test_nanohttp(); |
| 360 | ret += test_parser(); |
| 361 | ret += test_pattern(); |
| 362 | ret += test_relaxng(); |
| 363 | ret += test_schemasInternals(); |
| 364 | ret += test_tree(); |
| 365 | ret += test_uri(); |
| 366 | ret += test_valid(); |
| 367 | ret += test_xinclude(); |
| 368 | ret += test_xmlIO(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 369 | ret += test_xmlerror(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 370 | ret += test_xmlreader(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 371 | ret += test_xmlsave(); |
| 372 | ret += test_xmlschemas(); |
| 373 | ret += test_xmlschemastypes(); |
| 374 | ret += test_xmlstring(); |
| 375 | ret += test_xmlwriter(); |
| 376 | ret += test_xpath(); |
| 377 | ret += test_xpointer(); |
| 378 | |
| 379 | printf("Total: %d tests, %d errors\n", call_tests, ret); |
| 380 | return(ret); |
| 381 | } |
| 382 | |
| 383 | |
| 384 | static int |
| 385 | test_UTF8ToHtml(void) { |
| 386 | int ret = 0; |
| 387 | |
| 388 | |
| 389 | /* missing type support */ |
| 390 | return(ret); |
| 391 | } |
| 392 | |
| 393 | |
| 394 | static int |
| 395 | test_htmlAttrAllowed(void) { |
| 396 | int ret = 0; |
| 397 | |
| 398 | |
| 399 | /* missing type support */ |
| 400 | return(ret); |
| 401 | } |
| 402 | |
| 403 | |
| 404 | static int |
| 405 | test_htmlAutoCloseTag(void) { |
| 406 | int ret = 0; |
| 407 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 408 | #ifdef LIBXML_HTML_ENABLED |
| 409 | int mem_base; |
| 410 | int ret_val; |
| 411 | htmlDocPtr doc; /* the HTML document */ |
| 412 | int n_doc; |
| 413 | const xmlChar * name; /* The tag name */ |
| 414 | int n_name; |
| 415 | htmlNodePtr elem; /* the HTML element */ |
| 416 | int n_elem; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 417 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 418 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 419 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 420 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { |
| 421 | mem_base = xmlMemBlocks(); |
| 422 | doc = gen_xmlDocPtr(n_doc); |
| 423 | name = gen_const_xmlChar_ptr(n_name); |
| 424 | elem = gen_xmlNodePtr(n_elem); |
| 425 | |
| 426 | ret_val = htmlAutoCloseTag(doc, name, elem); |
| 427 | desret_int(ret_val); |
| 428 | call_tests++; |
| 429 | des_xmlDocPtr(n_doc, doc); |
| 430 | des_const_xmlChar_ptr(n_name, name); |
| 431 | des_xmlNodePtr(n_elem, elem); |
| 432 | xmlResetLastError(); |
| 433 | if (mem_base != xmlMemBlocks()) { |
| 434 | printf("Leak of %d blocks found in htmlAutoCloseTag", |
| 435 | xmlMemBlocks() - mem_base); |
| 436 | ret++; |
| 437 | printf(" %d", n_doc); |
| 438 | printf(" %d", n_name); |
| 439 | printf(" %d", n_elem); |
| 440 | printf("\n"); |
| 441 | } |
| 442 | } |
| 443 | } |
| 444 | } |
| 445 | #endif |
| 446 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 447 | return(ret); |
| 448 | } |
| 449 | |
| 450 | |
| 451 | static int |
| 452 | test_htmlCreateMemoryParserCtxt(void) { |
| 453 | int ret = 0; |
| 454 | |
| 455 | |
| 456 | /* missing type support */ |
| 457 | return(ret); |
| 458 | } |
| 459 | |
| 460 | |
| 461 | static int |
| 462 | test_htmlCreatePushParserCtxt(void) { |
| 463 | int ret = 0; |
| 464 | |
| 465 | |
| 466 | /* missing type support */ |
| 467 | return(ret); |
| 468 | } |
| 469 | |
| 470 | |
| 471 | static int |
| 472 | test_htmlCtxtReadDoc(void) { |
| 473 | int ret = 0; |
| 474 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 475 | #ifdef LIBXML_HTML_ENABLED |
| 476 | int mem_base; |
| 477 | htmlDocPtr ret_val; |
| 478 | htmlParserCtxtPtr ctxt; /* an HTML parser context */ |
| 479 | int n_ctxt; |
| 480 | const xmlChar * cur; /* a pointer to a zero terminated string */ |
| 481 | int n_cur; |
| 482 | const char * URL; /* the base URL to use for the document */ |
| 483 | int n_URL; |
| 484 | const char * encoding; /* the document encoding, or NULL */ |
| 485 | int n_encoding; |
| 486 | int options; /* a combination of htmlParserOption(s) */ |
| 487 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 488 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 489 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 490 | for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { |
| 491 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 492 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 493 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 494 | mem_base = xmlMemBlocks(); |
| 495 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 496 | cur = gen_const_xmlChar_ptr(n_cur); |
| 497 | URL = gen_filepath(n_URL); |
| 498 | encoding = gen_const_char_ptr(n_encoding); |
| 499 | options = gen_int(n_options); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 500 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 501 | ret_val = htmlCtxtReadDoc(ctxt, cur, URL, encoding, options); |
| 502 | desret_xmlDocPtr(ret_val); |
| 503 | call_tests++; |
| 504 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 505 | des_const_xmlChar_ptr(n_cur, cur); |
| 506 | des_filepath(n_URL, URL); |
| 507 | des_const_char_ptr(n_encoding, encoding); |
| 508 | des_int(n_options, options); |
| 509 | xmlResetLastError(); |
| 510 | if (mem_base != xmlMemBlocks()) { |
| 511 | printf("Leak of %d blocks found in htmlCtxtReadDoc", |
| 512 | xmlMemBlocks() - mem_base); |
| 513 | ret++; |
| 514 | printf(" %d", n_ctxt); |
| 515 | printf(" %d", n_cur); |
| 516 | printf(" %d", n_URL); |
| 517 | printf(" %d", n_encoding); |
| 518 | printf(" %d", n_options); |
| 519 | printf("\n"); |
| 520 | } |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | } |
| 525 | } |
| 526 | #endif |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 527 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 528 | return(ret); |
| 529 | } |
| 530 | |
| 531 | |
| 532 | static int |
| 533 | test_htmlCtxtReadFile(void) { |
| 534 | int ret = 0; |
| 535 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 536 | #ifdef LIBXML_HTML_ENABLED |
| 537 | int mem_base; |
| 538 | htmlDocPtr ret_val; |
| 539 | htmlParserCtxtPtr ctxt; /* an HTML parser context */ |
| 540 | int n_ctxt; |
| 541 | const char * filename; /* a file or URL */ |
| 542 | int n_filename; |
| 543 | const char * encoding; /* the document encoding, or NULL */ |
| 544 | int n_encoding; |
| 545 | int options; /* a combination of htmlParserOption(s) */ |
| 546 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 547 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 548 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 549 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 550 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 551 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 552 | mem_base = xmlMemBlocks(); |
| 553 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 554 | filename = gen_filepath(n_filename); |
| 555 | encoding = gen_const_char_ptr(n_encoding); |
| 556 | options = gen_int(n_options); |
| 557 | |
| 558 | ret_val = htmlCtxtReadFile(ctxt, filename, encoding, options); |
| 559 | desret_xmlDocPtr(ret_val); |
| 560 | call_tests++; |
| 561 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 562 | des_filepath(n_filename, filename); |
| 563 | des_const_char_ptr(n_encoding, encoding); |
| 564 | des_int(n_options, options); |
| 565 | xmlResetLastError(); |
| 566 | if (mem_base != xmlMemBlocks()) { |
| 567 | printf("Leak of %d blocks found in htmlCtxtReadFile", |
| 568 | xmlMemBlocks() - mem_base); |
| 569 | ret++; |
| 570 | printf(" %d", n_ctxt); |
| 571 | printf(" %d", n_filename); |
| 572 | printf(" %d", n_encoding); |
| 573 | printf(" %d", n_options); |
| 574 | printf("\n"); |
| 575 | } |
| 576 | } |
| 577 | } |
| 578 | } |
| 579 | } |
| 580 | #endif |
| 581 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 582 | return(ret); |
| 583 | } |
| 584 | |
| 585 | |
| 586 | static int |
| 587 | test_htmlCtxtReadIO(void) { |
| 588 | int ret = 0; |
| 589 | |
| 590 | |
| 591 | /* missing type support */ |
| 592 | return(ret); |
| 593 | } |
| 594 | |
| 595 | |
| 596 | static int |
| 597 | test_htmlCtxtReadMemory(void) { |
| 598 | int ret = 0; |
| 599 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 600 | #ifdef LIBXML_HTML_ENABLED |
| 601 | int mem_base; |
| 602 | htmlDocPtr ret_val; |
| 603 | htmlParserCtxtPtr ctxt; /* an HTML parser context */ |
| 604 | int n_ctxt; |
| 605 | const char * buffer; /* a pointer to a char array */ |
| 606 | int n_buffer; |
| 607 | int size; /* the size of the array */ |
| 608 | int n_size; |
| 609 | const char * URL; /* the base URL to use for the document */ |
| 610 | int n_URL; |
| 611 | const char * encoding; /* the document encoding, or NULL */ |
| 612 | int n_encoding; |
| 613 | int options; /* a combination of htmlParserOption(s) */ |
| 614 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 615 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 616 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 617 | for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { |
| 618 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 619 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 620 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 621 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 622 | mem_base = xmlMemBlocks(); |
| 623 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 624 | buffer = gen_const_char_ptr(n_buffer); |
| 625 | size = gen_int(n_size); |
| 626 | URL = gen_filepath(n_URL); |
| 627 | encoding = gen_const_char_ptr(n_encoding); |
| 628 | options = gen_int(n_options); |
| 629 | |
| 630 | ret_val = htmlCtxtReadMemory(ctxt, buffer, size, URL, encoding, options); |
| 631 | desret_xmlDocPtr(ret_val); |
| 632 | call_tests++; |
| 633 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 634 | des_const_char_ptr(n_buffer, buffer); |
| 635 | des_int(n_size, size); |
| 636 | des_filepath(n_URL, URL); |
| 637 | des_const_char_ptr(n_encoding, encoding); |
| 638 | des_int(n_options, options); |
| 639 | xmlResetLastError(); |
| 640 | if (mem_base != xmlMemBlocks()) { |
| 641 | printf("Leak of %d blocks found in htmlCtxtReadMemory", |
| 642 | xmlMemBlocks() - mem_base); |
| 643 | ret++; |
| 644 | printf(" %d", n_ctxt); |
| 645 | printf(" %d", n_buffer); |
| 646 | printf(" %d", n_size); |
| 647 | printf(" %d", n_URL); |
| 648 | printf(" %d", n_encoding); |
| 649 | printf(" %d", n_options); |
| 650 | printf("\n"); |
| 651 | } |
| 652 | } |
| 653 | } |
| 654 | } |
| 655 | } |
| 656 | } |
| 657 | } |
| 658 | #endif |
| 659 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 660 | return(ret); |
| 661 | } |
| 662 | |
| 663 | |
| 664 | static int |
| 665 | test_htmlCtxtReset(void) { |
| 666 | int ret = 0; |
| 667 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 668 | #ifdef LIBXML_HTML_ENABLED |
| 669 | int mem_base; |
| 670 | htmlParserCtxtPtr ctxt; /* an HTML parser context */ |
| 671 | int n_ctxt; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 672 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 673 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 674 | mem_base = xmlMemBlocks(); |
| 675 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 676 | |
| 677 | htmlCtxtReset(ctxt); |
| 678 | call_tests++; |
| 679 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 680 | xmlResetLastError(); |
| 681 | if (mem_base != xmlMemBlocks()) { |
| 682 | printf("Leak of %d blocks found in htmlCtxtReset", |
| 683 | xmlMemBlocks() - mem_base); |
| 684 | ret++; |
| 685 | printf(" %d", n_ctxt); |
| 686 | printf("\n"); |
| 687 | } |
| 688 | } |
| 689 | #endif |
| 690 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 691 | return(ret); |
| 692 | } |
| 693 | |
| 694 | |
| 695 | static int |
| 696 | test_htmlCtxtUseOptions(void) { |
| 697 | int ret = 0; |
| 698 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 699 | #ifdef LIBXML_HTML_ENABLED |
| 700 | int mem_base; |
| 701 | int ret_val; |
| 702 | htmlParserCtxtPtr ctxt; /* an HTML parser context */ |
| 703 | int n_ctxt; |
| 704 | int options; /* a combination of htmlParserOption(s) */ |
| 705 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 706 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 707 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 708 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 709 | mem_base = xmlMemBlocks(); |
| 710 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 711 | options = gen_int(n_options); |
| 712 | |
| 713 | ret_val = htmlCtxtUseOptions(ctxt, options); |
| 714 | desret_int(ret_val); |
| 715 | call_tests++; |
| 716 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 717 | des_int(n_options, options); |
| 718 | xmlResetLastError(); |
| 719 | if (mem_base != xmlMemBlocks()) { |
| 720 | printf("Leak of %d blocks found in htmlCtxtUseOptions", |
| 721 | xmlMemBlocks() - mem_base); |
| 722 | ret++; |
| 723 | printf(" %d", n_ctxt); |
| 724 | printf(" %d", n_options); |
| 725 | printf("\n"); |
| 726 | } |
| 727 | } |
| 728 | } |
| 729 | #endif |
| 730 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 731 | return(ret); |
| 732 | } |
| 733 | |
| 734 | |
| 735 | static int |
| 736 | test_htmlElementAllowedHere(void) { |
| 737 | int ret = 0; |
| 738 | |
| 739 | |
| 740 | /* missing type support */ |
| 741 | return(ret); |
| 742 | } |
| 743 | |
| 744 | |
| 745 | static int |
| 746 | test_htmlElementStatusHere(void) { |
| 747 | int ret = 0; |
| 748 | |
| 749 | |
| 750 | /* missing type support */ |
| 751 | return(ret); |
| 752 | } |
| 753 | |
| 754 | |
| 755 | static int |
| 756 | test_htmlEncodeEntities(void) { |
| 757 | int ret = 0; |
| 758 | |
| 759 | |
| 760 | /* missing type support */ |
| 761 | return(ret); |
| 762 | } |
| 763 | |
| 764 | |
| 765 | static int |
| 766 | test_htmlEntityLookup(void) { |
| 767 | int ret = 0; |
| 768 | |
| 769 | |
| 770 | /* missing type support */ |
| 771 | return(ret); |
| 772 | } |
| 773 | |
| 774 | |
| 775 | static int |
| 776 | test_htmlEntityValueLookup(void) { |
| 777 | int ret = 0; |
| 778 | |
| 779 | |
| 780 | /* missing type support */ |
| 781 | return(ret); |
| 782 | } |
| 783 | |
| 784 | |
| 785 | static int |
| 786 | test_htmlHandleOmittedElem(void) { |
| 787 | int ret = 0; |
| 788 | |
| 789 | #ifdef LIBXML_HTML_ENABLED |
| 790 | int mem_base; |
| 791 | int ret_val; |
| 792 | int val; /* int 0 or 1 */ |
| 793 | int n_val; |
| 794 | |
| 795 | for (n_val = 0;n_val < gen_nb_int;n_val++) { |
| 796 | mem_base = xmlMemBlocks(); |
| 797 | val = gen_int(n_val); |
| 798 | |
| 799 | ret_val = htmlHandleOmittedElem(val); |
| 800 | desret_int(ret_val); |
| 801 | call_tests++; |
| 802 | des_int(n_val, val); |
| 803 | xmlResetLastError(); |
| 804 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 805 | printf("Leak of %d blocks found in htmlHandleOmittedElem", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 806 | xmlMemBlocks() - mem_base); |
| 807 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 808 | printf(" %d", n_val); |
| 809 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 810 | } |
| 811 | } |
| 812 | #endif |
| 813 | |
| 814 | return(ret); |
| 815 | } |
| 816 | |
| 817 | |
| 818 | static int |
| 819 | test_htmlIsAutoClosed(void) { |
| 820 | int ret = 0; |
| 821 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 822 | #ifdef LIBXML_HTML_ENABLED |
| 823 | int mem_base; |
| 824 | int ret_val; |
| 825 | htmlDocPtr doc; /* the HTML document */ |
| 826 | int n_doc; |
| 827 | htmlNodePtr elem; /* the HTML element */ |
| 828 | int n_elem; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 829 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 830 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 831 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { |
| 832 | mem_base = xmlMemBlocks(); |
| 833 | doc = gen_xmlDocPtr(n_doc); |
| 834 | elem = gen_xmlNodePtr(n_elem); |
| 835 | |
| 836 | ret_val = htmlIsAutoClosed(doc, elem); |
| 837 | desret_int(ret_val); |
| 838 | call_tests++; |
| 839 | des_xmlDocPtr(n_doc, doc); |
| 840 | des_xmlNodePtr(n_elem, elem); |
| 841 | xmlResetLastError(); |
| 842 | if (mem_base != xmlMemBlocks()) { |
| 843 | printf("Leak of %d blocks found in htmlIsAutoClosed", |
| 844 | xmlMemBlocks() - mem_base); |
| 845 | ret++; |
| 846 | printf(" %d", n_doc); |
| 847 | printf(" %d", n_elem); |
| 848 | printf("\n"); |
| 849 | } |
| 850 | } |
| 851 | } |
| 852 | #endif |
| 853 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 854 | return(ret); |
| 855 | } |
| 856 | |
| 857 | |
| 858 | static int |
| 859 | test_htmlIsScriptAttribute(void) { |
| 860 | int ret = 0; |
| 861 | |
| 862 | #ifdef LIBXML_HTML_ENABLED |
| 863 | int mem_base; |
| 864 | int ret_val; |
| 865 | const xmlChar * name; /* an attribute name */ |
| 866 | int n_name; |
| 867 | |
| 868 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 869 | mem_base = xmlMemBlocks(); |
| 870 | name = gen_const_xmlChar_ptr(n_name); |
| 871 | |
| 872 | ret_val = htmlIsScriptAttribute(name); |
| 873 | desret_int(ret_val); |
| 874 | call_tests++; |
| 875 | des_const_xmlChar_ptr(n_name, name); |
| 876 | xmlResetLastError(); |
| 877 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 878 | printf("Leak of %d blocks found in htmlIsScriptAttribute", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 879 | xmlMemBlocks() - mem_base); |
| 880 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 881 | printf(" %d", n_name); |
| 882 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 883 | } |
| 884 | } |
| 885 | #endif |
| 886 | |
| 887 | return(ret); |
| 888 | } |
| 889 | |
| 890 | |
| 891 | static int |
| 892 | test_htmlNodeStatus(void) { |
| 893 | int ret = 0; |
| 894 | |
| 895 | |
| 896 | /* missing type support */ |
| 897 | return(ret); |
| 898 | } |
| 899 | |
| 900 | |
| 901 | static int |
| 902 | test_htmlParseCharRef(void) { |
| 903 | int ret = 0; |
| 904 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 905 | #ifdef LIBXML_HTML_ENABLED |
| 906 | int mem_base; |
| 907 | int ret_val; |
| 908 | htmlParserCtxtPtr ctxt; /* an HTML parser context */ |
| 909 | int n_ctxt; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 910 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 911 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 912 | mem_base = xmlMemBlocks(); |
| 913 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 914 | |
| 915 | ret_val = htmlParseCharRef(ctxt); |
| 916 | desret_int(ret_val); |
| 917 | call_tests++; |
| 918 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 919 | xmlResetLastError(); |
| 920 | if (mem_base != xmlMemBlocks()) { |
| 921 | printf("Leak of %d blocks found in htmlParseCharRef", |
| 922 | xmlMemBlocks() - mem_base); |
| 923 | ret++; |
| 924 | printf(" %d", n_ctxt); |
| 925 | printf("\n"); |
| 926 | } |
| 927 | } |
| 928 | #endif |
| 929 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 930 | return(ret); |
| 931 | } |
| 932 | |
| 933 | |
| 934 | static int |
| 935 | test_htmlParseChunk(void) { |
| 936 | int ret = 0; |
| 937 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 938 | #ifdef LIBXML_HTML_ENABLED |
| 939 | #ifdef LIBXML_PUSH_ENABLED |
| 940 | int mem_base; |
| 941 | int ret_val; |
| 942 | htmlParserCtxtPtr ctxt; /* an HTML parser context */ |
| 943 | int n_ctxt; |
| 944 | const char * chunk; /* an char array */ |
| 945 | int n_chunk; |
| 946 | int size; /* the size in byte of the chunk */ |
| 947 | int n_size; |
| 948 | int terminate; /* last chunk indicator */ |
| 949 | int n_terminate; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 950 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 951 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 952 | for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { |
| 953 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 954 | for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) { |
| 955 | mem_base = xmlMemBlocks(); |
| 956 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 957 | chunk = gen_const_char_ptr(n_chunk); |
| 958 | size = gen_int(n_size); |
| 959 | terminate = gen_int(n_terminate); |
| 960 | |
| 961 | ret_val = htmlParseChunk(ctxt, chunk, size, terminate); |
| 962 | desret_int(ret_val); |
| 963 | call_tests++; |
| 964 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 965 | des_const_char_ptr(n_chunk, chunk); |
| 966 | des_int(n_size, size); |
| 967 | des_int(n_terminate, terminate); |
| 968 | xmlResetLastError(); |
| 969 | if (mem_base != xmlMemBlocks()) { |
| 970 | printf("Leak of %d blocks found in htmlParseChunk", |
| 971 | xmlMemBlocks() - mem_base); |
| 972 | ret++; |
| 973 | printf(" %d", n_ctxt); |
| 974 | printf(" %d", n_chunk); |
| 975 | printf(" %d", n_size); |
| 976 | printf(" %d", n_terminate); |
| 977 | printf("\n"); |
| 978 | } |
| 979 | } |
| 980 | } |
| 981 | } |
| 982 | } |
| 983 | #endif |
| 984 | #endif |
| 985 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 986 | return(ret); |
| 987 | } |
| 988 | |
| 989 | |
| 990 | static int |
| 991 | test_htmlParseDoc(void) { |
| 992 | int ret = 0; |
| 993 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 994 | #ifdef LIBXML_HTML_ENABLED |
| 995 | int mem_base; |
| 996 | htmlDocPtr ret_val; |
| 997 | xmlChar * cur; /* a pointer to an array of xmlChar */ |
| 998 | int n_cur; |
| 999 | const char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ |
| 1000 | int n_encoding; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1001 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 1002 | for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) { |
| 1003 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 1004 | mem_base = xmlMemBlocks(); |
| 1005 | cur = gen_xmlChar_ptr(n_cur); |
| 1006 | encoding = gen_const_char_ptr(n_encoding); |
| 1007 | |
| 1008 | ret_val = htmlParseDoc(cur, encoding); |
| 1009 | desret_xmlDocPtr(ret_val); |
| 1010 | call_tests++; |
| 1011 | des_xmlChar_ptr(n_cur, cur); |
| 1012 | des_const_char_ptr(n_encoding, encoding); |
| 1013 | xmlResetLastError(); |
| 1014 | if (mem_base != xmlMemBlocks()) { |
| 1015 | printf("Leak of %d blocks found in htmlParseDoc", |
| 1016 | xmlMemBlocks() - mem_base); |
| 1017 | ret++; |
| 1018 | printf(" %d", n_cur); |
| 1019 | printf(" %d", n_encoding); |
| 1020 | printf("\n"); |
| 1021 | } |
| 1022 | } |
| 1023 | } |
| 1024 | #endif |
| 1025 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1026 | return(ret); |
| 1027 | } |
| 1028 | |
| 1029 | |
| 1030 | static int |
| 1031 | test_htmlParseDocument(void) { |
| 1032 | int ret = 0; |
| 1033 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1034 | #ifdef LIBXML_HTML_ENABLED |
| 1035 | int mem_base; |
| 1036 | int ret_val; |
| 1037 | htmlParserCtxtPtr ctxt; /* an HTML parser context */ |
| 1038 | int n_ctxt; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1039 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1040 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 1041 | mem_base = xmlMemBlocks(); |
| 1042 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 1043 | |
| 1044 | ret_val = htmlParseDocument(ctxt); |
| 1045 | desret_int(ret_val); |
| 1046 | call_tests++; |
| 1047 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 1048 | xmlResetLastError(); |
| 1049 | if (mem_base != xmlMemBlocks()) { |
| 1050 | printf("Leak of %d blocks found in htmlParseDocument", |
| 1051 | xmlMemBlocks() - mem_base); |
| 1052 | ret++; |
| 1053 | printf(" %d", n_ctxt); |
| 1054 | printf("\n"); |
| 1055 | } |
| 1056 | } |
| 1057 | #endif |
| 1058 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1059 | return(ret); |
| 1060 | } |
| 1061 | |
| 1062 | |
| 1063 | static int |
| 1064 | test_htmlParseElement(void) { |
| 1065 | int ret = 0; |
| 1066 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1067 | #ifdef LIBXML_HTML_ENABLED |
| 1068 | int mem_base; |
| 1069 | htmlParserCtxtPtr ctxt; /* an HTML parser context */ |
| 1070 | int n_ctxt; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1071 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1072 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 1073 | mem_base = xmlMemBlocks(); |
| 1074 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 1075 | |
| 1076 | htmlParseElement(ctxt); |
| 1077 | call_tests++; |
| 1078 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 1079 | xmlResetLastError(); |
| 1080 | if (mem_base != xmlMemBlocks()) { |
| 1081 | printf("Leak of %d blocks found in htmlParseElement", |
| 1082 | xmlMemBlocks() - mem_base); |
| 1083 | ret++; |
| 1084 | printf(" %d", n_ctxt); |
| 1085 | printf("\n"); |
| 1086 | } |
| 1087 | } |
| 1088 | #endif |
| 1089 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1090 | return(ret); |
| 1091 | } |
| 1092 | |
| 1093 | |
| 1094 | static int |
| 1095 | test_htmlParseEntityRef(void) { |
| 1096 | int ret = 0; |
| 1097 | |
| 1098 | |
| 1099 | /* missing type support */ |
| 1100 | return(ret); |
| 1101 | } |
| 1102 | |
| 1103 | |
| 1104 | static int |
| 1105 | test_htmlParseFile(void) { |
| 1106 | int ret = 0; |
| 1107 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1108 | #ifdef LIBXML_HTML_ENABLED |
| 1109 | htmlDocPtr ret_val; |
| 1110 | const char * filename; /* the filename */ |
| 1111 | int n_filename; |
| 1112 | const char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ |
| 1113 | int n_encoding; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1114 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1115 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 1116 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 1117 | filename = gen_filepath(n_filename); |
| 1118 | encoding = gen_const_char_ptr(n_encoding); |
| 1119 | |
| 1120 | ret_val = htmlParseFile(filename, encoding); |
| 1121 | desret_xmlDocPtr(ret_val); |
| 1122 | call_tests++; |
| 1123 | des_filepath(n_filename, filename); |
| 1124 | des_const_char_ptr(n_encoding, encoding); |
| 1125 | xmlResetLastError(); |
| 1126 | } |
| 1127 | } |
| 1128 | #endif |
| 1129 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1130 | return(ret); |
| 1131 | } |
| 1132 | |
| 1133 | |
| 1134 | static int |
| 1135 | test_htmlReadDoc(void) { |
| 1136 | int ret = 0; |
| 1137 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1138 | #ifdef LIBXML_HTML_ENABLED |
| 1139 | int mem_base; |
| 1140 | htmlDocPtr ret_val; |
| 1141 | const xmlChar * cur; /* a pointer to a zero terminated string */ |
| 1142 | int n_cur; |
| 1143 | const char * URL; /* the base URL to use for the document */ |
| 1144 | int n_URL; |
| 1145 | const char * encoding; /* the document encoding, or NULL */ |
| 1146 | int n_encoding; |
| 1147 | int options; /* a combination of htmlParserOption(s) */ |
| 1148 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1149 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1150 | for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { |
| 1151 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 1152 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 1153 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 1154 | mem_base = xmlMemBlocks(); |
| 1155 | cur = gen_const_xmlChar_ptr(n_cur); |
| 1156 | URL = gen_filepath(n_URL); |
| 1157 | encoding = gen_const_char_ptr(n_encoding); |
| 1158 | options = gen_int(n_options); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1159 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1160 | ret_val = htmlReadDoc(cur, URL, encoding, options); |
| 1161 | desret_xmlDocPtr(ret_val); |
| 1162 | call_tests++; |
| 1163 | des_const_xmlChar_ptr(n_cur, cur); |
| 1164 | des_filepath(n_URL, URL); |
| 1165 | des_const_char_ptr(n_encoding, encoding); |
| 1166 | des_int(n_options, options); |
| 1167 | xmlResetLastError(); |
| 1168 | if (mem_base != xmlMemBlocks()) { |
| 1169 | printf("Leak of %d blocks found in htmlReadDoc", |
| 1170 | xmlMemBlocks() - mem_base); |
| 1171 | ret++; |
| 1172 | printf(" %d", n_cur); |
| 1173 | printf(" %d", n_URL); |
| 1174 | printf(" %d", n_encoding); |
| 1175 | printf(" %d", n_options); |
| 1176 | printf("\n"); |
| 1177 | } |
| 1178 | } |
| 1179 | } |
| 1180 | } |
| 1181 | } |
| 1182 | #endif |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1183 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1184 | return(ret); |
| 1185 | } |
| 1186 | |
| 1187 | |
| 1188 | static int |
| 1189 | test_htmlReadFile(void) { |
| 1190 | int ret = 0; |
| 1191 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1192 | #ifdef LIBXML_HTML_ENABLED |
| 1193 | int mem_base; |
| 1194 | htmlDocPtr ret_val; |
| 1195 | const char * filename; /* a file or URL */ |
| 1196 | int n_filename; |
| 1197 | const char * encoding; /* the document encoding, or NULL */ |
| 1198 | int n_encoding; |
| 1199 | int options; /* a combination of htmlParserOption(s) */ |
| 1200 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1201 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1202 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 1203 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 1204 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 1205 | mem_base = xmlMemBlocks(); |
| 1206 | filename = gen_filepath(n_filename); |
| 1207 | encoding = gen_const_char_ptr(n_encoding); |
| 1208 | options = gen_int(n_options); |
| 1209 | |
| 1210 | ret_val = htmlReadFile(filename, encoding, options); |
| 1211 | desret_xmlDocPtr(ret_val); |
| 1212 | call_tests++; |
| 1213 | des_filepath(n_filename, filename); |
| 1214 | des_const_char_ptr(n_encoding, encoding); |
| 1215 | des_int(n_options, options); |
| 1216 | xmlResetLastError(); |
| 1217 | if (mem_base != xmlMemBlocks()) { |
| 1218 | printf("Leak of %d blocks found in htmlReadFile", |
| 1219 | xmlMemBlocks() - mem_base); |
| 1220 | ret++; |
| 1221 | printf(" %d", n_filename); |
| 1222 | printf(" %d", n_encoding); |
| 1223 | printf(" %d", n_options); |
| 1224 | printf("\n"); |
| 1225 | } |
| 1226 | } |
| 1227 | } |
| 1228 | } |
| 1229 | #endif |
| 1230 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1231 | return(ret); |
| 1232 | } |
| 1233 | |
| 1234 | |
| 1235 | static int |
| 1236 | test_htmlReadIO(void) { |
| 1237 | int ret = 0; |
| 1238 | |
| 1239 | |
| 1240 | /* missing type support */ |
| 1241 | return(ret); |
| 1242 | } |
| 1243 | |
| 1244 | |
| 1245 | static int |
| 1246 | test_htmlReadMemory(void) { |
| 1247 | int ret = 0; |
| 1248 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1249 | #ifdef LIBXML_HTML_ENABLED |
| 1250 | int mem_base; |
| 1251 | htmlDocPtr ret_val; |
| 1252 | const char * buffer; /* a pointer to a char array */ |
| 1253 | int n_buffer; |
| 1254 | int size; /* the size of the array */ |
| 1255 | int n_size; |
| 1256 | const char * URL; /* the base URL to use for the document */ |
| 1257 | int n_URL; |
| 1258 | const char * encoding; /* the document encoding, or NULL */ |
| 1259 | int n_encoding; |
| 1260 | int options; /* a combination of htmlParserOption(s) */ |
| 1261 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1262 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1263 | for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { |
| 1264 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 1265 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 1266 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 1267 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 1268 | mem_base = xmlMemBlocks(); |
| 1269 | buffer = gen_const_char_ptr(n_buffer); |
| 1270 | size = gen_int(n_size); |
| 1271 | URL = gen_filepath(n_URL); |
| 1272 | encoding = gen_const_char_ptr(n_encoding); |
| 1273 | options = gen_int(n_options); |
| 1274 | |
| 1275 | ret_val = htmlReadMemory(buffer, size, URL, encoding, options); |
| 1276 | desret_xmlDocPtr(ret_val); |
| 1277 | call_tests++; |
| 1278 | des_const_char_ptr(n_buffer, buffer); |
| 1279 | des_int(n_size, size); |
| 1280 | des_filepath(n_URL, URL); |
| 1281 | des_const_char_ptr(n_encoding, encoding); |
| 1282 | des_int(n_options, options); |
| 1283 | xmlResetLastError(); |
| 1284 | if (mem_base != xmlMemBlocks()) { |
| 1285 | printf("Leak of %d blocks found in htmlReadMemory", |
| 1286 | xmlMemBlocks() - mem_base); |
| 1287 | ret++; |
| 1288 | printf(" %d", n_buffer); |
| 1289 | printf(" %d", n_size); |
| 1290 | printf(" %d", n_URL); |
| 1291 | printf(" %d", n_encoding); |
| 1292 | printf(" %d", n_options); |
| 1293 | printf("\n"); |
| 1294 | } |
| 1295 | } |
| 1296 | } |
| 1297 | } |
| 1298 | } |
| 1299 | } |
| 1300 | #endif |
| 1301 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1302 | return(ret); |
| 1303 | } |
| 1304 | |
| 1305 | |
| 1306 | static int |
| 1307 | test_htmlSAXParseDoc(void) { |
| 1308 | int ret = 0; |
| 1309 | |
| 1310 | |
| 1311 | /* missing type support */ |
| 1312 | return(ret); |
| 1313 | } |
| 1314 | |
| 1315 | |
| 1316 | static int |
| 1317 | test_htmlSAXParseFile(void) { |
| 1318 | int ret = 0; |
| 1319 | |
| 1320 | |
| 1321 | /* missing type support */ |
| 1322 | return(ret); |
| 1323 | } |
| 1324 | |
| 1325 | |
| 1326 | static int |
| 1327 | test_htmlTagLookup(void) { |
| 1328 | int ret = 0; |
| 1329 | |
| 1330 | |
| 1331 | /* missing type support */ |
| 1332 | return(ret); |
| 1333 | } |
| 1334 | |
| 1335 | static int |
| 1336 | test_HTMLparser(void) { |
| 1337 | int ret = 0; |
| 1338 | |
| 1339 | printf("Testing HTMLparser ...\n"); |
| 1340 | ret += test_UTF8ToHtml(); |
| 1341 | ret += test_htmlAttrAllowed(); |
| 1342 | ret += test_htmlAutoCloseTag(); |
| 1343 | ret += test_htmlCreateMemoryParserCtxt(); |
| 1344 | ret += test_htmlCreatePushParserCtxt(); |
| 1345 | ret += test_htmlCtxtReadDoc(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1346 | ret += test_htmlCtxtReadFile(); |
| 1347 | ret += test_htmlCtxtReadIO(); |
| 1348 | ret += test_htmlCtxtReadMemory(); |
| 1349 | ret += test_htmlCtxtReset(); |
| 1350 | ret += test_htmlCtxtUseOptions(); |
| 1351 | ret += test_htmlElementAllowedHere(); |
| 1352 | ret += test_htmlElementStatusHere(); |
| 1353 | ret += test_htmlEncodeEntities(); |
| 1354 | ret += test_htmlEntityLookup(); |
| 1355 | ret += test_htmlEntityValueLookup(); |
| 1356 | ret += test_htmlHandleOmittedElem(); |
| 1357 | ret += test_htmlIsAutoClosed(); |
| 1358 | ret += test_htmlIsScriptAttribute(); |
| 1359 | ret += test_htmlNodeStatus(); |
| 1360 | ret += test_htmlParseCharRef(); |
| 1361 | ret += test_htmlParseChunk(); |
| 1362 | ret += test_htmlParseDoc(); |
| 1363 | ret += test_htmlParseDocument(); |
| 1364 | ret += test_htmlParseElement(); |
| 1365 | ret += test_htmlParseEntityRef(); |
| 1366 | ret += test_htmlParseFile(); |
| 1367 | ret += test_htmlReadDoc(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1368 | ret += test_htmlReadFile(); |
| 1369 | ret += test_htmlReadIO(); |
| 1370 | ret += test_htmlReadMemory(); |
| 1371 | ret += test_htmlSAXParseDoc(); |
| 1372 | ret += test_htmlSAXParseFile(); |
| 1373 | ret += test_htmlTagLookup(); |
| 1374 | |
| 1375 | if (ret != 0) |
| 1376 | printf("Module HTMLparser: %d errors\n", ret); |
| 1377 | return(ret); |
| 1378 | } |
| 1379 | |
| 1380 | static int |
| 1381 | test_htmlDocContentDumpFormatOutput(void) { |
| 1382 | int ret = 0; |
| 1383 | |
| 1384 | |
| 1385 | /* missing type support */ |
| 1386 | return(ret); |
| 1387 | } |
| 1388 | |
| 1389 | |
| 1390 | static int |
| 1391 | test_htmlDocContentDumpOutput(void) { |
| 1392 | int ret = 0; |
| 1393 | |
| 1394 | |
| 1395 | /* missing type support */ |
| 1396 | return(ret); |
| 1397 | } |
| 1398 | |
| 1399 | |
| 1400 | static int |
| 1401 | test_htmlDocDump(void) { |
| 1402 | int ret = 0; |
| 1403 | |
| 1404 | |
| 1405 | /* missing type support */ |
| 1406 | return(ret); |
| 1407 | } |
| 1408 | |
| 1409 | |
| 1410 | static int |
| 1411 | test_htmlDocDumpMemory(void) { |
| 1412 | int ret = 0; |
| 1413 | |
| 1414 | |
| 1415 | /* missing type support */ |
| 1416 | return(ret); |
| 1417 | } |
| 1418 | |
| 1419 | |
| 1420 | static int |
| 1421 | test_htmlGetMetaEncoding(void) { |
| 1422 | int ret = 0; |
| 1423 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 1424 | #ifdef LIBXML_HTML_ENABLED |
| 1425 | int mem_base; |
| 1426 | const xmlChar * ret_val; |
| 1427 | htmlDocPtr doc; /* the document */ |
| 1428 | int n_doc; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1429 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 1430 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 1431 | mem_base = xmlMemBlocks(); |
| 1432 | doc = gen_xmlDocPtr(n_doc); |
| 1433 | |
| 1434 | ret_val = htmlGetMetaEncoding(doc); |
| 1435 | desret_const_xmlChar_ptr(ret_val); |
| 1436 | call_tests++; |
| 1437 | des_xmlDocPtr(n_doc, doc); |
| 1438 | xmlResetLastError(); |
| 1439 | if (mem_base != xmlMemBlocks()) { |
| 1440 | printf("Leak of %d blocks found in htmlGetMetaEncoding", |
| 1441 | xmlMemBlocks() - mem_base); |
| 1442 | ret++; |
| 1443 | printf(" %d", n_doc); |
| 1444 | printf("\n"); |
| 1445 | } |
| 1446 | } |
| 1447 | #endif |
| 1448 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1449 | return(ret); |
| 1450 | } |
| 1451 | |
| 1452 | |
| 1453 | static int |
| 1454 | test_htmlIsBooleanAttr(void) { |
| 1455 | int ret = 0; |
| 1456 | |
| 1457 | #ifdef LIBXML_HTML_ENABLED |
| 1458 | int mem_base; |
| 1459 | int ret_val; |
| 1460 | const xmlChar * name; /* the name of the attribute to check */ |
| 1461 | int n_name; |
| 1462 | |
| 1463 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 1464 | mem_base = xmlMemBlocks(); |
| 1465 | name = gen_const_xmlChar_ptr(n_name); |
| 1466 | |
| 1467 | ret_val = htmlIsBooleanAttr(name); |
| 1468 | desret_int(ret_val); |
| 1469 | call_tests++; |
| 1470 | des_const_xmlChar_ptr(n_name, name); |
| 1471 | xmlResetLastError(); |
| 1472 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1473 | printf("Leak of %d blocks found in htmlIsBooleanAttr", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1474 | xmlMemBlocks() - mem_base); |
| 1475 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1476 | printf(" %d", n_name); |
| 1477 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1478 | } |
| 1479 | } |
| 1480 | #endif |
| 1481 | |
| 1482 | return(ret); |
| 1483 | } |
| 1484 | |
| 1485 | |
| 1486 | static int |
| 1487 | test_htmlNewDoc(void) { |
| 1488 | int ret = 0; |
| 1489 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1490 | #ifdef LIBXML_HTML_ENABLED |
| 1491 | int mem_base; |
| 1492 | htmlDocPtr ret_val; |
| 1493 | const xmlChar * URI; /* URI for the dtd, or NULL */ |
| 1494 | int n_URI; |
| 1495 | const xmlChar * ExternalID; /* the external ID of the DTD, or NULL */ |
| 1496 | int n_ExternalID; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1497 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1498 | for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { |
| 1499 | for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { |
| 1500 | mem_base = xmlMemBlocks(); |
| 1501 | URI = gen_const_xmlChar_ptr(n_URI); |
| 1502 | ExternalID = gen_const_xmlChar_ptr(n_ExternalID); |
| 1503 | |
| 1504 | ret_val = htmlNewDoc(URI, ExternalID); |
| 1505 | desret_xmlDocPtr(ret_val); |
| 1506 | call_tests++; |
| 1507 | des_const_xmlChar_ptr(n_URI, URI); |
| 1508 | des_const_xmlChar_ptr(n_ExternalID, ExternalID); |
| 1509 | xmlResetLastError(); |
| 1510 | if (mem_base != xmlMemBlocks()) { |
| 1511 | printf("Leak of %d blocks found in htmlNewDoc", |
| 1512 | xmlMemBlocks() - mem_base); |
| 1513 | ret++; |
| 1514 | printf(" %d", n_URI); |
| 1515 | printf(" %d", n_ExternalID); |
| 1516 | printf("\n"); |
| 1517 | } |
| 1518 | } |
| 1519 | } |
| 1520 | #endif |
| 1521 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1522 | return(ret); |
| 1523 | } |
| 1524 | |
| 1525 | |
| 1526 | static int |
| 1527 | test_htmlNewDocNoDtD(void) { |
| 1528 | int ret = 0; |
| 1529 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1530 | #ifdef LIBXML_HTML_ENABLED |
| 1531 | int mem_base; |
| 1532 | htmlDocPtr ret_val; |
| 1533 | const xmlChar * URI; /* URI for the dtd, or NULL */ |
| 1534 | int n_URI; |
| 1535 | const xmlChar * ExternalID; /* the external ID of the DTD, or NULL */ |
| 1536 | int n_ExternalID; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1537 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1538 | for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { |
| 1539 | for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { |
| 1540 | mem_base = xmlMemBlocks(); |
| 1541 | URI = gen_const_xmlChar_ptr(n_URI); |
| 1542 | ExternalID = gen_const_xmlChar_ptr(n_ExternalID); |
| 1543 | |
| 1544 | ret_val = htmlNewDocNoDtD(URI, ExternalID); |
| 1545 | desret_xmlDocPtr(ret_val); |
| 1546 | call_tests++; |
| 1547 | des_const_xmlChar_ptr(n_URI, URI); |
| 1548 | des_const_xmlChar_ptr(n_ExternalID, ExternalID); |
| 1549 | xmlResetLastError(); |
| 1550 | if (mem_base != xmlMemBlocks()) { |
| 1551 | printf("Leak of %d blocks found in htmlNewDocNoDtD", |
| 1552 | xmlMemBlocks() - mem_base); |
| 1553 | ret++; |
| 1554 | printf(" %d", n_URI); |
| 1555 | printf(" %d", n_ExternalID); |
| 1556 | printf("\n"); |
| 1557 | } |
| 1558 | } |
| 1559 | } |
| 1560 | #endif |
| 1561 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1562 | return(ret); |
| 1563 | } |
| 1564 | |
| 1565 | |
| 1566 | static int |
| 1567 | test_htmlNodeDump(void) { |
| 1568 | int ret = 0; |
| 1569 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 1570 | #ifdef LIBXML_HTML_ENABLED |
| 1571 | #ifdef LIBXML_OUTPUT_ENABLED |
| 1572 | int mem_base; |
| 1573 | int ret_val; |
| 1574 | xmlBufferPtr buf; /* the HTML buffer output */ |
| 1575 | int n_buf; |
| 1576 | xmlDocPtr doc; /* the document */ |
| 1577 | int n_doc; |
| 1578 | xmlNodePtr cur; /* the current node */ |
| 1579 | int n_cur; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1580 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 1581 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 1582 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 1583 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 1584 | mem_base = xmlMemBlocks(); |
| 1585 | buf = gen_xmlBufferPtr(n_buf); |
| 1586 | doc = gen_xmlDocPtr(n_doc); |
| 1587 | cur = gen_xmlNodePtr(n_cur); |
| 1588 | |
| 1589 | ret_val = htmlNodeDump(buf, doc, cur); |
| 1590 | desret_int(ret_val); |
| 1591 | call_tests++; |
| 1592 | des_xmlBufferPtr(n_buf, buf); |
| 1593 | des_xmlDocPtr(n_doc, doc); |
| 1594 | des_xmlNodePtr(n_cur, cur); |
| 1595 | xmlResetLastError(); |
| 1596 | if (mem_base != xmlMemBlocks()) { |
| 1597 | printf("Leak of %d blocks found in htmlNodeDump", |
| 1598 | xmlMemBlocks() - mem_base); |
| 1599 | ret++; |
| 1600 | printf(" %d", n_buf); |
| 1601 | printf(" %d", n_doc); |
| 1602 | printf(" %d", n_cur); |
| 1603 | printf("\n"); |
| 1604 | } |
| 1605 | } |
| 1606 | } |
| 1607 | } |
| 1608 | #endif |
| 1609 | #endif |
| 1610 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1611 | return(ret); |
| 1612 | } |
| 1613 | |
| 1614 | |
| 1615 | static int |
| 1616 | test_htmlNodeDumpFile(void) { |
| 1617 | int ret = 0; |
| 1618 | |
| 1619 | |
| 1620 | /* missing type support */ |
| 1621 | return(ret); |
| 1622 | } |
| 1623 | |
| 1624 | |
| 1625 | static int |
| 1626 | test_htmlNodeDumpFileFormat(void) { |
| 1627 | int ret = 0; |
| 1628 | |
| 1629 | |
| 1630 | /* missing type support */ |
| 1631 | return(ret); |
| 1632 | } |
| 1633 | |
| 1634 | |
| 1635 | static int |
| 1636 | test_htmlNodeDumpFormatOutput(void) { |
| 1637 | int ret = 0; |
| 1638 | |
| 1639 | |
| 1640 | /* missing type support */ |
| 1641 | return(ret); |
| 1642 | } |
| 1643 | |
| 1644 | |
| 1645 | static int |
| 1646 | test_htmlNodeDumpOutput(void) { |
| 1647 | int ret = 0; |
| 1648 | |
| 1649 | |
| 1650 | /* missing type support */ |
| 1651 | return(ret); |
| 1652 | } |
| 1653 | |
| 1654 | |
| 1655 | static int |
| 1656 | test_htmlSaveFile(void) { |
| 1657 | int ret = 0; |
| 1658 | |
| 1659 | #ifdef LIBXML_HTML_ENABLED |
| 1660 | #ifdef LIBXML_OUTPUT_ENABLED |
| 1661 | int mem_base; |
| 1662 | int ret_val; |
| 1663 | const char * filename; /* the filename (or URL) */ |
| 1664 | int n_filename; |
| 1665 | xmlDocPtr cur; /* the document */ |
| 1666 | int n_cur; |
| 1667 | |
| 1668 | for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { |
| 1669 | for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { |
| 1670 | mem_base = xmlMemBlocks(); |
| 1671 | filename = gen_fileoutput(n_filename); |
| 1672 | cur = gen_xmlDocPtr(n_cur); |
| 1673 | |
| 1674 | ret_val = htmlSaveFile(filename, cur); |
| 1675 | desret_int(ret_val); |
| 1676 | call_tests++; |
| 1677 | des_fileoutput(n_filename, filename); |
| 1678 | des_xmlDocPtr(n_cur, cur); |
| 1679 | xmlResetLastError(); |
| 1680 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1681 | printf("Leak of %d blocks found in htmlSaveFile", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1682 | xmlMemBlocks() - mem_base); |
| 1683 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1684 | printf(" %d", n_filename); |
| 1685 | printf(" %d", n_cur); |
| 1686 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1687 | } |
| 1688 | } |
| 1689 | } |
| 1690 | #endif |
| 1691 | #endif |
| 1692 | |
| 1693 | return(ret); |
| 1694 | } |
| 1695 | |
| 1696 | |
| 1697 | static int |
| 1698 | test_htmlSaveFileEnc(void) { |
| 1699 | int ret = 0; |
| 1700 | |
| 1701 | #ifdef LIBXML_HTML_ENABLED |
| 1702 | #ifdef LIBXML_OUTPUT_ENABLED |
| 1703 | int mem_base; |
| 1704 | int ret_val; |
| 1705 | const char * filename; /* the filename */ |
| 1706 | int n_filename; |
| 1707 | xmlDocPtr cur; /* the document */ |
| 1708 | int n_cur; |
| 1709 | const char * encoding; /* the document encoding */ |
| 1710 | int n_encoding; |
| 1711 | |
| 1712 | for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { |
| 1713 | for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { |
| 1714 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 1715 | mem_base = xmlMemBlocks(); |
| 1716 | filename = gen_fileoutput(n_filename); |
| 1717 | cur = gen_xmlDocPtr(n_cur); |
| 1718 | encoding = gen_const_char_ptr(n_encoding); |
| 1719 | |
| 1720 | ret_val = htmlSaveFileEnc(filename, cur, encoding); |
| 1721 | desret_int(ret_val); |
| 1722 | call_tests++; |
| 1723 | des_fileoutput(n_filename, filename); |
| 1724 | des_xmlDocPtr(n_cur, cur); |
| 1725 | des_const_char_ptr(n_encoding, encoding); |
| 1726 | xmlResetLastError(); |
| 1727 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1728 | printf("Leak of %d blocks found in htmlSaveFileEnc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1729 | xmlMemBlocks() - mem_base); |
| 1730 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1731 | printf(" %d", n_filename); |
| 1732 | printf(" %d", n_cur); |
| 1733 | printf(" %d", n_encoding); |
| 1734 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1735 | } |
| 1736 | } |
| 1737 | } |
| 1738 | } |
| 1739 | #endif |
| 1740 | #endif |
| 1741 | |
| 1742 | return(ret); |
| 1743 | } |
| 1744 | |
| 1745 | |
| 1746 | static int |
| 1747 | test_htmlSaveFileFormat(void) { |
| 1748 | int ret = 0; |
| 1749 | |
| 1750 | #ifdef LIBXML_HTML_ENABLED |
| 1751 | #ifdef LIBXML_OUTPUT_ENABLED |
| 1752 | int mem_base; |
| 1753 | int ret_val; |
| 1754 | const char * filename; /* the filename */ |
| 1755 | int n_filename; |
| 1756 | xmlDocPtr cur; /* the document */ |
| 1757 | int n_cur; |
| 1758 | const char * encoding; /* the document encoding */ |
| 1759 | int n_encoding; |
| 1760 | int format; /* should formatting spaces been added */ |
| 1761 | int n_format; |
| 1762 | |
| 1763 | for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { |
| 1764 | for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { |
| 1765 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 1766 | for (n_format = 0;n_format < gen_nb_int;n_format++) { |
| 1767 | mem_base = xmlMemBlocks(); |
| 1768 | filename = gen_fileoutput(n_filename); |
| 1769 | cur = gen_xmlDocPtr(n_cur); |
| 1770 | encoding = gen_const_char_ptr(n_encoding); |
| 1771 | format = gen_int(n_format); |
| 1772 | |
| 1773 | ret_val = htmlSaveFileFormat(filename, cur, encoding, format); |
| 1774 | desret_int(ret_val); |
| 1775 | call_tests++; |
| 1776 | des_fileoutput(n_filename, filename); |
| 1777 | des_xmlDocPtr(n_cur, cur); |
| 1778 | des_const_char_ptr(n_encoding, encoding); |
| 1779 | des_int(n_format, format); |
| 1780 | xmlResetLastError(); |
| 1781 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1782 | printf("Leak of %d blocks found in htmlSaveFileFormat", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1783 | xmlMemBlocks() - mem_base); |
| 1784 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1785 | printf(" %d", n_filename); |
| 1786 | printf(" %d", n_cur); |
| 1787 | printf(" %d", n_encoding); |
| 1788 | printf(" %d", n_format); |
| 1789 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1790 | } |
| 1791 | } |
| 1792 | } |
| 1793 | } |
| 1794 | } |
| 1795 | #endif |
| 1796 | #endif |
| 1797 | |
| 1798 | return(ret); |
| 1799 | } |
| 1800 | |
| 1801 | |
| 1802 | static int |
| 1803 | test_htmlSetMetaEncoding(void) { |
| 1804 | int ret = 0; |
| 1805 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1806 | #ifdef LIBXML_HTML_ENABLED |
| 1807 | int mem_base; |
| 1808 | int ret_val; |
| 1809 | htmlDocPtr doc; /* the document */ |
| 1810 | int n_doc; |
| 1811 | const xmlChar * encoding; /* the encoding string */ |
| 1812 | int n_encoding; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1813 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 1814 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 1815 | for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) { |
| 1816 | mem_base = xmlMemBlocks(); |
| 1817 | doc = gen_xmlDocPtr(n_doc); |
| 1818 | encoding = gen_const_xmlChar_ptr(n_encoding); |
| 1819 | |
| 1820 | ret_val = htmlSetMetaEncoding(doc, encoding); |
| 1821 | desret_int(ret_val); |
| 1822 | call_tests++; |
| 1823 | des_xmlDocPtr(n_doc, doc); |
| 1824 | des_const_xmlChar_ptr(n_encoding, encoding); |
| 1825 | xmlResetLastError(); |
| 1826 | if (mem_base != xmlMemBlocks()) { |
| 1827 | printf("Leak of %d blocks found in htmlSetMetaEncoding", |
| 1828 | xmlMemBlocks() - mem_base); |
| 1829 | ret++; |
| 1830 | printf(" %d", n_doc); |
| 1831 | printf(" %d", n_encoding); |
| 1832 | printf("\n"); |
| 1833 | } |
| 1834 | } |
| 1835 | } |
| 1836 | #endif |
| 1837 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 1838 | return(ret); |
| 1839 | } |
| 1840 | |
| 1841 | static int |
| 1842 | test_HTMLtree(void) { |
| 1843 | int ret = 0; |
| 1844 | |
| 1845 | printf("Testing HTMLtree ...\n"); |
| 1846 | ret += test_htmlDocContentDumpFormatOutput(); |
| 1847 | ret += test_htmlDocContentDumpOutput(); |
| 1848 | ret += test_htmlDocDump(); |
| 1849 | ret += test_htmlDocDumpMemory(); |
| 1850 | ret += test_htmlGetMetaEncoding(); |
| 1851 | ret += test_htmlIsBooleanAttr(); |
| 1852 | ret += test_htmlNewDoc(); |
| 1853 | ret += test_htmlNewDocNoDtD(); |
| 1854 | ret += test_htmlNodeDump(); |
| 1855 | ret += test_htmlNodeDumpFile(); |
| 1856 | ret += test_htmlNodeDumpFileFormat(); |
| 1857 | ret += test_htmlNodeDumpFormatOutput(); |
| 1858 | ret += test_htmlNodeDumpOutput(); |
| 1859 | ret += test_htmlSaveFile(); |
| 1860 | ret += test_htmlSaveFileEnc(); |
| 1861 | ret += test_htmlSaveFileFormat(); |
| 1862 | ret += test_htmlSetMetaEncoding(); |
| 1863 | |
| 1864 | if (ret != 0) |
| 1865 | printf("Module HTMLtree: %d errors\n", ret); |
| 1866 | return(ret); |
| 1867 | } |
| 1868 | |
| 1869 | static int |
| 1870 | test_xmlC14NDocDumpMemory(void) { |
| 1871 | int ret = 0; |
| 1872 | |
| 1873 | |
| 1874 | /* missing type support */ |
| 1875 | return(ret); |
| 1876 | } |
| 1877 | |
| 1878 | |
| 1879 | static int |
| 1880 | test_xmlC14NDocSave(void) { |
| 1881 | int ret = 0; |
| 1882 | |
| 1883 | |
| 1884 | /* missing type support */ |
| 1885 | return(ret); |
| 1886 | } |
| 1887 | |
| 1888 | |
| 1889 | static int |
| 1890 | test_xmlC14NDocSaveTo(void) { |
| 1891 | int ret = 0; |
| 1892 | |
| 1893 | |
| 1894 | /* missing type support */ |
| 1895 | return(ret); |
| 1896 | } |
| 1897 | |
| 1898 | |
| 1899 | static int |
| 1900 | test_xmlC14NExecute(void) { |
| 1901 | int ret = 0; |
| 1902 | |
| 1903 | |
| 1904 | /* missing type support */ |
| 1905 | return(ret); |
| 1906 | } |
| 1907 | |
| 1908 | static int |
| 1909 | test_c14n(void) { |
| 1910 | int ret = 0; |
| 1911 | |
| 1912 | printf("Testing c14n ...\n"); |
| 1913 | ret += test_xmlC14NDocDumpMemory(); |
| 1914 | ret += test_xmlC14NDocSave(); |
| 1915 | ret += test_xmlC14NDocSaveTo(); |
| 1916 | ret += test_xmlC14NExecute(); |
| 1917 | |
| 1918 | if (ret != 0) |
| 1919 | printf("Module c14n: %d errors\n", ret); |
| 1920 | return(ret); |
| 1921 | } |
| 1922 | |
| 1923 | static int |
| 1924 | test_xmlACatalogAdd(void) { |
| 1925 | int ret = 0; |
| 1926 | |
| 1927 | |
| 1928 | /* missing type support */ |
| 1929 | return(ret); |
| 1930 | } |
| 1931 | |
| 1932 | |
| 1933 | static int |
| 1934 | test_xmlACatalogDump(void) { |
| 1935 | int ret = 0; |
| 1936 | |
| 1937 | |
| 1938 | /* missing type support */ |
| 1939 | return(ret); |
| 1940 | } |
| 1941 | |
| 1942 | |
| 1943 | static int |
| 1944 | test_xmlACatalogRemove(void) { |
| 1945 | int ret = 0; |
| 1946 | |
| 1947 | |
| 1948 | /* missing type support */ |
| 1949 | return(ret); |
| 1950 | } |
| 1951 | |
| 1952 | |
| 1953 | static int |
| 1954 | test_xmlACatalogResolve(void) { |
| 1955 | int ret = 0; |
| 1956 | |
| 1957 | |
| 1958 | /* missing type support */ |
| 1959 | return(ret); |
| 1960 | } |
| 1961 | |
| 1962 | |
| 1963 | static int |
| 1964 | test_xmlACatalogResolvePublic(void) { |
| 1965 | int ret = 0; |
| 1966 | |
| 1967 | |
| 1968 | /* missing type support */ |
| 1969 | return(ret); |
| 1970 | } |
| 1971 | |
| 1972 | |
| 1973 | static int |
| 1974 | test_xmlACatalogResolveSystem(void) { |
| 1975 | int ret = 0; |
| 1976 | |
| 1977 | |
| 1978 | /* missing type support */ |
| 1979 | return(ret); |
| 1980 | } |
| 1981 | |
| 1982 | |
| 1983 | static int |
| 1984 | test_xmlACatalogResolveURI(void) { |
| 1985 | int ret = 0; |
| 1986 | |
| 1987 | |
| 1988 | /* missing type support */ |
| 1989 | return(ret); |
| 1990 | } |
| 1991 | |
| 1992 | |
| 1993 | static int |
| 1994 | test_xmlCatalogAdd(void) { |
| 1995 | int ret = 0; |
| 1996 | |
| 1997 | #ifdef LIBXML_CATALOG_ENABLED |
| 1998 | int mem_base; |
| 1999 | int ret_val; |
| 2000 | const xmlChar * type; /* the type of record to add to the catalog */ |
| 2001 | int n_type; |
| 2002 | const xmlChar * orig; /* the system, public or prefix to match */ |
| 2003 | int n_orig; |
| 2004 | const xmlChar * replace; /* the replacement value for the match */ |
| 2005 | int n_replace; |
| 2006 | |
| 2007 | for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) { |
| 2008 | for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) { |
| 2009 | for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) { |
| 2010 | mem_base = xmlMemBlocks(); |
| 2011 | type = gen_const_xmlChar_ptr(n_type); |
| 2012 | orig = gen_const_xmlChar_ptr(n_orig); |
| 2013 | replace = gen_const_xmlChar_ptr(n_replace); |
| 2014 | |
| 2015 | ret_val = xmlCatalogAdd(type, orig, replace); |
| 2016 | desret_int(ret_val); |
| 2017 | call_tests++; |
| 2018 | des_const_xmlChar_ptr(n_type, type); |
| 2019 | des_const_xmlChar_ptr(n_orig, orig); |
| 2020 | des_const_xmlChar_ptr(n_replace, replace); |
| 2021 | xmlResetLastError(); |
| 2022 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2023 | printf("Leak of %d blocks found in xmlCatalogAdd", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2024 | xmlMemBlocks() - mem_base); |
| 2025 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2026 | printf(" %d", n_type); |
| 2027 | printf(" %d", n_orig); |
| 2028 | printf(" %d", n_replace); |
| 2029 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2030 | } |
| 2031 | } |
| 2032 | } |
| 2033 | } |
| 2034 | #endif |
| 2035 | |
| 2036 | return(ret); |
| 2037 | } |
| 2038 | |
| 2039 | |
| 2040 | static int |
| 2041 | test_xmlCatalogAddLocal(void) { |
| 2042 | int ret = 0; |
| 2043 | |
| 2044 | |
| 2045 | /* missing type support */ |
| 2046 | return(ret); |
| 2047 | } |
| 2048 | |
| 2049 | |
| 2050 | static int |
| 2051 | test_xmlCatalogCleanup(void) { |
| 2052 | int ret = 0; |
| 2053 | |
| 2054 | #ifdef LIBXML_CATALOG_ENABLED |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2055 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2056 | |
| 2057 | xmlCatalogCleanup(); |
| 2058 | call_tests++; |
| 2059 | xmlResetLastError(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2060 | #endif |
| 2061 | |
| 2062 | return(ret); |
| 2063 | } |
| 2064 | |
| 2065 | |
| 2066 | static int |
| 2067 | test_xmlCatalogConvert(void) { |
| 2068 | int ret = 0; |
| 2069 | |
| 2070 | #ifdef LIBXML_CATALOG_ENABLED |
| 2071 | int ret_val; |
| 2072 | |
| 2073 | |
| 2074 | ret_val = xmlCatalogConvert(); |
| 2075 | desret_int(ret_val); |
| 2076 | call_tests++; |
| 2077 | xmlResetLastError(); |
| 2078 | #endif |
| 2079 | |
| 2080 | return(ret); |
| 2081 | } |
| 2082 | |
| 2083 | |
| 2084 | static int |
| 2085 | test_xmlCatalogDump(void) { |
| 2086 | int ret = 0; |
| 2087 | |
| 2088 | |
| 2089 | /* missing type support */ |
| 2090 | return(ret); |
| 2091 | } |
| 2092 | |
| 2093 | |
| 2094 | static int |
| 2095 | test_xmlCatalogGetDefaults(void) { |
| 2096 | int ret = 0; |
| 2097 | |
| 2098 | |
| 2099 | /* missing type support */ |
| 2100 | return(ret); |
| 2101 | } |
| 2102 | |
| 2103 | |
| 2104 | static int |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2105 | test_xmlCatalogIsEmpty(void) { |
| 2106 | int ret = 0; |
| 2107 | |
| 2108 | |
| 2109 | /* missing type support */ |
| 2110 | return(ret); |
| 2111 | } |
| 2112 | |
| 2113 | |
| 2114 | static int |
| 2115 | test_xmlCatalogLocalResolve(void) { |
| 2116 | int ret = 0; |
| 2117 | |
| 2118 | |
| 2119 | /* missing type support */ |
| 2120 | return(ret); |
| 2121 | } |
| 2122 | |
| 2123 | |
| 2124 | static int |
| 2125 | test_xmlCatalogLocalResolveURI(void) { |
| 2126 | int ret = 0; |
| 2127 | |
| 2128 | |
| 2129 | /* missing type support */ |
| 2130 | return(ret); |
| 2131 | } |
| 2132 | |
| 2133 | |
| 2134 | static int |
| 2135 | test_xmlCatalogRemove(void) { |
| 2136 | int ret = 0; |
| 2137 | |
| 2138 | #ifdef LIBXML_CATALOG_ENABLED |
| 2139 | int ret_val; |
| 2140 | const xmlChar * value; /* the value to remove */ |
| 2141 | int n_value; |
| 2142 | |
| 2143 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 2144 | value = gen_const_xmlChar_ptr(n_value); |
| 2145 | |
| 2146 | ret_val = xmlCatalogRemove(value); |
| 2147 | desret_int(ret_val); |
| 2148 | call_tests++; |
| 2149 | des_const_xmlChar_ptr(n_value, value); |
| 2150 | xmlResetLastError(); |
| 2151 | } |
| 2152 | #endif |
| 2153 | |
| 2154 | return(ret); |
| 2155 | } |
| 2156 | |
| 2157 | |
| 2158 | static int |
| 2159 | test_xmlCatalogResolve(void) { |
| 2160 | int ret = 0; |
| 2161 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 2162 | #ifdef LIBXML_CATALOG_ENABLED |
| 2163 | int mem_base; |
| 2164 | xmlChar * ret_val; |
| 2165 | const xmlChar * pubID; /* the public ID string */ |
| 2166 | int n_pubID; |
| 2167 | const xmlChar * sysID; /* the system ID string */ |
| 2168 | int n_sysID; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2169 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 2170 | for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { |
| 2171 | for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { |
| 2172 | mem_base = xmlMemBlocks(); |
| 2173 | pubID = gen_const_xmlChar_ptr(n_pubID); |
| 2174 | sysID = gen_const_xmlChar_ptr(n_sysID); |
| 2175 | |
| 2176 | ret_val = xmlCatalogResolve(pubID, sysID); |
| 2177 | desret_xmlChar_ptr(ret_val); |
| 2178 | call_tests++; |
| 2179 | des_const_xmlChar_ptr(n_pubID, pubID); |
| 2180 | des_const_xmlChar_ptr(n_sysID, sysID); |
| 2181 | xmlResetLastError(); |
| 2182 | if (mem_base != xmlMemBlocks()) { |
| 2183 | printf("Leak of %d blocks found in xmlCatalogResolve", |
| 2184 | xmlMemBlocks() - mem_base); |
| 2185 | ret++; |
| 2186 | printf(" %d", n_pubID); |
| 2187 | printf(" %d", n_sysID); |
| 2188 | printf("\n"); |
| 2189 | } |
| 2190 | } |
| 2191 | } |
| 2192 | #endif |
| 2193 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2194 | return(ret); |
| 2195 | } |
| 2196 | |
| 2197 | |
| 2198 | static int |
| 2199 | test_xmlCatalogResolvePublic(void) { |
| 2200 | int ret = 0; |
| 2201 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 2202 | #ifdef LIBXML_CATALOG_ENABLED |
| 2203 | int mem_base; |
| 2204 | xmlChar * ret_val; |
| 2205 | const xmlChar * pubID; /* the public ID string */ |
| 2206 | int n_pubID; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2207 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 2208 | for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { |
| 2209 | mem_base = xmlMemBlocks(); |
| 2210 | pubID = gen_const_xmlChar_ptr(n_pubID); |
| 2211 | |
| 2212 | ret_val = xmlCatalogResolvePublic(pubID); |
| 2213 | desret_xmlChar_ptr(ret_val); |
| 2214 | call_tests++; |
| 2215 | des_const_xmlChar_ptr(n_pubID, pubID); |
| 2216 | xmlResetLastError(); |
| 2217 | if (mem_base != xmlMemBlocks()) { |
| 2218 | printf("Leak of %d blocks found in xmlCatalogResolvePublic", |
| 2219 | xmlMemBlocks() - mem_base); |
| 2220 | ret++; |
| 2221 | printf(" %d", n_pubID); |
| 2222 | printf("\n"); |
| 2223 | } |
| 2224 | } |
| 2225 | #endif |
| 2226 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2227 | return(ret); |
| 2228 | } |
| 2229 | |
| 2230 | |
| 2231 | static int |
| 2232 | test_xmlCatalogResolveSystem(void) { |
| 2233 | int ret = 0; |
| 2234 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 2235 | #ifdef LIBXML_CATALOG_ENABLED |
| 2236 | int mem_base; |
| 2237 | xmlChar * ret_val; |
| 2238 | const xmlChar * sysID; /* the system ID string */ |
| 2239 | int n_sysID; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2240 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 2241 | for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { |
| 2242 | mem_base = xmlMemBlocks(); |
| 2243 | sysID = gen_const_xmlChar_ptr(n_sysID); |
| 2244 | |
| 2245 | ret_val = xmlCatalogResolveSystem(sysID); |
| 2246 | desret_xmlChar_ptr(ret_val); |
| 2247 | call_tests++; |
| 2248 | des_const_xmlChar_ptr(n_sysID, sysID); |
| 2249 | xmlResetLastError(); |
| 2250 | if (mem_base != xmlMemBlocks()) { |
| 2251 | printf("Leak of %d blocks found in xmlCatalogResolveSystem", |
| 2252 | xmlMemBlocks() - mem_base); |
| 2253 | ret++; |
| 2254 | printf(" %d", n_sysID); |
| 2255 | printf("\n"); |
| 2256 | } |
| 2257 | } |
| 2258 | #endif |
| 2259 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2260 | return(ret); |
| 2261 | } |
| 2262 | |
| 2263 | |
| 2264 | static int |
| 2265 | test_xmlCatalogResolveURI(void) { |
| 2266 | int ret = 0; |
| 2267 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 2268 | #ifdef LIBXML_CATALOG_ENABLED |
| 2269 | int mem_base; |
| 2270 | xmlChar * ret_val; |
| 2271 | const xmlChar * URI; /* the URI */ |
| 2272 | int n_URI; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2273 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 2274 | for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { |
| 2275 | mem_base = xmlMemBlocks(); |
| 2276 | URI = gen_const_xmlChar_ptr(n_URI); |
| 2277 | |
| 2278 | ret_val = xmlCatalogResolveURI(URI); |
| 2279 | desret_xmlChar_ptr(ret_val); |
| 2280 | call_tests++; |
| 2281 | des_const_xmlChar_ptr(n_URI, URI); |
| 2282 | xmlResetLastError(); |
| 2283 | if (mem_base != xmlMemBlocks()) { |
| 2284 | printf("Leak of %d blocks found in xmlCatalogResolveURI", |
| 2285 | xmlMemBlocks() - mem_base); |
| 2286 | ret++; |
| 2287 | printf(" %d", n_URI); |
| 2288 | printf("\n"); |
| 2289 | } |
| 2290 | } |
| 2291 | #endif |
| 2292 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2293 | return(ret); |
| 2294 | } |
| 2295 | |
| 2296 | |
| 2297 | static int |
| 2298 | test_xmlCatalogSetDebug(void) { |
| 2299 | int ret = 0; |
| 2300 | |
| 2301 | #ifdef LIBXML_CATALOG_ENABLED |
| 2302 | int mem_base; |
| 2303 | int ret_val; |
| 2304 | int level; /* the debug level of catalogs required */ |
| 2305 | int n_level; |
| 2306 | |
| 2307 | for (n_level = 0;n_level < gen_nb_int;n_level++) { |
| 2308 | mem_base = xmlMemBlocks(); |
| 2309 | level = gen_int(n_level); |
| 2310 | |
| 2311 | ret_val = xmlCatalogSetDebug(level); |
| 2312 | desret_int(ret_val); |
| 2313 | call_tests++; |
| 2314 | des_int(n_level, level); |
| 2315 | xmlResetLastError(); |
| 2316 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2317 | printf("Leak of %d blocks found in xmlCatalogSetDebug", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2318 | xmlMemBlocks() - mem_base); |
| 2319 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2320 | printf(" %d", n_level); |
| 2321 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2322 | } |
| 2323 | } |
| 2324 | #endif |
| 2325 | |
| 2326 | return(ret); |
| 2327 | } |
| 2328 | |
| 2329 | |
| 2330 | static int |
| 2331 | test_xmlCatalogSetDefaultPrefer(void) { |
| 2332 | int ret = 0; |
| 2333 | |
| 2334 | |
| 2335 | /* missing type support */ |
| 2336 | return(ret); |
| 2337 | } |
| 2338 | |
| 2339 | |
| 2340 | static int |
| 2341 | test_xmlCatalogSetDefaults(void) { |
| 2342 | int ret = 0; |
| 2343 | |
| 2344 | |
| 2345 | /* missing type support */ |
| 2346 | return(ret); |
| 2347 | } |
| 2348 | |
| 2349 | |
| 2350 | static int |
| 2351 | test_xmlConvertSGMLCatalog(void) { |
| 2352 | int ret = 0; |
| 2353 | |
| 2354 | |
| 2355 | /* missing type support */ |
| 2356 | return(ret); |
| 2357 | } |
| 2358 | |
| 2359 | |
| 2360 | static int |
| 2361 | test_xmlInitializeCatalog(void) { |
| 2362 | int ret = 0; |
| 2363 | |
| 2364 | #ifdef LIBXML_CATALOG_ENABLED |
| 2365 | int mem_base; |
| 2366 | |
| 2367 | mem_base = xmlMemBlocks(); |
| 2368 | |
| 2369 | xmlInitializeCatalog(); |
| 2370 | call_tests++; |
| 2371 | xmlResetLastError(); |
| 2372 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2373 | printf("Leak of %d blocks found in xmlInitializeCatalog", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2374 | xmlMemBlocks() - mem_base); |
| 2375 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2376 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2377 | } |
| 2378 | #endif |
| 2379 | |
| 2380 | return(ret); |
| 2381 | } |
| 2382 | |
| 2383 | |
| 2384 | static int |
| 2385 | test_xmlLoadACatalog(void) { |
| 2386 | int ret = 0; |
| 2387 | |
| 2388 | |
| 2389 | /* missing type support */ |
| 2390 | return(ret); |
| 2391 | } |
| 2392 | |
| 2393 | |
| 2394 | static int |
| 2395 | test_xmlLoadCatalog(void) { |
| 2396 | int ret = 0; |
| 2397 | |
| 2398 | #ifdef LIBXML_CATALOG_ENABLED |
| 2399 | int ret_val; |
| 2400 | const char * filename; /* a file path */ |
| 2401 | int n_filename; |
| 2402 | |
| 2403 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 2404 | filename = gen_filepath(n_filename); |
| 2405 | |
| 2406 | ret_val = xmlLoadCatalog(filename); |
| 2407 | desret_int(ret_val); |
| 2408 | call_tests++; |
| 2409 | des_filepath(n_filename, filename); |
| 2410 | xmlResetLastError(); |
| 2411 | } |
| 2412 | #endif |
| 2413 | |
| 2414 | return(ret); |
| 2415 | } |
| 2416 | |
| 2417 | |
| 2418 | static int |
| 2419 | test_xmlLoadCatalogs(void) { |
| 2420 | int ret = 0; |
| 2421 | |
| 2422 | #ifdef LIBXML_CATALOG_ENABLED |
| 2423 | const char * pathss; /* a list of directories separated by a colon or a space. */ |
| 2424 | int n_pathss; |
| 2425 | |
| 2426 | for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) { |
| 2427 | pathss = gen_const_char_ptr(n_pathss); |
| 2428 | |
| 2429 | xmlLoadCatalogs(pathss); |
| 2430 | call_tests++; |
| 2431 | des_const_char_ptr(n_pathss, pathss); |
| 2432 | xmlResetLastError(); |
| 2433 | } |
| 2434 | #endif |
| 2435 | |
| 2436 | return(ret); |
| 2437 | } |
| 2438 | |
| 2439 | |
| 2440 | static int |
| 2441 | test_xmlLoadSGMLSuperCatalog(void) { |
| 2442 | int ret = 0; |
| 2443 | |
| 2444 | |
| 2445 | /* missing type support */ |
| 2446 | return(ret); |
| 2447 | } |
| 2448 | |
| 2449 | |
| 2450 | static int |
| 2451 | test_xmlNewCatalog(void) { |
| 2452 | int ret = 0; |
| 2453 | |
| 2454 | |
| 2455 | /* missing type support */ |
| 2456 | return(ret); |
| 2457 | } |
| 2458 | |
| 2459 | |
| 2460 | static int |
| 2461 | test_xmlParseCatalogFile(void) { |
| 2462 | int ret = 0; |
| 2463 | |
| 2464 | #ifdef LIBXML_CATALOG_ENABLED |
| 2465 | int mem_base; |
| 2466 | xmlDocPtr ret_val; |
| 2467 | const char * filename; /* the filename */ |
| 2468 | int n_filename; |
| 2469 | |
| 2470 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 2471 | mem_base = xmlMemBlocks(); |
| 2472 | filename = gen_filepath(n_filename); |
| 2473 | |
| 2474 | ret_val = xmlParseCatalogFile(filename); |
| 2475 | desret_xmlDocPtr(ret_val); |
| 2476 | call_tests++; |
| 2477 | des_filepath(n_filename, filename); |
| 2478 | xmlResetLastError(); |
| 2479 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2480 | printf("Leak of %d blocks found in xmlParseCatalogFile", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2481 | xmlMemBlocks() - mem_base); |
| 2482 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2483 | printf(" %d", n_filename); |
| 2484 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2485 | } |
| 2486 | } |
| 2487 | #endif |
| 2488 | |
| 2489 | return(ret); |
| 2490 | } |
| 2491 | |
| 2492 | static int |
| 2493 | test_catalog(void) { |
| 2494 | int ret = 0; |
| 2495 | |
| 2496 | printf("Testing catalog ...\n"); |
| 2497 | ret += test_xmlACatalogAdd(); |
| 2498 | ret += test_xmlACatalogDump(); |
| 2499 | ret += test_xmlACatalogRemove(); |
| 2500 | ret += test_xmlACatalogResolve(); |
| 2501 | ret += test_xmlACatalogResolvePublic(); |
| 2502 | ret += test_xmlACatalogResolveSystem(); |
| 2503 | ret += test_xmlACatalogResolveURI(); |
| 2504 | ret += test_xmlCatalogAdd(); |
| 2505 | ret += test_xmlCatalogAddLocal(); |
| 2506 | ret += test_xmlCatalogCleanup(); |
| 2507 | ret += test_xmlCatalogConvert(); |
| 2508 | ret += test_xmlCatalogDump(); |
| 2509 | ret += test_xmlCatalogGetDefaults(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2510 | ret += test_xmlCatalogIsEmpty(); |
| 2511 | ret += test_xmlCatalogLocalResolve(); |
| 2512 | ret += test_xmlCatalogLocalResolveURI(); |
| 2513 | ret += test_xmlCatalogRemove(); |
| 2514 | ret += test_xmlCatalogResolve(); |
| 2515 | ret += test_xmlCatalogResolvePublic(); |
| 2516 | ret += test_xmlCatalogResolveSystem(); |
| 2517 | ret += test_xmlCatalogResolveURI(); |
| 2518 | ret += test_xmlCatalogSetDebug(); |
| 2519 | ret += test_xmlCatalogSetDefaultPrefer(); |
| 2520 | ret += test_xmlCatalogSetDefaults(); |
| 2521 | ret += test_xmlConvertSGMLCatalog(); |
| 2522 | ret += test_xmlInitializeCatalog(); |
| 2523 | ret += test_xmlLoadACatalog(); |
| 2524 | ret += test_xmlLoadCatalog(); |
| 2525 | ret += test_xmlLoadCatalogs(); |
| 2526 | ret += test_xmlLoadSGMLSuperCatalog(); |
| 2527 | ret += test_xmlNewCatalog(); |
| 2528 | ret += test_xmlParseCatalogFile(); |
| 2529 | |
| 2530 | if (ret != 0) |
| 2531 | printf("Module catalog: %d errors\n", ret); |
| 2532 | return(ret); |
| 2533 | } |
| 2534 | |
| 2535 | static int |
| 2536 | test_xmlCharInRange(void) { |
| 2537 | int ret = 0; |
| 2538 | |
| 2539 | |
| 2540 | /* missing type support */ |
| 2541 | return(ret); |
| 2542 | } |
| 2543 | |
| 2544 | |
| 2545 | static int |
| 2546 | test_xmlIsBaseChar(void) { |
| 2547 | int ret = 0; |
| 2548 | |
| 2549 | |
| 2550 | /* missing type support */ |
| 2551 | return(ret); |
| 2552 | } |
| 2553 | |
| 2554 | |
| 2555 | static int |
| 2556 | test_xmlIsBlank(void) { |
| 2557 | int ret = 0; |
| 2558 | |
| 2559 | |
| 2560 | /* missing type support */ |
| 2561 | return(ret); |
| 2562 | } |
| 2563 | |
| 2564 | |
| 2565 | static int |
| 2566 | test_xmlIsChar(void) { |
| 2567 | int ret = 0; |
| 2568 | |
| 2569 | |
| 2570 | /* missing type support */ |
| 2571 | return(ret); |
| 2572 | } |
| 2573 | |
| 2574 | |
| 2575 | static int |
| 2576 | test_xmlIsCombining(void) { |
| 2577 | int ret = 0; |
| 2578 | |
| 2579 | |
| 2580 | /* missing type support */ |
| 2581 | return(ret); |
| 2582 | } |
| 2583 | |
| 2584 | |
| 2585 | static int |
| 2586 | test_xmlIsDigit(void) { |
| 2587 | int ret = 0; |
| 2588 | |
| 2589 | |
| 2590 | /* missing type support */ |
| 2591 | return(ret); |
| 2592 | } |
| 2593 | |
| 2594 | |
| 2595 | static int |
| 2596 | test_xmlIsExtender(void) { |
| 2597 | int ret = 0; |
| 2598 | |
| 2599 | |
| 2600 | /* missing type support */ |
| 2601 | return(ret); |
| 2602 | } |
| 2603 | |
| 2604 | |
| 2605 | static int |
| 2606 | test_xmlIsIdeographic(void) { |
| 2607 | int ret = 0; |
| 2608 | |
| 2609 | |
| 2610 | /* missing type support */ |
| 2611 | return(ret); |
| 2612 | } |
| 2613 | |
| 2614 | |
| 2615 | static int |
| 2616 | test_xmlIsPubidChar(void) { |
| 2617 | int ret = 0; |
| 2618 | |
| 2619 | |
| 2620 | /* missing type support */ |
| 2621 | return(ret); |
| 2622 | } |
| 2623 | |
| 2624 | static int |
| 2625 | test_chvalid(void) { |
| 2626 | int ret = 0; |
| 2627 | |
| 2628 | printf("Testing chvalid ...\n"); |
| 2629 | ret += test_xmlCharInRange(); |
| 2630 | ret += test_xmlIsBaseChar(); |
| 2631 | ret += test_xmlIsBlank(); |
| 2632 | ret += test_xmlIsChar(); |
| 2633 | ret += test_xmlIsCombining(); |
| 2634 | ret += test_xmlIsDigit(); |
| 2635 | ret += test_xmlIsExtender(); |
| 2636 | ret += test_xmlIsIdeographic(); |
| 2637 | ret += test_xmlIsPubidChar(); |
| 2638 | |
| 2639 | if (ret != 0) |
| 2640 | printf("Module chvalid: %d errors\n", ret); |
| 2641 | return(ret); |
| 2642 | } |
| 2643 | |
| 2644 | static int |
| 2645 | test_xmlDictCreate(void) { |
| 2646 | int ret = 0; |
| 2647 | |
| 2648 | |
| 2649 | /* missing type support */ |
| 2650 | return(ret); |
| 2651 | } |
| 2652 | |
| 2653 | |
| 2654 | static int |
| 2655 | test_xmlDictCreateSub(void) { |
| 2656 | int ret = 0; |
| 2657 | |
| 2658 | |
| 2659 | /* missing type support */ |
| 2660 | return(ret); |
| 2661 | } |
| 2662 | |
| 2663 | |
| 2664 | static int |
| 2665 | test_xmlDictLookup(void) { |
| 2666 | int ret = 0; |
| 2667 | |
| 2668 | |
| 2669 | /* missing type support */ |
| 2670 | return(ret); |
| 2671 | } |
| 2672 | |
| 2673 | |
| 2674 | static int |
| 2675 | test_xmlDictOwns(void) { |
| 2676 | int ret = 0; |
| 2677 | |
| 2678 | |
| 2679 | /* missing type support */ |
| 2680 | return(ret); |
| 2681 | } |
| 2682 | |
| 2683 | |
| 2684 | static int |
| 2685 | test_xmlDictQLookup(void) { |
| 2686 | int ret = 0; |
| 2687 | |
| 2688 | |
| 2689 | /* missing type support */ |
| 2690 | return(ret); |
| 2691 | } |
| 2692 | |
| 2693 | |
| 2694 | static int |
| 2695 | test_xmlDictReference(void) { |
| 2696 | int ret = 0; |
| 2697 | |
| 2698 | |
| 2699 | /* missing type support */ |
| 2700 | return(ret); |
| 2701 | } |
| 2702 | |
| 2703 | |
| 2704 | static int |
| 2705 | test_xmlDictSize(void) { |
| 2706 | int ret = 0; |
| 2707 | |
| 2708 | |
| 2709 | /* missing type support */ |
| 2710 | return(ret); |
| 2711 | } |
| 2712 | |
| 2713 | static int |
| 2714 | test_dict(void) { |
| 2715 | int ret = 0; |
| 2716 | |
| 2717 | printf("Testing dict ...\n"); |
| 2718 | ret += test_xmlDictCreate(); |
| 2719 | ret += test_xmlDictCreateSub(); |
| 2720 | ret += test_xmlDictLookup(); |
| 2721 | ret += test_xmlDictOwns(); |
| 2722 | ret += test_xmlDictQLookup(); |
| 2723 | ret += test_xmlDictReference(); |
| 2724 | ret += test_xmlDictSize(); |
| 2725 | |
| 2726 | if (ret != 0) |
| 2727 | printf("Module dict: %d errors\n", ret); |
| 2728 | return(ret); |
| 2729 | } |
| 2730 | |
| 2731 | static int |
| 2732 | test_UTF8Toisolat1(void) { |
| 2733 | int ret = 0; |
| 2734 | |
| 2735 | |
| 2736 | /* missing type support */ |
| 2737 | return(ret); |
| 2738 | } |
| 2739 | |
| 2740 | |
| 2741 | static int |
| 2742 | test_isolat1ToUTF8(void) { |
| 2743 | int ret = 0; |
| 2744 | |
| 2745 | |
| 2746 | /* missing type support */ |
| 2747 | return(ret); |
| 2748 | } |
| 2749 | |
| 2750 | |
| 2751 | static int |
| 2752 | test_xmlAddEncodingAlias(void) { |
| 2753 | int ret = 0; |
| 2754 | |
| 2755 | int ret_val; |
| 2756 | const char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */ |
| 2757 | int n_name; |
| 2758 | const char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ |
| 2759 | int n_alias; |
| 2760 | |
| 2761 | for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { |
| 2762 | for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { |
| 2763 | name = gen_const_char_ptr(n_name); |
| 2764 | alias = gen_const_char_ptr(n_alias); |
| 2765 | |
| 2766 | ret_val = xmlAddEncodingAlias(name, alias); |
| 2767 | desret_int(ret_val); |
| 2768 | call_tests++; |
| 2769 | des_const_char_ptr(n_name, name); |
| 2770 | des_const_char_ptr(n_alias, alias); |
| 2771 | xmlResetLastError(); |
| 2772 | } |
| 2773 | } |
| 2774 | |
| 2775 | return(ret); |
| 2776 | } |
| 2777 | |
| 2778 | |
| 2779 | static int |
| 2780 | test_xmlCharEncCloseFunc(void) { |
| 2781 | int ret = 0; |
| 2782 | |
| 2783 | |
| 2784 | /* missing type support */ |
| 2785 | return(ret); |
| 2786 | } |
| 2787 | |
| 2788 | |
| 2789 | static int |
| 2790 | test_xmlCharEncFirstLine(void) { |
| 2791 | int ret = 0; |
| 2792 | |
| 2793 | |
| 2794 | /* missing type support */ |
| 2795 | return(ret); |
| 2796 | } |
| 2797 | |
| 2798 | |
| 2799 | static int |
| 2800 | test_xmlCharEncInFunc(void) { |
| 2801 | int ret = 0; |
| 2802 | |
| 2803 | |
| 2804 | /* missing type support */ |
| 2805 | return(ret); |
| 2806 | } |
| 2807 | |
| 2808 | |
| 2809 | static int |
| 2810 | test_xmlCharEncOutFunc(void) { |
| 2811 | int ret = 0; |
| 2812 | |
| 2813 | |
| 2814 | /* missing type support */ |
| 2815 | return(ret); |
| 2816 | } |
| 2817 | |
| 2818 | |
| 2819 | static int |
| 2820 | test_xmlCleanupCharEncodingHandlers(void) { |
| 2821 | int ret = 0; |
| 2822 | |
| 2823 | |
| 2824 | |
| 2825 | xmlCleanupCharEncodingHandlers(); |
| 2826 | call_tests++; |
| 2827 | xmlResetLastError(); |
| 2828 | |
| 2829 | return(ret); |
| 2830 | } |
| 2831 | |
| 2832 | |
| 2833 | static int |
| 2834 | test_xmlCleanupEncodingAliases(void) { |
| 2835 | int ret = 0; |
| 2836 | |
| 2837 | int mem_base; |
| 2838 | |
| 2839 | mem_base = xmlMemBlocks(); |
| 2840 | |
| 2841 | xmlCleanupEncodingAliases(); |
| 2842 | call_tests++; |
| 2843 | xmlResetLastError(); |
| 2844 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2845 | printf("Leak of %d blocks found in xmlCleanupEncodingAliases", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2846 | xmlMemBlocks() - mem_base); |
| 2847 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2848 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2849 | } |
| 2850 | |
| 2851 | return(ret); |
| 2852 | } |
| 2853 | |
| 2854 | |
| 2855 | static int |
| 2856 | test_xmlDelEncodingAlias(void) { |
| 2857 | int ret = 0; |
| 2858 | |
| 2859 | int mem_base; |
| 2860 | int ret_val; |
| 2861 | const char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ |
| 2862 | int n_alias; |
| 2863 | |
| 2864 | for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { |
| 2865 | mem_base = xmlMemBlocks(); |
| 2866 | alias = gen_const_char_ptr(n_alias); |
| 2867 | |
| 2868 | ret_val = xmlDelEncodingAlias(alias); |
| 2869 | desret_int(ret_val); |
| 2870 | call_tests++; |
| 2871 | des_const_char_ptr(n_alias, alias); |
| 2872 | xmlResetLastError(); |
| 2873 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2874 | printf("Leak of %d blocks found in xmlDelEncodingAlias", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2875 | xmlMemBlocks() - mem_base); |
| 2876 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2877 | printf(" %d", n_alias); |
| 2878 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2879 | } |
| 2880 | } |
| 2881 | |
| 2882 | return(ret); |
| 2883 | } |
| 2884 | |
| 2885 | |
| 2886 | static int |
| 2887 | test_xmlDetectCharEncoding(void) { |
| 2888 | int ret = 0; |
| 2889 | |
| 2890 | |
| 2891 | /* missing type support */ |
| 2892 | return(ret); |
| 2893 | } |
| 2894 | |
| 2895 | |
| 2896 | static int |
| 2897 | test_xmlFindCharEncodingHandler(void) { |
| 2898 | int ret = 0; |
| 2899 | |
| 2900 | |
| 2901 | /* missing type support */ |
| 2902 | return(ret); |
| 2903 | } |
| 2904 | |
| 2905 | |
| 2906 | static int |
| 2907 | test_xmlGetCharEncodingHandler(void) { |
| 2908 | int ret = 0; |
| 2909 | |
| 2910 | |
| 2911 | /* missing type support */ |
| 2912 | return(ret); |
| 2913 | } |
| 2914 | |
| 2915 | |
| 2916 | static int |
| 2917 | test_xmlGetCharEncodingName(void) { |
| 2918 | int ret = 0; |
| 2919 | |
| 2920 | |
| 2921 | /* missing type support */ |
| 2922 | return(ret); |
| 2923 | } |
| 2924 | |
| 2925 | |
| 2926 | static int |
| 2927 | test_xmlGetEncodingAlias(void) { |
| 2928 | int ret = 0; |
| 2929 | |
| 2930 | int mem_base; |
| 2931 | const char * ret_val; |
| 2932 | const char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ |
| 2933 | int n_alias; |
| 2934 | |
| 2935 | for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { |
| 2936 | mem_base = xmlMemBlocks(); |
| 2937 | alias = gen_const_char_ptr(n_alias); |
| 2938 | |
| 2939 | ret_val = xmlGetEncodingAlias(alias); |
| 2940 | desret_const_char_ptr(ret_val); |
| 2941 | call_tests++; |
| 2942 | des_const_char_ptr(n_alias, alias); |
| 2943 | xmlResetLastError(); |
| 2944 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2945 | printf("Leak of %d blocks found in xmlGetEncodingAlias", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2946 | xmlMemBlocks() - mem_base); |
| 2947 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 2948 | printf(" %d", n_alias); |
| 2949 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 2950 | } |
| 2951 | } |
| 2952 | |
| 2953 | return(ret); |
| 2954 | } |
| 2955 | |
| 2956 | |
| 2957 | static int |
| 2958 | test_xmlInitCharEncodingHandlers(void) { |
| 2959 | int ret = 0; |
| 2960 | |
| 2961 | |
| 2962 | |
| 2963 | xmlInitCharEncodingHandlers(); |
| 2964 | call_tests++; |
| 2965 | xmlResetLastError(); |
| 2966 | |
| 2967 | return(ret); |
| 2968 | } |
| 2969 | |
| 2970 | |
| 2971 | static int |
| 2972 | test_xmlNewCharEncodingHandler(void) { |
| 2973 | int ret = 0; |
| 2974 | |
| 2975 | |
| 2976 | /* missing type support */ |
| 2977 | return(ret); |
| 2978 | } |
| 2979 | |
| 2980 | |
| 2981 | static int |
| 2982 | test_xmlParseCharEncoding(void) { |
| 2983 | int ret = 0; |
| 2984 | |
| 2985 | |
| 2986 | /* missing type support */ |
| 2987 | return(ret); |
| 2988 | } |
| 2989 | |
| 2990 | |
| 2991 | static int |
| 2992 | test_xmlRegisterCharEncodingHandler(void) { |
| 2993 | int ret = 0; |
| 2994 | |
| 2995 | |
| 2996 | /* missing type support */ |
| 2997 | return(ret); |
| 2998 | } |
| 2999 | |
| 3000 | static int |
| 3001 | test_encoding(void) { |
| 3002 | int ret = 0; |
| 3003 | |
| 3004 | printf("Testing encoding ...\n"); |
| 3005 | ret += test_UTF8Toisolat1(); |
| 3006 | ret += test_isolat1ToUTF8(); |
| 3007 | ret += test_xmlAddEncodingAlias(); |
| 3008 | ret += test_xmlCharEncCloseFunc(); |
| 3009 | ret += test_xmlCharEncFirstLine(); |
| 3010 | ret += test_xmlCharEncInFunc(); |
| 3011 | ret += test_xmlCharEncOutFunc(); |
| 3012 | ret += test_xmlCleanupCharEncodingHandlers(); |
| 3013 | ret += test_xmlCleanupEncodingAliases(); |
| 3014 | ret += test_xmlDelEncodingAlias(); |
| 3015 | ret += test_xmlDetectCharEncoding(); |
| 3016 | ret += test_xmlFindCharEncodingHandler(); |
| 3017 | ret += test_xmlGetCharEncodingHandler(); |
| 3018 | ret += test_xmlGetCharEncodingName(); |
| 3019 | ret += test_xmlGetEncodingAlias(); |
| 3020 | ret += test_xmlInitCharEncodingHandlers(); |
| 3021 | ret += test_xmlNewCharEncodingHandler(); |
| 3022 | ret += test_xmlParseCharEncoding(); |
| 3023 | ret += test_xmlRegisterCharEncodingHandler(); |
| 3024 | |
| 3025 | if (ret != 0) |
| 3026 | printf("Module encoding: %d errors\n", ret); |
| 3027 | return(ret); |
| 3028 | } |
| 3029 | |
| 3030 | static int |
| 3031 | test_xmlAddDocEntity(void) { |
| 3032 | int ret = 0; |
| 3033 | |
| 3034 | |
| 3035 | /* missing type support */ |
| 3036 | return(ret); |
| 3037 | } |
| 3038 | |
| 3039 | |
| 3040 | static int |
| 3041 | test_xmlAddDtdEntity(void) { |
| 3042 | int ret = 0; |
| 3043 | |
| 3044 | |
| 3045 | /* missing type support */ |
| 3046 | return(ret); |
| 3047 | } |
| 3048 | |
| 3049 | |
| 3050 | static int |
| 3051 | test_xmlCleanupPredefinedEntities(void) { |
| 3052 | int ret = 0; |
| 3053 | |
| 3054 | int mem_base; |
| 3055 | |
| 3056 | mem_base = xmlMemBlocks(); |
| 3057 | |
| 3058 | xmlCleanupPredefinedEntities(); |
| 3059 | call_tests++; |
| 3060 | xmlResetLastError(); |
| 3061 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 3062 | printf("Leak of %d blocks found in xmlCleanupPredefinedEntities", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3063 | xmlMemBlocks() - mem_base); |
| 3064 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 3065 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3066 | } |
| 3067 | |
| 3068 | return(ret); |
| 3069 | } |
| 3070 | |
| 3071 | |
| 3072 | static int |
| 3073 | test_xmlCopyEntitiesTable(void) { |
| 3074 | int ret = 0; |
| 3075 | |
| 3076 | |
| 3077 | /* missing type support */ |
| 3078 | return(ret); |
| 3079 | } |
| 3080 | |
| 3081 | |
| 3082 | static int |
| 3083 | test_xmlCreateEntitiesTable(void) { |
| 3084 | int ret = 0; |
| 3085 | |
| 3086 | |
| 3087 | /* missing type support */ |
| 3088 | return(ret); |
| 3089 | } |
| 3090 | |
| 3091 | |
| 3092 | static int |
| 3093 | test_xmlDumpEntitiesTable(void) { |
| 3094 | int ret = 0; |
| 3095 | |
| 3096 | |
| 3097 | /* missing type support */ |
| 3098 | return(ret); |
| 3099 | } |
| 3100 | |
| 3101 | |
| 3102 | static int |
| 3103 | test_xmlDumpEntityDecl(void) { |
| 3104 | int ret = 0; |
| 3105 | |
| 3106 | |
| 3107 | /* missing type support */ |
| 3108 | return(ret); |
| 3109 | } |
| 3110 | |
| 3111 | |
| 3112 | static int |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3113 | test_xmlEncodeEntitiesReentrant(void) { |
| 3114 | int ret = 0; |
| 3115 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 3116 | int mem_base; |
| 3117 | xmlChar * ret_val; |
| 3118 | xmlDocPtr doc; /* the document containing the string */ |
| 3119 | int n_doc; |
| 3120 | const xmlChar * input; /* A string to convert to XML. */ |
| 3121 | int n_input; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3122 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 3123 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 3124 | for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) { |
| 3125 | mem_base = xmlMemBlocks(); |
| 3126 | doc = gen_xmlDocPtr(n_doc); |
| 3127 | input = gen_const_xmlChar_ptr(n_input); |
| 3128 | |
| 3129 | ret_val = xmlEncodeEntitiesReentrant(doc, input); |
| 3130 | desret_xmlChar_ptr(ret_val); |
| 3131 | call_tests++; |
| 3132 | des_xmlDocPtr(n_doc, doc); |
| 3133 | des_const_xmlChar_ptr(n_input, input); |
| 3134 | xmlResetLastError(); |
| 3135 | if (mem_base != xmlMemBlocks()) { |
| 3136 | printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant", |
| 3137 | xmlMemBlocks() - mem_base); |
| 3138 | ret++; |
| 3139 | printf(" %d", n_doc); |
| 3140 | printf(" %d", n_input); |
| 3141 | printf("\n"); |
| 3142 | } |
| 3143 | } |
| 3144 | } |
| 3145 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3146 | return(ret); |
| 3147 | } |
| 3148 | |
| 3149 | |
| 3150 | static int |
| 3151 | test_xmlEncodeSpecialChars(void) { |
| 3152 | int ret = 0; |
| 3153 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 3154 | int mem_base; |
| 3155 | xmlChar * ret_val; |
| 3156 | xmlDocPtr doc; /* the document containing the string */ |
| 3157 | int n_doc; |
| 3158 | const xmlChar * input; /* A string to convert to XML. */ |
| 3159 | int n_input; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3160 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 3161 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 3162 | for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) { |
| 3163 | mem_base = xmlMemBlocks(); |
| 3164 | doc = gen_xmlDocPtr(n_doc); |
| 3165 | input = gen_const_xmlChar_ptr(n_input); |
| 3166 | |
| 3167 | ret_val = xmlEncodeSpecialChars(doc, input); |
| 3168 | desret_xmlChar_ptr(ret_val); |
| 3169 | call_tests++; |
| 3170 | des_xmlDocPtr(n_doc, doc); |
| 3171 | des_const_xmlChar_ptr(n_input, input); |
| 3172 | xmlResetLastError(); |
| 3173 | if (mem_base != xmlMemBlocks()) { |
| 3174 | printf("Leak of %d blocks found in xmlEncodeSpecialChars", |
| 3175 | xmlMemBlocks() - mem_base); |
| 3176 | ret++; |
| 3177 | printf(" %d", n_doc); |
| 3178 | printf(" %d", n_input); |
| 3179 | printf("\n"); |
| 3180 | } |
| 3181 | } |
| 3182 | } |
| 3183 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3184 | return(ret); |
| 3185 | } |
| 3186 | |
| 3187 | |
| 3188 | static int |
| 3189 | test_xmlGetDocEntity(void) { |
| 3190 | int ret = 0; |
| 3191 | |
| 3192 | |
| 3193 | /* missing type support */ |
| 3194 | return(ret); |
| 3195 | } |
| 3196 | |
| 3197 | |
| 3198 | static int |
| 3199 | test_xmlGetDtdEntity(void) { |
| 3200 | int ret = 0; |
| 3201 | |
| 3202 | |
| 3203 | /* missing type support */ |
| 3204 | return(ret); |
| 3205 | } |
| 3206 | |
| 3207 | |
| 3208 | static int |
| 3209 | test_xmlGetParameterEntity(void) { |
| 3210 | int ret = 0; |
| 3211 | |
| 3212 | |
| 3213 | /* missing type support */ |
| 3214 | return(ret); |
| 3215 | } |
| 3216 | |
| 3217 | |
| 3218 | static int |
| 3219 | test_xmlGetPredefinedEntity(void) { |
| 3220 | int ret = 0; |
| 3221 | |
| 3222 | |
| 3223 | /* missing type support */ |
| 3224 | return(ret); |
| 3225 | } |
| 3226 | |
| 3227 | |
| 3228 | static int |
| 3229 | test_xmlInitializePredefinedEntities(void) { |
| 3230 | int ret = 0; |
| 3231 | |
| 3232 | int mem_base; |
| 3233 | |
| 3234 | mem_base = xmlMemBlocks(); |
| 3235 | |
| 3236 | xmlInitializePredefinedEntities(); |
| 3237 | call_tests++; |
| 3238 | xmlResetLastError(); |
| 3239 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 3240 | printf("Leak of %d blocks found in xmlInitializePredefinedEntities", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3241 | xmlMemBlocks() - mem_base); |
| 3242 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 3243 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3244 | } |
| 3245 | |
| 3246 | return(ret); |
| 3247 | } |
| 3248 | |
| 3249 | static int |
| 3250 | test_entities(void) { |
| 3251 | int ret = 0; |
| 3252 | |
| 3253 | printf("Testing entities ...\n"); |
| 3254 | ret += test_xmlAddDocEntity(); |
| 3255 | ret += test_xmlAddDtdEntity(); |
| 3256 | ret += test_xmlCleanupPredefinedEntities(); |
| 3257 | ret += test_xmlCopyEntitiesTable(); |
| 3258 | ret += test_xmlCreateEntitiesTable(); |
| 3259 | ret += test_xmlDumpEntitiesTable(); |
| 3260 | ret += test_xmlDumpEntityDecl(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3261 | ret += test_xmlEncodeEntitiesReentrant(); |
| 3262 | ret += test_xmlEncodeSpecialChars(); |
| 3263 | ret += test_xmlGetDocEntity(); |
| 3264 | ret += test_xmlGetDtdEntity(); |
| 3265 | ret += test_xmlGetParameterEntity(); |
| 3266 | ret += test_xmlGetPredefinedEntity(); |
| 3267 | ret += test_xmlInitializePredefinedEntities(); |
| 3268 | |
| 3269 | if (ret != 0) |
| 3270 | printf("Module entities: %d errors\n", ret); |
| 3271 | return(ret); |
| 3272 | } |
| 3273 | |
| 3274 | static int |
| 3275 | test_xmlHashAddEntry(void) { |
| 3276 | int ret = 0; |
| 3277 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3278 | int mem_base; |
| 3279 | int ret_val; |
| 3280 | xmlHashTablePtr table; /* the hash table */ |
| 3281 | int n_table; |
| 3282 | const xmlChar * name; /* the name of the userdata */ |
| 3283 | int n_name; |
| 3284 | void * userdata; /* a pointer to the userdata */ |
| 3285 | int n_userdata; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3286 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3287 | for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { |
| 3288 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 3289 | for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { |
| 3290 | mem_base = xmlMemBlocks(); |
| 3291 | table = gen_xmlHashTablePtr(n_table); |
| 3292 | name = gen_const_xmlChar_ptr(n_name); |
| 3293 | userdata = gen_userdata(n_userdata); |
| 3294 | |
| 3295 | ret_val = xmlHashAddEntry(table, name, userdata); |
| 3296 | desret_int(ret_val); |
| 3297 | call_tests++; |
| 3298 | des_xmlHashTablePtr(n_table, table); |
| 3299 | des_const_xmlChar_ptr(n_name, name); |
| 3300 | des_userdata(n_userdata, userdata); |
| 3301 | xmlResetLastError(); |
| 3302 | if (mem_base != xmlMemBlocks()) { |
| 3303 | printf("Leak of %d blocks found in xmlHashAddEntry", |
| 3304 | xmlMemBlocks() - mem_base); |
| 3305 | ret++; |
| 3306 | printf(" %d", n_table); |
| 3307 | printf(" %d", n_name); |
| 3308 | printf(" %d", n_userdata); |
| 3309 | printf("\n"); |
| 3310 | } |
| 3311 | } |
| 3312 | } |
| 3313 | } |
| 3314 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3315 | return(ret); |
| 3316 | } |
| 3317 | |
| 3318 | |
| 3319 | static int |
| 3320 | test_xmlHashAddEntry2(void) { |
| 3321 | int ret = 0; |
| 3322 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3323 | int mem_base; |
| 3324 | int ret_val; |
| 3325 | xmlHashTablePtr table; /* the hash table */ |
| 3326 | int n_table; |
| 3327 | const xmlChar * name; /* the name of the userdata */ |
| 3328 | int n_name; |
| 3329 | const xmlChar * name2; /* a second name of the userdata */ |
| 3330 | int n_name2; |
| 3331 | void * userdata; /* a pointer to the userdata */ |
| 3332 | int n_userdata; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3333 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3334 | for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { |
| 3335 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 3336 | for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { |
| 3337 | for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { |
| 3338 | mem_base = xmlMemBlocks(); |
| 3339 | table = gen_xmlHashTablePtr(n_table); |
| 3340 | name = gen_const_xmlChar_ptr(n_name); |
| 3341 | name2 = gen_const_xmlChar_ptr(n_name2); |
| 3342 | userdata = gen_userdata(n_userdata); |
| 3343 | |
| 3344 | ret_val = xmlHashAddEntry2(table, name, name2, userdata); |
| 3345 | desret_int(ret_val); |
| 3346 | call_tests++; |
| 3347 | des_xmlHashTablePtr(n_table, table); |
| 3348 | des_const_xmlChar_ptr(n_name, name); |
| 3349 | des_const_xmlChar_ptr(n_name2, name2); |
| 3350 | des_userdata(n_userdata, userdata); |
| 3351 | xmlResetLastError(); |
| 3352 | if (mem_base != xmlMemBlocks()) { |
| 3353 | printf("Leak of %d blocks found in xmlHashAddEntry2", |
| 3354 | xmlMemBlocks() - mem_base); |
| 3355 | ret++; |
| 3356 | printf(" %d", n_table); |
| 3357 | printf(" %d", n_name); |
| 3358 | printf(" %d", n_name2); |
| 3359 | printf(" %d", n_userdata); |
| 3360 | printf("\n"); |
| 3361 | } |
| 3362 | } |
| 3363 | } |
| 3364 | } |
| 3365 | } |
| 3366 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3367 | return(ret); |
| 3368 | } |
| 3369 | |
| 3370 | |
| 3371 | static int |
| 3372 | test_xmlHashAddEntry3(void) { |
| 3373 | int ret = 0; |
| 3374 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3375 | int mem_base; |
| 3376 | int ret_val; |
| 3377 | xmlHashTablePtr table; /* the hash table */ |
| 3378 | int n_table; |
| 3379 | const xmlChar * name; /* the name of the userdata */ |
| 3380 | int n_name; |
| 3381 | const xmlChar * name2; /* a second name of the userdata */ |
| 3382 | int n_name2; |
| 3383 | const xmlChar * name3; /* a third name of the userdata */ |
| 3384 | int n_name3; |
| 3385 | void * userdata; /* a pointer to the userdata */ |
| 3386 | int n_userdata; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3387 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3388 | for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { |
| 3389 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 3390 | for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { |
| 3391 | for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { |
| 3392 | for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { |
| 3393 | mem_base = xmlMemBlocks(); |
| 3394 | table = gen_xmlHashTablePtr(n_table); |
| 3395 | name = gen_const_xmlChar_ptr(n_name); |
| 3396 | name2 = gen_const_xmlChar_ptr(n_name2); |
| 3397 | name3 = gen_const_xmlChar_ptr(n_name3); |
| 3398 | userdata = gen_userdata(n_userdata); |
| 3399 | |
| 3400 | ret_val = xmlHashAddEntry3(table, name, name2, name3, userdata); |
| 3401 | desret_int(ret_val); |
| 3402 | call_tests++; |
| 3403 | des_xmlHashTablePtr(n_table, table); |
| 3404 | des_const_xmlChar_ptr(n_name, name); |
| 3405 | des_const_xmlChar_ptr(n_name2, name2); |
| 3406 | des_const_xmlChar_ptr(n_name3, name3); |
| 3407 | des_userdata(n_userdata, userdata); |
| 3408 | xmlResetLastError(); |
| 3409 | if (mem_base != xmlMemBlocks()) { |
| 3410 | printf("Leak of %d blocks found in xmlHashAddEntry3", |
| 3411 | xmlMemBlocks() - mem_base); |
| 3412 | ret++; |
| 3413 | printf(" %d", n_table); |
| 3414 | printf(" %d", n_name); |
| 3415 | printf(" %d", n_name2); |
| 3416 | printf(" %d", n_name3); |
| 3417 | printf(" %d", n_userdata); |
| 3418 | printf("\n"); |
| 3419 | } |
| 3420 | } |
| 3421 | } |
| 3422 | } |
| 3423 | } |
| 3424 | } |
| 3425 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3426 | return(ret); |
| 3427 | } |
| 3428 | |
| 3429 | |
| 3430 | static int |
| 3431 | test_xmlHashCopy(void) { |
| 3432 | int ret = 0; |
| 3433 | |
| 3434 | |
| 3435 | /* missing type support */ |
| 3436 | return(ret); |
| 3437 | } |
| 3438 | |
| 3439 | |
| 3440 | static int |
| 3441 | test_xmlHashCreate(void) { |
| 3442 | int ret = 0; |
| 3443 | |
| 3444 | |
| 3445 | /* missing type support */ |
| 3446 | return(ret); |
| 3447 | } |
| 3448 | |
| 3449 | |
| 3450 | static int |
| 3451 | test_xmlHashLookup(void) { |
| 3452 | int ret = 0; |
| 3453 | |
| 3454 | |
| 3455 | /* missing type support */ |
| 3456 | return(ret); |
| 3457 | } |
| 3458 | |
| 3459 | |
| 3460 | static int |
| 3461 | test_xmlHashLookup2(void) { |
| 3462 | int ret = 0; |
| 3463 | |
| 3464 | |
| 3465 | /* missing type support */ |
| 3466 | return(ret); |
| 3467 | } |
| 3468 | |
| 3469 | |
| 3470 | static int |
| 3471 | test_xmlHashLookup3(void) { |
| 3472 | int ret = 0; |
| 3473 | |
| 3474 | |
| 3475 | /* missing type support */ |
| 3476 | return(ret); |
| 3477 | } |
| 3478 | |
| 3479 | |
| 3480 | static int |
| 3481 | test_xmlHashQLookup(void) { |
| 3482 | int ret = 0; |
| 3483 | |
| 3484 | |
| 3485 | /* missing type support */ |
| 3486 | return(ret); |
| 3487 | } |
| 3488 | |
| 3489 | |
| 3490 | static int |
| 3491 | test_xmlHashQLookup2(void) { |
| 3492 | int ret = 0; |
| 3493 | |
| 3494 | |
| 3495 | /* missing type support */ |
| 3496 | return(ret); |
| 3497 | } |
| 3498 | |
| 3499 | |
| 3500 | static int |
| 3501 | test_xmlHashQLookup3(void) { |
| 3502 | int ret = 0; |
| 3503 | |
| 3504 | |
| 3505 | /* missing type support */ |
| 3506 | return(ret); |
| 3507 | } |
| 3508 | |
| 3509 | |
| 3510 | static int |
| 3511 | test_xmlHashRemoveEntry(void) { |
| 3512 | int ret = 0; |
| 3513 | |
| 3514 | |
| 3515 | /* missing type support */ |
| 3516 | return(ret); |
| 3517 | } |
| 3518 | |
| 3519 | |
| 3520 | static int |
| 3521 | test_xmlHashRemoveEntry2(void) { |
| 3522 | int ret = 0; |
| 3523 | |
| 3524 | |
| 3525 | /* missing type support */ |
| 3526 | return(ret); |
| 3527 | } |
| 3528 | |
| 3529 | |
| 3530 | static int |
| 3531 | test_xmlHashRemoveEntry3(void) { |
| 3532 | int ret = 0; |
| 3533 | |
| 3534 | |
| 3535 | /* missing type support */ |
| 3536 | return(ret); |
| 3537 | } |
| 3538 | |
| 3539 | |
| 3540 | static int |
| 3541 | test_xmlHashScan(void) { |
| 3542 | int ret = 0; |
| 3543 | |
| 3544 | |
| 3545 | /* missing type support */ |
| 3546 | return(ret); |
| 3547 | } |
| 3548 | |
| 3549 | |
| 3550 | static int |
| 3551 | test_xmlHashScan3(void) { |
| 3552 | int ret = 0; |
| 3553 | |
| 3554 | |
| 3555 | /* missing type support */ |
| 3556 | return(ret); |
| 3557 | } |
| 3558 | |
| 3559 | |
| 3560 | static int |
| 3561 | test_xmlHashScanFull(void) { |
| 3562 | int ret = 0; |
| 3563 | |
| 3564 | |
| 3565 | /* missing type support */ |
| 3566 | return(ret); |
| 3567 | } |
| 3568 | |
| 3569 | |
| 3570 | static int |
| 3571 | test_xmlHashScanFull3(void) { |
| 3572 | int ret = 0; |
| 3573 | |
| 3574 | |
| 3575 | /* missing type support */ |
| 3576 | return(ret); |
| 3577 | } |
| 3578 | |
| 3579 | |
| 3580 | static int |
| 3581 | test_xmlHashSize(void) { |
| 3582 | int ret = 0; |
| 3583 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3584 | int mem_base; |
| 3585 | int ret_val; |
| 3586 | xmlHashTablePtr table; /* the hash table */ |
| 3587 | int n_table; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3588 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3589 | for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { |
| 3590 | mem_base = xmlMemBlocks(); |
| 3591 | table = gen_xmlHashTablePtr(n_table); |
| 3592 | |
| 3593 | ret_val = xmlHashSize(table); |
| 3594 | desret_int(ret_val); |
| 3595 | call_tests++; |
| 3596 | des_xmlHashTablePtr(n_table, table); |
| 3597 | xmlResetLastError(); |
| 3598 | if (mem_base != xmlMemBlocks()) { |
| 3599 | printf("Leak of %d blocks found in xmlHashSize", |
| 3600 | xmlMemBlocks() - mem_base); |
| 3601 | ret++; |
| 3602 | printf(" %d", n_table); |
| 3603 | printf("\n"); |
| 3604 | } |
| 3605 | } |
| 3606 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3607 | return(ret); |
| 3608 | } |
| 3609 | |
| 3610 | |
| 3611 | static int |
| 3612 | test_xmlHashUpdateEntry(void) { |
| 3613 | int ret = 0; |
| 3614 | |
| 3615 | |
| 3616 | /* missing type support */ |
| 3617 | return(ret); |
| 3618 | } |
| 3619 | |
| 3620 | |
| 3621 | static int |
| 3622 | test_xmlHashUpdateEntry2(void) { |
| 3623 | int ret = 0; |
| 3624 | |
| 3625 | |
| 3626 | /* missing type support */ |
| 3627 | return(ret); |
| 3628 | } |
| 3629 | |
| 3630 | |
| 3631 | static int |
| 3632 | test_xmlHashUpdateEntry3(void) { |
| 3633 | int ret = 0; |
| 3634 | |
| 3635 | |
| 3636 | /* missing type support */ |
| 3637 | return(ret); |
| 3638 | } |
| 3639 | |
| 3640 | static int |
| 3641 | test_hash(void) { |
| 3642 | int ret = 0; |
| 3643 | |
| 3644 | printf("Testing hash ...\n"); |
| 3645 | ret += test_xmlHashAddEntry(); |
| 3646 | ret += test_xmlHashAddEntry2(); |
| 3647 | ret += test_xmlHashAddEntry3(); |
| 3648 | ret += test_xmlHashCopy(); |
| 3649 | ret += test_xmlHashCreate(); |
| 3650 | ret += test_xmlHashLookup(); |
| 3651 | ret += test_xmlHashLookup2(); |
| 3652 | ret += test_xmlHashLookup3(); |
| 3653 | ret += test_xmlHashQLookup(); |
| 3654 | ret += test_xmlHashQLookup2(); |
| 3655 | ret += test_xmlHashQLookup3(); |
| 3656 | ret += test_xmlHashRemoveEntry(); |
| 3657 | ret += test_xmlHashRemoveEntry2(); |
| 3658 | ret += test_xmlHashRemoveEntry3(); |
| 3659 | ret += test_xmlHashScan(); |
| 3660 | ret += test_xmlHashScan3(); |
| 3661 | ret += test_xmlHashScanFull(); |
| 3662 | ret += test_xmlHashScanFull3(); |
| 3663 | ret += test_xmlHashSize(); |
| 3664 | ret += test_xmlHashUpdateEntry(); |
| 3665 | ret += test_xmlHashUpdateEntry2(); |
| 3666 | ret += test_xmlHashUpdateEntry3(); |
| 3667 | |
| 3668 | if (ret != 0) |
| 3669 | printf("Module hash: %d errors\n", ret); |
| 3670 | return(ret); |
| 3671 | } |
| 3672 | |
| 3673 | static int |
| 3674 | test_xmlLinkGetData(void) { |
| 3675 | int ret = 0; |
| 3676 | |
| 3677 | |
| 3678 | /* missing type support */ |
| 3679 | return(ret); |
| 3680 | } |
| 3681 | |
| 3682 | |
| 3683 | static int |
| 3684 | test_xmlListAppend(void) { |
| 3685 | int ret = 0; |
| 3686 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3687 | int mem_base; |
| 3688 | int ret_val; |
| 3689 | xmlListPtr l; /* a list */ |
| 3690 | int n_l; |
| 3691 | void * data; /* the data */ |
| 3692 | int n_data; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3693 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3694 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 3695 | for (n_data = 0;n_data < gen_nb_userdata;n_data++) { |
| 3696 | mem_base = xmlMemBlocks(); |
| 3697 | l = gen_xmlListPtr(n_l); |
| 3698 | data = gen_userdata(n_data); |
| 3699 | |
| 3700 | ret_val = xmlListAppend(l, data); |
| 3701 | desret_int(ret_val); |
| 3702 | call_tests++; |
| 3703 | des_xmlListPtr(n_l, l); |
| 3704 | des_userdata(n_data, data); |
| 3705 | xmlResetLastError(); |
| 3706 | if (mem_base != xmlMemBlocks()) { |
| 3707 | printf("Leak of %d blocks found in xmlListAppend", |
| 3708 | xmlMemBlocks() - mem_base); |
| 3709 | ret++; |
| 3710 | printf(" %d", n_l); |
| 3711 | printf(" %d", n_data); |
| 3712 | printf("\n"); |
| 3713 | } |
| 3714 | } |
| 3715 | } |
| 3716 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3717 | return(ret); |
| 3718 | } |
| 3719 | |
| 3720 | |
| 3721 | static int |
| 3722 | test_xmlListClear(void) { |
| 3723 | int ret = 0; |
| 3724 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3725 | int mem_base; |
| 3726 | xmlListPtr l; /* a list */ |
| 3727 | int n_l; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3728 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3729 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 3730 | mem_base = xmlMemBlocks(); |
| 3731 | l = gen_xmlListPtr(n_l); |
| 3732 | |
| 3733 | xmlListClear(l); |
| 3734 | call_tests++; |
| 3735 | des_xmlListPtr(n_l, l); |
| 3736 | xmlResetLastError(); |
| 3737 | if (mem_base != xmlMemBlocks()) { |
| 3738 | printf("Leak of %d blocks found in xmlListClear", |
| 3739 | xmlMemBlocks() - mem_base); |
| 3740 | ret++; |
| 3741 | printf(" %d", n_l); |
| 3742 | printf("\n"); |
| 3743 | } |
| 3744 | } |
| 3745 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3746 | return(ret); |
| 3747 | } |
| 3748 | |
| 3749 | |
| 3750 | static int |
| 3751 | test_xmlListCopy(void) { |
| 3752 | int ret = 0; |
| 3753 | |
| 3754 | |
| 3755 | /* missing type support */ |
| 3756 | return(ret); |
| 3757 | } |
| 3758 | |
| 3759 | |
| 3760 | static int |
| 3761 | test_xmlListCreate(void) { |
| 3762 | int ret = 0; |
| 3763 | |
| 3764 | |
| 3765 | /* missing type support */ |
| 3766 | return(ret); |
| 3767 | } |
| 3768 | |
| 3769 | |
| 3770 | static int |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3771 | test_xmlListDup(void) { |
| 3772 | int ret = 0; |
| 3773 | |
| 3774 | |
| 3775 | /* missing type support */ |
| 3776 | return(ret); |
| 3777 | } |
| 3778 | |
| 3779 | |
| 3780 | static int |
| 3781 | test_xmlListEmpty(void) { |
| 3782 | int ret = 0; |
| 3783 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3784 | int mem_base; |
| 3785 | int ret_val; |
| 3786 | xmlListPtr l; /* a list */ |
| 3787 | int n_l; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3788 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3789 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 3790 | mem_base = xmlMemBlocks(); |
| 3791 | l = gen_xmlListPtr(n_l); |
| 3792 | |
| 3793 | ret_val = xmlListEmpty(l); |
| 3794 | desret_int(ret_val); |
| 3795 | call_tests++; |
| 3796 | des_xmlListPtr(n_l, l); |
| 3797 | xmlResetLastError(); |
| 3798 | if (mem_base != xmlMemBlocks()) { |
| 3799 | printf("Leak of %d blocks found in xmlListEmpty", |
| 3800 | xmlMemBlocks() - mem_base); |
| 3801 | ret++; |
| 3802 | printf(" %d", n_l); |
| 3803 | printf("\n"); |
| 3804 | } |
| 3805 | } |
| 3806 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3807 | return(ret); |
| 3808 | } |
| 3809 | |
| 3810 | |
| 3811 | static int |
| 3812 | test_xmlListEnd(void) { |
| 3813 | int ret = 0; |
| 3814 | |
| 3815 | |
| 3816 | /* missing type support */ |
| 3817 | return(ret); |
| 3818 | } |
| 3819 | |
| 3820 | |
| 3821 | static int |
| 3822 | test_xmlListFront(void) { |
| 3823 | int ret = 0; |
| 3824 | |
| 3825 | |
| 3826 | /* missing type support */ |
| 3827 | return(ret); |
| 3828 | } |
| 3829 | |
| 3830 | |
| 3831 | static int |
| 3832 | test_xmlListInsert(void) { |
| 3833 | int ret = 0; |
| 3834 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3835 | int mem_base; |
| 3836 | int ret_val; |
| 3837 | xmlListPtr l; /* a list */ |
| 3838 | int n_l; |
| 3839 | void * data; /* the data */ |
| 3840 | int n_data; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3841 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3842 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 3843 | for (n_data = 0;n_data < gen_nb_userdata;n_data++) { |
| 3844 | mem_base = xmlMemBlocks(); |
| 3845 | l = gen_xmlListPtr(n_l); |
| 3846 | data = gen_userdata(n_data); |
| 3847 | |
| 3848 | ret_val = xmlListInsert(l, data); |
| 3849 | desret_int(ret_val); |
| 3850 | call_tests++; |
| 3851 | des_xmlListPtr(n_l, l); |
| 3852 | des_userdata(n_data, data); |
| 3853 | xmlResetLastError(); |
| 3854 | if (mem_base != xmlMemBlocks()) { |
| 3855 | printf("Leak of %d blocks found in xmlListInsert", |
| 3856 | xmlMemBlocks() - mem_base); |
| 3857 | ret++; |
| 3858 | printf(" %d", n_l); |
| 3859 | printf(" %d", n_data); |
| 3860 | printf("\n"); |
| 3861 | } |
| 3862 | } |
| 3863 | } |
| 3864 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3865 | return(ret); |
| 3866 | } |
| 3867 | |
| 3868 | |
| 3869 | static int |
| 3870 | test_xmlListMerge(void) { |
| 3871 | int ret = 0; |
| 3872 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3873 | int mem_base; |
| 3874 | xmlListPtr l1; /* the original list */ |
| 3875 | int n_l1; |
| 3876 | xmlListPtr l2; /* the new list */ |
| 3877 | int n_l2; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3878 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3879 | for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) { |
| 3880 | for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) { |
| 3881 | mem_base = xmlMemBlocks(); |
| 3882 | l1 = gen_xmlListPtr(n_l1); |
| 3883 | l2 = gen_xmlListPtr(n_l2); |
| 3884 | |
| 3885 | xmlListMerge(l1, l2); |
| 3886 | call_tests++; |
| 3887 | des_xmlListPtr(n_l1, l1); |
| 3888 | des_xmlListPtr(n_l2, l2); |
| 3889 | xmlResetLastError(); |
| 3890 | if (mem_base != xmlMemBlocks()) { |
| 3891 | printf("Leak of %d blocks found in xmlListMerge", |
| 3892 | xmlMemBlocks() - mem_base); |
| 3893 | ret++; |
| 3894 | printf(" %d", n_l1); |
| 3895 | printf(" %d", n_l2); |
| 3896 | printf("\n"); |
| 3897 | } |
| 3898 | } |
| 3899 | } |
| 3900 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3901 | return(ret); |
| 3902 | } |
| 3903 | |
| 3904 | |
| 3905 | static int |
| 3906 | test_xmlListPopBack(void) { |
| 3907 | int ret = 0; |
| 3908 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3909 | int mem_base; |
| 3910 | xmlListPtr l; /* a list */ |
| 3911 | int n_l; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3912 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3913 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 3914 | mem_base = xmlMemBlocks(); |
| 3915 | l = gen_xmlListPtr(n_l); |
| 3916 | |
| 3917 | xmlListPopBack(l); |
| 3918 | call_tests++; |
| 3919 | des_xmlListPtr(n_l, l); |
| 3920 | xmlResetLastError(); |
| 3921 | if (mem_base != xmlMemBlocks()) { |
| 3922 | printf("Leak of %d blocks found in xmlListPopBack", |
| 3923 | xmlMemBlocks() - mem_base); |
| 3924 | ret++; |
| 3925 | printf(" %d", n_l); |
| 3926 | printf("\n"); |
| 3927 | } |
| 3928 | } |
| 3929 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3930 | return(ret); |
| 3931 | } |
| 3932 | |
| 3933 | |
| 3934 | static int |
| 3935 | test_xmlListPopFront(void) { |
| 3936 | int ret = 0; |
| 3937 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3938 | int mem_base; |
| 3939 | xmlListPtr l; /* a list */ |
| 3940 | int n_l; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3941 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3942 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 3943 | mem_base = xmlMemBlocks(); |
| 3944 | l = gen_xmlListPtr(n_l); |
| 3945 | |
| 3946 | xmlListPopFront(l); |
| 3947 | call_tests++; |
| 3948 | des_xmlListPtr(n_l, l); |
| 3949 | xmlResetLastError(); |
| 3950 | if (mem_base != xmlMemBlocks()) { |
| 3951 | printf("Leak of %d blocks found in xmlListPopFront", |
| 3952 | xmlMemBlocks() - mem_base); |
| 3953 | ret++; |
| 3954 | printf(" %d", n_l); |
| 3955 | printf("\n"); |
| 3956 | } |
| 3957 | } |
| 3958 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3959 | return(ret); |
| 3960 | } |
| 3961 | |
| 3962 | |
| 3963 | static int |
| 3964 | test_xmlListPushBack(void) { |
| 3965 | int ret = 0; |
| 3966 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3967 | int mem_base; |
| 3968 | int ret_val; |
| 3969 | xmlListPtr l; /* a list */ |
| 3970 | int n_l; |
| 3971 | void * data; /* new data */ |
| 3972 | int n_data; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3973 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 3974 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 3975 | for (n_data = 0;n_data < gen_nb_userdata;n_data++) { |
| 3976 | mem_base = xmlMemBlocks(); |
| 3977 | l = gen_xmlListPtr(n_l); |
| 3978 | data = gen_userdata(n_data); |
| 3979 | |
| 3980 | ret_val = xmlListPushBack(l, data); |
| 3981 | desret_int(ret_val); |
| 3982 | call_tests++; |
| 3983 | des_xmlListPtr(n_l, l); |
| 3984 | des_userdata(n_data, data); |
| 3985 | xmlResetLastError(); |
| 3986 | if (mem_base != xmlMemBlocks()) { |
| 3987 | printf("Leak of %d blocks found in xmlListPushBack", |
| 3988 | xmlMemBlocks() - mem_base); |
| 3989 | ret++; |
| 3990 | printf(" %d", n_l); |
| 3991 | printf(" %d", n_data); |
| 3992 | printf("\n"); |
| 3993 | } |
| 3994 | } |
| 3995 | } |
| 3996 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 3997 | return(ret); |
| 3998 | } |
| 3999 | |
| 4000 | |
| 4001 | static int |
| 4002 | test_xmlListPushFront(void) { |
| 4003 | int ret = 0; |
| 4004 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4005 | int mem_base; |
| 4006 | int ret_val; |
| 4007 | xmlListPtr l; /* a list */ |
| 4008 | int n_l; |
| 4009 | void * data; /* new data */ |
| 4010 | int n_data; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4011 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4012 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 4013 | for (n_data = 0;n_data < gen_nb_userdata;n_data++) { |
| 4014 | mem_base = xmlMemBlocks(); |
| 4015 | l = gen_xmlListPtr(n_l); |
| 4016 | data = gen_userdata(n_data); |
| 4017 | |
| 4018 | ret_val = xmlListPushFront(l, data); |
| 4019 | desret_int(ret_val); |
| 4020 | call_tests++; |
| 4021 | des_xmlListPtr(n_l, l); |
| 4022 | des_userdata(n_data, data); |
| 4023 | xmlResetLastError(); |
| 4024 | if (mem_base != xmlMemBlocks()) { |
| 4025 | printf("Leak of %d blocks found in xmlListPushFront", |
| 4026 | xmlMemBlocks() - mem_base); |
| 4027 | ret++; |
| 4028 | printf(" %d", n_l); |
| 4029 | printf(" %d", n_data); |
| 4030 | printf("\n"); |
| 4031 | } |
| 4032 | } |
| 4033 | } |
| 4034 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4035 | return(ret); |
| 4036 | } |
| 4037 | |
| 4038 | |
| 4039 | static int |
| 4040 | test_xmlListRemoveAll(void) { |
| 4041 | int ret = 0; |
| 4042 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4043 | int mem_base; |
| 4044 | int ret_val; |
| 4045 | xmlListPtr l; /* a list */ |
| 4046 | int n_l; |
| 4047 | void * data; /* list data */ |
| 4048 | int n_data; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4049 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4050 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 4051 | for (n_data = 0;n_data < gen_nb_userdata;n_data++) { |
| 4052 | mem_base = xmlMemBlocks(); |
| 4053 | l = gen_xmlListPtr(n_l); |
| 4054 | data = gen_userdata(n_data); |
| 4055 | |
| 4056 | ret_val = xmlListRemoveAll(l, data); |
| 4057 | desret_int(ret_val); |
| 4058 | call_tests++; |
| 4059 | des_xmlListPtr(n_l, l); |
| 4060 | des_userdata(n_data, data); |
| 4061 | xmlResetLastError(); |
| 4062 | if (mem_base != xmlMemBlocks()) { |
| 4063 | printf("Leak of %d blocks found in xmlListRemoveAll", |
| 4064 | xmlMemBlocks() - mem_base); |
| 4065 | ret++; |
| 4066 | printf(" %d", n_l); |
| 4067 | printf(" %d", n_data); |
| 4068 | printf("\n"); |
| 4069 | } |
| 4070 | } |
| 4071 | } |
| 4072 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4073 | return(ret); |
| 4074 | } |
| 4075 | |
| 4076 | |
| 4077 | static int |
| 4078 | test_xmlListRemoveFirst(void) { |
| 4079 | int ret = 0; |
| 4080 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4081 | int mem_base; |
| 4082 | int ret_val; |
| 4083 | xmlListPtr l; /* a list */ |
| 4084 | int n_l; |
| 4085 | void * data; /* list data */ |
| 4086 | int n_data; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4087 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4088 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 4089 | for (n_data = 0;n_data < gen_nb_userdata;n_data++) { |
| 4090 | mem_base = xmlMemBlocks(); |
| 4091 | l = gen_xmlListPtr(n_l); |
| 4092 | data = gen_userdata(n_data); |
| 4093 | |
| 4094 | ret_val = xmlListRemoveFirst(l, data); |
| 4095 | desret_int(ret_val); |
| 4096 | call_tests++; |
| 4097 | des_xmlListPtr(n_l, l); |
| 4098 | des_userdata(n_data, data); |
| 4099 | xmlResetLastError(); |
| 4100 | if (mem_base != xmlMemBlocks()) { |
| 4101 | printf("Leak of %d blocks found in xmlListRemoveFirst", |
| 4102 | xmlMemBlocks() - mem_base); |
| 4103 | ret++; |
| 4104 | printf(" %d", n_l); |
| 4105 | printf(" %d", n_data); |
| 4106 | printf("\n"); |
| 4107 | } |
| 4108 | } |
| 4109 | } |
| 4110 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4111 | return(ret); |
| 4112 | } |
| 4113 | |
| 4114 | |
| 4115 | static int |
| 4116 | test_xmlListRemoveLast(void) { |
| 4117 | int ret = 0; |
| 4118 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4119 | int mem_base; |
| 4120 | int ret_val; |
| 4121 | xmlListPtr l; /* a list */ |
| 4122 | int n_l; |
| 4123 | void * data; /* list data */ |
| 4124 | int n_data; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4125 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4126 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 4127 | for (n_data = 0;n_data < gen_nb_userdata;n_data++) { |
| 4128 | mem_base = xmlMemBlocks(); |
| 4129 | l = gen_xmlListPtr(n_l); |
| 4130 | data = gen_userdata(n_data); |
| 4131 | |
| 4132 | ret_val = xmlListRemoveLast(l, data); |
| 4133 | desret_int(ret_val); |
| 4134 | call_tests++; |
| 4135 | des_xmlListPtr(n_l, l); |
| 4136 | des_userdata(n_data, data); |
| 4137 | xmlResetLastError(); |
| 4138 | if (mem_base != xmlMemBlocks()) { |
| 4139 | printf("Leak of %d blocks found in xmlListRemoveLast", |
| 4140 | xmlMemBlocks() - mem_base); |
| 4141 | ret++; |
| 4142 | printf(" %d", n_l); |
| 4143 | printf(" %d", n_data); |
| 4144 | printf("\n"); |
| 4145 | } |
| 4146 | } |
| 4147 | } |
| 4148 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4149 | return(ret); |
| 4150 | } |
| 4151 | |
| 4152 | |
| 4153 | static int |
| 4154 | test_xmlListReverse(void) { |
| 4155 | int ret = 0; |
| 4156 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4157 | int mem_base; |
| 4158 | xmlListPtr l; /* a list */ |
| 4159 | int n_l; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4160 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4161 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 4162 | mem_base = xmlMemBlocks(); |
| 4163 | l = gen_xmlListPtr(n_l); |
| 4164 | |
| 4165 | xmlListReverse(l); |
| 4166 | call_tests++; |
| 4167 | des_xmlListPtr(n_l, l); |
| 4168 | xmlResetLastError(); |
| 4169 | if (mem_base != xmlMemBlocks()) { |
| 4170 | printf("Leak of %d blocks found in xmlListReverse", |
| 4171 | xmlMemBlocks() - mem_base); |
| 4172 | ret++; |
| 4173 | printf(" %d", n_l); |
| 4174 | printf("\n"); |
| 4175 | } |
| 4176 | } |
| 4177 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4178 | return(ret); |
| 4179 | } |
| 4180 | |
| 4181 | |
| 4182 | static int |
| 4183 | test_xmlListReverseSearch(void) { |
| 4184 | int ret = 0; |
| 4185 | |
| 4186 | |
| 4187 | /* missing type support */ |
| 4188 | return(ret); |
| 4189 | } |
| 4190 | |
| 4191 | |
| 4192 | static int |
| 4193 | test_xmlListReverseWalk(void) { |
| 4194 | int ret = 0; |
| 4195 | |
| 4196 | |
| 4197 | /* missing type support */ |
| 4198 | return(ret); |
| 4199 | } |
| 4200 | |
| 4201 | |
| 4202 | static int |
| 4203 | test_xmlListSearch(void) { |
| 4204 | int ret = 0; |
| 4205 | |
| 4206 | |
| 4207 | /* missing type support */ |
| 4208 | return(ret); |
| 4209 | } |
| 4210 | |
| 4211 | |
| 4212 | static int |
| 4213 | test_xmlListSize(void) { |
| 4214 | int ret = 0; |
| 4215 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4216 | int mem_base; |
| 4217 | int ret_val; |
| 4218 | xmlListPtr l; /* a list */ |
| 4219 | int n_l; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4220 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4221 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 4222 | mem_base = xmlMemBlocks(); |
| 4223 | l = gen_xmlListPtr(n_l); |
| 4224 | |
| 4225 | ret_val = xmlListSize(l); |
| 4226 | desret_int(ret_val); |
| 4227 | call_tests++; |
| 4228 | des_xmlListPtr(n_l, l); |
| 4229 | xmlResetLastError(); |
| 4230 | if (mem_base != xmlMemBlocks()) { |
| 4231 | printf("Leak of %d blocks found in xmlListSize", |
| 4232 | xmlMemBlocks() - mem_base); |
| 4233 | ret++; |
| 4234 | printf(" %d", n_l); |
| 4235 | printf("\n"); |
| 4236 | } |
| 4237 | } |
| 4238 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4239 | return(ret); |
| 4240 | } |
| 4241 | |
| 4242 | |
| 4243 | static int |
| 4244 | test_xmlListSort(void) { |
| 4245 | int ret = 0; |
| 4246 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4247 | int mem_base; |
| 4248 | xmlListPtr l; /* a list */ |
| 4249 | int n_l; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4250 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 4251 | for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { |
| 4252 | mem_base = xmlMemBlocks(); |
| 4253 | l = gen_xmlListPtr(n_l); |
| 4254 | |
| 4255 | xmlListSort(l); |
| 4256 | call_tests++; |
| 4257 | des_xmlListPtr(n_l, l); |
| 4258 | xmlResetLastError(); |
| 4259 | if (mem_base != xmlMemBlocks()) { |
| 4260 | printf("Leak of %d blocks found in xmlListSort", |
| 4261 | xmlMemBlocks() - mem_base); |
| 4262 | ret++; |
| 4263 | printf(" %d", n_l); |
| 4264 | printf("\n"); |
| 4265 | } |
| 4266 | } |
| 4267 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4268 | return(ret); |
| 4269 | } |
| 4270 | |
| 4271 | |
| 4272 | static int |
| 4273 | test_xmlListWalk(void) { |
| 4274 | int ret = 0; |
| 4275 | |
| 4276 | |
| 4277 | /* missing type support */ |
| 4278 | return(ret); |
| 4279 | } |
| 4280 | |
| 4281 | static int |
| 4282 | test_list(void) { |
| 4283 | int ret = 0; |
| 4284 | |
| 4285 | printf("Testing list ...\n"); |
| 4286 | ret += test_xmlLinkGetData(); |
| 4287 | ret += test_xmlListAppend(); |
| 4288 | ret += test_xmlListClear(); |
| 4289 | ret += test_xmlListCopy(); |
| 4290 | ret += test_xmlListCreate(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4291 | ret += test_xmlListDup(); |
| 4292 | ret += test_xmlListEmpty(); |
| 4293 | ret += test_xmlListEnd(); |
| 4294 | ret += test_xmlListFront(); |
| 4295 | ret += test_xmlListInsert(); |
| 4296 | ret += test_xmlListMerge(); |
| 4297 | ret += test_xmlListPopBack(); |
| 4298 | ret += test_xmlListPopFront(); |
| 4299 | ret += test_xmlListPushBack(); |
| 4300 | ret += test_xmlListPushFront(); |
| 4301 | ret += test_xmlListRemoveAll(); |
| 4302 | ret += test_xmlListRemoveFirst(); |
| 4303 | ret += test_xmlListRemoveLast(); |
| 4304 | ret += test_xmlListReverse(); |
| 4305 | ret += test_xmlListReverseSearch(); |
| 4306 | ret += test_xmlListReverseWalk(); |
| 4307 | ret += test_xmlListSearch(); |
| 4308 | ret += test_xmlListSize(); |
| 4309 | ret += test_xmlListSort(); |
| 4310 | ret += test_xmlListWalk(); |
| 4311 | |
| 4312 | if (ret != 0) |
| 4313 | printf("Module list: %d errors\n", ret); |
| 4314 | return(ret); |
| 4315 | } |
| 4316 | |
| 4317 | static int |
| 4318 | test_xmlNanoFTPCheckResponse(void) { |
| 4319 | int ret = 0; |
| 4320 | |
| 4321 | |
| 4322 | /* missing type support */ |
| 4323 | return(ret); |
| 4324 | } |
| 4325 | |
| 4326 | |
| 4327 | static int |
| 4328 | test_xmlNanoFTPCleanup(void) { |
| 4329 | int ret = 0; |
| 4330 | |
| 4331 | #ifdef LIBXML_FTP_ENABLED |
| 4332 | int mem_base; |
| 4333 | |
| 4334 | mem_base = xmlMemBlocks(); |
| 4335 | |
| 4336 | xmlNanoFTPCleanup(); |
| 4337 | call_tests++; |
| 4338 | xmlResetLastError(); |
| 4339 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4340 | printf("Leak of %d blocks found in xmlNanoFTPCleanup", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4341 | xmlMemBlocks() - mem_base); |
| 4342 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4343 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4344 | } |
| 4345 | #endif |
| 4346 | |
| 4347 | return(ret); |
| 4348 | } |
| 4349 | |
| 4350 | |
| 4351 | static int |
| 4352 | test_xmlNanoFTPClose(void) { |
| 4353 | int ret = 0; |
| 4354 | |
| 4355 | |
| 4356 | /* missing type support */ |
| 4357 | return(ret); |
| 4358 | } |
| 4359 | |
| 4360 | |
| 4361 | static int |
| 4362 | test_xmlNanoFTPCloseConnection(void) { |
| 4363 | int ret = 0; |
| 4364 | |
| 4365 | |
| 4366 | /* missing type support */ |
| 4367 | return(ret); |
| 4368 | } |
| 4369 | |
| 4370 | |
| 4371 | static int |
| 4372 | test_xmlNanoFTPConnect(void) { |
| 4373 | int ret = 0; |
| 4374 | |
| 4375 | |
| 4376 | /* missing type support */ |
| 4377 | return(ret); |
| 4378 | } |
| 4379 | |
| 4380 | |
| 4381 | static int |
| 4382 | test_xmlNanoFTPConnectTo(void) { |
| 4383 | int ret = 0; |
| 4384 | |
| 4385 | |
| 4386 | /* missing type support */ |
| 4387 | return(ret); |
| 4388 | } |
| 4389 | |
| 4390 | |
| 4391 | static int |
| 4392 | test_xmlNanoFTPCwd(void) { |
| 4393 | int ret = 0; |
| 4394 | |
| 4395 | |
| 4396 | /* missing type support */ |
| 4397 | return(ret); |
| 4398 | } |
| 4399 | |
| 4400 | |
| 4401 | static int |
| 4402 | test_xmlNanoFTPDele(void) { |
| 4403 | int ret = 0; |
| 4404 | |
| 4405 | |
| 4406 | /* missing type support */ |
| 4407 | return(ret); |
| 4408 | } |
| 4409 | |
| 4410 | |
| 4411 | static int |
| 4412 | test_xmlNanoFTPGet(void) { |
| 4413 | int ret = 0; |
| 4414 | |
| 4415 | |
| 4416 | /* missing type support */ |
| 4417 | return(ret); |
| 4418 | } |
| 4419 | |
| 4420 | |
| 4421 | static int |
| 4422 | test_xmlNanoFTPGetConnection(void) { |
| 4423 | int ret = 0; |
| 4424 | |
| 4425 | |
| 4426 | /* missing type support */ |
| 4427 | return(ret); |
| 4428 | } |
| 4429 | |
| 4430 | |
| 4431 | static int |
| 4432 | test_xmlNanoFTPGetResponse(void) { |
| 4433 | int ret = 0; |
| 4434 | |
| 4435 | |
| 4436 | /* missing type support */ |
| 4437 | return(ret); |
| 4438 | } |
| 4439 | |
| 4440 | |
| 4441 | static int |
| 4442 | test_xmlNanoFTPGetSocket(void) { |
| 4443 | int ret = 0; |
| 4444 | |
| 4445 | |
| 4446 | /* missing type support */ |
| 4447 | return(ret); |
| 4448 | } |
| 4449 | |
| 4450 | |
| 4451 | static int |
| 4452 | test_xmlNanoFTPInit(void) { |
| 4453 | int ret = 0; |
| 4454 | |
| 4455 | #ifdef LIBXML_FTP_ENABLED |
| 4456 | int mem_base; |
| 4457 | |
| 4458 | mem_base = xmlMemBlocks(); |
| 4459 | |
| 4460 | xmlNanoFTPInit(); |
| 4461 | call_tests++; |
| 4462 | xmlResetLastError(); |
| 4463 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4464 | printf("Leak of %d blocks found in xmlNanoFTPInit", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4465 | xmlMemBlocks() - mem_base); |
| 4466 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4467 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4468 | } |
| 4469 | #endif |
| 4470 | |
| 4471 | return(ret); |
| 4472 | } |
| 4473 | |
| 4474 | |
| 4475 | static int |
| 4476 | test_xmlNanoFTPList(void) { |
| 4477 | int ret = 0; |
| 4478 | |
| 4479 | |
| 4480 | /* missing type support */ |
| 4481 | return(ret); |
| 4482 | } |
| 4483 | |
| 4484 | |
| 4485 | static int |
| 4486 | test_xmlNanoFTPNewCtxt(void) { |
| 4487 | int ret = 0; |
| 4488 | |
| 4489 | |
| 4490 | /* missing type support */ |
| 4491 | return(ret); |
| 4492 | } |
| 4493 | |
| 4494 | |
| 4495 | static int |
| 4496 | test_xmlNanoFTPOpen(void) { |
| 4497 | int ret = 0; |
| 4498 | |
| 4499 | |
| 4500 | /* missing type support */ |
| 4501 | return(ret); |
| 4502 | } |
| 4503 | |
| 4504 | |
| 4505 | static int |
| 4506 | test_xmlNanoFTPProxy(void) { |
| 4507 | int ret = 0; |
| 4508 | |
| 4509 | #ifdef LIBXML_FTP_ENABLED |
| 4510 | const char * host; /* the proxy host name */ |
| 4511 | int n_host; |
| 4512 | int port; /* the proxy port */ |
| 4513 | int n_port; |
| 4514 | const char * user; /* the proxy user name */ |
| 4515 | int n_user; |
| 4516 | const char * passwd; /* the proxy password */ |
| 4517 | int n_passwd; |
| 4518 | int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */ |
| 4519 | int n_type; |
| 4520 | |
| 4521 | for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) { |
| 4522 | for (n_port = 0;n_port < gen_nb_int;n_port++) { |
| 4523 | for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) { |
| 4524 | for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) { |
| 4525 | for (n_type = 0;n_type < gen_nb_int;n_type++) { |
| 4526 | host = gen_const_char_ptr(n_host); |
| 4527 | port = gen_int(n_port); |
| 4528 | user = gen_const_char_ptr(n_user); |
| 4529 | passwd = gen_const_char_ptr(n_passwd); |
| 4530 | type = gen_int(n_type); |
| 4531 | |
| 4532 | xmlNanoFTPProxy(host, port, user, passwd, type); |
| 4533 | call_tests++; |
| 4534 | des_const_char_ptr(n_host, host); |
| 4535 | des_int(n_port, port); |
| 4536 | des_const_char_ptr(n_user, user); |
| 4537 | des_const_char_ptr(n_passwd, passwd); |
| 4538 | des_int(n_type, type); |
| 4539 | xmlResetLastError(); |
| 4540 | } |
| 4541 | } |
| 4542 | } |
| 4543 | } |
| 4544 | } |
| 4545 | #endif |
| 4546 | |
| 4547 | return(ret); |
| 4548 | } |
| 4549 | |
| 4550 | |
| 4551 | static int |
| 4552 | test_xmlNanoFTPQuit(void) { |
| 4553 | int ret = 0; |
| 4554 | |
| 4555 | |
| 4556 | /* missing type support */ |
| 4557 | return(ret); |
| 4558 | } |
| 4559 | |
| 4560 | |
| 4561 | static int |
| 4562 | test_xmlNanoFTPRead(void) { |
| 4563 | int ret = 0; |
| 4564 | |
| 4565 | |
| 4566 | /* missing type support */ |
| 4567 | return(ret); |
| 4568 | } |
| 4569 | |
| 4570 | |
| 4571 | static int |
| 4572 | test_xmlNanoFTPScanProxy(void) { |
| 4573 | int ret = 0; |
| 4574 | |
| 4575 | #ifdef LIBXML_FTP_ENABLED |
| 4576 | const char * URL; /* The proxy URL used to initialize the proxy context */ |
| 4577 | int n_URL; |
| 4578 | |
| 4579 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 4580 | URL = gen_filepath(n_URL); |
| 4581 | |
| 4582 | xmlNanoFTPScanProxy(URL); |
| 4583 | call_tests++; |
| 4584 | des_filepath(n_URL, URL); |
| 4585 | xmlResetLastError(); |
| 4586 | } |
| 4587 | #endif |
| 4588 | |
| 4589 | return(ret); |
| 4590 | } |
| 4591 | |
| 4592 | |
| 4593 | static int |
| 4594 | test_xmlNanoFTPUpdateURL(void) { |
| 4595 | int ret = 0; |
| 4596 | |
| 4597 | |
| 4598 | /* missing type support */ |
| 4599 | return(ret); |
| 4600 | } |
| 4601 | |
| 4602 | static int |
| 4603 | test_nanoftp(void) { |
| 4604 | int ret = 0; |
| 4605 | |
| 4606 | printf("Testing nanoftp ...\n"); |
| 4607 | ret += test_xmlNanoFTPCheckResponse(); |
| 4608 | ret += test_xmlNanoFTPCleanup(); |
| 4609 | ret += test_xmlNanoFTPClose(); |
| 4610 | ret += test_xmlNanoFTPCloseConnection(); |
| 4611 | ret += test_xmlNanoFTPConnect(); |
| 4612 | ret += test_xmlNanoFTPConnectTo(); |
| 4613 | ret += test_xmlNanoFTPCwd(); |
| 4614 | ret += test_xmlNanoFTPDele(); |
| 4615 | ret += test_xmlNanoFTPGet(); |
| 4616 | ret += test_xmlNanoFTPGetConnection(); |
| 4617 | ret += test_xmlNanoFTPGetResponse(); |
| 4618 | ret += test_xmlNanoFTPGetSocket(); |
| 4619 | ret += test_xmlNanoFTPInit(); |
| 4620 | ret += test_xmlNanoFTPList(); |
| 4621 | ret += test_xmlNanoFTPNewCtxt(); |
| 4622 | ret += test_xmlNanoFTPOpen(); |
| 4623 | ret += test_xmlNanoFTPProxy(); |
| 4624 | ret += test_xmlNanoFTPQuit(); |
| 4625 | ret += test_xmlNanoFTPRead(); |
| 4626 | ret += test_xmlNanoFTPScanProxy(); |
| 4627 | ret += test_xmlNanoFTPUpdateURL(); |
| 4628 | |
| 4629 | if (ret != 0) |
| 4630 | printf("Module nanoftp: %d errors\n", ret); |
| 4631 | return(ret); |
| 4632 | } |
| 4633 | |
| 4634 | static int |
| 4635 | test_xmlNanoHTTPAuthHeader(void) { |
| 4636 | int ret = 0; |
| 4637 | |
| 4638 | |
| 4639 | /* missing type support */ |
| 4640 | return(ret); |
| 4641 | } |
| 4642 | |
| 4643 | |
| 4644 | static int |
| 4645 | test_xmlNanoHTTPCleanup(void) { |
| 4646 | int ret = 0; |
| 4647 | |
| 4648 | #ifdef LIBXML_HTTP_ENABLED |
| 4649 | int mem_base; |
| 4650 | |
| 4651 | mem_base = xmlMemBlocks(); |
| 4652 | |
| 4653 | xmlNanoHTTPCleanup(); |
| 4654 | call_tests++; |
| 4655 | xmlResetLastError(); |
| 4656 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4657 | printf("Leak of %d blocks found in xmlNanoHTTPCleanup", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4658 | xmlMemBlocks() - mem_base); |
| 4659 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4660 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4661 | } |
| 4662 | #endif |
| 4663 | |
| 4664 | return(ret); |
| 4665 | } |
| 4666 | |
| 4667 | |
| 4668 | static int |
| 4669 | test_xmlNanoHTTPClose(void) { |
| 4670 | int ret = 0; |
| 4671 | |
| 4672 | |
| 4673 | /* missing type support */ |
| 4674 | return(ret); |
| 4675 | } |
| 4676 | |
| 4677 | |
| 4678 | static int |
| 4679 | test_xmlNanoHTTPContentLength(void) { |
| 4680 | int ret = 0; |
| 4681 | |
| 4682 | |
| 4683 | /* missing type support */ |
| 4684 | return(ret); |
| 4685 | } |
| 4686 | |
| 4687 | |
| 4688 | static int |
| 4689 | test_xmlNanoHTTPEncoding(void) { |
| 4690 | int ret = 0; |
| 4691 | |
| 4692 | |
| 4693 | /* missing type support */ |
| 4694 | return(ret); |
| 4695 | } |
| 4696 | |
| 4697 | |
| 4698 | static int |
| 4699 | test_xmlNanoHTTPFetch(void) { |
| 4700 | int ret = 0; |
| 4701 | |
| 4702 | |
| 4703 | /* missing type support */ |
| 4704 | return(ret); |
| 4705 | } |
| 4706 | |
| 4707 | |
| 4708 | static int |
| 4709 | test_xmlNanoHTTPInit(void) { |
| 4710 | int ret = 0; |
| 4711 | |
| 4712 | #ifdef LIBXML_HTTP_ENABLED |
| 4713 | int mem_base; |
| 4714 | |
| 4715 | mem_base = xmlMemBlocks(); |
| 4716 | |
| 4717 | xmlNanoHTTPInit(); |
| 4718 | call_tests++; |
| 4719 | xmlResetLastError(); |
| 4720 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4721 | printf("Leak of %d blocks found in xmlNanoHTTPInit", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4722 | xmlMemBlocks() - mem_base); |
| 4723 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4724 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4725 | } |
| 4726 | #endif |
| 4727 | |
| 4728 | return(ret); |
| 4729 | } |
| 4730 | |
| 4731 | |
| 4732 | static int |
| 4733 | test_xmlNanoHTTPMethod(void) { |
| 4734 | int ret = 0; |
| 4735 | |
| 4736 | |
| 4737 | /* missing type support */ |
| 4738 | return(ret); |
| 4739 | } |
| 4740 | |
| 4741 | |
| 4742 | static int |
| 4743 | test_xmlNanoHTTPMethodRedir(void) { |
| 4744 | int ret = 0; |
| 4745 | |
| 4746 | |
| 4747 | /* missing type support */ |
| 4748 | return(ret); |
| 4749 | } |
| 4750 | |
| 4751 | |
| 4752 | static int |
| 4753 | test_xmlNanoHTTPMimeType(void) { |
| 4754 | int ret = 0; |
| 4755 | |
| 4756 | |
| 4757 | /* missing type support */ |
| 4758 | return(ret); |
| 4759 | } |
| 4760 | |
| 4761 | |
| 4762 | static int |
| 4763 | test_xmlNanoHTTPOpen(void) { |
| 4764 | int ret = 0; |
| 4765 | |
| 4766 | |
| 4767 | /* missing type support */ |
| 4768 | return(ret); |
| 4769 | } |
| 4770 | |
| 4771 | |
| 4772 | static int |
| 4773 | test_xmlNanoHTTPOpenRedir(void) { |
| 4774 | int ret = 0; |
| 4775 | |
| 4776 | |
| 4777 | /* missing type support */ |
| 4778 | return(ret); |
| 4779 | } |
| 4780 | |
| 4781 | |
| 4782 | static int |
| 4783 | test_xmlNanoHTTPRead(void) { |
| 4784 | int ret = 0; |
| 4785 | |
| 4786 | |
| 4787 | /* missing type support */ |
| 4788 | return(ret); |
| 4789 | } |
| 4790 | |
| 4791 | |
| 4792 | static int |
| 4793 | test_xmlNanoHTTPRedir(void) { |
| 4794 | int ret = 0; |
| 4795 | |
| 4796 | |
| 4797 | /* missing type support */ |
| 4798 | return(ret); |
| 4799 | } |
| 4800 | |
| 4801 | |
| 4802 | static int |
| 4803 | test_xmlNanoHTTPReturnCode(void) { |
| 4804 | int ret = 0; |
| 4805 | |
| 4806 | |
| 4807 | /* missing type support */ |
| 4808 | return(ret); |
| 4809 | } |
| 4810 | |
| 4811 | |
| 4812 | static int |
| 4813 | test_xmlNanoHTTPSave(void) { |
| 4814 | int ret = 0; |
| 4815 | |
| 4816 | |
| 4817 | /* missing type support */ |
| 4818 | return(ret); |
| 4819 | } |
| 4820 | |
| 4821 | |
| 4822 | static int |
| 4823 | test_xmlNanoHTTPScanProxy(void) { |
| 4824 | int ret = 0; |
| 4825 | |
| 4826 | #ifdef LIBXML_HTTP_ENABLED |
| 4827 | const char * URL; /* The proxy URL used to initialize the proxy context */ |
| 4828 | int n_URL; |
| 4829 | |
| 4830 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 4831 | URL = gen_filepath(n_URL); |
| 4832 | |
| 4833 | xmlNanoHTTPScanProxy(URL); |
| 4834 | call_tests++; |
| 4835 | des_filepath(n_URL, URL); |
| 4836 | xmlResetLastError(); |
| 4837 | } |
| 4838 | #endif |
| 4839 | |
| 4840 | return(ret); |
| 4841 | } |
| 4842 | |
| 4843 | static int |
| 4844 | test_nanohttp(void) { |
| 4845 | int ret = 0; |
| 4846 | |
| 4847 | printf("Testing nanohttp ...\n"); |
| 4848 | ret += test_xmlNanoHTTPAuthHeader(); |
| 4849 | ret += test_xmlNanoHTTPCleanup(); |
| 4850 | ret += test_xmlNanoHTTPClose(); |
| 4851 | ret += test_xmlNanoHTTPContentLength(); |
| 4852 | ret += test_xmlNanoHTTPEncoding(); |
| 4853 | ret += test_xmlNanoHTTPFetch(); |
| 4854 | ret += test_xmlNanoHTTPInit(); |
| 4855 | ret += test_xmlNanoHTTPMethod(); |
| 4856 | ret += test_xmlNanoHTTPMethodRedir(); |
| 4857 | ret += test_xmlNanoHTTPMimeType(); |
| 4858 | ret += test_xmlNanoHTTPOpen(); |
| 4859 | ret += test_xmlNanoHTTPOpenRedir(); |
| 4860 | ret += test_xmlNanoHTTPRead(); |
| 4861 | ret += test_xmlNanoHTTPRedir(); |
| 4862 | ret += test_xmlNanoHTTPReturnCode(); |
| 4863 | ret += test_xmlNanoHTTPSave(); |
| 4864 | ret += test_xmlNanoHTTPScanProxy(); |
| 4865 | |
| 4866 | if (ret != 0) |
| 4867 | printf("Module nanohttp: %d errors\n", ret); |
| 4868 | return(ret); |
| 4869 | } |
| 4870 | |
| 4871 | static int |
| 4872 | test_xmlByteConsumed(void) { |
| 4873 | int ret = 0; |
| 4874 | |
| 4875 | |
| 4876 | /* missing type support */ |
| 4877 | return(ret); |
| 4878 | } |
| 4879 | |
| 4880 | |
| 4881 | static int |
| 4882 | test_xmlClearNodeInfoSeq(void) { |
| 4883 | int ret = 0; |
| 4884 | |
| 4885 | |
| 4886 | /* missing type support */ |
| 4887 | return(ret); |
| 4888 | } |
| 4889 | |
| 4890 | |
| 4891 | static int |
| 4892 | test_xmlClearParserCtxt(void) { |
| 4893 | int ret = 0; |
| 4894 | |
| 4895 | int mem_base; |
| 4896 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 4897 | int n_ctxt; |
| 4898 | |
| 4899 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 4900 | mem_base = xmlMemBlocks(); |
| 4901 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 4902 | |
| 4903 | xmlClearParserCtxt(ctxt); |
| 4904 | call_tests++; |
| 4905 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 4906 | xmlResetLastError(); |
| 4907 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4908 | printf("Leak of %d blocks found in xmlClearParserCtxt", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4909 | xmlMemBlocks() - mem_base); |
| 4910 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4911 | printf(" %d", n_ctxt); |
| 4912 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4913 | } |
| 4914 | } |
| 4915 | |
| 4916 | return(ret); |
| 4917 | } |
| 4918 | |
| 4919 | |
| 4920 | static int |
| 4921 | test_xmlCreateDocParserCtxt(void) { |
| 4922 | int ret = 0; |
| 4923 | |
| 4924 | |
| 4925 | /* missing type support */ |
| 4926 | return(ret); |
| 4927 | } |
| 4928 | |
| 4929 | |
| 4930 | static int |
| 4931 | test_xmlCreateIOParserCtxt(void) { |
| 4932 | int ret = 0; |
| 4933 | |
| 4934 | |
| 4935 | /* missing type support */ |
| 4936 | return(ret); |
| 4937 | } |
| 4938 | |
| 4939 | |
| 4940 | static int |
| 4941 | test_xmlCreatePushParserCtxt(void) { |
| 4942 | int ret = 0; |
| 4943 | |
| 4944 | |
| 4945 | /* missing type support */ |
| 4946 | return(ret); |
| 4947 | } |
| 4948 | |
| 4949 | |
| 4950 | static int |
| 4951 | test_xmlCtxtReadDoc(void) { |
| 4952 | int ret = 0; |
| 4953 | |
| 4954 | int mem_base; |
| 4955 | xmlDocPtr ret_val; |
| 4956 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 4957 | int n_ctxt; |
| 4958 | const xmlChar * cur; /* a pointer to a zero terminated string */ |
| 4959 | int n_cur; |
| 4960 | const char * URL; /* the base URL to use for the document */ |
| 4961 | int n_URL; |
| 4962 | const char * encoding; /* the document encoding, or NULL */ |
| 4963 | int n_encoding; |
| 4964 | int options; /* a combination of xmlParserOption */ |
| 4965 | int n_options; |
| 4966 | |
| 4967 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 4968 | for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { |
| 4969 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 4970 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 4971 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 4972 | mem_base = xmlMemBlocks(); |
| 4973 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 4974 | cur = gen_const_xmlChar_ptr(n_cur); |
| 4975 | URL = gen_filepath(n_URL); |
| 4976 | encoding = gen_const_char_ptr(n_encoding); |
| 4977 | options = gen_int(n_options); |
| 4978 | |
| 4979 | ret_val = xmlCtxtReadDoc(ctxt, cur, URL, encoding, options); |
| 4980 | desret_xmlDocPtr(ret_val); |
| 4981 | call_tests++; |
| 4982 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 4983 | des_const_xmlChar_ptr(n_cur, cur); |
| 4984 | des_filepath(n_URL, URL); |
| 4985 | des_const_char_ptr(n_encoding, encoding); |
| 4986 | des_int(n_options, options); |
| 4987 | xmlResetLastError(); |
| 4988 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4989 | printf("Leak of %d blocks found in xmlCtxtReadDoc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4990 | xmlMemBlocks() - mem_base); |
| 4991 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 4992 | printf(" %d", n_ctxt); |
| 4993 | printf(" %d", n_cur); |
| 4994 | printf(" %d", n_URL); |
| 4995 | printf(" %d", n_encoding); |
| 4996 | printf(" %d", n_options); |
| 4997 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 4998 | } |
| 4999 | } |
| 5000 | } |
| 5001 | } |
| 5002 | } |
| 5003 | } |
| 5004 | |
| 5005 | return(ret); |
| 5006 | } |
| 5007 | |
| 5008 | |
| 5009 | static int |
| 5010 | test_xmlCtxtReadFile(void) { |
| 5011 | int ret = 0; |
| 5012 | |
| 5013 | int mem_base; |
| 5014 | xmlDocPtr ret_val; |
| 5015 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 5016 | int n_ctxt; |
| 5017 | const char * filename; /* a file or URL */ |
| 5018 | int n_filename; |
| 5019 | const char * encoding; /* the document encoding, or NULL */ |
| 5020 | int n_encoding; |
| 5021 | int options; /* a combination of xmlParserOption */ |
| 5022 | int n_options; |
| 5023 | |
| 5024 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 5025 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 5026 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 5027 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 5028 | mem_base = xmlMemBlocks(); |
| 5029 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 5030 | filename = gen_filepath(n_filename); |
| 5031 | encoding = gen_const_char_ptr(n_encoding); |
| 5032 | options = gen_int(n_options); |
| 5033 | |
| 5034 | ret_val = xmlCtxtReadFile(ctxt, filename, encoding, options); |
| 5035 | desret_xmlDocPtr(ret_val); |
| 5036 | call_tests++; |
| 5037 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 5038 | des_filepath(n_filename, filename); |
| 5039 | des_const_char_ptr(n_encoding, encoding); |
| 5040 | des_int(n_options, options); |
| 5041 | xmlResetLastError(); |
| 5042 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5043 | printf("Leak of %d blocks found in xmlCtxtReadFile", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5044 | xmlMemBlocks() - mem_base); |
| 5045 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5046 | printf(" %d", n_ctxt); |
| 5047 | printf(" %d", n_filename); |
| 5048 | printf(" %d", n_encoding); |
| 5049 | printf(" %d", n_options); |
| 5050 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5051 | } |
| 5052 | } |
| 5053 | } |
| 5054 | } |
| 5055 | } |
| 5056 | |
| 5057 | return(ret); |
| 5058 | } |
| 5059 | |
| 5060 | |
| 5061 | static int |
| 5062 | test_xmlCtxtReadIO(void) { |
| 5063 | int ret = 0; |
| 5064 | |
| 5065 | |
| 5066 | /* missing type support */ |
| 5067 | return(ret); |
| 5068 | } |
| 5069 | |
| 5070 | |
| 5071 | static int |
| 5072 | test_xmlCtxtReadMemory(void) { |
| 5073 | int ret = 0; |
| 5074 | |
| 5075 | int mem_base; |
| 5076 | xmlDocPtr ret_val; |
| 5077 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 5078 | int n_ctxt; |
| 5079 | const char * buffer; /* a pointer to a char array */ |
| 5080 | int n_buffer; |
| 5081 | int size; /* the size of the array */ |
| 5082 | int n_size; |
| 5083 | const char * URL; /* the base URL to use for the document */ |
| 5084 | int n_URL; |
| 5085 | const char * encoding; /* the document encoding, or NULL */ |
| 5086 | int n_encoding; |
| 5087 | int options; /* a combination of xmlParserOption */ |
| 5088 | int n_options; |
| 5089 | |
| 5090 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 5091 | for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { |
| 5092 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 5093 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 5094 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 5095 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 5096 | mem_base = xmlMemBlocks(); |
| 5097 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 5098 | buffer = gen_const_char_ptr(n_buffer); |
| 5099 | size = gen_int(n_size); |
| 5100 | URL = gen_filepath(n_URL); |
| 5101 | encoding = gen_const_char_ptr(n_encoding); |
| 5102 | options = gen_int(n_options); |
| 5103 | |
| 5104 | ret_val = xmlCtxtReadMemory(ctxt, buffer, size, URL, encoding, options); |
| 5105 | desret_xmlDocPtr(ret_val); |
| 5106 | call_tests++; |
| 5107 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 5108 | des_const_char_ptr(n_buffer, buffer); |
| 5109 | des_int(n_size, size); |
| 5110 | des_filepath(n_URL, URL); |
| 5111 | des_const_char_ptr(n_encoding, encoding); |
| 5112 | des_int(n_options, options); |
| 5113 | xmlResetLastError(); |
| 5114 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5115 | printf("Leak of %d blocks found in xmlCtxtReadMemory", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5116 | xmlMemBlocks() - mem_base); |
| 5117 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5118 | printf(" %d", n_ctxt); |
| 5119 | printf(" %d", n_buffer); |
| 5120 | printf(" %d", n_size); |
| 5121 | printf(" %d", n_URL); |
| 5122 | printf(" %d", n_encoding); |
| 5123 | printf(" %d", n_options); |
| 5124 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5125 | } |
| 5126 | } |
| 5127 | } |
| 5128 | } |
| 5129 | } |
| 5130 | } |
| 5131 | } |
| 5132 | |
| 5133 | return(ret); |
| 5134 | } |
| 5135 | |
| 5136 | |
| 5137 | static int |
| 5138 | test_xmlCtxtReset(void) { |
| 5139 | int ret = 0; |
| 5140 | |
| 5141 | int mem_base; |
| 5142 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 5143 | int n_ctxt; |
| 5144 | |
| 5145 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 5146 | mem_base = xmlMemBlocks(); |
| 5147 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 5148 | |
| 5149 | xmlCtxtReset(ctxt); |
| 5150 | call_tests++; |
| 5151 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 5152 | xmlResetLastError(); |
| 5153 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5154 | printf("Leak of %d blocks found in xmlCtxtReset", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5155 | xmlMemBlocks() - mem_base); |
| 5156 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5157 | printf(" %d", n_ctxt); |
| 5158 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5159 | } |
| 5160 | } |
| 5161 | |
| 5162 | return(ret); |
| 5163 | } |
| 5164 | |
| 5165 | |
| 5166 | static int |
| 5167 | test_xmlCtxtResetPush(void) { |
| 5168 | int ret = 0; |
| 5169 | |
| 5170 | int mem_base; |
| 5171 | int ret_val; |
| 5172 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 5173 | int n_ctxt; |
| 5174 | const char * chunk; /* a pointer to an array of chars */ |
| 5175 | int n_chunk; |
| 5176 | int size; /* number of chars in the array */ |
| 5177 | int n_size; |
| 5178 | const char * filename; /* an optional file name or URI */ |
| 5179 | int n_filename; |
| 5180 | const char * encoding; /* the document encoding, or NULL */ |
| 5181 | int n_encoding; |
| 5182 | |
| 5183 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 5184 | for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { |
| 5185 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 5186 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 5187 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 5188 | mem_base = xmlMemBlocks(); |
| 5189 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 5190 | chunk = gen_const_char_ptr(n_chunk); |
| 5191 | size = gen_int(n_size); |
| 5192 | filename = gen_filepath(n_filename); |
| 5193 | encoding = gen_const_char_ptr(n_encoding); |
| 5194 | |
| 5195 | ret_val = xmlCtxtResetPush(ctxt, chunk, size, filename, encoding); |
| 5196 | desret_int(ret_val); |
| 5197 | call_tests++; |
| 5198 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 5199 | des_const_char_ptr(n_chunk, chunk); |
| 5200 | des_int(n_size, size); |
| 5201 | des_filepath(n_filename, filename); |
| 5202 | des_const_char_ptr(n_encoding, encoding); |
| 5203 | xmlResetLastError(); |
| 5204 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5205 | printf("Leak of %d blocks found in xmlCtxtResetPush", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5206 | xmlMemBlocks() - mem_base); |
| 5207 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5208 | printf(" %d", n_ctxt); |
| 5209 | printf(" %d", n_chunk); |
| 5210 | printf(" %d", n_size); |
| 5211 | printf(" %d", n_filename); |
| 5212 | printf(" %d", n_encoding); |
| 5213 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5214 | } |
| 5215 | } |
| 5216 | } |
| 5217 | } |
| 5218 | } |
| 5219 | } |
| 5220 | |
| 5221 | return(ret); |
| 5222 | } |
| 5223 | |
| 5224 | |
| 5225 | static int |
| 5226 | test_xmlCtxtUseOptions(void) { |
| 5227 | int ret = 0; |
| 5228 | |
| 5229 | int mem_base; |
| 5230 | int ret_val; |
| 5231 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 5232 | int n_ctxt; |
| 5233 | int options; /* a combination of xmlParserOption */ |
| 5234 | int n_options; |
| 5235 | |
| 5236 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 5237 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 5238 | mem_base = xmlMemBlocks(); |
| 5239 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 5240 | options = gen_int(n_options); |
| 5241 | |
| 5242 | ret_val = xmlCtxtUseOptions(ctxt, options); |
| 5243 | desret_int(ret_val); |
| 5244 | call_tests++; |
| 5245 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 5246 | des_int(n_options, options); |
| 5247 | xmlResetLastError(); |
| 5248 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5249 | printf("Leak of %d blocks found in xmlCtxtUseOptions", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5250 | xmlMemBlocks() - mem_base); |
| 5251 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5252 | printf(" %d", n_ctxt); |
| 5253 | printf(" %d", n_options); |
| 5254 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5255 | } |
| 5256 | } |
| 5257 | } |
| 5258 | |
| 5259 | return(ret); |
| 5260 | } |
| 5261 | |
| 5262 | |
| 5263 | static int |
| 5264 | test_xmlGetExternalEntityLoader(void) { |
| 5265 | int ret = 0; |
| 5266 | |
| 5267 | |
| 5268 | /* missing type support */ |
| 5269 | return(ret); |
| 5270 | } |
| 5271 | |
| 5272 | |
| 5273 | static int |
| 5274 | test_xmlGetFeature(void) { |
| 5275 | int ret = 0; |
| 5276 | |
| 5277 | |
| 5278 | /* missing type support */ |
| 5279 | return(ret); |
| 5280 | } |
| 5281 | |
| 5282 | |
| 5283 | static int |
| 5284 | test_xmlGetFeaturesList(void) { |
| 5285 | int ret = 0; |
| 5286 | |
| 5287 | |
| 5288 | /* missing type support */ |
| 5289 | return(ret); |
| 5290 | } |
| 5291 | |
| 5292 | |
| 5293 | static int |
| 5294 | test_xmlIOParseDTD(void) { |
| 5295 | int ret = 0; |
| 5296 | |
| 5297 | |
| 5298 | /* missing type support */ |
| 5299 | return(ret); |
| 5300 | } |
| 5301 | |
| 5302 | |
| 5303 | static int |
| 5304 | test_xmlInitNodeInfoSeq(void) { |
| 5305 | int ret = 0; |
| 5306 | |
| 5307 | |
| 5308 | /* missing type support */ |
| 5309 | return(ret); |
| 5310 | } |
| 5311 | |
| 5312 | |
| 5313 | static int |
| 5314 | test_xmlInitParser(void) { |
| 5315 | int ret = 0; |
| 5316 | |
| 5317 | int mem_base; |
| 5318 | |
| 5319 | mem_base = xmlMemBlocks(); |
| 5320 | |
| 5321 | xmlInitParser(); |
| 5322 | call_tests++; |
| 5323 | xmlResetLastError(); |
| 5324 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5325 | printf("Leak of %d blocks found in xmlInitParser", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5326 | xmlMemBlocks() - mem_base); |
| 5327 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5328 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5329 | } |
| 5330 | |
| 5331 | return(ret); |
| 5332 | } |
| 5333 | |
| 5334 | |
| 5335 | static int |
| 5336 | test_xmlInitParserCtxt(void) { |
| 5337 | int ret = 0; |
| 5338 | |
| 5339 | int mem_base; |
| 5340 | int ret_val; |
| 5341 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 5342 | int n_ctxt; |
| 5343 | |
| 5344 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 5345 | mem_base = xmlMemBlocks(); |
| 5346 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 5347 | |
| 5348 | ret_val = xmlInitParserCtxt(ctxt); |
| 5349 | desret_int(ret_val); |
| 5350 | call_tests++; |
| 5351 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 5352 | xmlResetLastError(); |
| 5353 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5354 | printf("Leak of %d blocks found in xmlInitParserCtxt", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5355 | xmlMemBlocks() - mem_base); |
| 5356 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5357 | printf(" %d", n_ctxt); |
| 5358 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5359 | } |
| 5360 | } |
| 5361 | |
| 5362 | return(ret); |
| 5363 | } |
| 5364 | |
| 5365 | |
| 5366 | static int |
| 5367 | test_xmlKeepBlanksDefault(void) { |
| 5368 | int ret = 0; |
| 5369 | |
| 5370 | int mem_base; |
| 5371 | int ret_val; |
| 5372 | int val; /* int 0 or 1 */ |
| 5373 | int n_val; |
| 5374 | |
| 5375 | for (n_val = 0;n_val < gen_nb_int;n_val++) { |
| 5376 | mem_base = xmlMemBlocks(); |
| 5377 | val = gen_int(n_val); |
| 5378 | |
| 5379 | ret_val = xmlKeepBlanksDefault(val); |
| 5380 | desret_int(ret_val); |
| 5381 | call_tests++; |
| 5382 | des_int(n_val, val); |
| 5383 | xmlResetLastError(); |
| 5384 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5385 | printf("Leak of %d blocks found in xmlKeepBlanksDefault", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5386 | xmlMemBlocks() - mem_base); |
| 5387 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5388 | printf(" %d", n_val); |
| 5389 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5390 | } |
| 5391 | } |
| 5392 | |
| 5393 | return(ret); |
| 5394 | } |
| 5395 | |
| 5396 | |
| 5397 | static int |
| 5398 | test_xmlLineNumbersDefault(void) { |
| 5399 | int ret = 0; |
| 5400 | |
| 5401 | int mem_base; |
| 5402 | int ret_val; |
| 5403 | int val; /* int 0 or 1 */ |
| 5404 | int n_val; |
| 5405 | |
| 5406 | for (n_val = 0;n_val < gen_nb_int;n_val++) { |
| 5407 | mem_base = xmlMemBlocks(); |
| 5408 | val = gen_int(n_val); |
| 5409 | |
| 5410 | ret_val = xmlLineNumbersDefault(val); |
| 5411 | desret_int(ret_val); |
| 5412 | call_tests++; |
| 5413 | des_int(n_val, val); |
| 5414 | xmlResetLastError(); |
| 5415 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5416 | printf("Leak of %d blocks found in xmlLineNumbersDefault", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5417 | xmlMemBlocks() - mem_base); |
| 5418 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5419 | printf(" %d", n_val); |
| 5420 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5421 | } |
| 5422 | } |
| 5423 | |
| 5424 | return(ret); |
| 5425 | } |
| 5426 | |
| 5427 | |
| 5428 | static int |
| 5429 | test_xmlLoadExternalEntity(void) { |
| 5430 | int ret = 0; |
| 5431 | |
| 5432 | |
| 5433 | /* missing type support */ |
| 5434 | return(ret); |
| 5435 | } |
| 5436 | |
| 5437 | |
| 5438 | static int |
| 5439 | test_xmlNewIOInputStream(void) { |
| 5440 | int ret = 0; |
| 5441 | |
| 5442 | |
| 5443 | /* missing type support */ |
| 5444 | return(ret); |
| 5445 | } |
| 5446 | |
| 5447 | |
| 5448 | static int |
| 5449 | test_xmlNewParserCtxt(void) { |
| 5450 | int ret = 0; |
| 5451 | |
| 5452 | |
| 5453 | /* missing type support */ |
| 5454 | return(ret); |
| 5455 | } |
| 5456 | |
| 5457 | |
| 5458 | static int |
| 5459 | test_xmlParseBalancedChunkMemory(void) { |
| 5460 | int ret = 0; |
| 5461 | |
| 5462 | |
| 5463 | /* missing type support */ |
| 5464 | return(ret); |
| 5465 | } |
| 5466 | |
| 5467 | |
| 5468 | static int |
| 5469 | test_xmlParseBalancedChunkMemoryRecover(void) { |
| 5470 | int ret = 0; |
| 5471 | |
| 5472 | |
| 5473 | /* missing type support */ |
| 5474 | return(ret); |
| 5475 | } |
| 5476 | |
| 5477 | |
| 5478 | static int |
| 5479 | test_xmlParseChunk(void) { |
| 5480 | int ret = 0; |
| 5481 | |
| 5482 | #ifdef LIBXML_PUSH_ENABLED |
| 5483 | int mem_base; |
| 5484 | int ret_val; |
| 5485 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 5486 | int n_ctxt; |
| 5487 | const char * chunk; /* an char array */ |
| 5488 | int n_chunk; |
| 5489 | int size; /* the size in byte of the chunk */ |
| 5490 | int n_size; |
| 5491 | int terminate; /* last chunk indicator */ |
| 5492 | int n_terminate; |
| 5493 | |
| 5494 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 5495 | for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { |
| 5496 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 5497 | for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) { |
| 5498 | mem_base = xmlMemBlocks(); |
| 5499 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 5500 | chunk = gen_const_char_ptr(n_chunk); |
| 5501 | size = gen_int(n_size); |
| 5502 | terminate = gen_int(n_terminate); |
| 5503 | |
| 5504 | ret_val = xmlParseChunk(ctxt, chunk, size, terminate); |
| 5505 | desret_int(ret_val); |
| 5506 | call_tests++; |
| 5507 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 5508 | des_const_char_ptr(n_chunk, chunk); |
| 5509 | des_int(n_size, size); |
| 5510 | des_int(n_terminate, terminate); |
| 5511 | xmlResetLastError(); |
| 5512 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5513 | printf("Leak of %d blocks found in xmlParseChunk", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5514 | xmlMemBlocks() - mem_base); |
| 5515 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5516 | printf(" %d", n_ctxt); |
| 5517 | printf(" %d", n_chunk); |
| 5518 | printf(" %d", n_size); |
| 5519 | printf(" %d", n_terminate); |
| 5520 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5521 | } |
| 5522 | } |
| 5523 | } |
| 5524 | } |
| 5525 | } |
| 5526 | #endif |
| 5527 | |
| 5528 | return(ret); |
| 5529 | } |
| 5530 | |
| 5531 | |
| 5532 | static int |
| 5533 | test_xmlParseCtxtExternalEntity(void) { |
| 5534 | int ret = 0; |
| 5535 | |
| 5536 | |
| 5537 | /* missing type support */ |
| 5538 | return(ret); |
| 5539 | } |
| 5540 | |
| 5541 | |
| 5542 | static int |
| 5543 | test_xmlParseDTD(void) { |
| 5544 | int ret = 0; |
| 5545 | |
| 5546 | |
| 5547 | /* missing type support */ |
| 5548 | return(ret); |
| 5549 | } |
| 5550 | |
| 5551 | |
| 5552 | static int |
| 5553 | test_xmlParseDoc(void) { |
| 5554 | int ret = 0; |
| 5555 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 5556 | int mem_base; |
| 5557 | xmlDocPtr ret_val; |
| 5558 | xmlChar * cur; /* a pointer to an array of xmlChar */ |
| 5559 | int n_cur; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5560 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 5561 | for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) { |
| 5562 | mem_base = xmlMemBlocks(); |
| 5563 | cur = gen_xmlChar_ptr(n_cur); |
| 5564 | |
| 5565 | ret_val = xmlParseDoc(cur); |
| 5566 | desret_xmlDocPtr(ret_val); |
| 5567 | call_tests++; |
| 5568 | des_xmlChar_ptr(n_cur, cur); |
| 5569 | xmlResetLastError(); |
| 5570 | if (mem_base != xmlMemBlocks()) { |
| 5571 | printf("Leak of %d blocks found in xmlParseDoc", |
| 5572 | xmlMemBlocks() - mem_base); |
| 5573 | ret++; |
| 5574 | printf(" %d", n_cur); |
| 5575 | printf("\n"); |
| 5576 | } |
| 5577 | } |
| 5578 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5579 | return(ret); |
| 5580 | } |
| 5581 | |
| 5582 | |
| 5583 | static int |
| 5584 | test_xmlParseDocument(void) { |
| 5585 | int ret = 0; |
| 5586 | |
| 5587 | int mem_base; |
| 5588 | int ret_val; |
| 5589 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 5590 | int n_ctxt; |
| 5591 | |
| 5592 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 5593 | mem_base = xmlMemBlocks(); |
| 5594 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 5595 | |
| 5596 | ret_val = xmlParseDocument(ctxt); |
| 5597 | desret_int(ret_val); |
| 5598 | call_tests++; |
| 5599 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 5600 | xmlResetLastError(); |
| 5601 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5602 | printf("Leak of %d blocks found in xmlParseDocument", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5603 | xmlMemBlocks() - mem_base); |
| 5604 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5605 | printf(" %d", n_ctxt); |
| 5606 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5607 | } |
| 5608 | } |
| 5609 | |
| 5610 | return(ret); |
| 5611 | } |
| 5612 | |
| 5613 | |
| 5614 | static int |
| 5615 | test_xmlParseEntity(void) { |
| 5616 | int ret = 0; |
| 5617 | |
| 5618 | int mem_base; |
| 5619 | xmlDocPtr ret_val; |
| 5620 | const char * filename; /* the filename */ |
| 5621 | int n_filename; |
| 5622 | |
| 5623 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 5624 | mem_base = xmlMemBlocks(); |
| 5625 | filename = gen_filepath(n_filename); |
| 5626 | |
| 5627 | ret_val = xmlParseEntity(filename); |
| 5628 | desret_xmlDocPtr(ret_val); |
| 5629 | call_tests++; |
| 5630 | des_filepath(n_filename, filename); |
| 5631 | xmlResetLastError(); |
| 5632 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5633 | printf("Leak of %d blocks found in xmlParseEntity", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5634 | xmlMemBlocks() - mem_base); |
| 5635 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5636 | printf(" %d", n_filename); |
| 5637 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5638 | } |
| 5639 | } |
| 5640 | |
| 5641 | return(ret); |
| 5642 | } |
| 5643 | |
| 5644 | |
| 5645 | static int |
| 5646 | test_xmlParseExtParsedEnt(void) { |
| 5647 | int ret = 0; |
| 5648 | |
| 5649 | int mem_base; |
| 5650 | int ret_val; |
| 5651 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 5652 | int n_ctxt; |
| 5653 | |
| 5654 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 5655 | mem_base = xmlMemBlocks(); |
| 5656 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 5657 | |
| 5658 | ret_val = xmlParseExtParsedEnt(ctxt); |
| 5659 | desret_int(ret_val); |
| 5660 | call_tests++; |
| 5661 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 5662 | xmlResetLastError(); |
| 5663 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5664 | printf("Leak of %d blocks found in xmlParseExtParsedEnt", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5665 | xmlMemBlocks() - mem_base); |
| 5666 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5667 | printf(" %d", n_ctxt); |
| 5668 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5669 | } |
| 5670 | } |
| 5671 | |
| 5672 | return(ret); |
| 5673 | } |
| 5674 | |
| 5675 | |
| 5676 | static int |
| 5677 | test_xmlParseExternalEntity(void) { |
| 5678 | int ret = 0; |
| 5679 | |
| 5680 | |
| 5681 | /* missing type support */ |
| 5682 | return(ret); |
| 5683 | } |
| 5684 | |
| 5685 | |
| 5686 | static int |
| 5687 | test_xmlParseFile(void) { |
| 5688 | int ret = 0; |
| 5689 | |
| 5690 | int mem_base; |
| 5691 | xmlDocPtr ret_val; |
| 5692 | const char * filename; /* the filename */ |
| 5693 | int n_filename; |
| 5694 | |
| 5695 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 5696 | mem_base = xmlMemBlocks(); |
| 5697 | filename = gen_filepath(n_filename); |
| 5698 | |
| 5699 | ret_val = xmlParseFile(filename); |
| 5700 | desret_xmlDocPtr(ret_val); |
| 5701 | call_tests++; |
| 5702 | des_filepath(n_filename, filename); |
| 5703 | xmlResetLastError(); |
| 5704 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5705 | printf("Leak of %d blocks found in xmlParseFile", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5706 | xmlMemBlocks() - mem_base); |
| 5707 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5708 | printf(" %d", n_filename); |
| 5709 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5710 | } |
| 5711 | } |
| 5712 | |
| 5713 | return(ret); |
| 5714 | } |
| 5715 | |
| 5716 | |
| 5717 | static int |
| 5718 | test_xmlParseInNodeContext(void) { |
| 5719 | int ret = 0; |
| 5720 | |
| 5721 | |
| 5722 | /* missing type support */ |
| 5723 | return(ret); |
| 5724 | } |
| 5725 | |
| 5726 | |
| 5727 | static int |
| 5728 | test_xmlParseMemory(void) { |
| 5729 | int ret = 0; |
| 5730 | |
| 5731 | int mem_base; |
| 5732 | xmlDocPtr ret_val; |
| 5733 | const char * buffer; /* an pointer to a char array */ |
| 5734 | int n_buffer; |
| 5735 | int size; /* the size of the array */ |
| 5736 | int n_size; |
| 5737 | |
| 5738 | for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { |
| 5739 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 5740 | mem_base = xmlMemBlocks(); |
| 5741 | buffer = gen_const_char_ptr(n_buffer); |
| 5742 | size = gen_int(n_size); |
| 5743 | |
| 5744 | ret_val = xmlParseMemory(buffer, size); |
| 5745 | desret_xmlDocPtr(ret_val); |
| 5746 | call_tests++; |
| 5747 | des_const_char_ptr(n_buffer, buffer); |
| 5748 | des_int(n_size, size); |
| 5749 | xmlResetLastError(); |
| 5750 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5751 | printf("Leak of %d blocks found in xmlParseMemory", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5752 | xmlMemBlocks() - mem_base); |
| 5753 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5754 | printf(" %d", n_buffer); |
| 5755 | printf(" %d", n_size); |
| 5756 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5757 | } |
| 5758 | } |
| 5759 | } |
| 5760 | |
| 5761 | return(ret); |
| 5762 | } |
| 5763 | |
| 5764 | |
| 5765 | static int |
| 5766 | test_xmlParserAddNodeInfo(void) { |
| 5767 | int ret = 0; |
| 5768 | |
| 5769 | |
| 5770 | /* missing type support */ |
| 5771 | return(ret); |
| 5772 | } |
| 5773 | |
| 5774 | |
| 5775 | static int |
| 5776 | test_xmlParserFindNodeInfo(void) { |
| 5777 | int ret = 0; |
| 5778 | |
| 5779 | |
| 5780 | /* missing type support */ |
| 5781 | return(ret); |
| 5782 | } |
| 5783 | |
| 5784 | |
| 5785 | static int |
| 5786 | test_xmlParserFindNodeInfoIndex(void) { |
| 5787 | int ret = 0; |
| 5788 | |
| 5789 | |
| 5790 | /* missing type support */ |
| 5791 | return(ret); |
| 5792 | } |
| 5793 | |
| 5794 | |
| 5795 | static int |
| 5796 | test_xmlParserInputGrow(void) { |
| 5797 | int ret = 0; |
| 5798 | |
| 5799 | |
| 5800 | /* missing type support */ |
| 5801 | return(ret); |
| 5802 | } |
| 5803 | |
| 5804 | |
| 5805 | static int |
| 5806 | test_xmlParserInputRead(void) { |
| 5807 | int ret = 0; |
| 5808 | |
| 5809 | |
| 5810 | /* missing type support */ |
| 5811 | return(ret); |
| 5812 | } |
| 5813 | |
| 5814 | |
| 5815 | static int |
| 5816 | test_xmlPedanticParserDefault(void) { |
| 5817 | int ret = 0; |
| 5818 | |
| 5819 | int mem_base; |
| 5820 | int ret_val; |
| 5821 | int val; /* int 0 or 1 */ |
| 5822 | int n_val; |
| 5823 | |
| 5824 | for (n_val = 0;n_val < gen_nb_int;n_val++) { |
| 5825 | mem_base = xmlMemBlocks(); |
| 5826 | val = gen_int(n_val); |
| 5827 | |
| 5828 | ret_val = xmlPedanticParserDefault(val); |
| 5829 | desret_int(ret_val); |
| 5830 | call_tests++; |
| 5831 | des_int(n_val, val); |
| 5832 | xmlResetLastError(); |
| 5833 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5834 | printf("Leak of %d blocks found in xmlPedanticParserDefault", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5835 | xmlMemBlocks() - mem_base); |
| 5836 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5837 | printf(" %d", n_val); |
| 5838 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5839 | } |
| 5840 | } |
| 5841 | |
| 5842 | return(ret); |
| 5843 | } |
| 5844 | |
| 5845 | |
| 5846 | static int |
| 5847 | test_xmlReadDoc(void) { |
| 5848 | int ret = 0; |
| 5849 | |
| 5850 | int mem_base; |
| 5851 | xmlDocPtr ret_val; |
| 5852 | const xmlChar * cur; /* a pointer to a zero terminated string */ |
| 5853 | int n_cur; |
| 5854 | const char * URL; /* the base URL to use for the document */ |
| 5855 | int n_URL; |
| 5856 | const char * encoding; /* the document encoding, or NULL */ |
| 5857 | int n_encoding; |
| 5858 | int options; /* a combination of xmlParserOption */ |
| 5859 | int n_options; |
| 5860 | |
| 5861 | for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { |
| 5862 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 5863 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 5864 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 5865 | mem_base = xmlMemBlocks(); |
| 5866 | cur = gen_const_xmlChar_ptr(n_cur); |
| 5867 | URL = gen_filepath(n_URL); |
| 5868 | encoding = gen_const_char_ptr(n_encoding); |
| 5869 | options = gen_int(n_options); |
| 5870 | |
| 5871 | ret_val = xmlReadDoc(cur, URL, encoding, options); |
| 5872 | desret_xmlDocPtr(ret_val); |
| 5873 | call_tests++; |
| 5874 | des_const_xmlChar_ptr(n_cur, cur); |
| 5875 | des_filepath(n_URL, URL); |
| 5876 | des_const_char_ptr(n_encoding, encoding); |
| 5877 | des_int(n_options, options); |
| 5878 | xmlResetLastError(); |
| 5879 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5880 | printf("Leak of %d blocks found in xmlReadDoc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5881 | xmlMemBlocks() - mem_base); |
| 5882 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5883 | printf(" %d", n_cur); |
| 5884 | printf(" %d", n_URL); |
| 5885 | printf(" %d", n_encoding); |
| 5886 | printf(" %d", n_options); |
| 5887 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5888 | } |
| 5889 | } |
| 5890 | } |
| 5891 | } |
| 5892 | } |
| 5893 | |
| 5894 | return(ret); |
| 5895 | } |
| 5896 | |
| 5897 | |
| 5898 | static int |
| 5899 | test_xmlReadFile(void) { |
| 5900 | int ret = 0; |
| 5901 | |
| 5902 | int mem_base; |
| 5903 | xmlDocPtr ret_val; |
| 5904 | const char * filename; /* a file or URL */ |
| 5905 | int n_filename; |
| 5906 | const char * encoding; /* the document encoding, or NULL */ |
| 5907 | int n_encoding; |
| 5908 | int options; /* a combination of xmlParserOption */ |
| 5909 | int n_options; |
| 5910 | |
| 5911 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 5912 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 5913 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 5914 | mem_base = xmlMemBlocks(); |
| 5915 | filename = gen_filepath(n_filename); |
| 5916 | encoding = gen_const_char_ptr(n_encoding); |
| 5917 | options = gen_int(n_options); |
| 5918 | |
| 5919 | ret_val = xmlReadFile(filename, encoding, options); |
| 5920 | desret_xmlDocPtr(ret_val); |
| 5921 | call_tests++; |
| 5922 | des_filepath(n_filename, filename); |
| 5923 | des_const_char_ptr(n_encoding, encoding); |
| 5924 | des_int(n_options, options); |
| 5925 | xmlResetLastError(); |
| 5926 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5927 | printf("Leak of %d blocks found in xmlReadFile", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5928 | xmlMemBlocks() - mem_base); |
| 5929 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5930 | printf(" %d", n_filename); |
| 5931 | printf(" %d", n_encoding); |
| 5932 | printf(" %d", n_options); |
| 5933 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5934 | } |
| 5935 | } |
| 5936 | } |
| 5937 | } |
| 5938 | |
| 5939 | return(ret); |
| 5940 | } |
| 5941 | |
| 5942 | |
| 5943 | static int |
| 5944 | test_xmlReadIO(void) { |
| 5945 | int ret = 0; |
| 5946 | |
| 5947 | |
| 5948 | /* missing type support */ |
| 5949 | return(ret); |
| 5950 | } |
| 5951 | |
| 5952 | |
| 5953 | static int |
| 5954 | test_xmlReadMemory(void) { |
| 5955 | int ret = 0; |
| 5956 | |
| 5957 | int mem_base; |
| 5958 | xmlDocPtr ret_val; |
| 5959 | const char * buffer; /* a pointer to a char array */ |
| 5960 | int n_buffer; |
| 5961 | int size; /* the size of the array */ |
| 5962 | int n_size; |
| 5963 | const char * URL; /* the base URL to use for the document */ |
| 5964 | int n_URL; |
| 5965 | const char * encoding; /* the document encoding, or NULL */ |
| 5966 | int n_encoding; |
| 5967 | int options; /* a combination of xmlParserOption */ |
| 5968 | int n_options; |
| 5969 | |
| 5970 | for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { |
| 5971 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 5972 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 5973 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 5974 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 5975 | mem_base = xmlMemBlocks(); |
| 5976 | buffer = gen_const_char_ptr(n_buffer); |
| 5977 | size = gen_int(n_size); |
| 5978 | URL = gen_filepath(n_URL); |
| 5979 | encoding = gen_const_char_ptr(n_encoding); |
| 5980 | options = gen_int(n_options); |
| 5981 | |
| 5982 | ret_val = xmlReadMemory(buffer, size, URL, encoding, options); |
| 5983 | desret_xmlDocPtr(ret_val); |
| 5984 | call_tests++; |
| 5985 | des_const_char_ptr(n_buffer, buffer); |
| 5986 | des_int(n_size, size); |
| 5987 | des_filepath(n_URL, URL); |
| 5988 | des_const_char_ptr(n_encoding, encoding); |
| 5989 | des_int(n_options, options); |
| 5990 | xmlResetLastError(); |
| 5991 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5992 | printf("Leak of %d blocks found in xmlReadMemory", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 5993 | xmlMemBlocks() - mem_base); |
| 5994 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 5995 | printf(" %d", n_buffer); |
| 5996 | printf(" %d", n_size); |
| 5997 | printf(" %d", n_URL); |
| 5998 | printf(" %d", n_encoding); |
| 5999 | printf(" %d", n_options); |
| 6000 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6001 | } |
| 6002 | } |
| 6003 | } |
| 6004 | } |
| 6005 | } |
| 6006 | } |
| 6007 | |
| 6008 | return(ret); |
| 6009 | } |
| 6010 | |
| 6011 | |
| 6012 | static int |
| 6013 | test_xmlRecoverDoc(void) { |
| 6014 | int ret = 0; |
| 6015 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 6016 | int mem_base; |
| 6017 | xmlDocPtr ret_val; |
| 6018 | xmlChar * cur; /* a pointer to an array of xmlChar */ |
| 6019 | int n_cur; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6020 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 6021 | for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) { |
| 6022 | mem_base = xmlMemBlocks(); |
| 6023 | cur = gen_xmlChar_ptr(n_cur); |
| 6024 | |
| 6025 | ret_val = xmlRecoverDoc(cur); |
| 6026 | desret_xmlDocPtr(ret_val); |
| 6027 | call_tests++; |
| 6028 | des_xmlChar_ptr(n_cur, cur); |
| 6029 | xmlResetLastError(); |
| 6030 | if (mem_base != xmlMemBlocks()) { |
| 6031 | printf("Leak of %d blocks found in xmlRecoverDoc", |
| 6032 | xmlMemBlocks() - mem_base); |
| 6033 | ret++; |
| 6034 | printf(" %d", n_cur); |
| 6035 | printf("\n"); |
| 6036 | } |
| 6037 | } |
| 6038 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6039 | return(ret); |
| 6040 | } |
| 6041 | |
| 6042 | |
| 6043 | static int |
| 6044 | test_xmlRecoverFile(void) { |
| 6045 | int ret = 0; |
| 6046 | |
| 6047 | int mem_base; |
| 6048 | xmlDocPtr ret_val; |
| 6049 | const char * filename; /* the filename */ |
| 6050 | int n_filename; |
| 6051 | |
| 6052 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 6053 | mem_base = xmlMemBlocks(); |
| 6054 | filename = gen_filepath(n_filename); |
| 6055 | |
| 6056 | ret_val = xmlRecoverFile(filename); |
| 6057 | desret_xmlDocPtr(ret_val); |
| 6058 | call_tests++; |
| 6059 | des_filepath(n_filename, filename); |
| 6060 | xmlResetLastError(); |
| 6061 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6062 | printf("Leak of %d blocks found in xmlRecoverFile", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6063 | xmlMemBlocks() - mem_base); |
| 6064 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6065 | printf(" %d", n_filename); |
| 6066 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6067 | } |
| 6068 | } |
| 6069 | |
| 6070 | return(ret); |
| 6071 | } |
| 6072 | |
| 6073 | |
| 6074 | static int |
| 6075 | test_xmlRecoverMemory(void) { |
| 6076 | int ret = 0; |
| 6077 | |
| 6078 | int mem_base; |
| 6079 | xmlDocPtr ret_val; |
| 6080 | const char * buffer; /* an pointer to a char array */ |
| 6081 | int n_buffer; |
| 6082 | int size; /* the size of the array */ |
| 6083 | int n_size; |
| 6084 | |
| 6085 | for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { |
| 6086 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 6087 | mem_base = xmlMemBlocks(); |
| 6088 | buffer = gen_const_char_ptr(n_buffer); |
| 6089 | size = gen_int(n_size); |
| 6090 | |
| 6091 | ret_val = xmlRecoverMemory(buffer, size); |
| 6092 | desret_xmlDocPtr(ret_val); |
| 6093 | call_tests++; |
| 6094 | des_const_char_ptr(n_buffer, buffer); |
| 6095 | des_int(n_size, size); |
| 6096 | xmlResetLastError(); |
| 6097 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6098 | printf("Leak of %d blocks found in xmlRecoverMemory", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6099 | xmlMemBlocks() - mem_base); |
| 6100 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6101 | printf(" %d", n_buffer); |
| 6102 | printf(" %d", n_size); |
| 6103 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6104 | } |
| 6105 | } |
| 6106 | } |
| 6107 | |
| 6108 | return(ret); |
| 6109 | } |
| 6110 | |
| 6111 | |
| 6112 | static int |
| 6113 | test_xmlSAXParseDTD(void) { |
| 6114 | int ret = 0; |
| 6115 | |
| 6116 | |
| 6117 | /* missing type support */ |
| 6118 | return(ret); |
| 6119 | } |
| 6120 | |
| 6121 | |
| 6122 | static int |
| 6123 | test_xmlSAXParseDoc(void) { |
| 6124 | int ret = 0; |
| 6125 | |
| 6126 | |
| 6127 | /* missing type support */ |
| 6128 | return(ret); |
| 6129 | } |
| 6130 | |
| 6131 | |
| 6132 | static int |
| 6133 | test_xmlSAXParseEntity(void) { |
| 6134 | int ret = 0; |
| 6135 | |
| 6136 | |
| 6137 | /* missing type support */ |
| 6138 | return(ret); |
| 6139 | } |
| 6140 | |
| 6141 | |
| 6142 | static int |
| 6143 | test_xmlSAXParseFile(void) { |
| 6144 | int ret = 0; |
| 6145 | |
| 6146 | |
| 6147 | /* missing type support */ |
| 6148 | return(ret); |
| 6149 | } |
| 6150 | |
| 6151 | |
| 6152 | static int |
| 6153 | test_xmlSAXParseFileWithData(void) { |
| 6154 | int ret = 0; |
| 6155 | |
| 6156 | |
| 6157 | /* missing type support */ |
| 6158 | return(ret); |
| 6159 | } |
| 6160 | |
| 6161 | |
| 6162 | static int |
| 6163 | test_xmlSAXParseMemory(void) { |
| 6164 | int ret = 0; |
| 6165 | |
| 6166 | |
| 6167 | /* missing type support */ |
| 6168 | return(ret); |
| 6169 | } |
| 6170 | |
| 6171 | |
| 6172 | static int |
| 6173 | test_xmlSAXParseMemoryWithData(void) { |
| 6174 | int ret = 0; |
| 6175 | |
| 6176 | |
| 6177 | /* missing type support */ |
| 6178 | return(ret); |
| 6179 | } |
| 6180 | |
| 6181 | |
| 6182 | static int |
| 6183 | test_xmlSAXUserParseFile(void) { |
| 6184 | int ret = 0; |
| 6185 | |
| 6186 | |
| 6187 | /* missing type support */ |
| 6188 | return(ret); |
| 6189 | } |
| 6190 | |
| 6191 | |
| 6192 | static int |
| 6193 | test_xmlSAXUserParseMemory(void) { |
| 6194 | int ret = 0; |
| 6195 | |
| 6196 | |
| 6197 | /* missing type support */ |
| 6198 | return(ret); |
| 6199 | } |
| 6200 | |
| 6201 | |
| 6202 | static int |
| 6203 | test_xmlSetExternalEntityLoader(void) { |
| 6204 | int ret = 0; |
| 6205 | |
| 6206 | |
| 6207 | /* missing type support */ |
| 6208 | return(ret); |
| 6209 | } |
| 6210 | |
| 6211 | |
| 6212 | static int |
| 6213 | test_xmlSetFeature(void) { |
| 6214 | int ret = 0; |
| 6215 | |
| 6216 | |
| 6217 | /* missing type support */ |
| 6218 | return(ret); |
| 6219 | } |
| 6220 | |
| 6221 | |
| 6222 | static int |
| 6223 | test_xmlSetupParserForBuffer(void) { |
| 6224 | int ret = 0; |
| 6225 | |
| 6226 | int mem_base; |
| 6227 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 6228 | int n_ctxt; |
| 6229 | const xmlChar * buffer; /* a xmlChar * buffer */ |
| 6230 | int n_buffer; |
| 6231 | const char * filename; /* a file name */ |
| 6232 | int n_filename; |
| 6233 | |
| 6234 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 6235 | for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) { |
| 6236 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 6237 | mem_base = xmlMemBlocks(); |
| 6238 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 6239 | buffer = gen_const_xmlChar_ptr(n_buffer); |
| 6240 | filename = gen_filepath(n_filename); |
| 6241 | |
| 6242 | xmlSetupParserForBuffer(ctxt, buffer, filename); |
| 6243 | call_tests++; |
| 6244 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 6245 | des_const_xmlChar_ptr(n_buffer, buffer); |
| 6246 | des_filepath(n_filename, filename); |
| 6247 | xmlResetLastError(); |
| 6248 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6249 | printf("Leak of %d blocks found in xmlSetupParserForBuffer", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6250 | xmlMemBlocks() - mem_base); |
| 6251 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6252 | printf(" %d", n_ctxt); |
| 6253 | printf(" %d", n_buffer); |
| 6254 | printf(" %d", n_filename); |
| 6255 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6256 | } |
| 6257 | } |
| 6258 | } |
| 6259 | } |
| 6260 | |
| 6261 | return(ret); |
| 6262 | } |
| 6263 | |
| 6264 | |
| 6265 | static int |
| 6266 | test_xmlStopParser(void) { |
| 6267 | int ret = 0; |
| 6268 | |
| 6269 | int mem_base; |
| 6270 | xmlParserCtxtPtr ctxt; /* an XML parser context */ |
| 6271 | int n_ctxt; |
| 6272 | |
| 6273 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { |
| 6274 | mem_base = xmlMemBlocks(); |
| 6275 | ctxt = gen_xmlParserCtxtPtr(n_ctxt); |
| 6276 | |
| 6277 | xmlStopParser(ctxt); |
| 6278 | call_tests++; |
| 6279 | des_xmlParserCtxtPtr(n_ctxt, ctxt); |
| 6280 | xmlResetLastError(); |
| 6281 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6282 | printf("Leak of %d blocks found in xmlStopParser", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6283 | xmlMemBlocks() - mem_base); |
| 6284 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6285 | printf(" %d", n_ctxt); |
| 6286 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6287 | } |
| 6288 | } |
| 6289 | |
| 6290 | return(ret); |
| 6291 | } |
| 6292 | |
| 6293 | |
| 6294 | static int |
| 6295 | test_xmlSubstituteEntitiesDefault(void) { |
| 6296 | int ret = 0; |
| 6297 | |
| 6298 | int mem_base; |
| 6299 | int ret_val; |
| 6300 | int val; /* int 0 or 1 */ |
| 6301 | int n_val; |
| 6302 | |
| 6303 | for (n_val = 0;n_val < gen_nb_int;n_val++) { |
| 6304 | mem_base = xmlMemBlocks(); |
| 6305 | val = gen_int(n_val); |
| 6306 | |
| 6307 | ret_val = xmlSubstituteEntitiesDefault(val); |
| 6308 | desret_int(ret_val); |
| 6309 | call_tests++; |
| 6310 | des_int(n_val, val); |
| 6311 | xmlResetLastError(); |
| 6312 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6313 | printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6314 | xmlMemBlocks() - mem_base); |
| 6315 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6316 | printf(" %d", n_val); |
| 6317 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6318 | } |
| 6319 | } |
| 6320 | |
| 6321 | return(ret); |
| 6322 | } |
| 6323 | |
| 6324 | static int |
| 6325 | test_parser(void) { |
| 6326 | int ret = 0; |
| 6327 | |
| 6328 | printf("Testing parser ...\n"); |
| 6329 | ret += test_xmlByteConsumed(); |
| 6330 | ret += test_xmlClearNodeInfoSeq(); |
| 6331 | ret += test_xmlClearParserCtxt(); |
| 6332 | ret += test_xmlCreateDocParserCtxt(); |
| 6333 | ret += test_xmlCreateIOParserCtxt(); |
| 6334 | ret += test_xmlCreatePushParserCtxt(); |
| 6335 | ret += test_xmlCtxtReadDoc(); |
| 6336 | ret += test_xmlCtxtReadFile(); |
| 6337 | ret += test_xmlCtxtReadIO(); |
| 6338 | ret += test_xmlCtxtReadMemory(); |
| 6339 | ret += test_xmlCtxtReset(); |
| 6340 | ret += test_xmlCtxtResetPush(); |
| 6341 | ret += test_xmlCtxtUseOptions(); |
| 6342 | ret += test_xmlGetExternalEntityLoader(); |
| 6343 | ret += test_xmlGetFeature(); |
| 6344 | ret += test_xmlGetFeaturesList(); |
| 6345 | ret += test_xmlIOParseDTD(); |
| 6346 | ret += test_xmlInitNodeInfoSeq(); |
| 6347 | ret += test_xmlInitParser(); |
| 6348 | ret += test_xmlInitParserCtxt(); |
| 6349 | ret += test_xmlKeepBlanksDefault(); |
| 6350 | ret += test_xmlLineNumbersDefault(); |
| 6351 | ret += test_xmlLoadExternalEntity(); |
| 6352 | ret += test_xmlNewIOInputStream(); |
| 6353 | ret += test_xmlNewParserCtxt(); |
| 6354 | ret += test_xmlParseBalancedChunkMemory(); |
| 6355 | ret += test_xmlParseBalancedChunkMemoryRecover(); |
| 6356 | ret += test_xmlParseChunk(); |
| 6357 | ret += test_xmlParseCtxtExternalEntity(); |
| 6358 | ret += test_xmlParseDTD(); |
| 6359 | ret += test_xmlParseDoc(); |
| 6360 | ret += test_xmlParseDocument(); |
| 6361 | ret += test_xmlParseEntity(); |
| 6362 | ret += test_xmlParseExtParsedEnt(); |
| 6363 | ret += test_xmlParseExternalEntity(); |
| 6364 | ret += test_xmlParseFile(); |
| 6365 | ret += test_xmlParseInNodeContext(); |
| 6366 | ret += test_xmlParseMemory(); |
| 6367 | ret += test_xmlParserAddNodeInfo(); |
| 6368 | ret += test_xmlParserFindNodeInfo(); |
| 6369 | ret += test_xmlParserFindNodeInfoIndex(); |
| 6370 | ret += test_xmlParserInputGrow(); |
| 6371 | ret += test_xmlParserInputRead(); |
| 6372 | ret += test_xmlPedanticParserDefault(); |
| 6373 | ret += test_xmlReadDoc(); |
| 6374 | ret += test_xmlReadFile(); |
| 6375 | ret += test_xmlReadIO(); |
| 6376 | ret += test_xmlReadMemory(); |
| 6377 | ret += test_xmlRecoverDoc(); |
| 6378 | ret += test_xmlRecoverFile(); |
| 6379 | ret += test_xmlRecoverMemory(); |
| 6380 | ret += test_xmlSAXParseDTD(); |
| 6381 | ret += test_xmlSAXParseDoc(); |
| 6382 | ret += test_xmlSAXParseEntity(); |
| 6383 | ret += test_xmlSAXParseFile(); |
| 6384 | ret += test_xmlSAXParseFileWithData(); |
| 6385 | ret += test_xmlSAXParseMemory(); |
| 6386 | ret += test_xmlSAXParseMemoryWithData(); |
| 6387 | ret += test_xmlSAXUserParseFile(); |
| 6388 | ret += test_xmlSAXUserParseMemory(); |
| 6389 | ret += test_xmlSetExternalEntityLoader(); |
| 6390 | ret += test_xmlSetFeature(); |
| 6391 | ret += test_xmlSetupParserForBuffer(); |
| 6392 | ret += test_xmlStopParser(); |
| 6393 | ret += test_xmlSubstituteEntitiesDefault(); |
| 6394 | |
| 6395 | if (ret != 0) |
| 6396 | printf("Module parser: %d errors\n", ret); |
| 6397 | return(ret); |
| 6398 | } |
| 6399 | |
| 6400 | static int |
| 6401 | test_xmlPatternMatch(void) { |
| 6402 | int ret = 0; |
| 6403 | |
| 6404 | |
| 6405 | /* missing type support */ |
| 6406 | return(ret); |
| 6407 | } |
| 6408 | |
| 6409 | |
| 6410 | static int |
| 6411 | test_xmlPatterncompile(void) { |
| 6412 | int ret = 0; |
| 6413 | |
| 6414 | |
| 6415 | /* missing type support */ |
| 6416 | return(ret); |
| 6417 | } |
| 6418 | |
| 6419 | static int |
| 6420 | test_pattern(void) { |
| 6421 | int ret = 0; |
| 6422 | |
| 6423 | printf("Testing pattern ...\n"); |
| 6424 | ret += test_xmlPatternMatch(); |
| 6425 | ret += test_xmlPatterncompile(); |
| 6426 | |
| 6427 | if (ret != 0) |
| 6428 | printf("Module pattern: %d errors\n", ret); |
| 6429 | return(ret); |
| 6430 | } |
| 6431 | |
| 6432 | static int |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6433 | test_xmlRelaxNGDump(void) { |
| 6434 | int ret = 0; |
| 6435 | |
| 6436 | |
| 6437 | /* missing type support */ |
| 6438 | return(ret); |
| 6439 | } |
| 6440 | |
| 6441 | |
| 6442 | static int |
| 6443 | test_xmlRelaxNGDumpTree(void) { |
| 6444 | int ret = 0; |
| 6445 | |
| 6446 | |
| 6447 | /* missing type support */ |
| 6448 | return(ret); |
| 6449 | } |
| 6450 | |
| 6451 | |
| 6452 | static int |
| 6453 | test_xmlRelaxNGGetParserErrors(void) { |
| 6454 | int ret = 0; |
| 6455 | |
| 6456 | |
| 6457 | /* missing type support */ |
| 6458 | return(ret); |
| 6459 | } |
| 6460 | |
| 6461 | |
| 6462 | static int |
| 6463 | test_xmlRelaxNGGetValidErrors(void) { |
| 6464 | int ret = 0; |
| 6465 | |
| 6466 | |
| 6467 | /* missing type support */ |
| 6468 | return(ret); |
| 6469 | } |
| 6470 | |
| 6471 | |
| 6472 | static int |
| 6473 | test_xmlRelaxNGNewDocParserCtxt(void) { |
| 6474 | int ret = 0; |
| 6475 | |
| 6476 | |
| 6477 | /* missing type support */ |
| 6478 | return(ret); |
| 6479 | } |
| 6480 | |
| 6481 | |
| 6482 | static int |
| 6483 | test_xmlRelaxNGNewMemParserCtxt(void) { |
| 6484 | int ret = 0; |
| 6485 | |
| 6486 | |
| 6487 | /* missing type support */ |
| 6488 | return(ret); |
| 6489 | } |
| 6490 | |
| 6491 | |
| 6492 | static int |
| 6493 | test_xmlRelaxNGNewParserCtxt(void) { |
| 6494 | int ret = 0; |
| 6495 | |
| 6496 | |
| 6497 | /* missing type support */ |
| 6498 | return(ret); |
| 6499 | } |
| 6500 | |
| 6501 | |
| 6502 | static int |
| 6503 | test_xmlRelaxNGNewValidCtxt(void) { |
| 6504 | int ret = 0; |
| 6505 | |
| 6506 | |
| 6507 | /* missing type support */ |
| 6508 | return(ret); |
| 6509 | } |
| 6510 | |
| 6511 | |
| 6512 | static int |
| 6513 | test_xmlRelaxNGParse(void) { |
| 6514 | int ret = 0; |
| 6515 | |
| 6516 | |
| 6517 | /* missing type support */ |
| 6518 | return(ret); |
| 6519 | } |
| 6520 | |
| 6521 | |
| 6522 | static int |
| 6523 | test_xmlRelaxNGSetParserErrors(void) { |
| 6524 | int ret = 0; |
| 6525 | |
| 6526 | |
| 6527 | /* missing type support */ |
| 6528 | return(ret); |
| 6529 | } |
| 6530 | |
| 6531 | |
| 6532 | static int |
| 6533 | test_xmlRelaxNGSetValidErrors(void) { |
| 6534 | int ret = 0; |
| 6535 | |
| 6536 | |
| 6537 | /* missing type support */ |
| 6538 | return(ret); |
| 6539 | } |
| 6540 | |
| 6541 | |
| 6542 | static int |
| 6543 | test_xmlRelaxNGValidateDoc(void) { |
| 6544 | int ret = 0; |
| 6545 | |
| 6546 | |
| 6547 | /* missing type support */ |
| 6548 | return(ret); |
| 6549 | } |
| 6550 | |
| 6551 | |
| 6552 | static int |
| 6553 | test_xmlRelaxNGValidateFullElement(void) { |
| 6554 | int ret = 0; |
| 6555 | |
| 6556 | |
| 6557 | /* missing type support */ |
| 6558 | return(ret); |
| 6559 | } |
| 6560 | |
| 6561 | |
| 6562 | static int |
| 6563 | test_xmlRelaxNGValidatePopElement(void) { |
| 6564 | int ret = 0; |
| 6565 | |
| 6566 | |
| 6567 | /* missing type support */ |
| 6568 | return(ret); |
| 6569 | } |
| 6570 | |
| 6571 | |
| 6572 | static int |
| 6573 | test_xmlRelaxNGValidatePushCData(void) { |
| 6574 | int ret = 0; |
| 6575 | |
| 6576 | |
| 6577 | /* missing type support */ |
| 6578 | return(ret); |
| 6579 | } |
| 6580 | |
| 6581 | |
| 6582 | static int |
| 6583 | test_xmlRelaxNGValidatePushElement(void) { |
| 6584 | int ret = 0; |
| 6585 | |
| 6586 | |
| 6587 | /* missing type support */ |
| 6588 | return(ret); |
| 6589 | } |
| 6590 | |
| 6591 | |
| 6592 | static int |
| 6593 | test_xmlRelaxParserSetFlag(void) { |
| 6594 | int ret = 0; |
| 6595 | |
| 6596 | |
| 6597 | /* missing type support */ |
| 6598 | return(ret); |
| 6599 | } |
| 6600 | |
| 6601 | static int |
| 6602 | test_relaxng(void) { |
| 6603 | int ret = 0; |
| 6604 | |
| 6605 | printf("Testing relaxng ...\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6606 | ret += test_xmlRelaxNGDump(); |
| 6607 | ret += test_xmlRelaxNGDumpTree(); |
| 6608 | ret += test_xmlRelaxNGGetParserErrors(); |
| 6609 | ret += test_xmlRelaxNGGetValidErrors(); |
| 6610 | ret += test_xmlRelaxNGNewDocParserCtxt(); |
| 6611 | ret += test_xmlRelaxNGNewMemParserCtxt(); |
| 6612 | ret += test_xmlRelaxNGNewParserCtxt(); |
| 6613 | ret += test_xmlRelaxNGNewValidCtxt(); |
| 6614 | ret += test_xmlRelaxNGParse(); |
| 6615 | ret += test_xmlRelaxNGSetParserErrors(); |
| 6616 | ret += test_xmlRelaxNGSetValidErrors(); |
| 6617 | ret += test_xmlRelaxNGValidateDoc(); |
| 6618 | ret += test_xmlRelaxNGValidateFullElement(); |
| 6619 | ret += test_xmlRelaxNGValidatePopElement(); |
| 6620 | ret += test_xmlRelaxNGValidatePushCData(); |
| 6621 | ret += test_xmlRelaxNGValidatePushElement(); |
| 6622 | ret += test_xmlRelaxParserSetFlag(); |
| 6623 | |
| 6624 | if (ret != 0) |
| 6625 | printf("Module relaxng: %d errors\n", ret); |
| 6626 | return(ret); |
| 6627 | } |
| 6628 | static int |
| 6629 | test_schemasInternals(void) { |
| 6630 | int ret = 0; |
| 6631 | |
| 6632 | printf("Testing schemasInternals ...\n"); |
| 6633 | |
| 6634 | if (ret != 0) |
| 6635 | printf("Module schemasInternals: %d errors\n", ret); |
| 6636 | return(ret); |
| 6637 | } |
| 6638 | |
| 6639 | static int |
| 6640 | test_xmlAddChild(void) { |
| 6641 | int ret = 0; |
| 6642 | |
| 6643 | int mem_base; |
| 6644 | xmlNodePtr ret_val; |
| 6645 | xmlNodePtr parent; /* the parent node */ |
| 6646 | int n_parent; |
| 6647 | xmlNodePtr cur; /* the child node */ |
| 6648 | int n_cur; |
| 6649 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6650 | for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6651 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { |
| 6652 | mem_base = xmlMemBlocks(); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6653 | parent = gen_xmlNodePtr(n_parent); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6654 | cur = gen_xmlNodePtr_in(n_cur); |
| 6655 | |
| 6656 | ret_val = xmlAddChild(parent, cur); |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 6657 | if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; } |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6658 | desret_xmlNodePtr(ret_val); |
| 6659 | call_tests++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6660 | des_xmlNodePtr(n_parent, parent); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6661 | des_xmlNodePtr_in(n_cur, cur); |
| 6662 | xmlResetLastError(); |
| 6663 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6664 | printf("Leak of %d blocks found in xmlAddChild", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6665 | xmlMemBlocks() - mem_base); |
| 6666 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6667 | printf(" %d", n_parent); |
| 6668 | printf(" %d", n_cur); |
| 6669 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6670 | } |
| 6671 | } |
| 6672 | } |
| 6673 | |
| 6674 | return(ret); |
| 6675 | } |
| 6676 | |
| 6677 | |
| 6678 | static int |
| 6679 | test_xmlAddChildList(void) { |
| 6680 | int ret = 0; |
| 6681 | |
| 6682 | int mem_base; |
| 6683 | xmlNodePtr ret_val; |
| 6684 | xmlNodePtr parent; /* the parent node */ |
| 6685 | int n_parent; |
| 6686 | xmlNodePtr cur; /* the first node in the list */ |
| 6687 | int n_cur; |
| 6688 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6689 | for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6690 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { |
| 6691 | mem_base = xmlMemBlocks(); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6692 | parent = gen_xmlNodePtr(n_parent); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6693 | cur = gen_xmlNodePtr_in(n_cur); |
| 6694 | |
| 6695 | ret_val = xmlAddChildList(parent, cur); |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 6696 | if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; } |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6697 | desret_xmlNodePtr(ret_val); |
| 6698 | call_tests++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6699 | des_xmlNodePtr(n_parent, parent); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6700 | des_xmlNodePtr_in(n_cur, cur); |
| 6701 | xmlResetLastError(); |
| 6702 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6703 | printf("Leak of %d blocks found in xmlAddChildList", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6704 | xmlMemBlocks() - mem_base); |
| 6705 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6706 | printf(" %d", n_parent); |
| 6707 | printf(" %d", n_cur); |
| 6708 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6709 | } |
| 6710 | } |
| 6711 | } |
| 6712 | |
| 6713 | return(ret); |
| 6714 | } |
| 6715 | |
| 6716 | |
| 6717 | static int |
| 6718 | test_xmlAddNextSibling(void) { |
| 6719 | int ret = 0; |
| 6720 | |
| 6721 | int mem_base; |
| 6722 | xmlNodePtr ret_val; |
| 6723 | xmlNodePtr cur; /* the child node */ |
| 6724 | int n_cur; |
| 6725 | xmlNodePtr elem; /* the new node */ |
| 6726 | int n_elem; |
| 6727 | |
| 6728 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6729 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6730 | mem_base = xmlMemBlocks(); |
| 6731 | cur = gen_xmlNodePtr(n_cur); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6732 | elem = gen_xmlNodePtr_in(n_elem); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6733 | |
| 6734 | ret_val = xmlAddNextSibling(cur, elem); |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 6735 | if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6736 | desret_xmlNodePtr(ret_val); |
| 6737 | call_tests++; |
| 6738 | des_xmlNodePtr(n_cur, cur); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6739 | des_xmlNodePtr_in(n_elem, elem); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6740 | xmlResetLastError(); |
| 6741 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6742 | printf("Leak of %d blocks found in xmlAddNextSibling", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6743 | xmlMemBlocks() - mem_base); |
| 6744 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6745 | printf(" %d", n_cur); |
| 6746 | printf(" %d", n_elem); |
| 6747 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6748 | } |
| 6749 | } |
| 6750 | } |
| 6751 | |
| 6752 | return(ret); |
| 6753 | } |
| 6754 | |
| 6755 | |
| 6756 | static int |
| 6757 | test_xmlAddPrevSibling(void) { |
| 6758 | int ret = 0; |
| 6759 | |
| 6760 | #ifdef LIBXML_TREE_ENABLED |
| 6761 | int mem_base; |
| 6762 | xmlNodePtr ret_val; |
| 6763 | xmlNodePtr cur; /* the child node */ |
| 6764 | int n_cur; |
| 6765 | xmlNodePtr elem; /* the new node */ |
| 6766 | int n_elem; |
| 6767 | |
| 6768 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6769 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6770 | mem_base = xmlMemBlocks(); |
| 6771 | cur = gen_xmlNodePtr(n_cur); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6772 | elem = gen_xmlNodePtr_in(n_elem); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6773 | |
| 6774 | ret_val = xmlAddPrevSibling(cur, elem); |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 6775 | if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6776 | desret_xmlNodePtr(ret_val); |
| 6777 | call_tests++; |
| 6778 | des_xmlNodePtr(n_cur, cur); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6779 | des_xmlNodePtr_in(n_elem, elem); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6780 | xmlResetLastError(); |
| 6781 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6782 | printf("Leak of %d blocks found in xmlAddPrevSibling", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6783 | xmlMemBlocks() - mem_base); |
| 6784 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6785 | printf(" %d", n_cur); |
| 6786 | printf(" %d", n_elem); |
| 6787 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6788 | } |
| 6789 | } |
| 6790 | } |
| 6791 | #endif |
| 6792 | |
| 6793 | return(ret); |
| 6794 | } |
| 6795 | |
| 6796 | |
| 6797 | static int |
| 6798 | test_xmlAddSibling(void) { |
| 6799 | int ret = 0; |
| 6800 | |
| 6801 | int mem_base; |
| 6802 | xmlNodePtr ret_val; |
| 6803 | xmlNodePtr cur; /* the child node */ |
| 6804 | int n_cur; |
| 6805 | xmlNodePtr elem; /* the new node */ |
| 6806 | int n_elem; |
| 6807 | |
| 6808 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6809 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6810 | mem_base = xmlMemBlocks(); |
| 6811 | cur = gen_xmlNodePtr(n_cur); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6812 | elem = gen_xmlNodePtr_in(n_elem); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6813 | |
| 6814 | ret_val = xmlAddSibling(cur, elem); |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 6815 | if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6816 | desret_xmlNodePtr(ret_val); |
| 6817 | call_tests++; |
| 6818 | des_xmlNodePtr(n_cur, cur); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6819 | des_xmlNodePtr_in(n_elem, elem); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6820 | xmlResetLastError(); |
| 6821 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6822 | printf("Leak of %d blocks found in xmlAddSibling", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6823 | xmlMemBlocks() - mem_base); |
| 6824 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 6825 | printf(" %d", n_cur); |
| 6826 | printf(" %d", n_elem); |
| 6827 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6828 | } |
| 6829 | } |
| 6830 | } |
| 6831 | |
| 6832 | return(ret); |
| 6833 | } |
| 6834 | |
| 6835 | |
| 6836 | static int |
| 6837 | test_xmlAttrSerializeTxtContent(void) { |
| 6838 | int ret = 0; |
| 6839 | |
| 6840 | |
| 6841 | /* missing type support */ |
| 6842 | return(ret); |
| 6843 | } |
| 6844 | |
| 6845 | |
| 6846 | static int |
| 6847 | test_xmlBufferAdd(void) { |
| 6848 | int ret = 0; |
| 6849 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 6850 | int mem_base; |
| 6851 | int ret_val; |
| 6852 | xmlBufferPtr buf; /* the buffer to dump */ |
| 6853 | int n_buf; |
| 6854 | const xmlChar * str; /* the #xmlChar string */ |
| 6855 | int n_str; |
| 6856 | int len; /* the number of #xmlChar to add */ |
| 6857 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6858 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 6859 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 6860 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 6861 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 6862 | mem_base = xmlMemBlocks(); |
| 6863 | buf = gen_xmlBufferPtr(n_buf); |
| 6864 | str = gen_const_xmlChar_ptr(n_str); |
| 6865 | len = gen_int(n_len); |
| 6866 | |
| 6867 | ret_val = xmlBufferAdd(buf, str, len); |
| 6868 | desret_int(ret_val); |
| 6869 | call_tests++; |
| 6870 | des_xmlBufferPtr(n_buf, buf); |
| 6871 | des_const_xmlChar_ptr(n_str, str); |
| 6872 | des_int(n_len, len); |
| 6873 | xmlResetLastError(); |
| 6874 | if (mem_base != xmlMemBlocks()) { |
| 6875 | printf("Leak of %d blocks found in xmlBufferAdd", |
| 6876 | xmlMemBlocks() - mem_base); |
| 6877 | ret++; |
| 6878 | printf(" %d", n_buf); |
| 6879 | printf(" %d", n_str); |
| 6880 | printf(" %d", n_len); |
| 6881 | printf("\n"); |
| 6882 | } |
| 6883 | } |
| 6884 | } |
| 6885 | } |
| 6886 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6887 | return(ret); |
| 6888 | } |
| 6889 | |
| 6890 | |
| 6891 | static int |
| 6892 | test_xmlBufferAddHead(void) { |
| 6893 | int ret = 0; |
| 6894 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 6895 | int mem_base; |
| 6896 | int ret_val; |
| 6897 | xmlBufferPtr buf; /* the buffer */ |
| 6898 | int n_buf; |
| 6899 | const xmlChar * str; /* the #xmlChar string */ |
| 6900 | int n_str; |
| 6901 | int len; /* the number of #xmlChar to add */ |
| 6902 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6903 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 6904 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 6905 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 6906 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 6907 | mem_base = xmlMemBlocks(); |
| 6908 | buf = gen_xmlBufferPtr(n_buf); |
| 6909 | str = gen_const_xmlChar_ptr(n_str); |
| 6910 | len = gen_int(n_len); |
| 6911 | |
| 6912 | ret_val = xmlBufferAddHead(buf, str, len); |
| 6913 | desret_int(ret_val); |
| 6914 | call_tests++; |
| 6915 | des_xmlBufferPtr(n_buf, buf); |
| 6916 | des_const_xmlChar_ptr(n_str, str); |
| 6917 | des_int(n_len, len); |
| 6918 | xmlResetLastError(); |
| 6919 | if (mem_base != xmlMemBlocks()) { |
| 6920 | printf("Leak of %d blocks found in xmlBufferAddHead", |
| 6921 | xmlMemBlocks() - mem_base); |
| 6922 | ret++; |
| 6923 | printf(" %d", n_buf); |
| 6924 | printf(" %d", n_str); |
| 6925 | printf(" %d", n_len); |
| 6926 | printf("\n"); |
| 6927 | } |
| 6928 | } |
| 6929 | } |
| 6930 | } |
| 6931 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6932 | return(ret); |
| 6933 | } |
| 6934 | |
| 6935 | |
| 6936 | static int |
| 6937 | test_xmlBufferCCat(void) { |
| 6938 | int ret = 0; |
| 6939 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 6940 | int mem_base; |
| 6941 | int ret_val; |
| 6942 | xmlBufferPtr buf; /* the buffer to dump */ |
| 6943 | int n_buf; |
| 6944 | const char * str; /* the C char string */ |
| 6945 | int n_str; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6946 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 6947 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 6948 | for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { |
| 6949 | mem_base = xmlMemBlocks(); |
| 6950 | buf = gen_xmlBufferPtr(n_buf); |
| 6951 | str = gen_const_char_ptr(n_str); |
| 6952 | |
| 6953 | ret_val = xmlBufferCCat(buf, str); |
| 6954 | desret_int(ret_val); |
| 6955 | call_tests++; |
| 6956 | des_xmlBufferPtr(n_buf, buf); |
| 6957 | des_const_char_ptr(n_str, str); |
| 6958 | xmlResetLastError(); |
| 6959 | if (mem_base != xmlMemBlocks()) { |
| 6960 | printf("Leak of %d blocks found in xmlBufferCCat", |
| 6961 | xmlMemBlocks() - mem_base); |
| 6962 | ret++; |
| 6963 | printf(" %d", n_buf); |
| 6964 | printf(" %d", n_str); |
| 6965 | printf("\n"); |
| 6966 | } |
| 6967 | } |
| 6968 | } |
| 6969 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6970 | return(ret); |
| 6971 | } |
| 6972 | |
| 6973 | |
| 6974 | static int |
| 6975 | test_xmlBufferCat(void) { |
| 6976 | int ret = 0; |
| 6977 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 6978 | int mem_base; |
| 6979 | int ret_val; |
| 6980 | xmlBufferPtr buf; /* the buffer to add to */ |
| 6981 | int n_buf; |
| 6982 | const xmlChar * str; /* the #xmlChar string */ |
| 6983 | int n_str; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 6984 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 6985 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 6986 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 6987 | mem_base = xmlMemBlocks(); |
| 6988 | buf = gen_xmlBufferPtr(n_buf); |
| 6989 | str = gen_const_xmlChar_ptr(n_str); |
| 6990 | |
| 6991 | ret_val = xmlBufferCat(buf, str); |
| 6992 | desret_int(ret_val); |
| 6993 | call_tests++; |
| 6994 | des_xmlBufferPtr(n_buf, buf); |
| 6995 | des_const_xmlChar_ptr(n_str, str); |
| 6996 | xmlResetLastError(); |
| 6997 | if (mem_base != xmlMemBlocks()) { |
| 6998 | printf("Leak of %d blocks found in xmlBufferCat", |
| 6999 | xmlMemBlocks() - mem_base); |
| 7000 | ret++; |
| 7001 | printf(" %d", n_buf); |
| 7002 | printf(" %d", n_str); |
| 7003 | printf("\n"); |
| 7004 | } |
| 7005 | } |
| 7006 | } |
| 7007 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7008 | return(ret); |
| 7009 | } |
| 7010 | |
| 7011 | |
| 7012 | static int |
| 7013 | test_xmlBufferContent(void) { |
| 7014 | int ret = 0; |
| 7015 | |
| 7016 | |
| 7017 | /* missing type support */ |
| 7018 | return(ret); |
| 7019 | } |
| 7020 | |
| 7021 | |
| 7022 | static int |
| 7023 | test_xmlBufferCreate(void) { |
| 7024 | int ret = 0; |
| 7025 | |
| 7026 | |
| 7027 | /* missing type support */ |
| 7028 | return(ret); |
| 7029 | } |
| 7030 | |
| 7031 | |
| 7032 | static int |
| 7033 | test_xmlBufferCreateSize(void) { |
| 7034 | int ret = 0; |
| 7035 | |
| 7036 | |
| 7037 | /* missing type support */ |
| 7038 | return(ret); |
| 7039 | } |
| 7040 | |
| 7041 | |
| 7042 | static int |
| 7043 | test_xmlBufferCreateStatic(void) { |
| 7044 | int ret = 0; |
| 7045 | |
| 7046 | |
| 7047 | /* missing type support */ |
| 7048 | return(ret); |
| 7049 | } |
| 7050 | |
| 7051 | |
| 7052 | static int |
| 7053 | test_xmlBufferDump(void) { |
| 7054 | int ret = 0; |
| 7055 | |
| 7056 | |
| 7057 | /* missing type support */ |
| 7058 | return(ret); |
| 7059 | } |
| 7060 | |
| 7061 | |
| 7062 | static int |
| 7063 | test_xmlBufferEmpty(void) { |
| 7064 | int ret = 0; |
| 7065 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 7066 | int mem_base; |
| 7067 | xmlBufferPtr buf; /* the buffer */ |
| 7068 | int n_buf; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7069 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 7070 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 7071 | mem_base = xmlMemBlocks(); |
| 7072 | buf = gen_xmlBufferPtr(n_buf); |
| 7073 | |
| 7074 | xmlBufferEmpty(buf); |
| 7075 | call_tests++; |
| 7076 | des_xmlBufferPtr(n_buf, buf); |
| 7077 | xmlResetLastError(); |
| 7078 | if (mem_base != xmlMemBlocks()) { |
| 7079 | printf("Leak of %d blocks found in xmlBufferEmpty", |
| 7080 | xmlMemBlocks() - mem_base); |
| 7081 | ret++; |
| 7082 | printf(" %d", n_buf); |
| 7083 | printf("\n"); |
| 7084 | } |
| 7085 | } |
| 7086 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7087 | return(ret); |
| 7088 | } |
| 7089 | |
| 7090 | |
| 7091 | static int |
| 7092 | test_xmlBufferGrow(void) { |
| 7093 | int ret = 0; |
| 7094 | |
| 7095 | |
| 7096 | /* missing type support */ |
| 7097 | return(ret); |
| 7098 | } |
| 7099 | |
| 7100 | |
| 7101 | static int |
| 7102 | test_xmlBufferLength(void) { |
| 7103 | int ret = 0; |
| 7104 | |
| 7105 | |
| 7106 | /* missing type support */ |
| 7107 | return(ret); |
| 7108 | } |
| 7109 | |
| 7110 | |
| 7111 | static int |
| 7112 | test_xmlBufferResize(void) { |
| 7113 | int ret = 0; |
| 7114 | |
| 7115 | |
| 7116 | /* missing type support */ |
| 7117 | return(ret); |
| 7118 | } |
| 7119 | |
| 7120 | |
| 7121 | static int |
| 7122 | test_xmlBufferSetAllocationScheme(void) { |
| 7123 | int ret = 0; |
| 7124 | |
| 7125 | |
| 7126 | /* missing type support */ |
| 7127 | return(ret); |
| 7128 | } |
| 7129 | |
| 7130 | |
| 7131 | static int |
| 7132 | test_xmlBufferShrink(void) { |
| 7133 | int ret = 0; |
| 7134 | |
| 7135 | |
| 7136 | /* missing type support */ |
| 7137 | return(ret); |
| 7138 | } |
| 7139 | |
| 7140 | |
| 7141 | static int |
| 7142 | test_xmlBufferWriteCHAR(void) { |
| 7143 | int ret = 0; |
| 7144 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 7145 | int mem_base; |
| 7146 | xmlBufferPtr buf; /* the XML buffer */ |
| 7147 | int n_buf; |
| 7148 | const xmlChar * string; /* the string to add */ |
| 7149 | int n_string; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7150 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 7151 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 7152 | for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { |
| 7153 | mem_base = xmlMemBlocks(); |
| 7154 | buf = gen_xmlBufferPtr(n_buf); |
| 7155 | string = gen_const_xmlChar_ptr(n_string); |
| 7156 | |
| 7157 | xmlBufferWriteCHAR(buf, string); |
| 7158 | call_tests++; |
| 7159 | des_xmlBufferPtr(n_buf, buf); |
| 7160 | des_const_xmlChar_ptr(n_string, string); |
| 7161 | xmlResetLastError(); |
| 7162 | if (mem_base != xmlMemBlocks()) { |
| 7163 | printf("Leak of %d blocks found in xmlBufferWriteCHAR", |
| 7164 | xmlMemBlocks() - mem_base); |
| 7165 | ret++; |
| 7166 | printf(" %d", n_buf); |
| 7167 | printf(" %d", n_string); |
| 7168 | printf("\n"); |
| 7169 | } |
| 7170 | } |
| 7171 | } |
| 7172 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7173 | return(ret); |
| 7174 | } |
| 7175 | |
| 7176 | |
| 7177 | static int |
| 7178 | test_xmlBufferWriteChar(void) { |
| 7179 | int ret = 0; |
| 7180 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 7181 | int mem_base; |
| 7182 | xmlBufferPtr buf; /* the XML buffer output */ |
| 7183 | int n_buf; |
| 7184 | const char * string; /* the string to add */ |
| 7185 | int n_string; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7186 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 7187 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 7188 | for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) { |
| 7189 | mem_base = xmlMemBlocks(); |
| 7190 | buf = gen_xmlBufferPtr(n_buf); |
| 7191 | string = gen_const_char_ptr(n_string); |
| 7192 | |
| 7193 | xmlBufferWriteChar(buf, string); |
| 7194 | call_tests++; |
| 7195 | des_xmlBufferPtr(n_buf, buf); |
| 7196 | des_const_char_ptr(n_string, string); |
| 7197 | xmlResetLastError(); |
| 7198 | if (mem_base != xmlMemBlocks()) { |
| 7199 | printf("Leak of %d blocks found in xmlBufferWriteChar", |
| 7200 | xmlMemBlocks() - mem_base); |
| 7201 | ret++; |
| 7202 | printf(" %d", n_buf); |
| 7203 | printf(" %d", n_string); |
| 7204 | printf("\n"); |
| 7205 | } |
| 7206 | } |
| 7207 | } |
| 7208 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7209 | return(ret); |
| 7210 | } |
| 7211 | |
| 7212 | |
| 7213 | static int |
| 7214 | test_xmlBufferWriteQuotedString(void) { |
| 7215 | int ret = 0; |
| 7216 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 7217 | int mem_base; |
| 7218 | xmlBufferPtr buf; /* the XML buffer output */ |
| 7219 | int n_buf; |
| 7220 | const xmlChar * string; /* the string to add */ |
| 7221 | int n_string; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7222 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 7223 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 7224 | for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { |
| 7225 | mem_base = xmlMemBlocks(); |
| 7226 | buf = gen_xmlBufferPtr(n_buf); |
| 7227 | string = gen_const_xmlChar_ptr(n_string); |
| 7228 | |
| 7229 | xmlBufferWriteQuotedString(buf, string); |
| 7230 | call_tests++; |
| 7231 | des_xmlBufferPtr(n_buf, buf); |
| 7232 | des_const_xmlChar_ptr(n_string, string); |
| 7233 | xmlResetLastError(); |
| 7234 | if (mem_base != xmlMemBlocks()) { |
| 7235 | printf("Leak of %d blocks found in xmlBufferWriteQuotedString", |
| 7236 | xmlMemBlocks() - mem_base); |
| 7237 | ret++; |
| 7238 | printf(" %d", n_buf); |
| 7239 | printf(" %d", n_string); |
| 7240 | printf("\n"); |
| 7241 | } |
| 7242 | } |
| 7243 | } |
| 7244 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7245 | return(ret); |
| 7246 | } |
| 7247 | |
| 7248 | |
| 7249 | static int |
| 7250 | test_xmlBuildQName(void) { |
| 7251 | int ret = 0; |
| 7252 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7253 | int mem_base; |
| 7254 | xmlChar * ret_val; |
| 7255 | const xmlChar * ncname; /* the Name */ |
| 7256 | int n_ncname; |
| 7257 | const xmlChar * prefix; /* the prefix */ |
| 7258 | int n_prefix; |
| 7259 | xmlChar * memory; /* preallocated memory */ |
| 7260 | int n_memory; |
| 7261 | int len; /* preallocated memory length */ |
| 7262 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7263 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7264 | for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) { |
| 7265 | for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { |
| 7266 | for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) { |
| 7267 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 7268 | mem_base = xmlMemBlocks(); |
| 7269 | ncname = gen_const_xmlChar_ptr(n_ncname); |
| 7270 | prefix = gen_const_xmlChar_ptr(n_prefix); |
| 7271 | memory = gen_xmlChar_ptr(n_memory); |
| 7272 | len = gen_int(n_len); |
| 7273 | |
| 7274 | ret_val = xmlBuildQName(ncname, prefix, memory, len); |
| 7275 | if ((ret_val != NULL) && (ret_val != ncname) && |
| 7276 | (ret_val != prefix) && (ret_val != memory)) |
| 7277 | xmlFree(ret_val); |
| 7278 | ret_val = NULL; |
| 7279 | desret_xmlChar_ptr(ret_val); |
| 7280 | call_tests++; |
| 7281 | des_const_xmlChar_ptr(n_ncname, ncname); |
| 7282 | des_const_xmlChar_ptr(n_prefix, prefix); |
| 7283 | des_xmlChar_ptr(n_memory, memory); |
| 7284 | des_int(n_len, len); |
| 7285 | xmlResetLastError(); |
| 7286 | if (mem_base != xmlMemBlocks()) { |
| 7287 | printf("Leak of %d blocks found in xmlBuildQName", |
| 7288 | xmlMemBlocks() - mem_base); |
| 7289 | ret++; |
| 7290 | printf(" %d", n_ncname); |
| 7291 | printf(" %d", n_prefix); |
| 7292 | printf(" %d", n_memory); |
| 7293 | printf(" %d", n_len); |
| 7294 | printf("\n"); |
| 7295 | } |
| 7296 | } |
| 7297 | } |
| 7298 | } |
| 7299 | } |
| 7300 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7301 | return(ret); |
| 7302 | } |
| 7303 | |
| 7304 | |
| 7305 | static int |
| 7306 | test_xmlCopyDoc(void) { |
| 7307 | int ret = 0; |
| 7308 | |
| 7309 | #ifdef LIBXML_TREE_ENABLED |
| 7310 | int mem_base; |
| 7311 | xmlDocPtr ret_val; |
| 7312 | xmlDocPtr doc; /* the document */ |
| 7313 | int n_doc; |
| 7314 | int recursive; /* if not zero do a recursive copy. */ |
| 7315 | int n_recursive; |
| 7316 | |
| 7317 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 7318 | for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) { |
| 7319 | mem_base = xmlMemBlocks(); |
| 7320 | doc = gen_xmlDocPtr(n_doc); |
| 7321 | recursive = gen_int(n_recursive); |
| 7322 | |
| 7323 | ret_val = xmlCopyDoc(doc, recursive); |
| 7324 | desret_xmlDocPtr(ret_val); |
| 7325 | call_tests++; |
| 7326 | des_xmlDocPtr(n_doc, doc); |
| 7327 | des_int(n_recursive, recursive); |
| 7328 | xmlResetLastError(); |
| 7329 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7330 | printf("Leak of %d blocks found in xmlCopyDoc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7331 | xmlMemBlocks() - mem_base); |
| 7332 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7333 | printf(" %d", n_doc); |
| 7334 | printf(" %d", n_recursive); |
| 7335 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7336 | } |
| 7337 | } |
| 7338 | } |
| 7339 | #endif |
| 7340 | |
| 7341 | return(ret); |
| 7342 | } |
| 7343 | |
| 7344 | |
| 7345 | static int |
| 7346 | test_xmlCopyDtd(void) { |
| 7347 | int ret = 0; |
| 7348 | |
| 7349 | |
| 7350 | /* missing type support */ |
| 7351 | return(ret); |
| 7352 | } |
| 7353 | |
| 7354 | |
| 7355 | static int |
| 7356 | test_xmlCopyNamespace(void) { |
| 7357 | int ret = 0; |
| 7358 | |
| 7359 | |
| 7360 | /* missing type support */ |
| 7361 | return(ret); |
| 7362 | } |
| 7363 | |
| 7364 | |
| 7365 | static int |
| 7366 | test_xmlCopyNamespaceList(void) { |
| 7367 | int ret = 0; |
| 7368 | |
| 7369 | |
| 7370 | /* missing type support */ |
| 7371 | return(ret); |
| 7372 | } |
| 7373 | |
| 7374 | |
| 7375 | static int |
| 7376 | test_xmlCopyNode(void) { |
| 7377 | int ret = 0; |
| 7378 | |
| 7379 | |
| 7380 | /* missing type support */ |
| 7381 | return(ret); |
| 7382 | } |
| 7383 | |
| 7384 | |
| 7385 | static int |
| 7386 | test_xmlCopyNodeList(void) { |
| 7387 | int ret = 0; |
| 7388 | |
| 7389 | |
| 7390 | /* missing type support */ |
| 7391 | return(ret); |
| 7392 | } |
| 7393 | |
| 7394 | |
| 7395 | static int |
| 7396 | test_xmlCopyProp(void) { |
| 7397 | int ret = 0; |
| 7398 | |
| 7399 | |
| 7400 | /* missing type support */ |
| 7401 | return(ret); |
| 7402 | } |
| 7403 | |
| 7404 | |
| 7405 | static int |
| 7406 | test_xmlCopyPropList(void) { |
| 7407 | int ret = 0; |
| 7408 | |
| 7409 | |
| 7410 | /* missing type support */ |
| 7411 | return(ret); |
| 7412 | } |
| 7413 | |
| 7414 | |
| 7415 | static int |
| 7416 | test_xmlCreateIntSubset(void) { |
| 7417 | int ret = 0; |
| 7418 | |
| 7419 | |
| 7420 | /* missing type support */ |
| 7421 | return(ret); |
| 7422 | } |
| 7423 | |
| 7424 | |
| 7425 | static int |
| 7426 | test_xmlDocCopyNode(void) { |
| 7427 | int ret = 0; |
| 7428 | |
| 7429 | |
| 7430 | /* missing type support */ |
| 7431 | return(ret); |
| 7432 | } |
| 7433 | |
| 7434 | |
| 7435 | static int |
| 7436 | test_xmlDocCopyNodeList(void) { |
| 7437 | int ret = 0; |
| 7438 | |
| 7439 | |
| 7440 | /* missing type support */ |
| 7441 | return(ret); |
| 7442 | } |
| 7443 | |
| 7444 | |
| 7445 | static int |
| 7446 | test_xmlDocDump(void) { |
| 7447 | int ret = 0; |
| 7448 | |
| 7449 | |
| 7450 | /* missing type support */ |
| 7451 | return(ret); |
| 7452 | } |
| 7453 | |
| 7454 | |
| 7455 | static int |
| 7456 | test_xmlDocDumpFormatMemory(void) { |
| 7457 | int ret = 0; |
| 7458 | |
| 7459 | |
| 7460 | /* missing type support */ |
| 7461 | return(ret); |
| 7462 | } |
| 7463 | |
| 7464 | |
| 7465 | static int |
| 7466 | test_xmlDocDumpFormatMemoryEnc(void) { |
| 7467 | int ret = 0; |
| 7468 | |
| 7469 | |
| 7470 | /* missing type support */ |
| 7471 | return(ret); |
| 7472 | } |
| 7473 | |
| 7474 | |
| 7475 | static int |
| 7476 | test_xmlDocDumpMemory(void) { |
| 7477 | int ret = 0; |
| 7478 | |
| 7479 | |
| 7480 | /* missing type support */ |
| 7481 | return(ret); |
| 7482 | } |
| 7483 | |
| 7484 | |
| 7485 | static int |
| 7486 | test_xmlDocDumpMemoryEnc(void) { |
| 7487 | int ret = 0; |
| 7488 | |
| 7489 | |
| 7490 | /* missing type support */ |
| 7491 | return(ret); |
| 7492 | } |
| 7493 | |
| 7494 | |
| 7495 | static int |
| 7496 | test_xmlDocFormatDump(void) { |
| 7497 | int ret = 0; |
| 7498 | |
| 7499 | |
| 7500 | /* missing type support */ |
| 7501 | return(ret); |
| 7502 | } |
| 7503 | |
| 7504 | |
| 7505 | static int |
| 7506 | test_xmlDocGetRootElement(void) { |
| 7507 | int ret = 0; |
| 7508 | |
| 7509 | int mem_base; |
| 7510 | xmlNodePtr ret_val; |
| 7511 | xmlDocPtr doc; /* the document */ |
| 7512 | int n_doc; |
| 7513 | |
| 7514 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 7515 | mem_base = xmlMemBlocks(); |
| 7516 | doc = gen_xmlDocPtr(n_doc); |
| 7517 | |
| 7518 | ret_val = xmlDocGetRootElement(doc); |
| 7519 | desret_xmlNodePtr(ret_val); |
| 7520 | call_tests++; |
| 7521 | des_xmlDocPtr(n_doc, doc); |
| 7522 | xmlResetLastError(); |
| 7523 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7524 | printf("Leak of %d blocks found in xmlDocGetRootElement", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7525 | xmlMemBlocks() - mem_base); |
| 7526 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7527 | printf(" %d", n_doc); |
| 7528 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7529 | } |
| 7530 | } |
| 7531 | |
| 7532 | return(ret); |
| 7533 | } |
| 7534 | |
| 7535 | |
| 7536 | static int |
| 7537 | test_xmlDocSetRootElement(void) { |
| 7538 | int ret = 0; |
| 7539 | |
| 7540 | #ifdef LIBXML_TREE_ENABLED |
| 7541 | int mem_base; |
| 7542 | xmlNodePtr ret_val; |
| 7543 | xmlDocPtr doc; /* the document */ |
| 7544 | int n_doc; |
| 7545 | xmlNodePtr root; /* the new document root element */ |
| 7546 | int n_root; |
| 7547 | |
| 7548 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7549 | for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) { |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7550 | mem_base = xmlMemBlocks(); |
| 7551 | doc = gen_xmlDocPtr(n_doc); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7552 | root = gen_xmlNodePtr_in(n_root); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7553 | |
| 7554 | ret_val = xmlDocSetRootElement(doc, root); |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7555 | if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; } |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7556 | desret_xmlNodePtr(ret_val); |
| 7557 | call_tests++; |
| 7558 | des_xmlDocPtr(n_doc, doc); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7559 | des_xmlNodePtr_in(n_root, root); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7560 | xmlResetLastError(); |
| 7561 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7562 | printf("Leak of %d blocks found in xmlDocSetRootElement", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7563 | xmlMemBlocks() - mem_base); |
| 7564 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7565 | printf(" %d", n_doc); |
| 7566 | printf(" %d", n_root); |
| 7567 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7568 | } |
| 7569 | } |
| 7570 | } |
| 7571 | #endif |
| 7572 | |
| 7573 | return(ret); |
| 7574 | } |
| 7575 | |
| 7576 | |
| 7577 | static int |
| 7578 | test_xmlElemDump(void) { |
| 7579 | int ret = 0; |
| 7580 | |
| 7581 | |
| 7582 | /* missing type support */ |
| 7583 | return(ret); |
| 7584 | } |
| 7585 | |
| 7586 | |
| 7587 | static int |
| 7588 | test_xmlGetBufferAllocationScheme(void) { |
| 7589 | int ret = 0; |
| 7590 | |
| 7591 | |
| 7592 | /* missing type support */ |
| 7593 | return(ret); |
| 7594 | } |
| 7595 | |
| 7596 | |
| 7597 | static int |
| 7598 | test_xmlGetCompressMode(void) { |
| 7599 | int ret = 0; |
| 7600 | |
| 7601 | int mem_base; |
| 7602 | int ret_val; |
| 7603 | |
| 7604 | mem_base = xmlMemBlocks(); |
| 7605 | |
| 7606 | ret_val = xmlGetCompressMode(); |
| 7607 | desret_int(ret_val); |
| 7608 | call_tests++; |
| 7609 | xmlResetLastError(); |
| 7610 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7611 | printf("Leak of %d blocks found in xmlGetCompressMode", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7612 | xmlMemBlocks() - mem_base); |
| 7613 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7614 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7615 | } |
| 7616 | |
| 7617 | return(ret); |
| 7618 | } |
| 7619 | |
| 7620 | |
| 7621 | static int |
| 7622 | test_xmlGetDocCompressMode(void) { |
| 7623 | int ret = 0; |
| 7624 | |
| 7625 | int mem_base; |
| 7626 | int ret_val; |
| 7627 | xmlDocPtr doc; /* the document */ |
| 7628 | int n_doc; |
| 7629 | |
| 7630 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 7631 | mem_base = xmlMemBlocks(); |
| 7632 | doc = gen_xmlDocPtr(n_doc); |
| 7633 | |
| 7634 | ret_val = xmlGetDocCompressMode(doc); |
| 7635 | desret_int(ret_val); |
| 7636 | call_tests++; |
| 7637 | des_xmlDocPtr(n_doc, doc); |
| 7638 | xmlResetLastError(); |
| 7639 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7640 | printf("Leak of %d blocks found in xmlGetDocCompressMode", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7641 | xmlMemBlocks() - mem_base); |
| 7642 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7643 | printf(" %d", n_doc); |
| 7644 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7645 | } |
| 7646 | } |
| 7647 | |
| 7648 | return(ret); |
| 7649 | } |
| 7650 | |
| 7651 | |
| 7652 | static int |
| 7653 | test_xmlGetIntSubset(void) { |
| 7654 | int ret = 0; |
| 7655 | |
| 7656 | |
| 7657 | /* missing type support */ |
| 7658 | return(ret); |
| 7659 | } |
| 7660 | |
| 7661 | |
| 7662 | static int |
| 7663 | test_xmlGetLastChild(void) { |
| 7664 | int ret = 0; |
| 7665 | |
| 7666 | int mem_base; |
| 7667 | xmlNodePtr ret_val; |
| 7668 | xmlNodePtr parent; /* the parent node */ |
| 7669 | int n_parent; |
| 7670 | |
| 7671 | for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { |
| 7672 | mem_base = xmlMemBlocks(); |
| 7673 | parent = gen_xmlNodePtr(n_parent); |
| 7674 | |
| 7675 | ret_val = xmlGetLastChild(parent); |
| 7676 | desret_xmlNodePtr(ret_val); |
| 7677 | call_tests++; |
| 7678 | des_xmlNodePtr(n_parent, parent); |
| 7679 | xmlResetLastError(); |
| 7680 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7681 | printf("Leak of %d blocks found in xmlGetLastChild", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7682 | xmlMemBlocks() - mem_base); |
| 7683 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7684 | printf(" %d", n_parent); |
| 7685 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7686 | } |
| 7687 | } |
| 7688 | |
| 7689 | return(ret); |
| 7690 | } |
| 7691 | |
| 7692 | |
| 7693 | static int |
| 7694 | test_xmlGetLineNo(void) { |
| 7695 | int ret = 0; |
| 7696 | |
| 7697 | |
| 7698 | /* missing type support */ |
| 7699 | return(ret); |
| 7700 | } |
| 7701 | |
| 7702 | |
| 7703 | static int |
| 7704 | test_xmlGetNoNsProp(void) { |
| 7705 | int ret = 0; |
| 7706 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7707 | int mem_base; |
| 7708 | xmlChar * ret_val; |
| 7709 | xmlNodePtr node; /* the node */ |
| 7710 | int n_node; |
| 7711 | const xmlChar * name; /* the attribute name */ |
| 7712 | int n_name; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7713 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7714 | for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { |
| 7715 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 7716 | mem_base = xmlMemBlocks(); |
| 7717 | node = gen_xmlNodePtr(n_node); |
| 7718 | name = gen_const_xmlChar_ptr(n_name); |
| 7719 | |
| 7720 | ret_val = xmlGetNoNsProp(node, name); |
| 7721 | desret_xmlChar_ptr(ret_val); |
| 7722 | call_tests++; |
| 7723 | des_xmlNodePtr(n_node, node); |
| 7724 | des_const_xmlChar_ptr(n_name, name); |
| 7725 | xmlResetLastError(); |
| 7726 | if (mem_base != xmlMemBlocks()) { |
| 7727 | printf("Leak of %d blocks found in xmlGetNoNsProp", |
| 7728 | xmlMemBlocks() - mem_base); |
| 7729 | ret++; |
| 7730 | printf(" %d", n_node); |
| 7731 | printf(" %d", n_name); |
| 7732 | printf("\n"); |
| 7733 | } |
| 7734 | } |
| 7735 | } |
| 7736 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7737 | return(ret); |
| 7738 | } |
| 7739 | |
| 7740 | |
| 7741 | static int |
| 7742 | test_xmlGetNodePath(void) { |
| 7743 | int ret = 0; |
| 7744 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7745 | #ifdef LIBXML_TREE_ENABLED |
| 7746 | int mem_base; |
| 7747 | xmlChar * ret_val; |
| 7748 | xmlNodePtr node; /* a node */ |
| 7749 | int n_node; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7750 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7751 | for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { |
| 7752 | mem_base = xmlMemBlocks(); |
| 7753 | node = gen_xmlNodePtr(n_node); |
| 7754 | |
| 7755 | ret_val = xmlGetNodePath(node); |
| 7756 | desret_xmlChar_ptr(ret_val); |
| 7757 | call_tests++; |
| 7758 | des_xmlNodePtr(n_node, node); |
| 7759 | xmlResetLastError(); |
| 7760 | if (mem_base != xmlMemBlocks()) { |
| 7761 | printf("Leak of %d blocks found in xmlGetNodePath", |
| 7762 | xmlMemBlocks() - mem_base); |
| 7763 | ret++; |
| 7764 | printf(" %d", n_node); |
| 7765 | printf("\n"); |
| 7766 | } |
| 7767 | } |
| 7768 | #endif |
| 7769 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7770 | return(ret); |
| 7771 | } |
| 7772 | |
| 7773 | |
| 7774 | static int |
| 7775 | test_xmlGetNsList(void) { |
| 7776 | int ret = 0; |
| 7777 | |
| 7778 | |
| 7779 | /* missing type support */ |
| 7780 | return(ret); |
| 7781 | } |
| 7782 | |
| 7783 | |
| 7784 | static int |
| 7785 | test_xmlGetNsProp(void) { |
| 7786 | int ret = 0; |
| 7787 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7788 | int mem_base; |
| 7789 | xmlChar * ret_val; |
| 7790 | xmlNodePtr node; /* the node */ |
| 7791 | int n_node; |
| 7792 | const xmlChar * name; /* the attribute name */ |
| 7793 | int n_name; |
| 7794 | const xmlChar * nameSpace; /* the URI of the namespace */ |
| 7795 | int n_nameSpace; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7796 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7797 | for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { |
| 7798 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 7799 | for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { |
| 7800 | mem_base = xmlMemBlocks(); |
| 7801 | node = gen_xmlNodePtr(n_node); |
| 7802 | name = gen_const_xmlChar_ptr(n_name); |
| 7803 | nameSpace = gen_const_xmlChar_ptr(n_nameSpace); |
| 7804 | |
| 7805 | ret_val = xmlGetNsProp(node, name, nameSpace); |
| 7806 | desret_xmlChar_ptr(ret_val); |
| 7807 | call_tests++; |
| 7808 | des_xmlNodePtr(n_node, node); |
| 7809 | des_const_xmlChar_ptr(n_name, name); |
| 7810 | des_const_xmlChar_ptr(n_nameSpace, nameSpace); |
| 7811 | xmlResetLastError(); |
| 7812 | if (mem_base != xmlMemBlocks()) { |
| 7813 | printf("Leak of %d blocks found in xmlGetNsProp", |
| 7814 | xmlMemBlocks() - mem_base); |
| 7815 | ret++; |
| 7816 | printf(" %d", n_node); |
| 7817 | printf(" %d", n_name); |
| 7818 | printf(" %d", n_nameSpace); |
| 7819 | printf("\n"); |
| 7820 | } |
| 7821 | } |
| 7822 | } |
| 7823 | } |
| 7824 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7825 | return(ret); |
| 7826 | } |
| 7827 | |
| 7828 | |
| 7829 | static int |
| 7830 | test_xmlGetProp(void) { |
| 7831 | int ret = 0; |
| 7832 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7833 | int mem_base; |
| 7834 | xmlChar * ret_val; |
| 7835 | xmlNodePtr node; /* the node */ |
| 7836 | int n_node; |
| 7837 | const xmlChar * name; /* the attribute name */ |
| 7838 | int n_name; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7839 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 7840 | for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { |
| 7841 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 7842 | mem_base = xmlMemBlocks(); |
| 7843 | node = gen_xmlNodePtr(n_node); |
| 7844 | name = gen_const_xmlChar_ptr(n_name); |
| 7845 | |
| 7846 | ret_val = xmlGetProp(node, name); |
| 7847 | desret_xmlChar_ptr(ret_val); |
| 7848 | call_tests++; |
| 7849 | des_xmlNodePtr(n_node, node); |
| 7850 | des_const_xmlChar_ptr(n_name, name); |
| 7851 | xmlResetLastError(); |
| 7852 | if (mem_base != xmlMemBlocks()) { |
| 7853 | printf("Leak of %d blocks found in xmlGetProp", |
| 7854 | xmlMemBlocks() - mem_base); |
| 7855 | ret++; |
| 7856 | printf(" %d", n_node); |
| 7857 | printf(" %d", n_name); |
| 7858 | printf("\n"); |
| 7859 | } |
| 7860 | } |
| 7861 | } |
| 7862 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7863 | return(ret); |
| 7864 | } |
| 7865 | |
| 7866 | |
| 7867 | static int |
| 7868 | test_xmlHasNsProp(void) { |
| 7869 | int ret = 0; |
| 7870 | |
| 7871 | |
| 7872 | /* missing type support */ |
| 7873 | return(ret); |
| 7874 | } |
| 7875 | |
| 7876 | |
| 7877 | static int |
| 7878 | test_xmlHasProp(void) { |
| 7879 | int ret = 0; |
| 7880 | |
| 7881 | |
| 7882 | /* missing type support */ |
| 7883 | return(ret); |
| 7884 | } |
| 7885 | |
| 7886 | |
| 7887 | static int |
| 7888 | test_xmlIsBlankNode(void) { |
| 7889 | int ret = 0; |
| 7890 | |
| 7891 | int mem_base; |
| 7892 | int ret_val; |
| 7893 | xmlNodePtr node; /* the node */ |
| 7894 | int n_node; |
| 7895 | |
| 7896 | for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { |
| 7897 | mem_base = xmlMemBlocks(); |
| 7898 | node = gen_xmlNodePtr(n_node); |
| 7899 | |
| 7900 | ret_val = xmlIsBlankNode(node); |
| 7901 | desret_int(ret_val); |
| 7902 | call_tests++; |
| 7903 | des_xmlNodePtr(n_node, node); |
| 7904 | xmlResetLastError(); |
| 7905 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7906 | printf("Leak of %d blocks found in xmlIsBlankNode", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7907 | xmlMemBlocks() - mem_base); |
| 7908 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7909 | printf(" %d", n_node); |
| 7910 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7911 | } |
| 7912 | } |
| 7913 | |
| 7914 | return(ret); |
| 7915 | } |
| 7916 | |
| 7917 | |
| 7918 | static int |
| 7919 | test_xmlIsXHTML(void) { |
| 7920 | int ret = 0; |
| 7921 | |
| 7922 | int mem_base; |
| 7923 | int ret_val; |
| 7924 | const xmlChar * systemID; /* the system identifier */ |
| 7925 | int n_systemID; |
| 7926 | const xmlChar * publicID; /* the public identifier */ |
| 7927 | int n_publicID; |
| 7928 | |
| 7929 | for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) { |
| 7930 | for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) { |
| 7931 | mem_base = xmlMemBlocks(); |
| 7932 | systemID = gen_const_xmlChar_ptr(n_systemID); |
| 7933 | publicID = gen_const_xmlChar_ptr(n_publicID); |
| 7934 | |
| 7935 | ret_val = xmlIsXHTML(systemID, publicID); |
| 7936 | desret_int(ret_val); |
| 7937 | call_tests++; |
| 7938 | des_const_xmlChar_ptr(n_systemID, systemID); |
| 7939 | des_const_xmlChar_ptr(n_publicID, publicID); |
| 7940 | xmlResetLastError(); |
| 7941 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7942 | printf("Leak of %d blocks found in xmlIsXHTML", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7943 | xmlMemBlocks() - mem_base); |
| 7944 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7945 | printf(" %d", n_systemID); |
| 7946 | printf(" %d", n_publicID); |
| 7947 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7948 | } |
| 7949 | } |
| 7950 | } |
| 7951 | |
| 7952 | return(ret); |
| 7953 | } |
| 7954 | |
| 7955 | |
| 7956 | static int |
| 7957 | test_xmlNewCDataBlock(void) { |
| 7958 | int ret = 0; |
| 7959 | |
| 7960 | int mem_base; |
| 7961 | xmlNodePtr ret_val; |
| 7962 | xmlDocPtr doc; /* the document */ |
| 7963 | int n_doc; |
| 7964 | const xmlChar * content; /* the CDATA block content content */ |
| 7965 | int n_content; |
| 7966 | int len; /* the length of the block */ |
| 7967 | int n_len; |
| 7968 | |
| 7969 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 7970 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 7971 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 7972 | mem_base = xmlMemBlocks(); |
| 7973 | doc = gen_xmlDocPtr(n_doc); |
| 7974 | content = gen_const_xmlChar_ptr(n_content); |
| 7975 | len = gen_int(n_len); |
| 7976 | |
| 7977 | ret_val = xmlNewCDataBlock(doc, content, len); |
| 7978 | desret_xmlNodePtr(ret_val); |
| 7979 | call_tests++; |
| 7980 | des_xmlDocPtr(n_doc, doc); |
| 7981 | des_const_xmlChar_ptr(n_content, content); |
| 7982 | des_int(n_len, len); |
| 7983 | xmlResetLastError(); |
| 7984 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7985 | printf("Leak of %d blocks found in xmlNewCDataBlock", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7986 | xmlMemBlocks() - mem_base); |
| 7987 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 7988 | printf(" %d", n_doc); |
| 7989 | printf(" %d", n_content); |
| 7990 | printf(" %d", n_len); |
| 7991 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 7992 | } |
| 7993 | } |
| 7994 | } |
| 7995 | } |
| 7996 | |
| 7997 | return(ret); |
| 7998 | } |
| 7999 | |
| 8000 | |
| 8001 | static int |
| 8002 | test_xmlNewCharRef(void) { |
| 8003 | int ret = 0; |
| 8004 | |
| 8005 | int mem_base; |
| 8006 | xmlNodePtr ret_val; |
| 8007 | xmlDocPtr doc; /* the document */ |
| 8008 | int n_doc; |
| 8009 | const xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */ |
| 8010 | int n_name; |
| 8011 | |
| 8012 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8013 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 8014 | mem_base = xmlMemBlocks(); |
| 8015 | doc = gen_xmlDocPtr(n_doc); |
| 8016 | name = gen_const_xmlChar_ptr(n_name); |
| 8017 | |
| 8018 | ret_val = xmlNewCharRef(doc, name); |
| 8019 | desret_xmlNodePtr(ret_val); |
| 8020 | call_tests++; |
| 8021 | des_xmlDocPtr(n_doc, doc); |
| 8022 | des_const_xmlChar_ptr(n_name, name); |
| 8023 | xmlResetLastError(); |
| 8024 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8025 | printf("Leak of %d blocks found in xmlNewCharRef", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8026 | xmlMemBlocks() - mem_base); |
| 8027 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8028 | printf(" %d", n_doc); |
| 8029 | printf(" %d", n_name); |
| 8030 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8031 | } |
| 8032 | } |
| 8033 | } |
| 8034 | |
| 8035 | return(ret); |
| 8036 | } |
| 8037 | |
| 8038 | |
| 8039 | static int |
| 8040 | test_xmlNewChild(void) { |
| 8041 | int ret = 0; |
| 8042 | |
| 8043 | |
| 8044 | /* missing type support */ |
| 8045 | return(ret); |
| 8046 | } |
| 8047 | |
| 8048 | |
| 8049 | static int |
| 8050 | test_xmlNewComment(void) { |
| 8051 | int ret = 0; |
| 8052 | |
| 8053 | int mem_base; |
| 8054 | xmlNodePtr ret_val; |
| 8055 | const xmlChar * content; /* the comment content */ |
| 8056 | int n_content; |
| 8057 | |
| 8058 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8059 | mem_base = xmlMemBlocks(); |
| 8060 | content = gen_const_xmlChar_ptr(n_content); |
| 8061 | |
| 8062 | ret_val = xmlNewComment(content); |
| 8063 | desret_xmlNodePtr(ret_val); |
| 8064 | call_tests++; |
| 8065 | des_const_xmlChar_ptr(n_content, content); |
| 8066 | xmlResetLastError(); |
| 8067 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8068 | printf("Leak of %d blocks found in xmlNewComment", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8069 | xmlMemBlocks() - mem_base); |
| 8070 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8071 | printf(" %d", n_content); |
| 8072 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8073 | } |
| 8074 | } |
| 8075 | |
| 8076 | return(ret); |
| 8077 | } |
| 8078 | |
| 8079 | |
| 8080 | static int |
| 8081 | test_xmlNewDoc(void) { |
| 8082 | int ret = 0; |
| 8083 | |
| 8084 | int mem_base; |
| 8085 | xmlDocPtr ret_val; |
| 8086 | const xmlChar * version; /* xmlChar string giving the version of XML "1.0" */ |
| 8087 | int n_version; |
| 8088 | |
| 8089 | for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) { |
| 8090 | mem_base = xmlMemBlocks(); |
| 8091 | version = gen_const_xmlChar_ptr(n_version); |
| 8092 | |
| 8093 | ret_val = xmlNewDoc(version); |
| 8094 | desret_xmlDocPtr(ret_val); |
| 8095 | call_tests++; |
| 8096 | des_const_xmlChar_ptr(n_version, version); |
| 8097 | xmlResetLastError(); |
| 8098 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8099 | printf("Leak of %d blocks found in xmlNewDoc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8100 | xmlMemBlocks() - mem_base); |
| 8101 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8102 | printf(" %d", n_version); |
| 8103 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8104 | } |
| 8105 | } |
| 8106 | |
| 8107 | return(ret); |
| 8108 | } |
| 8109 | |
| 8110 | |
| 8111 | static int |
| 8112 | test_xmlNewDocComment(void) { |
| 8113 | int ret = 0; |
| 8114 | |
| 8115 | int mem_base; |
| 8116 | xmlNodePtr ret_val; |
| 8117 | xmlDocPtr doc; /* the document */ |
| 8118 | int n_doc; |
| 8119 | const xmlChar * content; /* the comment content */ |
| 8120 | int n_content; |
| 8121 | |
| 8122 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8123 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8124 | mem_base = xmlMemBlocks(); |
| 8125 | doc = gen_xmlDocPtr(n_doc); |
| 8126 | content = gen_const_xmlChar_ptr(n_content); |
| 8127 | |
| 8128 | ret_val = xmlNewDocComment(doc, content); |
| 8129 | desret_xmlNodePtr(ret_val); |
| 8130 | call_tests++; |
| 8131 | des_xmlDocPtr(n_doc, doc); |
| 8132 | des_const_xmlChar_ptr(n_content, content); |
| 8133 | xmlResetLastError(); |
| 8134 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8135 | printf("Leak of %d blocks found in xmlNewDocComment", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8136 | xmlMemBlocks() - mem_base); |
| 8137 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8138 | printf(" %d", n_doc); |
| 8139 | printf(" %d", n_content); |
| 8140 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8141 | } |
| 8142 | } |
| 8143 | } |
| 8144 | |
| 8145 | return(ret); |
| 8146 | } |
| 8147 | |
| 8148 | |
| 8149 | static int |
| 8150 | test_xmlNewDocFragment(void) { |
| 8151 | int ret = 0; |
| 8152 | |
| 8153 | #ifdef LIBXML_TREE_ENABLED |
| 8154 | int mem_base; |
| 8155 | xmlNodePtr ret_val; |
| 8156 | xmlDocPtr doc; /* the document owning the fragment */ |
| 8157 | int n_doc; |
| 8158 | |
| 8159 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8160 | mem_base = xmlMemBlocks(); |
| 8161 | doc = gen_xmlDocPtr(n_doc); |
| 8162 | |
| 8163 | ret_val = xmlNewDocFragment(doc); |
| 8164 | desret_xmlNodePtr(ret_val); |
| 8165 | call_tests++; |
| 8166 | des_xmlDocPtr(n_doc, doc); |
| 8167 | xmlResetLastError(); |
| 8168 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8169 | printf("Leak of %d blocks found in xmlNewDocFragment", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8170 | xmlMemBlocks() - mem_base); |
| 8171 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8172 | printf(" %d", n_doc); |
| 8173 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8174 | } |
| 8175 | } |
| 8176 | #endif |
| 8177 | |
| 8178 | return(ret); |
| 8179 | } |
| 8180 | |
| 8181 | |
| 8182 | static int |
| 8183 | test_xmlNewDocNode(void) { |
| 8184 | int ret = 0; |
| 8185 | |
| 8186 | |
| 8187 | /* missing type support */ |
| 8188 | return(ret); |
| 8189 | } |
| 8190 | |
| 8191 | |
| 8192 | static int |
| 8193 | test_xmlNewDocNodeEatName(void) { |
| 8194 | int ret = 0; |
| 8195 | |
| 8196 | |
| 8197 | /* missing type support */ |
| 8198 | return(ret); |
| 8199 | } |
| 8200 | |
| 8201 | |
| 8202 | static int |
| 8203 | test_xmlNewDocPI(void) { |
| 8204 | int ret = 0; |
| 8205 | |
| 8206 | int mem_base; |
| 8207 | xmlNodePtr ret_val; |
| 8208 | xmlDocPtr doc; /* the target document */ |
| 8209 | int n_doc; |
| 8210 | const xmlChar * name; /* the processing instruction name */ |
| 8211 | int n_name; |
| 8212 | const xmlChar * content; /* the PI content */ |
| 8213 | int n_content; |
| 8214 | |
| 8215 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8216 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 8217 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8218 | mem_base = xmlMemBlocks(); |
| 8219 | doc = gen_xmlDocPtr(n_doc); |
| 8220 | name = gen_const_xmlChar_ptr(n_name); |
| 8221 | content = gen_const_xmlChar_ptr(n_content); |
| 8222 | |
| 8223 | ret_val = xmlNewDocPI(doc, name, content); |
| 8224 | desret_xmlNodePtr(ret_val); |
| 8225 | call_tests++; |
| 8226 | des_xmlDocPtr(n_doc, doc); |
| 8227 | des_const_xmlChar_ptr(n_name, name); |
| 8228 | des_const_xmlChar_ptr(n_content, content); |
| 8229 | xmlResetLastError(); |
| 8230 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8231 | printf("Leak of %d blocks found in xmlNewDocPI", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8232 | xmlMemBlocks() - mem_base); |
| 8233 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8234 | printf(" %d", n_doc); |
| 8235 | printf(" %d", n_name); |
| 8236 | printf(" %d", n_content); |
| 8237 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8238 | } |
| 8239 | } |
| 8240 | } |
| 8241 | } |
| 8242 | |
| 8243 | return(ret); |
| 8244 | } |
| 8245 | |
| 8246 | |
| 8247 | static int |
| 8248 | test_xmlNewDocProp(void) { |
| 8249 | int ret = 0; |
| 8250 | |
| 8251 | |
| 8252 | /* missing type support */ |
| 8253 | return(ret); |
| 8254 | } |
| 8255 | |
| 8256 | |
| 8257 | static int |
| 8258 | test_xmlNewDocRawNode(void) { |
| 8259 | int ret = 0; |
| 8260 | |
| 8261 | |
| 8262 | /* missing type support */ |
| 8263 | return(ret); |
| 8264 | } |
| 8265 | |
| 8266 | |
| 8267 | static int |
| 8268 | test_xmlNewDocText(void) { |
| 8269 | int ret = 0; |
| 8270 | |
| 8271 | int mem_base; |
| 8272 | xmlNodePtr ret_val; |
| 8273 | xmlDocPtr doc; /* the document */ |
| 8274 | int n_doc; |
| 8275 | const xmlChar * content; /* the text content */ |
| 8276 | int n_content; |
| 8277 | |
| 8278 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8279 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8280 | mem_base = xmlMemBlocks(); |
| 8281 | doc = gen_xmlDocPtr(n_doc); |
| 8282 | content = gen_const_xmlChar_ptr(n_content); |
| 8283 | |
| 8284 | ret_val = xmlNewDocText(doc, content); |
| 8285 | desret_xmlNodePtr(ret_val); |
| 8286 | call_tests++; |
| 8287 | des_xmlDocPtr(n_doc, doc); |
| 8288 | des_const_xmlChar_ptr(n_content, content); |
| 8289 | xmlResetLastError(); |
| 8290 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8291 | printf("Leak of %d blocks found in xmlNewDocText", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8292 | xmlMemBlocks() - mem_base); |
| 8293 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8294 | printf(" %d", n_doc); |
| 8295 | printf(" %d", n_content); |
| 8296 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8297 | } |
| 8298 | } |
| 8299 | } |
| 8300 | |
| 8301 | return(ret); |
| 8302 | } |
| 8303 | |
| 8304 | |
| 8305 | static int |
| 8306 | test_xmlNewDocTextLen(void) { |
| 8307 | int ret = 0; |
| 8308 | |
| 8309 | int mem_base; |
| 8310 | xmlNodePtr ret_val; |
| 8311 | xmlDocPtr doc; /* the document */ |
| 8312 | int n_doc; |
| 8313 | const xmlChar * content; /* the text content */ |
| 8314 | int n_content; |
| 8315 | int len; /* the text len. */ |
| 8316 | int n_len; |
| 8317 | |
| 8318 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8319 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8320 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 8321 | mem_base = xmlMemBlocks(); |
| 8322 | doc = gen_xmlDocPtr(n_doc); |
| 8323 | content = gen_const_xmlChar_ptr(n_content); |
| 8324 | len = gen_int(n_len); |
| 8325 | |
| 8326 | ret_val = xmlNewDocTextLen(doc, content, len); |
| 8327 | desret_xmlNodePtr(ret_val); |
| 8328 | call_tests++; |
| 8329 | des_xmlDocPtr(n_doc, doc); |
| 8330 | des_const_xmlChar_ptr(n_content, content); |
| 8331 | des_int(n_len, len); |
| 8332 | xmlResetLastError(); |
| 8333 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8334 | printf("Leak of %d blocks found in xmlNewDocTextLen", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8335 | xmlMemBlocks() - mem_base); |
| 8336 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8337 | printf(" %d", n_doc); |
| 8338 | printf(" %d", n_content); |
| 8339 | printf(" %d", n_len); |
| 8340 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8341 | } |
| 8342 | } |
| 8343 | } |
| 8344 | } |
| 8345 | |
| 8346 | return(ret); |
| 8347 | } |
| 8348 | |
| 8349 | |
| 8350 | static int |
| 8351 | test_xmlNewDtd(void) { |
| 8352 | int ret = 0; |
| 8353 | |
| 8354 | |
| 8355 | /* missing type support */ |
| 8356 | return(ret); |
| 8357 | } |
| 8358 | |
| 8359 | |
| 8360 | static int |
| 8361 | test_xmlNewGlobalNs(void) { |
| 8362 | int ret = 0; |
| 8363 | |
| 8364 | |
| 8365 | /* missing type support */ |
| 8366 | return(ret); |
| 8367 | } |
| 8368 | |
| 8369 | |
| 8370 | static int |
| 8371 | test_xmlNewNode(void) { |
| 8372 | int ret = 0; |
| 8373 | |
| 8374 | |
| 8375 | /* missing type support */ |
| 8376 | return(ret); |
| 8377 | } |
| 8378 | |
| 8379 | |
| 8380 | static int |
| 8381 | test_xmlNewNodeEatName(void) { |
| 8382 | int ret = 0; |
| 8383 | |
| 8384 | |
| 8385 | /* missing type support */ |
| 8386 | return(ret); |
| 8387 | } |
| 8388 | |
| 8389 | |
| 8390 | static int |
| 8391 | test_xmlNewNs(void) { |
| 8392 | int ret = 0; |
| 8393 | |
| 8394 | |
| 8395 | /* missing type support */ |
| 8396 | return(ret); |
| 8397 | } |
| 8398 | |
| 8399 | |
| 8400 | static int |
| 8401 | test_xmlNewNsProp(void) { |
| 8402 | int ret = 0; |
| 8403 | |
| 8404 | |
| 8405 | /* missing type support */ |
| 8406 | return(ret); |
| 8407 | } |
| 8408 | |
| 8409 | |
| 8410 | static int |
| 8411 | test_xmlNewNsPropEatName(void) { |
| 8412 | int ret = 0; |
| 8413 | |
| 8414 | |
| 8415 | /* missing type support */ |
| 8416 | return(ret); |
| 8417 | } |
| 8418 | |
| 8419 | |
| 8420 | static int |
| 8421 | test_xmlNewPI(void) { |
| 8422 | int ret = 0; |
| 8423 | |
| 8424 | int mem_base; |
| 8425 | xmlNodePtr ret_val; |
| 8426 | const xmlChar * name; /* the processing instruction name */ |
| 8427 | int n_name; |
| 8428 | const xmlChar * content; /* the PI content */ |
| 8429 | int n_content; |
| 8430 | |
| 8431 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 8432 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8433 | mem_base = xmlMemBlocks(); |
| 8434 | name = gen_const_xmlChar_ptr(n_name); |
| 8435 | content = gen_const_xmlChar_ptr(n_content); |
| 8436 | |
| 8437 | ret_val = xmlNewPI(name, content); |
| 8438 | desret_xmlNodePtr(ret_val); |
| 8439 | call_tests++; |
| 8440 | des_const_xmlChar_ptr(n_name, name); |
| 8441 | des_const_xmlChar_ptr(n_content, content); |
| 8442 | xmlResetLastError(); |
| 8443 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8444 | printf("Leak of %d blocks found in xmlNewPI", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8445 | xmlMemBlocks() - mem_base); |
| 8446 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8447 | printf(" %d", n_name); |
| 8448 | printf(" %d", n_content); |
| 8449 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8450 | } |
| 8451 | } |
| 8452 | } |
| 8453 | |
| 8454 | return(ret); |
| 8455 | } |
| 8456 | |
| 8457 | |
| 8458 | static int |
| 8459 | test_xmlNewProp(void) { |
| 8460 | int ret = 0; |
| 8461 | |
| 8462 | |
| 8463 | /* missing type support */ |
| 8464 | return(ret); |
| 8465 | } |
| 8466 | |
| 8467 | |
| 8468 | static int |
| 8469 | test_xmlNewReference(void) { |
| 8470 | int ret = 0; |
| 8471 | |
| 8472 | int mem_base; |
| 8473 | xmlNodePtr ret_val; |
| 8474 | xmlDocPtr doc; /* the document */ |
| 8475 | int n_doc; |
| 8476 | const xmlChar * name; /* the reference name, or the reference string with & and ; */ |
| 8477 | int n_name; |
| 8478 | |
| 8479 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8480 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 8481 | mem_base = xmlMemBlocks(); |
| 8482 | doc = gen_xmlDocPtr(n_doc); |
| 8483 | name = gen_const_xmlChar_ptr(n_name); |
| 8484 | |
| 8485 | ret_val = xmlNewReference(doc, name); |
| 8486 | desret_xmlNodePtr(ret_val); |
| 8487 | call_tests++; |
| 8488 | des_xmlDocPtr(n_doc, doc); |
| 8489 | des_const_xmlChar_ptr(n_name, name); |
| 8490 | xmlResetLastError(); |
| 8491 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8492 | printf("Leak of %d blocks found in xmlNewReference", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8493 | xmlMemBlocks() - mem_base); |
| 8494 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8495 | printf(" %d", n_doc); |
| 8496 | printf(" %d", n_name); |
| 8497 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8498 | } |
| 8499 | } |
| 8500 | } |
| 8501 | |
| 8502 | return(ret); |
| 8503 | } |
| 8504 | |
| 8505 | |
| 8506 | static int |
| 8507 | test_xmlNewText(void) { |
| 8508 | int ret = 0; |
| 8509 | |
| 8510 | int mem_base; |
| 8511 | xmlNodePtr ret_val; |
| 8512 | const xmlChar * content; /* the text content */ |
| 8513 | int n_content; |
| 8514 | |
| 8515 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8516 | mem_base = xmlMemBlocks(); |
| 8517 | content = gen_const_xmlChar_ptr(n_content); |
| 8518 | |
| 8519 | ret_val = xmlNewText(content); |
| 8520 | desret_xmlNodePtr(ret_val); |
| 8521 | call_tests++; |
| 8522 | des_const_xmlChar_ptr(n_content, content); |
| 8523 | xmlResetLastError(); |
| 8524 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8525 | printf("Leak of %d blocks found in xmlNewText", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8526 | xmlMemBlocks() - mem_base); |
| 8527 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8528 | printf(" %d", n_content); |
| 8529 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8530 | } |
| 8531 | } |
| 8532 | |
| 8533 | return(ret); |
| 8534 | } |
| 8535 | |
| 8536 | |
| 8537 | static int |
| 8538 | test_xmlNewTextChild(void) { |
| 8539 | int ret = 0; |
| 8540 | |
| 8541 | |
| 8542 | /* missing type support */ |
| 8543 | return(ret); |
| 8544 | } |
| 8545 | |
| 8546 | |
| 8547 | static int |
| 8548 | test_xmlNewTextLen(void) { |
| 8549 | int ret = 0; |
| 8550 | |
| 8551 | int mem_base; |
| 8552 | xmlNodePtr ret_val; |
| 8553 | const xmlChar * content; /* the text content */ |
| 8554 | int n_content; |
| 8555 | int len; /* the text len. */ |
| 8556 | int n_len; |
| 8557 | |
| 8558 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8559 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 8560 | mem_base = xmlMemBlocks(); |
| 8561 | content = gen_const_xmlChar_ptr(n_content); |
| 8562 | len = gen_int(n_len); |
| 8563 | |
| 8564 | ret_val = xmlNewTextLen(content, len); |
| 8565 | desret_xmlNodePtr(ret_val); |
| 8566 | call_tests++; |
| 8567 | des_const_xmlChar_ptr(n_content, content); |
| 8568 | des_int(n_len, len); |
| 8569 | xmlResetLastError(); |
| 8570 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8571 | printf("Leak of %d blocks found in xmlNewTextLen", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8572 | xmlMemBlocks() - mem_base); |
| 8573 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8574 | printf(" %d", n_content); |
| 8575 | printf(" %d", n_len); |
| 8576 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8577 | } |
| 8578 | } |
| 8579 | } |
| 8580 | |
| 8581 | return(ret); |
| 8582 | } |
| 8583 | |
| 8584 | |
| 8585 | static int |
| 8586 | test_xmlNodeAddContent(void) { |
| 8587 | int ret = 0; |
| 8588 | |
| 8589 | int mem_base; |
| 8590 | xmlNodePtr cur; /* the node being modified */ |
| 8591 | int n_cur; |
| 8592 | const xmlChar * content; /* extra content */ |
| 8593 | int n_content; |
| 8594 | |
| 8595 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 8596 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8597 | mem_base = xmlMemBlocks(); |
| 8598 | cur = gen_xmlNodePtr(n_cur); |
| 8599 | content = gen_const_xmlChar_ptr(n_content); |
| 8600 | |
| 8601 | xmlNodeAddContent(cur, content); |
| 8602 | call_tests++; |
| 8603 | des_xmlNodePtr(n_cur, cur); |
| 8604 | des_const_xmlChar_ptr(n_content, content); |
| 8605 | xmlResetLastError(); |
| 8606 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8607 | printf("Leak of %d blocks found in xmlNodeAddContent", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8608 | xmlMemBlocks() - mem_base); |
| 8609 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8610 | printf(" %d", n_cur); |
| 8611 | printf(" %d", n_content); |
| 8612 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8613 | } |
| 8614 | } |
| 8615 | } |
| 8616 | |
| 8617 | return(ret); |
| 8618 | } |
| 8619 | |
| 8620 | |
| 8621 | static int |
| 8622 | test_xmlNodeAddContentLen(void) { |
| 8623 | int ret = 0; |
| 8624 | |
| 8625 | int mem_base; |
| 8626 | xmlNodePtr cur; /* the node being modified */ |
| 8627 | int n_cur; |
| 8628 | const xmlChar * content; /* extra content */ |
| 8629 | int n_content; |
| 8630 | int len; /* the size of @content */ |
| 8631 | int n_len; |
| 8632 | |
| 8633 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 8634 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 8635 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 8636 | mem_base = xmlMemBlocks(); |
| 8637 | cur = gen_xmlNodePtr(n_cur); |
| 8638 | content = gen_const_xmlChar_ptr(n_content); |
| 8639 | len = gen_int(n_len); |
| 8640 | |
| 8641 | xmlNodeAddContentLen(cur, content, len); |
| 8642 | call_tests++; |
| 8643 | des_xmlNodePtr(n_cur, cur); |
| 8644 | des_const_xmlChar_ptr(n_content, content); |
| 8645 | des_int(n_len, len); |
| 8646 | xmlResetLastError(); |
| 8647 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8648 | printf("Leak of %d blocks found in xmlNodeAddContentLen", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8649 | xmlMemBlocks() - mem_base); |
| 8650 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8651 | printf(" %d", n_cur); |
| 8652 | printf(" %d", n_content); |
| 8653 | printf(" %d", n_len); |
| 8654 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8655 | } |
| 8656 | } |
| 8657 | } |
| 8658 | } |
| 8659 | |
| 8660 | return(ret); |
| 8661 | } |
| 8662 | |
| 8663 | |
| 8664 | static int |
| 8665 | test_xmlNodeBufGetContent(void) { |
| 8666 | int ret = 0; |
| 8667 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 8668 | int mem_base; |
| 8669 | int ret_val; |
| 8670 | xmlBufferPtr buffer; /* a buffer */ |
| 8671 | int n_buffer; |
| 8672 | xmlNodePtr cur; /* the node being read */ |
| 8673 | int n_cur; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8674 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 8675 | for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) { |
| 8676 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 8677 | mem_base = xmlMemBlocks(); |
| 8678 | buffer = gen_xmlBufferPtr(n_buffer); |
| 8679 | cur = gen_xmlNodePtr(n_cur); |
| 8680 | |
| 8681 | ret_val = xmlNodeBufGetContent(buffer, cur); |
| 8682 | desret_int(ret_val); |
| 8683 | call_tests++; |
| 8684 | des_xmlBufferPtr(n_buffer, buffer); |
| 8685 | des_xmlNodePtr(n_cur, cur); |
| 8686 | xmlResetLastError(); |
| 8687 | if (mem_base != xmlMemBlocks()) { |
| 8688 | printf("Leak of %d blocks found in xmlNodeBufGetContent", |
| 8689 | xmlMemBlocks() - mem_base); |
| 8690 | ret++; |
| 8691 | printf(" %d", n_buffer); |
| 8692 | printf(" %d", n_cur); |
| 8693 | printf("\n"); |
| 8694 | } |
| 8695 | } |
| 8696 | } |
| 8697 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8698 | return(ret); |
| 8699 | } |
| 8700 | |
| 8701 | |
| 8702 | static int |
| 8703 | test_xmlNodeDump(void) { |
| 8704 | int ret = 0; |
| 8705 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 8706 | #ifdef LIBXML_OUTPUT_ENABLED |
| 8707 | int mem_base; |
| 8708 | int ret_val; |
| 8709 | xmlBufferPtr buf; /* the XML buffer output */ |
| 8710 | int n_buf; |
| 8711 | xmlDocPtr doc; /* the document */ |
| 8712 | int n_doc; |
| 8713 | xmlNodePtr cur; /* the current node */ |
| 8714 | int n_cur; |
| 8715 | int level; /* the imbrication level for indenting */ |
| 8716 | int n_level; |
| 8717 | int format; /* is formatting allowed */ |
| 8718 | int n_format; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8719 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 8720 | for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
| 8721 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8722 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 8723 | for (n_level = 0;n_level < gen_nb_int;n_level++) { |
| 8724 | for (n_format = 0;n_format < gen_nb_int;n_format++) { |
| 8725 | mem_base = xmlMemBlocks(); |
| 8726 | buf = gen_xmlBufferPtr(n_buf); |
| 8727 | doc = gen_xmlDocPtr(n_doc); |
| 8728 | cur = gen_xmlNodePtr(n_cur); |
| 8729 | level = gen_int(n_level); |
| 8730 | format = gen_int(n_format); |
| 8731 | |
| 8732 | ret_val = xmlNodeDump(buf, doc, cur, level, format); |
| 8733 | desret_int(ret_val); |
| 8734 | call_tests++; |
| 8735 | des_xmlBufferPtr(n_buf, buf); |
| 8736 | des_xmlDocPtr(n_doc, doc); |
| 8737 | des_xmlNodePtr(n_cur, cur); |
| 8738 | des_int(n_level, level); |
| 8739 | des_int(n_format, format); |
| 8740 | xmlResetLastError(); |
| 8741 | if (mem_base != xmlMemBlocks()) { |
| 8742 | printf("Leak of %d blocks found in xmlNodeDump", |
| 8743 | xmlMemBlocks() - mem_base); |
| 8744 | ret++; |
| 8745 | printf(" %d", n_buf); |
| 8746 | printf(" %d", n_doc); |
| 8747 | printf(" %d", n_cur); |
| 8748 | printf(" %d", n_level); |
| 8749 | printf(" %d", n_format); |
| 8750 | printf("\n"); |
| 8751 | } |
| 8752 | } |
| 8753 | } |
| 8754 | } |
| 8755 | } |
| 8756 | } |
| 8757 | #endif |
| 8758 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8759 | return(ret); |
| 8760 | } |
| 8761 | |
| 8762 | |
| 8763 | static int |
| 8764 | test_xmlNodeDumpOutput(void) { |
| 8765 | int ret = 0; |
| 8766 | |
| 8767 | |
| 8768 | /* missing type support */ |
| 8769 | return(ret); |
| 8770 | } |
| 8771 | |
| 8772 | |
| 8773 | static int |
| 8774 | test_xmlNodeGetBase(void) { |
| 8775 | int ret = 0; |
| 8776 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8777 | int mem_base; |
| 8778 | xmlChar * ret_val; |
| 8779 | xmlDocPtr doc; /* the document the node pertains to */ |
| 8780 | int n_doc; |
| 8781 | xmlNodePtr cur; /* the node being checked */ |
| 8782 | int n_cur; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8783 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8784 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8785 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 8786 | mem_base = xmlMemBlocks(); |
| 8787 | doc = gen_xmlDocPtr(n_doc); |
| 8788 | cur = gen_xmlNodePtr(n_cur); |
| 8789 | |
| 8790 | ret_val = xmlNodeGetBase(doc, cur); |
| 8791 | desret_xmlChar_ptr(ret_val); |
| 8792 | call_tests++; |
| 8793 | des_xmlDocPtr(n_doc, doc); |
| 8794 | des_xmlNodePtr(n_cur, cur); |
| 8795 | xmlResetLastError(); |
| 8796 | if (mem_base != xmlMemBlocks()) { |
| 8797 | printf("Leak of %d blocks found in xmlNodeGetBase", |
| 8798 | xmlMemBlocks() - mem_base); |
| 8799 | ret++; |
| 8800 | printf(" %d", n_doc); |
| 8801 | printf(" %d", n_cur); |
| 8802 | printf("\n"); |
| 8803 | } |
| 8804 | } |
| 8805 | } |
| 8806 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8807 | return(ret); |
| 8808 | } |
| 8809 | |
| 8810 | |
| 8811 | static int |
| 8812 | test_xmlNodeGetContent(void) { |
| 8813 | int ret = 0; |
| 8814 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8815 | int mem_base; |
| 8816 | xmlChar * ret_val; |
| 8817 | xmlNodePtr cur; /* the node being read */ |
| 8818 | int n_cur; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8819 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8820 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 8821 | mem_base = xmlMemBlocks(); |
| 8822 | cur = gen_xmlNodePtr(n_cur); |
| 8823 | |
| 8824 | ret_val = xmlNodeGetContent(cur); |
| 8825 | desret_xmlChar_ptr(ret_val); |
| 8826 | call_tests++; |
| 8827 | des_xmlNodePtr(n_cur, cur); |
| 8828 | xmlResetLastError(); |
| 8829 | if (mem_base != xmlMemBlocks()) { |
| 8830 | printf("Leak of %d blocks found in xmlNodeGetContent", |
| 8831 | xmlMemBlocks() - mem_base); |
| 8832 | ret++; |
| 8833 | printf(" %d", n_cur); |
| 8834 | printf("\n"); |
| 8835 | } |
| 8836 | } |
| 8837 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8838 | return(ret); |
| 8839 | } |
| 8840 | |
| 8841 | |
| 8842 | static int |
| 8843 | test_xmlNodeGetLang(void) { |
| 8844 | int ret = 0; |
| 8845 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8846 | int mem_base; |
| 8847 | xmlChar * ret_val; |
| 8848 | xmlNodePtr cur; /* the node being checked */ |
| 8849 | int n_cur; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8850 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8851 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 8852 | mem_base = xmlMemBlocks(); |
| 8853 | cur = gen_xmlNodePtr(n_cur); |
| 8854 | |
| 8855 | ret_val = xmlNodeGetLang(cur); |
| 8856 | desret_xmlChar_ptr(ret_val); |
| 8857 | call_tests++; |
| 8858 | des_xmlNodePtr(n_cur, cur); |
| 8859 | xmlResetLastError(); |
| 8860 | if (mem_base != xmlMemBlocks()) { |
| 8861 | printf("Leak of %d blocks found in xmlNodeGetLang", |
| 8862 | xmlMemBlocks() - mem_base); |
| 8863 | ret++; |
| 8864 | printf(" %d", n_cur); |
| 8865 | printf("\n"); |
| 8866 | } |
| 8867 | } |
| 8868 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8869 | return(ret); |
| 8870 | } |
| 8871 | |
| 8872 | |
| 8873 | static int |
| 8874 | test_xmlNodeGetSpacePreserve(void) { |
| 8875 | int ret = 0; |
| 8876 | |
| 8877 | int mem_base; |
| 8878 | int ret_val; |
| 8879 | xmlNodePtr cur; /* the node being checked */ |
| 8880 | int n_cur; |
| 8881 | |
| 8882 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 8883 | mem_base = xmlMemBlocks(); |
| 8884 | cur = gen_xmlNodePtr(n_cur); |
| 8885 | |
| 8886 | ret_val = xmlNodeGetSpacePreserve(cur); |
| 8887 | desret_int(ret_val); |
| 8888 | call_tests++; |
| 8889 | des_xmlNodePtr(n_cur, cur); |
| 8890 | xmlResetLastError(); |
| 8891 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8892 | printf("Leak of %d blocks found in xmlNodeGetSpacePreserve", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8893 | xmlMemBlocks() - mem_base); |
| 8894 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8895 | printf(" %d", n_cur); |
| 8896 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8897 | } |
| 8898 | } |
| 8899 | |
| 8900 | return(ret); |
| 8901 | } |
| 8902 | |
| 8903 | |
| 8904 | static int |
| 8905 | test_xmlNodeIsText(void) { |
| 8906 | int ret = 0; |
| 8907 | |
| 8908 | int mem_base; |
| 8909 | int ret_val; |
| 8910 | xmlNodePtr node; /* the node */ |
| 8911 | int n_node; |
| 8912 | |
| 8913 | for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { |
| 8914 | mem_base = xmlMemBlocks(); |
| 8915 | node = gen_xmlNodePtr(n_node); |
| 8916 | |
| 8917 | ret_val = xmlNodeIsText(node); |
| 8918 | desret_int(ret_val); |
| 8919 | call_tests++; |
| 8920 | des_xmlNodePtr(n_node, node); |
| 8921 | xmlResetLastError(); |
| 8922 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8923 | printf("Leak of %d blocks found in xmlNodeIsText", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8924 | xmlMemBlocks() - mem_base); |
| 8925 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 8926 | printf(" %d", n_node); |
| 8927 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8928 | } |
| 8929 | } |
| 8930 | |
| 8931 | return(ret); |
| 8932 | } |
| 8933 | |
| 8934 | |
| 8935 | static int |
| 8936 | test_xmlNodeListGetRawString(void) { |
| 8937 | int ret = 0; |
| 8938 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8939 | #ifdef LIBXML_TREE_ENABLED |
| 8940 | int mem_base; |
| 8941 | xmlChar * ret_val; |
| 8942 | xmlDocPtr doc; /* the document */ |
| 8943 | int n_doc; |
| 8944 | xmlNodePtr list; /* a Node list */ |
| 8945 | int n_list; |
| 8946 | int inLine; /* should we replace entity contents or show their external form */ |
| 8947 | int n_inLine; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8948 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8949 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8950 | for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) { |
| 8951 | for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) { |
| 8952 | mem_base = xmlMemBlocks(); |
| 8953 | doc = gen_xmlDocPtr(n_doc); |
| 8954 | list = gen_xmlNodePtr(n_list); |
| 8955 | inLine = gen_int(n_inLine); |
| 8956 | |
| 8957 | ret_val = xmlNodeListGetRawString(doc, list, inLine); |
| 8958 | desret_xmlChar_ptr(ret_val); |
| 8959 | call_tests++; |
| 8960 | des_xmlDocPtr(n_doc, doc); |
| 8961 | des_xmlNodePtr(n_list, list); |
| 8962 | des_int(n_inLine, inLine); |
| 8963 | xmlResetLastError(); |
| 8964 | if (mem_base != xmlMemBlocks()) { |
| 8965 | printf("Leak of %d blocks found in xmlNodeListGetRawString", |
| 8966 | xmlMemBlocks() - mem_base); |
| 8967 | ret++; |
| 8968 | printf(" %d", n_doc); |
| 8969 | printf(" %d", n_list); |
| 8970 | printf(" %d", n_inLine); |
| 8971 | printf("\n"); |
| 8972 | } |
| 8973 | } |
| 8974 | } |
| 8975 | } |
| 8976 | #endif |
| 8977 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8978 | return(ret); |
| 8979 | } |
| 8980 | |
| 8981 | |
| 8982 | static int |
| 8983 | test_xmlNodeListGetString(void) { |
| 8984 | int ret = 0; |
| 8985 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8986 | int mem_base; |
| 8987 | xmlChar * ret_val; |
| 8988 | xmlDocPtr doc; /* the document */ |
| 8989 | int n_doc; |
| 8990 | xmlNodePtr list; /* a Node list */ |
| 8991 | int n_list; |
| 8992 | int inLine; /* should we replace entity contents or show their external form */ |
| 8993 | int n_inLine; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 8994 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 8995 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 8996 | for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) { |
| 8997 | for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) { |
| 8998 | mem_base = xmlMemBlocks(); |
| 8999 | doc = gen_xmlDocPtr(n_doc); |
| 9000 | list = gen_xmlNodePtr(n_list); |
| 9001 | inLine = gen_int(n_inLine); |
| 9002 | |
| 9003 | ret_val = xmlNodeListGetString(doc, list, inLine); |
| 9004 | desret_xmlChar_ptr(ret_val); |
| 9005 | call_tests++; |
| 9006 | des_xmlDocPtr(n_doc, doc); |
| 9007 | des_xmlNodePtr(n_list, list); |
| 9008 | des_int(n_inLine, inLine); |
| 9009 | xmlResetLastError(); |
| 9010 | if (mem_base != xmlMemBlocks()) { |
| 9011 | printf("Leak of %d blocks found in xmlNodeListGetString", |
| 9012 | xmlMemBlocks() - mem_base); |
| 9013 | ret++; |
| 9014 | printf(" %d", n_doc); |
| 9015 | printf(" %d", n_list); |
| 9016 | printf(" %d", n_inLine); |
| 9017 | printf("\n"); |
| 9018 | } |
| 9019 | } |
| 9020 | } |
| 9021 | } |
| 9022 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9023 | return(ret); |
| 9024 | } |
| 9025 | |
| 9026 | |
| 9027 | static int |
| 9028 | test_xmlNodeSetBase(void) { |
| 9029 | int ret = 0; |
| 9030 | |
| 9031 | #ifdef LIBXML_TREE_ENABLED |
| 9032 | int mem_base; |
| 9033 | xmlNodePtr cur; /* the node being changed */ |
| 9034 | int n_cur; |
| 9035 | const xmlChar * uri; /* the new base URI */ |
| 9036 | int n_uri; |
| 9037 | |
| 9038 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 9039 | for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) { |
| 9040 | mem_base = xmlMemBlocks(); |
| 9041 | cur = gen_xmlNodePtr(n_cur); |
| 9042 | uri = gen_const_xmlChar_ptr(n_uri); |
| 9043 | |
| 9044 | xmlNodeSetBase(cur, uri); |
| 9045 | call_tests++; |
| 9046 | des_xmlNodePtr(n_cur, cur); |
| 9047 | des_const_xmlChar_ptr(n_uri, uri); |
| 9048 | xmlResetLastError(); |
| 9049 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9050 | printf("Leak of %d blocks found in xmlNodeSetBase", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9051 | xmlMemBlocks() - mem_base); |
| 9052 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9053 | printf(" %d", n_cur); |
| 9054 | printf(" %d", n_uri); |
| 9055 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9056 | } |
| 9057 | } |
| 9058 | } |
| 9059 | #endif |
| 9060 | |
| 9061 | return(ret); |
| 9062 | } |
| 9063 | |
| 9064 | |
| 9065 | static int |
| 9066 | test_xmlNodeSetContent(void) { |
| 9067 | int ret = 0; |
| 9068 | |
| 9069 | int mem_base; |
| 9070 | xmlNodePtr cur; /* the node being modified */ |
| 9071 | int n_cur; |
| 9072 | const xmlChar * content; /* the new value of the content */ |
| 9073 | int n_content; |
| 9074 | |
| 9075 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 9076 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 9077 | mem_base = xmlMemBlocks(); |
| 9078 | cur = gen_xmlNodePtr(n_cur); |
| 9079 | content = gen_const_xmlChar_ptr(n_content); |
| 9080 | |
| 9081 | xmlNodeSetContent(cur, content); |
| 9082 | call_tests++; |
| 9083 | des_xmlNodePtr(n_cur, cur); |
| 9084 | des_const_xmlChar_ptr(n_content, content); |
| 9085 | xmlResetLastError(); |
| 9086 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9087 | printf("Leak of %d blocks found in xmlNodeSetContent", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9088 | xmlMemBlocks() - mem_base); |
| 9089 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9090 | printf(" %d", n_cur); |
| 9091 | printf(" %d", n_content); |
| 9092 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9093 | } |
| 9094 | } |
| 9095 | } |
| 9096 | |
| 9097 | return(ret); |
| 9098 | } |
| 9099 | |
| 9100 | |
| 9101 | static int |
| 9102 | test_xmlNodeSetContentLen(void) { |
| 9103 | int ret = 0; |
| 9104 | |
| 9105 | #ifdef LIBXML_TREE_ENABLED |
| 9106 | int mem_base; |
| 9107 | xmlNodePtr cur; /* the node being modified */ |
| 9108 | int n_cur; |
| 9109 | const xmlChar * content; /* the new value of the content */ |
| 9110 | int n_content; |
| 9111 | int len; /* the size of @content */ |
| 9112 | int n_len; |
| 9113 | |
| 9114 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 9115 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 9116 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 9117 | mem_base = xmlMemBlocks(); |
| 9118 | cur = gen_xmlNodePtr(n_cur); |
| 9119 | content = gen_const_xmlChar_ptr(n_content); |
| 9120 | len = gen_int(n_len); |
| 9121 | |
| 9122 | xmlNodeSetContentLen(cur, content, len); |
| 9123 | call_tests++; |
| 9124 | des_xmlNodePtr(n_cur, cur); |
| 9125 | des_const_xmlChar_ptr(n_content, content); |
| 9126 | des_int(n_len, len); |
| 9127 | xmlResetLastError(); |
| 9128 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9129 | printf("Leak of %d blocks found in xmlNodeSetContentLen", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9130 | xmlMemBlocks() - mem_base); |
| 9131 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9132 | printf(" %d", n_cur); |
| 9133 | printf(" %d", n_content); |
| 9134 | printf(" %d", n_len); |
| 9135 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9136 | } |
| 9137 | } |
| 9138 | } |
| 9139 | } |
| 9140 | #endif |
| 9141 | |
| 9142 | return(ret); |
| 9143 | } |
| 9144 | |
| 9145 | |
| 9146 | static int |
| 9147 | test_xmlNodeSetLang(void) { |
| 9148 | int ret = 0; |
| 9149 | |
| 9150 | #ifdef LIBXML_TREE_ENABLED |
| 9151 | int mem_base; |
| 9152 | xmlNodePtr cur; /* the node being changed */ |
| 9153 | int n_cur; |
| 9154 | const xmlChar * lang; /* the language description */ |
| 9155 | int n_lang; |
| 9156 | |
| 9157 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 9158 | for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) { |
| 9159 | mem_base = xmlMemBlocks(); |
| 9160 | cur = gen_xmlNodePtr(n_cur); |
| 9161 | lang = gen_const_xmlChar_ptr(n_lang); |
| 9162 | |
| 9163 | xmlNodeSetLang(cur, lang); |
| 9164 | call_tests++; |
| 9165 | des_xmlNodePtr(n_cur, cur); |
| 9166 | des_const_xmlChar_ptr(n_lang, lang); |
| 9167 | xmlResetLastError(); |
| 9168 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9169 | printf("Leak of %d blocks found in xmlNodeSetLang", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9170 | xmlMemBlocks() - mem_base); |
| 9171 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9172 | printf(" %d", n_cur); |
| 9173 | printf(" %d", n_lang); |
| 9174 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9175 | } |
| 9176 | } |
| 9177 | } |
| 9178 | #endif |
| 9179 | |
| 9180 | return(ret); |
| 9181 | } |
| 9182 | |
| 9183 | |
| 9184 | static int |
| 9185 | test_xmlNodeSetName(void) { |
| 9186 | int ret = 0; |
| 9187 | |
| 9188 | #ifdef LIBXML_TREE_ENABLED |
| 9189 | int mem_base; |
| 9190 | xmlNodePtr cur; /* the node being changed */ |
| 9191 | int n_cur; |
| 9192 | const xmlChar * name; /* the new tag name */ |
| 9193 | int n_name; |
| 9194 | |
| 9195 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 9196 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 9197 | mem_base = xmlMemBlocks(); |
| 9198 | cur = gen_xmlNodePtr(n_cur); |
| 9199 | name = gen_const_xmlChar_ptr(n_name); |
| 9200 | |
| 9201 | xmlNodeSetName(cur, name); |
| 9202 | call_tests++; |
| 9203 | des_xmlNodePtr(n_cur, cur); |
| 9204 | des_const_xmlChar_ptr(n_name, name); |
| 9205 | xmlResetLastError(); |
| 9206 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9207 | printf("Leak of %d blocks found in xmlNodeSetName", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9208 | xmlMemBlocks() - mem_base); |
| 9209 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9210 | printf(" %d", n_cur); |
| 9211 | printf(" %d", n_name); |
| 9212 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9213 | } |
| 9214 | } |
| 9215 | } |
| 9216 | #endif |
| 9217 | |
| 9218 | return(ret); |
| 9219 | } |
| 9220 | |
| 9221 | |
| 9222 | static int |
| 9223 | test_xmlNodeSetSpacePreserve(void) { |
| 9224 | int ret = 0; |
| 9225 | |
| 9226 | #ifdef LIBXML_TREE_ENABLED |
| 9227 | int mem_base; |
| 9228 | xmlNodePtr cur; /* the node being changed */ |
| 9229 | int n_cur; |
| 9230 | int val; /* the xml:space value ("0": default, 1: "preserve") */ |
| 9231 | int n_val; |
| 9232 | |
| 9233 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 9234 | for (n_val = 0;n_val < gen_nb_int;n_val++) { |
| 9235 | mem_base = xmlMemBlocks(); |
| 9236 | cur = gen_xmlNodePtr(n_cur); |
| 9237 | val = gen_int(n_val); |
| 9238 | |
| 9239 | xmlNodeSetSpacePreserve(cur, val); |
| 9240 | call_tests++; |
| 9241 | des_xmlNodePtr(n_cur, cur); |
| 9242 | des_int(n_val, val); |
| 9243 | xmlResetLastError(); |
| 9244 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9245 | printf("Leak of %d blocks found in xmlNodeSetSpacePreserve", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9246 | xmlMemBlocks() - mem_base); |
| 9247 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9248 | printf(" %d", n_cur); |
| 9249 | printf(" %d", n_val); |
| 9250 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9251 | } |
| 9252 | } |
| 9253 | } |
| 9254 | #endif |
| 9255 | |
| 9256 | return(ret); |
| 9257 | } |
| 9258 | |
| 9259 | |
| 9260 | static int |
| 9261 | test_xmlReconciliateNs(void) { |
| 9262 | int ret = 0; |
| 9263 | |
| 9264 | int mem_base; |
| 9265 | int ret_val; |
| 9266 | xmlDocPtr doc; /* the document */ |
| 9267 | int n_doc; |
| 9268 | xmlNodePtr tree; /* a node defining the subtree to reconciliate */ |
| 9269 | int n_tree; |
| 9270 | |
| 9271 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 9272 | for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { |
| 9273 | mem_base = xmlMemBlocks(); |
| 9274 | doc = gen_xmlDocPtr(n_doc); |
| 9275 | tree = gen_xmlNodePtr(n_tree); |
| 9276 | |
| 9277 | ret_val = xmlReconciliateNs(doc, tree); |
| 9278 | desret_int(ret_val); |
| 9279 | call_tests++; |
| 9280 | des_xmlDocPtr(n_doc, doc); |
| 9281 | des_xmlNodePtr(n_tree, tree); |
| 9282 | xmlResetLastError(); |
| 9283 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9284 | printf("Leak of %d blocks found in xmlReconciliateNs", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9285 | xmlMemBlocks() - mem_base); |
| 9286 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9287 | printf(" %d", n_doc); |
| 9288 | printf(" %d", n_tree); |
| 9289 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9290 | } |
| 9291 | } |
| 9292 | } |
| 9293 | |
| 9294 | return(ret); |
| 9295 | } |
| 9296 | |
| 9297 | |
| 9298 | static int |
| 9299 | test_xmlRemoveProp(void) { |
| 9300 | int ret = 0; |
| 9301 | |
| 9302 | |
| 9303 | /* missing type support */ |
| 9304 | return(ret); |
| 9305 | } |
| 9306 | |
| 9307 | |
| 9308 | static int |
| 9309 | test_xmlReplaceNode(void) { |
| 9310 | int ret = 0; |
| 9311 | |
| 9312 | #ifdef LIBXML_TREE_ENABLED |
| 9313 | int mem_base; |
| 9314 | xmlNodePtr ret_val; |
| 9315 | xmlNodePtr old; /* the old node */ |
| 9316 | int n_old; |
| 9317 | xmlNodePtr cur; /* the node */ |
| 9318 | int n_cur; |
| 9319 | |
| 9320 | for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9321 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9322 | mem_base = xmlMemBlocks(); |
| 9323 | old = gen_xmlNodePtr(n_old); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9324 | cur = gen_xmlNodePtr_in(n_cur); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9325 | |
| 9326 | ret_val = xmlReplaceNode(old, cur); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9327 | if ((old == NULL) || (old->parent == NULL)) { |
| 9328 | xmlFreeNode(cur) ; cur = NULL ; } |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 9329 | desret_xmlNodePtr(ret_val); |
| 9330 | call_tests++; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9331 | des_xmlNodePtr(n_old, old); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9332 | des_xmlNodePtr_in(n_cur, cur); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9333 | xmlResetLastError(); |
| 9334 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9335 | printf("Leak of %d blocks found in xmlReplaceNode", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9336 | xmlMemBlocks() - mem_base); |
| 9337 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9338 | printf(" %d", n_old); |
| 9339 | printf(" %d", n_cur); |
| 9340 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9341 | } |
| 9342 | } |
| 9343 | } |
| 9344 | #endif |
| 9345 | |
| 9346 | return(ret); |
| 9347 | } |
| 9348 | |
| 9349 | |
| 9350 | static int |
| 9351 | test_xmlSaveFile(void) { |
| 9352 | int ret = 0; |
| 9353 | |
| 9354 | #ifdef LIBXML_OUTPUT_ENABLED |
| 9355 | int mem_base; |
| 9356 | int ret_val; |
| 9357 | const char * filename; /* the filename (or URL) */ |
| 9358 | int n_filename; |
| 9359 | xmlDocPtr cur; /* the document */ |
| 9360 | int n_cur; |
| 9361 | |
| 9362 | for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { |
| 9363 | for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { |
| 9364 | mem_base = xmlMemBlocks(); |
| 9365 | filename = gen_fileoutput(n_filename); |
| 9366 | cur = gen_xmlDocPtr(n_cur); |
| 9367 | |
| 9368 | ret_val = xmlSaveFile(filename, cur); |
| 9369 | desret_int(ret_val); |
| 9370 | call_tests++; |
| 9371 | des_fileoutput(n_filename, filename); |
| 9372 | des_xmlDocPtr(n_cur, cur); |
| 9373 | xmlResetLastError(); |
| 9374 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9375 | printf("Leak of %d blocks found in xmlSaveFile", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9376 | xmlMemBlocks() - mem_base); |
| 9377 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9378 | printf(" %d", n_filename); |
| 9379 | printf(" %d", n_cur); |
| 9380 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9381 | } |
| 9382 | } |
| 9383 | } |
| 9384 | #endif |
| 9385 | |
| 9386 | return(ret); |
| 9387 | } |
| 9388 | |
| 9389 | |
| 9390 | static int |
| 9391 | test_xmlSaveFileEnc(void) { |
| 9392 | int ret = 0; |
| 9393 | |
| 9394 | #ifdef LIBXML_OUTPUT_ENABLED |
| 9395 | int mem_base; |
| 9396 | int ret_val; |
| 9397 | const char * filename; /* the filename (or URL) */ |
| 9398 | int n_filename; |
| 9399 | xmlDocPtr cur; /* the document */ |
| 9400 | int n_cur; |
| 9401 | const char * encoding; /* the name of an encoding (or NULL) */ |
| 9402 | int n_encoding; |
| 9403 | |
| 9404 | for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { |
| 9405 | for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { |
| 9406 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 9407 | mem_base = xmlMemBlocks(); |
| 9408 | filename = gen_fileoutput(n_filename); |
| 9409 | cur = gen_xmlDocPtr(n_cur); |
| 9410 | encoding = gen_const_char_ptr(n_encoding); |
| 9411 | |
| 9412 | ret_val = xmlSaveFileEnc(filename, cur, encoding); |
| 9413 | desret_int(ret_val); |
| 9414 | call_tests++; |
| 9415 | des_fileoutput(n_filename, filename); |
| 9416 | des_xmlDocPtr(n_cur, cur); |
| 9417 | des_const_char_ptr(n_encoding, encoding); |
| 9418 | xmlResetLastError(); |
| 9419 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9420 | printf("Leak of %d blocks found in xmlSaveFileEnc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9421 | xmlMemBlocks() - mem_base); |
| 9422 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9423 | printf(" %d", n_filename); |
| 9424 | printf(" %d", n_cur); |
| 9425 | printf(" %d", n_encoding); |
| 9426 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9427 | } |
| 9428 | } |
| 9429 | } |
| 9430 | } |
| 9431 | #endif |
| 9432 | |
| 9433 | return(ret); |
| 9434 | } |
| 9435 | |
| 9436 | |
| 9437 | static int |
| 9438 | test_xmlSaveFileTo(void) { |
| 9439 | int ret = 0; |
| 9440 | |
| 9441 | |
| 9442 | /* missing type support */ |
| 9443 | return(ret); |
| 9444 | } |
| 9445 | |
| 9446 | |
| 9447 | static int |
| 9448 | test_xmlSaveFormatFile(void) { |
| 9449 | int ret = 0; |
| 9450 | |
| 9451 | #ifdef LIBXML_OUTPUT_ENABLED |
| 9452 | int mem_base; |
| 9453 | int ret_val; |
| 9454 | const char * filename; /* the filename (or URL) */ |
| 9455 | int n_filename; |
| 9456 | xmlDocPtr cur; /* the document */ |
| 9457 | int n_cur; |
| 9458 | int format; /* should formatting spaces been added */ |
| 9459 | int n_format; |
| 9460 | |
| 9461 | for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { |
| 9462 | for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { |
| 9463 | for (n_format = 0;n_format < gen_nb_int;n_format++) { |
| 9464 | mem_base = xmlMemBlocks(); |
| 9465 | filename = gen_fileoutput(n_filename); |
| 9466 | cur = gen_xmlDocPtr(n_cur); |
| 9467 | format = gen_int(n_format); |
| 9468 | |
| 9469 | ret_val = xmlSaveFormatFile(filename, cur, format); |
| 9470 | desret_int(ret_val); |
| 9471 | call_tests++; |
| 9472 | des_fileoutput(n_filename, filename); |
| 9473 | des_xmlDocPtr(n_cur, cur); |
| 9474 | des_int(n_format, format); |
| 9475 | xmlResetLastError(); |
| 9476 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9477 | printf("Leak of %d blocks found in xmlSaveFormatFile", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9478 | xmlMemBlocks() - mem_base); |
| 9479 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9480 | printf(" %d", n_filename); |
| 9481 | printf(" %d", n_cur); |
| 9482 | printf(" %d", n_format); |
| 9483 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9484 | } |
| 9485 | } |
| 9486 | } |
| 9487 | } |
| 9488 | #endif |
| 9489 | |
| 9490 | return(ret); |
| 9491 | } |
| 9492 | |
| 9493 | |
| 9494 | static int |
| 9495 | test_xmlSaveFormatFileEnc(void) { |
| 9496 | int ret = 0; |
| 9497 | |
| 9498 | #ifdef LIBXML_OUTPUT_ENABLED |
| 9499 | int mem_base; |
| 9500 | int ret_val; |
| 9501 | const char * filename; /* the filename or URL to output */ |
| 9502 | int n_filename; |
| 9503 | xmlDocPtr cur; /* the document being saved */ |
| 9504 | int n_cur; |
| 9505 | const char * encoding; /* the name of the encoding to use or NULL. */ |
| 9506 | int n_encoding; |
| 9507 | int format; /* should formatting spaces be added. */ |
| 9508 | int n_format; |
| 9509 | |
| 9510 | for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { |
| 9511 | for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { |
| 9512 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 9513 | for (n_format = 0;n_format < gen_nb_int;n_format++) { |
| 9514 | mem_base = xmlMemBlocks(); |
| 9515 | filename = gen_fileoutput(n_filename); |
| 9516 | cur = gen_xmlDocPtr(n_cur); |
| 9517 | encoding = gen_const_char_ptr(n_encoding); |
| 9518 | format = gen_int(n_format); |
| 9519 | |
| 9520 | ret_val = xmlSaveFormatFileEnc(filename, cur, encoding, format); |
| 9521 | desret_int(ret_val); |
| 9522 | call_tests++; |
| 9523 | des_fileoutput(n_filename, filename); |
| 9524 | des_xmlDocPtr(n_cur, cur); |
| 9525 | des_const_char_ptr(n_encoding, encoding); |
| 9526 | des_int(n_format, format); |
| 9527 | xmlResetLastError(); |
| 9528 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9529 | printf("Leak of %d blocks found in xmlSaveFormatFileEnc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9530 | xmlMemBlocks() - mem_base); |
| 9531 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9532 | printf(" %d", n_filename); |
| 9533 | printf(" %d", n_cur); |
| 9534 | printf(" %d", n_encoding); |
| 9535 | printf(" %d", n_format); |
| 9536 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9537 | } |
| 9538 | } |
| 9539 | } |
| 9540 | } |
| 9541 | } |
| 9542 | #endif |
| 9543 | |
| 9544 | return(ret); |
| 9545 | } |
| 9546 | |
| 9547 | |
| 9548 | static int |
| 9549 | test_xmlSaveFormatFileTo(void) { |
| 9550 | int ret = 0; |
| 9551 | |
| 9552 | |
| 9553 | /* missing type support */ |
| 9554 | return(ret); |
| 9555 | } |
| 9556 | |
| 9557 | |
| 9558 | static int |
| 9559 | test_xmlSearchNs(void) { |
| 9560 | int ret = 0; |
| 9561 | |
| 9562 | |
| 9563 | /* missing type support */ |
| 9564 | return(ret); |
| 9565 | } |
| 9566 | |
| 9567 | |
| 9568 | static int |
| 9569 | test_xmlSearchNsByHref(void) { |
| 9570 | int ret = 0; |
| 9571 | |
| 9572 | |
| 9573 | /* missing type support */ |
| 9574 | return(ret); |
| 9575 | } |
| 9576 | |
| 9577 | |
| 9578 | static int |
| 9579 | test_xmlSetBufferAllocationScheme(void) { |
| 9580 | int ret = 0; |
| 9581 | |
| 9582 | |
| 9583 | /* missing type support */ |
| 9584 | return(ret); |
| 9585 | } |
| 9586 | |
| 9587 | |
| 9588 | static int |
| 9589 | test_xmlSetCompressMode(void) { |
| 9590 | int ret = 0; |
| 9591 | |
| 9592 | int mem_base; |
| 9593 | int mode; /* the compression ratio */ |
| 9594 | int n_mode; |
| 9595 | |
| 9596 | for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { |
| 9597 | mem_base = xmlMemBlocks(); |
| 9598 | mode = gen_int(n_mode); |
| 9599 | |
| 9600 | xmlSetCompressMode(mode); |
| 9601 | call_tests++; |
| 9602 | des_int(n_mode, mode); |
| 9603 | xmlResetLastError(); |
| 9604 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9605 | printf("Leak of %d blocks found in xmlSetCompressMode", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9606 | xmlMemBlocks() - mem_base); |
| 9607 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9608 | printf(" %d", n_mode); |
| 9609 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9610 | } |
| 9611 | } |
| 9612 | |
| 9613 | return(ret); |
| 9614 | } |
| 9615 | |
| 9616 | |
| 9617 | static int |
| 9618 | test_xmlSetDocCompressMode(void) { |
| 9619 | int ret = 0; |
| 9620 | |
| 9621 | int mem_base; |
| 9622 | xmlDocPtr doc; /* the document */ |
| 9623 | int n_doc; |
| 9624 | int mode; /* the compression ratio */ |
| 9625 | int n_mode; |
| 9626 | |
| 9627 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 9628 | for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { |
| 9629 | mem_base = xmlMemBlocks(); |
| 9630 | doc = gen_xmlDocPtr(n_doc); |
| 9631 | mode = gen_int(n_mode); |
| 9632 | |
| 9633 | xmlSetDocCompressMode(doc, mode); |
| 9634 | call_tests++; |
| 9635 | des_xmlDocPtr(n_doc, doc); |
| 9636 | des_int(n_mode, mode); |
| 9637 | xmlResetLastError(); |
| 9638 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9639 | printf("Leak of %d blocks found in xmlSetDocCompressMode", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9640 | xmlMemBlocks() - mem_base); |
| 9641 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9642 | printf(" %d", n_doc); |
| 9643 | printf(" %d", n_mode); |
| 9644 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9645 | } |
| 9646 | } |
| 9647 | } |
| 9648 | |
| 9649 | return(ret); |
| 9650 | } |
| 9651 | |
| 9652 | |
| 9653 | static int |
| 9654 | test_xmlSetListDoc(void) { |
| 9655 | int ret = 0; |
| 9656 | |
| 9657 | int mem_base; |
| 9658 | xmlNodePtr list; /* the first element */ |
| 9659 | int n_list; |
| 9660 | xmlDocPtr doc; /* the document */ |
| 9661 | int n_doc; |
| 9662 | |
| 9663 | for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) { |
| 9664 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 9665 | mem_base = xmlMemBlocks(); |
| 9666 | list = gen_xmlNodePtr(n_list); |
| 9667 | doc = gen_xmlDocPtr(n_doc); |
| 9668 | |
| 9669 | xmlSetListDoc(list, doc); |
| 9670 | call_tests++; |
| 9671 | des_xmlNodePtr(n_list, list); |
| 9672 | des_xmlDocPtr(n_doc, doc); |
| 9673 | xmlResetLastError(); |
| 9674 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9675 | printf("Leak of %d blocks found in xmlSetListDoc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9676 | xmlMemBlocks() - mem_base); |
| 9677 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9678 | printf(" %d", n_list); |
| 9679 | printf(" %d", n_doc); |
| 9680 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9681 | } |
| 9682 | } |
| 9683 | } |
| 9684 | |
| 9685 | return(ret); |
| 9686 | } |
| 9687 | |
| 9688 | |
| 9689 | static int |
| 9690 | test_xmlSetNs(void) { |
| 9691 | int ret = 0; |
| 9692 | |
| 9693 | |
| 9694 | /* missing type support */ |
| 9695 | return(ret); |
| 9696 | } |
| 9697 | |
| 9698 | |
| 9699 | static int |
| 9700 | test_xmlSetNsProp(void) { |
| 9701 | int ret = 0; |
| 9702 | |
| 9703 | |
| 9704 | /* missing type support */ |
| 9705 | return(ret); |
| 9706 | } |
| 9707 | |
| 9708 | |
| 9709 | static int |
| 9710 | test_xmlSetProp(void) { |
| 9711 | int ret = 0; |
| 9712 | |
| 9713 | |
| 9714 | /* missing type support */ |
| 9715 | return(ret); |
| 9716 | } |
| 9717 | |
| 9718 | |
| 9719 | static int |
| 9720 | test_xmlSetTreeDoc(void) { |
| 9721 | int ret = 0; |
| 9722 | |
| 9723 | int mem_base; |
| 9724 | xmlNodePtr tree; /* the top element */ |
| 9725 | int n_tree; |
| 9726 | xmlDocPtr doc; /* the document */ |
| 9727 | int n_doc; |
| 9728 | |
| 9729 | for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { |
| 9730 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 9731 | mem_base = xmlMemBlocks(); |
| 9732 | tree = gen_xmlNodePtr(n_tree); |
| 9733 | doc = gen_xmlDocPtr(n_doc); |
| 9734 | |
| 9735 | xmlSetTreeDoc(tree, doc); |
| 9736 | call_tests++; |
| 9737 | des_xmlNodePtr(n_tree, tree); |
| 9738 | des_xmlDocPtr(n_doc, doc); |
| 9739 | xmlResetLastError(); |
| 9740 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9741 | printf("Leak of %d blocks found in xmlSetTreeDoc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9742 | xmlMemBlocks() - mem_base); |
| 9743 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9744 | printf(" %d", n_tree); |
| 9745 | printf(" %d", n_doc); |
| 9746 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9747 | } |
| 9748 | } |
| 9749 | } |
| 9750 | |
| 9751 | return(ret); |
| 9752 | } |
| 9753 | |
| 9754 | |
| 9755 | static int |
| 9756 | test_xmlSplitQName2(void) { |
| 9757 | int ret = 0; |
| 9758 | |
| 9759 | |
| 9760 | /* missing type support */ |
| 9761 | return(ret); |
| 9762 | } |
| 9763 | |
| 9764 | |
| 9765 | static int |
| 9766 | test_xmlSplitQName3(void) { |
| 9767 | int ret = 0; |
| 9768 | |
| 9769 | |
| 9770 | /* missing type support */ |
| 9771 | return(ret); |
| 9772 | } |
| 9773 | |
| 9774 | |
| 9775 | static int |
| 9776 | test_xmlStringGetNodeList(void) { |
| 9777 | int ret = 0; |
| 9778 | |
| 9779 | int mem_base; |
| 9780 | xmlNodePtr ret_val; |
| 9781 | xmlDocPtr doc; /* the document */ |
| 9782 | int n_doc; |
| 9783 | const xmlChar * value; /* the value of the attribute */ |
| 9784 | int n_value; |
| 9785 | |
| 9786 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 9787 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 9788 | mem_base = xmlMemBlocks(); |
| 9789 | doc = gen_xmlDocPtr(n_doc); |
| 9790 | value = gen_const_xmlChar_ptr(n_value); |
| 9791 | |
| 9792 | ret_val = xmlStringGetNodeList(doc, value); |
| 9793 | desret_xmlNodePtr(ret_val); |
| 9794 | call_tests++; |
| 9795 | des_xmlDocPtr(n_doc, doc); |
| 9796 | des_const_xmlChar_ptr(n_value, value); |
| 9797 | xmlResetLastError(); |
| 9798 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9799 | printf("Leak of %d blocks found in xmlStringGetNodeList", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9800 | xmlMemBlocks() - mem_base); |
| 9801 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9802 | printf(" %d", n_doc); |
| 9803 | printf(" %d", n_value); |
| 9804 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9805 | } |
| 9806 | } |
| 9807 | } |
| 9808 | |
| 9809 | return(ret); |
| 9810 | } |
| 9811 | |
| 9812 | |
| 9813 | static int |
| 9814 | test_xmlStringLenGetNodeList(void) { |
| 9815 | int ret = 0; |
| 9816 | |
| 9817 | int mem_base; |
| 9818 | xmlNodePtr ret_val; |
| 9819 | xmlDocPtr doc; /* the document */ |
| 9820 | int n_doc; |
| 9821 | const xmlChar * value; /* the value of the text */ |
| 9822 | int n_value; |
| 9823 | int len; /* the length of the string value */ |
| 9824 | int n_len; |
| 9825 | |
| 9826 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 9827 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 9828 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 9829 | mem_base = xmlMemBlocks(); |
| 9830 | doc = gen_xmlDocPtr(n_doc); |
| 9831 | value = gen_const_xmlChar_ptr(n_value); |
| 9832 | len = gen_int(n_len); |
| 9833 | |
| 9834 | ret_val = xmlStringLenGetNodeList(doc, value, len); |
| 9835 | desret_xmlNodePtr(ret_val); |
| 9836 | call_tests++; |
| 9837 | des_xmlDocPtr(n_doc, doc); |
| 9838 | des_const_xmlChar_ptr(n_value, value); |
| 9839 | des_int(n_len, len); |
| 9840 | xmlResetLastError(); |
| 9841 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9842 | printf("Leak of %d blocks found in xmlStringLenGetNodeList", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9843 | xmlMemBlocks() - mem_base); |
| 9844 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9845 | printf(" %d", n_doc); |
| 9846 | printf(" %d", n_value); |
| 9847 | printf(" %d", n_len); |
| 9848 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9849 | } |
| 9850 | } |
| 9851 | } |
| 9852 | } |
| 9853 | |
| 9854 | return(ret); |
| 9855 | } |
| 9856 | |
| 9857 | |
| 9858 | static int |
| 9859 | test_xmlTextConcat(void) { |
| 9860 | int ret = 0; |
| 9861 | |
| 9862 | int mem_base; |
| 9863 | int ret_val; |
| 9864 | xmlNodePtr node; /* the node */ |
| 9865 | int n_node; |
| 9866 | const xmlChar * content; /* the content */ |
| 9867 | int n_content; |
| 9868 | int len; /* @content length */ |
| 9869 | int n_len; |
| 9870 | |
| 9871 | for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { |
| 9872 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 9873 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 9874 | mem_base = xmlMemBlocks(); |
| 9875 | node = gen_xmlNodePtr(n_node); |
| 9876 | content = gen_const_xmlChar_ptr(n_content); |
| 9877 | len = gen_int(n_len); |
| 9878 | |
| 9879 | ret_val = xmlTextConcat(node, content, len); |
| 9880 | desret_int(ret_val); |
| 9881 | call_tests++; |
| 9882 | des_xmlNodePtr(n_node, node); |
| 9883 | des_const_xmlChar_ptr(n_content, content); |
| 9884 | des_int(n_len, len); |
| 9885 | xmlResetLastError(); |
| 9886 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9887 | printf("Leak of %d blocks found in xmlTextConcat", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9888 | xmlMemBlocks() - mem_base); |
| 9889 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9890 | printf(" %d", n_node); |
| 9891 | printf(" %d", n_content); |
| 9892 | printf(" %d", n_len); |
| 9893 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9894 | } |
| 9895 | } |
| 9896 | } |
| 9897 | } |
| 9898 | |
| 9899 | return(ret); |
| 9900 | } |
| 9901 | |
| 9902 | |
| 9903 | static int |
| 9904 | test_xmlTextMerge(void) { |
| 9905 | int ret = 0; |
| 9906 | |
| 9907 | int mem_base; |
| 9908 | xmlNodePtr ret_val; |
| 9909 | xmlNodePtr first; /* the first text node */ |
| 9910 | int n_first; |
| 9911 | xmlNodePtr second; /* the second text node being merged */ |
| 9912 | int n_second; |
| 9913 | |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9914 | for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) { |
| 9915 | for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) { |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9916 | mem_base = xmlMemBlocks(); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9917 | first = gen_xmlNodePtr_in(n_first); |
| 9918 | second = gen_xmlNodePtr_in(n_second); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9919 | |
| 9920 | ret_val = xmlTextMerge(first, second); |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9921 | if ((first != NULL) && (first->type != XML_TEXT_NODE)) { |
| 9922 | xmlFreeNode(second) ; second = NULL ; } |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 9923 | desret_xmlNodePtr(ret_val); |
| 9924 | call_tests++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9925 | des_xmlNodePtr_in(n_first, first); |
| 9926 | des_xmlNodePtr_in(n_second, second); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9927 | xmlResetLastError(); |
| 9928 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9929 | printf("Leak of %d blocks found in xmlTextMerge", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9930 | xmlMemBlocks() - mem_base); |
| 9931 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9932 | printf(" %d", n_first); |
| 9933 | printf(" %d", n_second); |
| 9934 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9935 | } |
| 9936 | } |
| 9937 | } |
| 9938 | |
| 9939 | return(ret); |
| 9940 | } |
| 9941 | |
| 9942 | |
| 9943 | static int |
| 9944 | test_xmlUnlinkNode(void) { |
| 9945 | int ret = 0; |
| 9946 | |
| 9947 | int mem_base; |
| 9948 | xmlNodePtr cur; /* the node */ |
| 9949 | int n_cur; |
| 9950 | |
| 9951 | for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { |
| 9952 | mem_base = xmlMemBlocks(); |
| 9953 | cur = gen_xmlNodePtr(n_cur); |
| 9954 | |
| 9955 | xmlUnlinkNode(cur); |
| 9956 | call_tests++; |
| 9957 | des_xmlNodePtr(n_cur, cur); |
| 9958 | xmlResetLastError(); |
| 9959 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9960 | printf("Leak of %d blocks found in xmlUnlinkNode", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9961 | xmlMemBlocks() - mem_base); |
| 9962 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 9963 | printf(" %d", n_cur); |
| 9964 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 9965 | } |
| 9966 | } |
| 9967 | |
| 9968 | return(ret); |
| 9969 | } |
| 9970 | |
| 9971 | |
| 9972 | static int |
| 9973 | test_xmlUnsetNsProp(void) { |
| 9974 | int ret = 0; |
| 9975 | |
| 9976 | |
| 9977 | /* missing type support */ |
| 9978 | return(ret); |
| 9979 | } |
| 9980 | |
| 9981 | |
| 9982 | static int |
| 9983 | test_xmlUnsetProp(void) { |
| 9984 | int ret = 0; |
| 9985 | |
| 9986 | #ifdef LIBXML_TREE_ENABLED |
| 9987 | int mem_base; |
| 9988 | int ret_val; |
| 9989 | xmlNodePtr node; /* the node */ |
| 9990 | int n_node; |
| 9991 | const xmlChar * name; /* the attribute name */ |
| 9992 | int n_name; |
| 9993 | |
| 9994 | for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { |
| 9995 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 9996 | mem_base = xmlMemBlocks(); |
| 9997 | node = gen_xmlNodePtr(n_node); |
| 9998 | name = gen_const_xmlChar_ptr(n_name); |
| 9999 | |
| 10000 | ret_val = xmlUnsetProp(node, name); |
| 10001 | desret_int(ret_val); |
| 10002 | call_tests++; |
| 10003 | des_xmlNodePtr(n_node, node); |
| 10004 | des_const_xmlChar_ptr(n_name, name); |
| 10005 | xmlResetLastError(); |
| 10006 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10007 | printf("Leak of %d blocks found in xmlUnsetProp", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10008 | xmlMemBlocks() - mem_base); |
| 10009 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10010 | printf(" %d", n_node); |
| 10011 | printf(" %d", n_name); |
| 10012 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10013 | } |
| 10014 | } |
| 10015 | } |
| 10016 | #endif |
| 10017 | |
| 10018 | return(ret); |
| 10019 | } |
| 10020 | |
| 10021 | |
| 10022 | static int |
| 10023 | test_xmlValidateNCName(void) { |
| 10024 | int ret = 0; |
| 10025 | |
| 10026 | int mem_base; |
| 10027 | int ret_val; |
| 10028 | const xmlChar * value; /* the value to check */ |
| 10029 | int n_value; |
| 10030 | int space; /* allow spaces in front and end of the string */ |
| 10031 | int n_space; |
| 10032 | |
| 10033 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 10034 | for (n_space = 0;n_space < gen_nb_int;n_space++) { |
| 10035 | mem_base = xmlMemBlocks(); |
| 10036 | value = gen_const_xmlChar_ptr(n_value); |
| 10037 | space = gen_int(n_space); |
| 10038 | |
| 10039 | ret_val = xmlValidateNCName(value, space); |
| 10040 | desret_int(ret_val); |
| 10041 | call_tests++; |
| 10042 | des_const_xmlChar_ptr(n_value, value); |
| 10043 | des_int(n_space, space); |
| 10044 | xmlResetLastError(); |
| 10045 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10046 | printf("Leak of %d blocks found in xmlValidateNCName", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10047 | xmlMemBlocks() - mem_base); |
| 10048 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10049 | printf(" %d", n_value); |
| 10050 | printf(" %d", n_space); |
| 10051 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10052 | } |
| 10053 | } |
| 10054 | } |
| 10055 | |
| 10056 | return(ret); |
| 10057 | } |
| 10058 | |
| 10059 | |
| 10060 | static int |
| 10061 | test_xmlValidateNMToken(void) { |
| 10062 | int ret = 0; |
| 10063 | |
| 10064 | int mem_base; |
| 10065 | int ret_val; |
| 10066 | const xmlChar * value; /* the value to check */ |
| 10067 | int n_value; |
| 10068 | int space; /* allow spaces in front and end of the string */ |
| 10069 | int n_space; |
| 10070 | |
| 10071 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 10072 | for (n_space = 0;n_space < gen_nb_int;n_space++) { |
| 10073 | mem_base = xmlMemBlocks(); |
| 10074 | value = gen_const_xmlChar_ptr(n_value); |
| 10075 | space = gen_int(n_space); |
| 10076 | |
| 10077 | ret_val = xmlValidateNMToken(value, space); |
| 10078 | desret_int(ret_val); |
| 10079 | call_tests++; |
| 10080 | des_const_xmlChar_ptr(n_value, value); |
| 10081 | des_int(n_space, space); |
| 10082 | xmlResetLastError(); |
| 10083 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10084 | printf("Leak of %d blocks found in xmlValidateNMToken", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10085 | xmlMemBlocks() - mem_base); |
| 10086 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10087 | printf(" %d", n_value); |
| 10088 | printf(" %d", n_space); |
| 10089 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10090 | } |
| 10091 | } |
| 10092 | } |
| 10093 | |
| 10094 | return(ret); |
| 10095 | } |
| 10096 | |
| 10097 | |
| 10098 | static int |
| 10099 | test_xmlValidateName(void) { |
| 10100 | int ret = 0; |
| 10101 | |
| 10102 | int mem_base; |
| 10103 | int ret_val; |
| 10104 | const xmlChar * value; /* the value to check */ |
| 10105 | int n_value; |
| 10106 | int space; /* allow spaces in front and end of the string */ |
| 10107 | int n_space; |
| 10108 | |
| 10109 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 10110 | for (n_space = 0;n_space < gen_nb_int;n_space++) { |
| 10111 | mem_base = xmlMemBlocks(); |
| 10112 | value = gen_const_xmlChar_ptr(n_value); |
| 10113 | space = gen_int(n_space); |
| 10114 | |
| 10115 | ret_val = xmlValidateName(value, space); |
| 10116 | desret_int(ret_val); |
| 10117 | call_tests++; |
| 10118 | des_const_xmlChar_ptr(n_value, value); |
| 10119 | des_int(n_space, space); |
| 10120 | xmlResetLastError(); |
| 10121 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10122 | printf("Leak of %d blocks found in xmlValidateName", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10123 | xmlMemBlocks() - mem_base); |
| 10124 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10125 | printf(" %d", n_value); |
| 10126 | printf(" %d", n_space); |
| 10127 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10128 | } |
| 10129 | } |
| 10130 | } |
| 10131 | |
| 10132 | return(ret); |
| 10133 | } |
| 10134 | |
| 10135 | |
| 10136 | static int |
| 10137 | test_xmlValidateQName(void) { |
| 10138 | int ret = 0; |
| 10139 | |
| 10140 | int mem_base; |
| 10141 | int ret_val; |
| 10142 | const xmlChar * value; /* the value to check */ |
| 10143 | int n_value; |
| 10144 | int space; /* allow spaces in front and end of the string */ |
| 10145 | int n_space; |
| 10146 | |
| 10147 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 10148 | for (n_space = 0;n_space < gen_nb_int;n_space++) { |
| 10149 | mem_base = xmlMemBlocks(); |
| 10150 | value = gen_const_xmlChar_ptr(n_value); |
| 10151 | space = gen_int(n_space); |
| 10152 | |
| 10153 | ret_val = xmlValidateQName(value, space); |
| 10154 | desret_int(ret_val); |
| 10155 | call_tests++; |
| 10156 | des_const_xmlChar_ptr(n_value, value); |
| 10157 | des_int(n_space, space); |
| 10158 | xmlResetLastError(); |
| 10159 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10160 | printf("Leak of %d blocks found in xmlValidateQName", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10161 | xmlMemBlocks() - mem_base); |
| 10162 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10163 | printf(" %d", n_value); |
| 10164 | printf(" %d", n_space); |
| 10165 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10166 | } |
| 10167 | } |
| 10168 | } |
| 10169 | |
| 10170 | return(ret); |
| 10171 | } |
| 10172 | |
| 10173 | static int |
| 10174 | test_tree(void) { |
| 10175 | int ret = 0; |
| 10176 | |
| 10177 | printf("Testing tree ...\n"); |
| 10178 | ret += test_xmlAddChild(); |
| 10179 | ret += test_xmlAddChildList(); |
| 10180 | ret += test_xmlAddNextSibling(); |
| 10181 | ret += test_xmlAddPrevSibling(); |
| 10182 | ret += test_xmlAddSibling(); |
| 10183 | ret += test_xmlAttrSerializeTxtContent(); |
| 10184 | ret += test_xmlBufferAdd(); |
| 10185 | ret += test_xmlBufferAddHead(); |
| 10186 | ret += test_xmlBufferCCat(); |
| 10187 | ret += test_xmlBufferCat(); |
| 10188 | ret += test_xmlBufferContent(); |
| 10189 | ret += test_xmlBufferCreate(); |
| 10190 | ret += test_xmlBufferCreateSize(); |
| 10191 | ret += test_xmlBufferCreateStatic(); |
| 10192 | ret += test_xmlBufferDump(); |
| 10193 | ret += test_xmlBufferEmpty(); |
| 10194 | ret += test_xmlBufferGrow(); |
| 10195 | ret += test_xmlBufferLength(); |
| 10196 | ret += test_xmlBufferResize(); |
| 10197 | ret += test_xmlBufferSetAllocationScheme(); |
| 10198 | ret += test_xmlBufferShrink(); |
| 10199 | ret += test_xmlBufferWriteCHAR(); |
| 10200 | ret += test_xmlBufferWriteChar(); |
| 10201 | ret += test_xmlBufferWriteQuotedString(); |
| 10202 | ret += test_xmlBuildQName(); |
| 10203 | ret += test_xmlCopyDoc(); |
| 10204 | ret += test_xmlCopyDtd(); |
| 10205 | ret += test_xmlCopyNamespace(); |
| 10206 | ret += test_xmlCopyNamespaceList(); |
| 10207 | ret += test_xmlCopyNode(); |
| 10208 | ret += test_xmlCopyNodeList(); |
| 10209 | ret += test_xmlCopyProp(); |
| 10210 | ret += test_xmlCopyPropList(); |
| 10211 | ret += test_xmlCreateIntSubset(); |
| 10212 | ret += test_xmlDocCopyNode(); |
| 10213 | ret += test_xmlDocCopyNodeList(); |
| 10214 | ret += test_xmlDocDump(); |
| 10215 | ret += test_xmlDocDumpFormatMemory(); |
| 10216 | ret += test_xmlDocDumpFormatMemoryEnc(); |
| 10217 | ret += test_xmlDocDumpMemory(); |
| 10218 | ret += test_xmlDocDumpMemoryEnc(); |
| 10219 | ret += test_xmlDocFormatDump(); |
| 10220 | ret += test_xmlDocGetRootElement(); |
| 10221 | ret += test_xmlDocSetRootElement(); |
| 10222 | ret += test_xmlElemDump(); |
| 10223 | ret += test_xmlGetBufferAllocationScheme(); |
| 10224 | ret += test_xmlGetCompressMode(); |
| 10225 | ret += test_xmlGetDocCompressMode(); |
| 10226 | ret += test_xmlGetIntSubset(); |
| 10227 | ret += test_xmlGetLastChild(); |
| 10228 | ret += test_xmlGetLineNo(); |
| 10229 | ret += test_xmlGetNoNsProp(); |
| 10230 | ret += test_xmlGetNodePath(); |
| 10231 | ret += test_xmlGetNsList(); |
| 10232 | ret += test_xmlGetNsProp(); |
| 10233 | ret += test_xmlGetProp(); |
| 10234 | ret += test_xmlHasNsProp(); |
| 10235 | ret += test_xmlHasProp(); |
| 10236 | ret += test_xmlIsBlankNode(); |
| 10237 | ret += test_xmlIsXHTML(); |
| 10238 | ret += test_xmlNewCDataBlock(); |
| 10239 | ret += test_xmlNewCharRef(); |
| 10240 | ret += test_xmlNewChild(); |
| 10241 | ret += test_xmlNewComment(); |
| 10242 | ret += test_xmlNewDoc(); |
| 10243 | ret += test_xmlNewDocComment(); |
| 10244 | ret += test_xmlNewDocFragment(); |
| 10245 | ret += test_xmlNewDocNode(); |
| 10246 | ret += test_xmlNewDocNodeEatName(); |
| 10247 | ret += test_xmlNewDocPI(); |
| 10248 | ret += test_xmlNewDocProp(); |
| 10249 | ret += test_xmlNewDocRawNode(); |
| 10250 | ret += test_xmlNewDocText(); |
| 10251 | ret += test_xmlNewDocTextLen(); |
| 10252 | ret += test_xmlNewDtd(); |
| 10253 | ret += test_xmlNewGlobalNs(); |
| 10254 | ret += test_xmlNewNode(); |
| 10255 | ret += test_xmlNewNodeEatName(); |
| 10256 | ret += test_xmlNewNs(); |
| 10257 | ret += test_xmlNewNsProp(); |
| 10258 | ret += test_xmlNewNsPropEatName(); |
| 10259 | ret += test_xmlNewPI(); |
| 10260 | ret += test_xmlNewProp(); |
| 10261 | ret += test_xmlNewReference(); |
| 10262 | ret += test_xmlNewText(); |
| 10263 | ret += test_xmlNewTextChild(); |
| 10264 | ret += test_xmlNewTextLen(); |
| 10265 | ret += test_xmlNodeAddContent(); |
| 10266 | ret += test_xmlNodeAddContentLen(); |
| 10267 | ret += test_xmlNodeBufGetContent(); |
| 10268 | ret += test_xmlNodeDump(); |
| 10269 | ret += test_xmlNodeDumpOutput(); |
| 10270 | ret += test_xmlNodeGetBase(); |
| 10271 | ret += test_xmlNodeGetContent(); |
| 10272 | ret += test_xmlNodeGetLang(); |
| 10273 | ret += test_xmlNodeGetSpacePreserve(); |
| 10274 | ret += test_xmlNodeIsText(); |
| 10275 | ret += test_xmlNodeListGetRawString(); |
| 10276 | ret += test_xmlNodeListGetString(); |
| 10277 | ret += test_xmlNodeSetBase(); |
| 10278 | ret += test_xmlNodeSetContent(); |
| 10279 | ret += test_xmlNodeSetContentLen(); |
| 10280 | ret += test_xmlNodeSetLang(); |
| 10281 | ret += test_xmlNodeSetName(); |
| 10282 | ret += test_xmlNodeSetSpacePreserve(); |
| 10283 | ret += test_xmlReconciliateNs(); |
| 10284 | ret += test_xmlRemoveProp(); |
| 10285 | ret += test_xmlReplaceNode(); |
| 10286 | ret += test_xmlSaveFile(); |
| 10287 | ret += test_xmlSaveFileEnc(); |
| 10288 | ret += test_xmlSaveFileTo(); |
| 10289 | ret += test_xmlSaveFormatFile(); |
| 10290 | ret += test_xmlSaveFormatFileEnc(); |
| 10291 | ret += test_xmlSaveFormatFileTo(); |
| 10292 | ret += test_xmlSearchNs(); |
| 10293 | ret += test_xmlSearchNsByHref(); |
| 10294 | ret += test_xmlSetBufferAllocationScheme(); |
| 10295 | ret += test_xmlSetCompressMode(); |
| 10296 | ret += test_xmlSetDocCompressMode(); |
| 10297 | ret += test_xmlSetListDoc(); |
| 10298 | ret += test_xmlSetNs(); |
| 10299 | ret += test_xmlSetNsProp(); |
| 10300 | ret += test_xmlSetProp(); |
| 10301 | ret += test_xmlSetTreeDoc(); |
| 10302 | ret += test_xmlSplitQName2(); |
| 10303 | ret += test_xmlSplitQName3(); |
| 10304 | ret += test_xmlStringGetNodeList(); |
| 10305 | ret += test_xmlStringLenGetNodeList(); |
| 10306 | ret += test_xmlTextConcat(); |
| 10307 | ret += test_xmlTextMerge(); |
| 10308 | ret += test_xmlUnlinkNode(); |
| 10309 | ret += test_xmlUnsetNsProp(); |
| 10310 | ret += test_xmlUnsetProp(); |
| 10311 | ret += test_xmlValidateNCName(); |
| 10312 | ret += test_xmlValidateNMToken(); |
| 10313 | ret += test_xmlValidateName(); |
| 10314 | ret += test_xmlValidateQName(); |
| 10315 | |
| 10316 | if (ret != 0) |
| 10317 | printf("Module tree: %d errors\n", ret); |
| 10318 | return(ret); |
| 10319 | } |
| 10320 | |
| 10321 | static int |
| 10322 | test_xmlBuildRelativeURI(void) { |
| 10323 | int ret = 0; |
| 10324 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10325 | int mem_base; |
| 10326 | xmlChar * ret_val; |
| 10327 | const xmlChar * URI; /* the URI reference under consideration */ |
| 10328 | int n_URI; |
| 10329 | const xmlChar * base; /* the base value */ |
| 10330 | int n_base; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10331 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10332 | for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { |
| 10333 | for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { |
| 10334 | mem_base = xmlMemBlocks(); |
| 10335 | URI = gen_const_xmlChar_ptr(n_URI); |
| 10336 | base = gen_const_xmlChar_ptr(n_base); |
| 10337 | |
| 10338 | ret_val = xmlBuildRelativeURI(URI, base); |
| 10339 | desret_xmlChar_ptr(ret_val); |
| 10340 | call_tests++; |
| 10341 | des_const_xmlChar_ptr(n_URI, URI); |
| 10342 | des_const_xmlChar_ptr(n_base, base); |
| 10343 | xmlResetLastError(); |
| 10344 | if (mem_base != xmlMemBlocks()) { |
| 10345 | printf("Leak of %d blocks found in xmlBuildRelativeURI", |
| 10346 | xmlMemBlocks() - mem_base); |
| 10347 | ret++; |
| 10348 | printf(" %d", n_URI); |
| 10349 | printf(" %d", n_base); |
| 10350 | printf("\n"); |
| 10351 | } |
| 10352 | } |
| 10353 | } |
| 10354 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10355 | return(ret); |
| 10356 | } |
| 10357 | |
| 10358 | |
| 10359 | static int |
| 10360 | test_xmlBuildURI(void) { |
| 10361 | int ret = 0; |
| 10362 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10363 | int mem_base; |
| 10364 | xmlChar * ret_val; |
| 10365 | const xmlChar * URI; /* the URI instance found in the document */ |
| 10366 | int n_URI; |
| 10367 | const xmlChar * base; /* the base value */ |
| 10368 | int n_base; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10369 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10370 | for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { |
| 10371 | for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { |
| 10372 | mem_base = xmlMemBlocks(); |
| 10373 | URI = gen_const_xmlChar_ptr(n_URI); |
| 10374 | base = gen_const_xmlChar_ptr(n_base); |
| 10375 | |
| 10376 | ret_val = xmlBuildURI(URI, base); |
| 10377 | desret_xmlChar_ptr(ret_val); |
| 10378 | call_tests++; |
| 10379 | des_const_xmlChar_ptr(n_URI, URI); |
| 10380 | des_const_xmlChar_ptr(n_base, base); |
| 10381 | xmlResetLastError(); |
| 10382 | if (mem_base != xmlMemBlocks()) { |
| 10383 | printf("Leak of %d blocks found in xmlBuildURI", |
| 10384 | xmlMemBlocks() - mem_base); |
| 10385 | ret++; |
| 10386 | printf(" %d", n_URI); |
| 10387 | printf(" %d", n_base); |
| 10388 | printf("\n"); |
| 10389 | } |
| 10390 | } |
| 10391 | } |
| 10392 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10393 | return(ret); |
| 10394 | } |
| 10395 | |
| 10396 | |
| 10397 | static int |
| 10398 | test_xmlCanonicPath(void) { |
| 10399 | int ret = 0; |
| 10400 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10401 | int mem_base; |
| 10402 | xmlChar * ret_val; |
| 10403 | const xmlChar * path; /* the resource locator in a filesystem notation */ |
| 10404 | int n_path; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10405 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10406 | for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { |
| 10407 | mem_base = xmlMemBlocks(); |
| 10408 | path = gen_const_xmlChar_ptr(n_path); |
| 10409 | |
| 10410 | ret_val = xmlCanonicPath(path); |
| 10411 | desret_xmlChar_ptr(ret_val); |
| 10412 | call_tests++; |
| 10413 | des_const_xmlChar_ptr(n_path, path); |
| 10414 | xmlResetLastError(); |
| 10415 | if (mem_base != xmlMemBlocks()) { |
| 10416 | printf("Leak of %d blocks found in xmlCanonicPath", |
| 10417 | xmlMemBlocks() - mem_base); |
| 10418 | ret++; |
| 10419 | printf(" %d", n_path); |
| 10420 | printf("\n"); |
| 10421 | } |
| 10422 | } |
| 10423 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10424 | return(ret); |
| 10425 | } |
| 10426 | |
| 10427 | |
| 10428 | static int |
| 10429 | test_xmlCreateURI(void) { |
| 10430 | int ret = 0; |
| 10431 | |
| 10432 | |
| 10433 | /* missing type support */ |
| 10434 | return(ret); |
| 10435 | } |
| 10436 | |
| 10437 | |
| 10438 | static int |
| 10439 | test_xmlNormalizeURIPath(void) { |
| 10440 | int ret = 0; |
| 10441 | |
| 10442 | |
| 10443 | /* missing type support */ |
| 10444 | return(ret); |
| 10445 | } |
| 10446 | |
| 10447 | |
| 10448 | static int |
| 10449 | test_xmlParseURI(void) { |
| 10450 | int ret = 0; |
| 10451 | |
| 10452 | |
| 10453 | /* missing type support */ |
| 10454 | return(ret); |
| 10455 | } |
| 10456 | |
| 10457 | |
| 10458 | static int |
| 10459 | test_xmlParseURIReference(void) { |
| 10460 | int ret = 0; |
| 10461 | |
| 10462 | |
| 10463 | /* missing type support */ |
| 10464 | return(ret); |
| 10465 | } |
| 10466 | |
| 10467 | |
| 10468 | static int |
| 10469 | test_xmlPrintURI(void) { |
| 10470 | int ret = 0; |
| 10471 | |
| 10472 | |
| 10473 | /* missing type support */ |
| 10474 | return(ret); |
| 10475 | } |
| 10476 | |
| 10477 | |
| 10478 | static int |
| 10479 | test_xmlSaveUri(void) { |
| 10480 | int ret = 0; |
| 10481 | |
| 10482 | |
| 10483 | /* missing type support */ |
| 10484 | return(ret); |
| 10485 | } |
| 10486 | |
| 10487 | |
| 10488 | static int |
| 10489 | test_xmlURIEscape(void) { |
| 10490 | int ret = 0; |
| 10491 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10492 | int mem_base; |
| 10493 | xmlChar * ret_val; |
| 10494 | const xmlChar * str; /* the string of the URI to escape */ |
| 10495 | int n_str; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10496 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10497 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 10498 | mem_base = xmlMemBlocks(); |
| 10499 | str = gen_const_xmlChar_ptr(n_str); |
| 10500 | |
| 10501 | ret_val = xmlURIEscape(str); |
| 10502 | desret_xmlChar_ptr(ret_val); |
| 10503 | call_tests++; |
| 10504 | des_const_xmlChar_ptr(n_str, str); |
| 10505 | xmlResetLastError(); |
| 10506 | if (mem_base != xmlMemBlocks()) { |
| 10507 | printf("Leak of %d blocks found in xmlURIEscape", |
| 10508 | xmlMemBlocks() - mem_base); |
| 10509 | ret++; |
| 10510 | printf(" %d", n_str); |
| 10511 | printf("\n"); |
| 10512 | } |
| 10513 | } |
| 10514 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10515 | return(ret); |
| 10516 | } |
| 10517 | |
| 10518 | |
| 10519 | static int |
| 10520 | test_xmlURIEscapeStr(void) { |
| 10521 | int ret = 0; |
| 10522 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10523 | int mem_base; |
| 10524 | xmlChar * ret_val; |
| 10525 | const xmlChar * str; /* string to escape */ |
| 10526 | int n_str; |
| 10527 | const xmlChar * list; /* exception list string of chars not to escape */ |
| 10528 | int n_list; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10529 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 10530 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 10531 | for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) { |
| 10532 | mem_base = xmlMemBlocks(); |
| 10533 | str = gen_const_xmlChar_ptr(n_str); |
| 10534 | list = gen_const_xmlChar_ptr(n_list); |
| 10535 | |
| 10536 | ret_val = xmlURIEscapeStr(str, list); |
| 10537 | desret_xmlChar_ptr(ret_val); |
| 10538 | call_tests++; |
| 10539 | des_const_xmlChar_ptr(n_str, str); |
| 10540 | des_const_xmlChar_ptr(n_list, list); |
| 10541 | xmlResetLastError(); |
| 10542 | if (mem_base != xmlMemBlocks()) { |
| 10543 | printf("Leak of %d blocks found in xmlURIEscapeStr", |
| 10544 | xmlMemBlocks() - mem_base); |
| 10545 | ret++; |
| 10546 | printf(" %d", n_str); |
| 10547 | printf(" %d", n_list); |
| 10548 | printf("\n"); |
| 10549 | } |
| 10550 | } |
| 10551 | } |
| 10552 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10553 | return(ret); |
| 10554 | } |
| 10555 | |
| 10556 | |
| 10557 | static int |
| 10558 | test_xmlURIUnescapeString(void) { |
| 10559 | int ret = 0; |
| 10560 | |
| 10561 | |
| 10562 | /* missing type support */ |
| 10563 | return(ret); |
| 10564 | } |
| 10565 | |
| 10566 | static int |
| 10567 | test_uri(void) { |
| 10568 | int ret = 0; |
| 10569 | |
| 10570 | printf("Testing uri ...\n"); |
| 10571 | ret += test_xmlBuildRelativeURI(); |
| 10572 | ret += test_xmlBuildURI(); |
| 10573 | ret += test_xmlCanonicPath(); |
| 10574 | ret += test_xmlCreateURI(); |
| 10575 | ret += test_xmlNormalizeURIPath(); |
| 10576 | ret += test_xmlParseURI(); |
| 10577 | ret += test_xmlParseURIReference(); |
| 10578 | ret += test_xmlPrintURI(); |
| 10579 | ret += test_xmlSaveUri(); |
| 10580 | ret += test_xmlURIEscape(); |
| 10581 | ret += test_xmlURIEscapeStr(); |
| 10582 | ret += test_xmlURIUnescapeString(); |
| 10583 | |
| 10584 | if (ret != 0) |
| 10585 | printf("Module uri: %d errors\n", ret); |
| 10586 | return(ret); |
| 10587 | } |
| 10588 | |
| 10589 | static int |
| 10590 | test_xmlAddAttributeDecl(void) { |
| 10591 | int ret = 0; |
| 10592 | |
| 10593 | |
| 10594 | /* missing type support */ |
| 10595 | return(ret); |
| 10596 | } |
| 10597 | |
| 10598 | |
| 10599 | static int |
| 10600 | test_xmlAddElementDecl(void) { |
| 10601 | int ret = 0; |
| 10602 | |
| 10603 | |
| 10604 | /* missing type support */ |
| 10605 | return(ret); |
| 10606 | } |
| 10607 | |
| 10608 | |
| 10609 | static int |
| 10610 | test_xmlAddID(void) { |
| 10611 | int ret = 0; |
| 10612 | |
| 10613 | |
| 10614 | /* missing type support */ |
| 10615 | return(ret); |
| 10616 | } |
| 10617 | |
| 10618 | |
| 10619 | static int |
| 10620 | test_xmlAddNotationDecl(void) { |
| 10621 | int ret = 0; |
| 10622 | |
| 10623 | |
| 10624 | /* missing type support */ |
| 10625 | return(ret); |
| 10626 | } |
| 10627 | |
| 10628 | |
| 10629 | static int |
| 10630 | test_xmlAddRef(void) { |
| 10631 | int ret = 0; |
| 10632 | |
| 10633 | |
| 10634 | /* missing type support */ |
| 10635 | return(ret); |
| 10636 | } |
| 10637 | |
| 10638 | |
| 10639 | static int |
| 10640 | test_xmlCopyAttributeTable(void) { |
| 10641 | int ret = 0; |
| 10642 | |
| 10643 | |
| 10644 | /* missing type support */ |
| 10645 | return(ret); |
| 10646 | } |
| 10647 | |
| 10648 | |
| 10649 | static int |
| 10650 | test_xmlCopyElementContent(void) { |
| 10651 | int ret = 0; |
| 10652 | |
| 10653 | |
| 10654 | /* missing type support */ |
| 10655 | return(ret); |
| 10656 | } |
| 10657 | |
| 10658 | |
| 10659 | static int |
| 10660 | test_xmlCopyElementTable(void) { |
| 10661 | int ret = 0; |
| 10662 | |
| 10663 | |
| 10664 | /* missing type support */ |
| 10665 | return(ret); |
| 10666 | } |
| 10667 | |
| 10668 | |
| 10669 | static int |
| 10670 | test_xmlCopyEnumeration(void) { |
| 10671 | int ret = 0; |
| 10672 | |
| 10673 | |
| 10674 | /* missing type support */ |
| 10675 | return(ret); |
| 10676 | } |
| 10677 | |
| 10678 | |
| 10679 | static int |
| 10680 | test_xmlCopyNotationTable(void) { |
| 10681 | int ret = 0; |
| 10682 | |
| 10683 | |
| 10684 | /* missing type support */ |
| 10685 | return(ret); |
| 10686 | } |
| 10687 | |
| 10688 | |
| 10689 | static int |
| 10690 | test_xmlCreateEnumeration(void) { |
| 10691 | int ret = 0; |
| 10692 | |
| 10693 | |
| 10694 | /* missing type support */ |
| 10695 | return(ret); |
| 10696 | } |
| 10697 | |
| 10698 | |
| 10699 | static int |
| 10700 | test_xmlDumpAttributeDecl(void) { |
| 10701 | int ret = 0; |
| 10702 | |
| 10703 | |
| 10704 | /* missing type support */ |
| 10705 | return(ret); |
| 10706 | } |
| 10707 | |
| 10708 | |
| 10709 | static int |
| 10710 | test_xmlDumpAttributeTable(void) { |
| 10711 | int ret = 0; |
| 10712 | |
| 10713 | |
| 10714 | /* missing type support */ |
| 10715 | return(ret); |
| 10716 | } |
| 10717 | |
| 10718 | |
| 10719 | static int |
| 10720 | test_xmlDumpElementDecl(void) { |
| 10721 | int ret = 0; |
| 10722 | |
| 10723 | |
| 10724 | /* missing type support */ |
| 10725 | return(ret); |
| 10726 | } |
| 10727 | |
| 10728 | |
| 10729 | static int |
| 10730 | test_xmlDumpElementTable(void) { |
| 10731 | int ret = 0; |
| 10732 | |
| 10733 | |
| 10734 | /* missing type support */ |
| 10735 | return(ret); |
| 10736 | } |
| 10737 | |
| 10738 | |
| 10739 | static int |
| 10740 | test_xmlDumpNotationDecl(void) { |
| 10741 | int ret = 0; |
| 10742 | |
| 10743 | |
| 10744 | /* missing type support */ |
| 10745 | return(ret); |
| 10746 | } |
| 10747 | |
| 10748 | |
| 10749 | static int |
| 10750 | test_xmlDumpNotationTable(void) { |
| 10751 | int ret = 0; |
| 10752 | |
| 10753 | |
| 10754 | /* missing type support */ |
| 10755 | return(ret); |
| 10756 | } |
| 10757 | |
| 10758 | |
| 10759 | static int |
| 10760 | test_xmlGetDtdAttrDesc(void) { |
| 10761 | int ret = 0; |
| 10762 | |
| 10763 | |
| 10764 | /* missing type support */ |
| 10765 | return(ret); |
| 10766 | } |
| 10767 | |
| 10768 | |
| 10769 | static int |
| 10770 | test_xmlGetDtdElementDesc(void) { |
| 10771 | int ret = 0; |
| 10772 | |
| 10773 | |
| 10774 | /* missing type support */ |
| 10775 | return(ret); |
| 10776 | } |
| 10777 | |
| 10778 | |
| 10779 | static int |
| 10780 | test_xmlGetDtdNotationDesc(void) { |
| 10781 | int ret = 0; |
| 10782 | |
| 10783 | |
| 10784 | /* missing type support */ |
| 10785 | return(ret); |
| 10786 | } |
| 10787 | |
| 10788 | |
| 10789 | static int |
| 10790 | test_xmlGetDtdQAttrDesc(void) { |
| 10791 | int ret = 0; |
| 10792 | |
| 10793 | |
| 10794 | /* missing type support */ |
| 10795 | return(ret); |
| 10796 | } |
| 10797 | |
| 10798 | |
| 10799 | static int |
| 10800 | test_xmlGetDtdQElementDesc(void) { |
| 10801 | int ret = 0; |
| 10802 | |
| 10803 | |
| 10804 | /* missing type support */ |
| 10805 | return(ret); |
| 10806 | } |
| 10807 | |
| 10808 | |
| 10809 | static int |
| 10810 | test_xmlGetID(void) { |
| 10811 | int ret = 0; |
| 10812 | |
| 10813 | |
| 10814 | /* missing type support */ |
| 10815 | return(ret); |
| 10816 | } |
| 10817 | |
| 10818 | |
| 10819 | static int |
| 10820 | test_xmlGetRefs(void) { |
| 10821 | int ret = 0; |
| 10822 | |
| 10823 | |
| 10824 | /* missing type support */ |
| 10825 | return(ret); |
| 10826 | } |
| 10827 | |
| 10828 | |
| 10829 | static int |
| 10830 | test_xmlIsID(void) { |
| 10831 | int ret = 0; |
| 10832 | |
| 10833 | |
| 10834 | /* missing type support */ |
| 10835 | return(ret); |
| 10836 | } |
| 10837 | |
| 10838 | |
| 10839 | static int |
| 10840 | test_xmlIsMixedElement(void) { |
| 10841 | int ret = 0; |
| 10842 | |
| 10843 | int mem_base; |
| 10844 | int ret_val; |
| 10845 | xmlDocPtr doc; /* the document */ |
| 10846 | int n_doc; |
| 10847 | const xmlChar * name; /* the element name */ |
| 10848 | int n_name; |
| 10849 | |
| 10850 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 10851 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 10852 | mem_base = xmlMemBlocks(); |
| 10853 | doc = gen_xmlDocPtr(n_doc); |
| 10854 | name = gen_const_xmlChar_ptr(n_name); |
| 10855 | |
| 10856 | ret_val = xmlIsMixedElement(doc, name); |
| 10857 | desret_int(ret_val); |
| 10858 | call_tests++; |
| 10859 | des_xmlDocPtr(n_doc, doc); |
| 10860 | des_const_xmlChar_ptr(n_name, name); |
| 10861 | xmlResetLastError(); |
| 10862 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10863 | printf("Leak of %d blocks found in xmlIsMixedElement", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10864 | xmlMemBlocks() - mem_base); |
| 10865 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 10866 | printf(" %d", n_doc); |
| 10867 | printf(" %d", n_name); |
| 10868 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10869 | } |
| 10870 | } |
| 10871 | } |
| 10872 | |
| 10873 | return(ret); |
| 10874 | } |
| 10875 | |
| 10876 | |
| 10877 | static int |
| 10878 | test_xmlIsRef(void) { |
| 10879 | int ret = 0; |
| 10880 | |
| 10881 | |
| 10882 | /* missing type support */ |
| 10883 | return(ret); |
| 10884 | } |
| 10885 | |
| 10886 | |
| 10887 | static int |
| 10888 | test_xmlNewElementContent(void) { |
| 10889 | int ret = 0; |
| 10890 | |
| 10891 | |
| 10892 | /* missing type support */ |
| 10893 | return(ret); |
| 10894 | } |
| 10895 | |
| 10896 | |
| 10897 | static int |
| 10898 | test_xmlNewValidCtxt(void) { |
| 10899 | int ret = 0; |
| 10900 | |
| 10901 | |
| 10902 | /* missing type support */ |
| 10903 | return(ret); |
| 10904 | } |
| 10905 | |
| 10906 | |
| 10907 | static int |
| 10908 | test_xmlRemoveID(void) { |
| 10909 | int ret = 0; |
| 10910 | |
| 10911 | |
| 10912 | /* missing type support */ |
| 10913 | return(ret); |
| 10914 | } |
| 10915 | |
| 10916 | |
| 10917 | static int |
| 10918 | test_xmlRemoveRef(void) { |
| 10919 | int ret = 0; |
| 10920 | |
| 10921 | |
| 10922 | /* missing type support */ |
| 10923 | return(ret); |
| 10924 | } |
| 10925 | |
| 10926 | |
| 10927 | static int |
| 10928 | test_xmlSnprintfElementContent(void) { |
| 10929 | int ret = 0; |
| 10930 | |
| 10931 | |
| 10932 | /* missing type support */ |
| 10933 | return(ret); |
| 10934 | } |
| 10935 | |
| 10936 | |
| 10937 | static int |
| 10938 | test_xmlSprintfElementContent(void) { |
| 10939 | int ret = 0; |
| 10940 | |
| 10941 | |
| 10942 | /* missing type support */ |
| 10943 | return(ret); |
| 10944 | } |
| 10945 | |
| 10946 | |
| 10947 | static int |
| 10948 | test_xmlValidBuildContentModel(void) { |
| 10949 | int ret = 0; |
| 10950 | |
| 10951 | |
| 10952 | /* missing type support */ |
| 10953 | return(ret); |
| 10954 | } |
| 10955 | |
| 10956 | |
| 10957 | static int |
| 10958 | test_xmlValidCtxtNormalizeAttributeValue(void) { |
| 10959 | int ret = 0; |
| 10960 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 10961 | #ifdef LIBXML_VALID_ENABLED |
| 10962 | int mem_base; |
| 10963 | xmlChar * ret_val; |
| 10964 | xmlValidCtxtPtr ctxt; /* the validation context or NULL */ |
| 10965 | int n_ctxt; |
| 10966 | xmlDocPtr doc; /* the document */ |
| 10967 | int n_doc; |
| 10968 | xmlNodePtr elem; /* the parent */ |
| 10969 | int n_elem; |
| 10970 | const xmlChar * name; /* the attribute name */ |
| 10971 | int n_name; |
| 10972 | const xmlChar * value; /* the attribute value */ |
| 10973 | int n_value; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 10974 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 10975 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 10976 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 10977 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { |
| 10978 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 10979 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 10980 | mem_base = xmlMemBlocks(); |
| 10981 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 10982 | doc = gen_xmlDocPtr(n_doc); |
| 10983 | elem = gen_xmlNodePtr(n_elem); |
| 10984 | name = gen_const_xmlChar_ptr(n_name); |
| 10985 | value = gen_const_xmlChar_ptr(n_value); |
| 10986 | |
| 10987 | ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, name, value); |
| 10988 | desret_xmlChar_ptr(ret_val); |
| 10989 | call_tests++; |
| 10990 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 10991 | des_xmlDocPtr(n_doc, doc); |
| 10992 | des_xmlNodePtr(n_elem, elem); |
| 10993 | des_const_xmlChar_ptr(n_name, name); |
| 10994 | des_const_xmlChar_ptr(n_value, value); |
| 10995 | xmlResetLastError(); |
| 10996 | if (mem_base != xmlMemBlocks()) { |
| 10997 | printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue", |
| 10998 | xmlMemBlocks() - mem_base); |
| 10999 | ret++; |
| 11000 | printf(" %d", n_ctxt); |
| 11001 | printf(" %d", n_doc); |
| 11002 | printf(" %d", n_elem); |
| 11003 | printf(" %d", n_name); |
| 11004 | printf(" %d", n_value); |
| 11005 | printf("\n"); |
| 11006 | } |
| 11007 | } |
| 11008 | } |
| 11009 | } |
| 11010 | } |
| 11011 | } |
| 11012 | #endif |
| 11013 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11014 | return(ret); |
| 11015 | } |
| 11016 | |
| 11017 | |
| 11018 | static int |
| 11019 | test_xmlValidGetPotentialChildren(void) { |
| 11020 | int ret = 0; |
| 11021 | |
| 11022 | |
| 11023 | /* missing type support */ |
| 11024 | return(ret); |
| 11025 | } |
| 11026 | |
| 11027 | |
| 11028 | static int |
| 11029 | test_xmlValidGetValidElements(void) { |
| 11030 | int ret = 0; |
| 11031 | |
| 11032 | |
| 11033 | /* missing type support */ |
| 11034 | return(ret); |
| 11035 | } |
| 11036 | |
| 11037 | |
| 11038 | static int |
| 11039 | test_xmlValidNormalizeAttributeValue(void) { |
| 11040 | int ret = 0; |
| 11041 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 11042 | #ifdef LIBXML_VALID_ENABLED |
| 11043 | int mem_base; |
| 11044 | xmlChar * ret_val; |
| 11045 | xmlDocPtr doc; /* the document */ |
| 11046 | int n_doc; |
| 11047 | xmlNodePtr elem; /* the parent */ |
| 11048 | int n_elem; |
| 11049 | const xmlChar * name; /* the attribute name */ |
| 11050 | int n_name; |
| 11051 | const xmlChar * value; /* the attribute value */ |
| 11052 | int n_value; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11053 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 11054 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11055 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { |
| 11056 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 11057 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 11058 | mem_base = xmlMemBlocks(); |
| 11059 | doc = gen_xmlDocPtr(n_doc); |
| 11060 | elem = gen_xmlNodePtr(n_elem); |
| 11061 | name = gen_const_xmlChar_ptr(n_name); |
| 11062 | value = gen_const_xmlChar_ptr(n_value); |
| 11063 | |
| 11064 | ret_val = xmlValidNormalizeAttributeValue(doc, elem, name, value); |
| 11065 | desret_xmlChar_ptr(ret_val); |
| 11066 | call_tests++; |
| 11067 | des_xmlDocPtr(n_doc, doc); |
| 11068 | des_xmlNodePtr(n_elem, elem); |
| 11069 | des_const_xmlChar_ptr(n_name, name); |
| 11070 | des_const_xmlChar_ptr(n_value, value); |
| 11071 | xmlResetLastError(); |
| 11072 | if (mem_base != xmlMemBlocks()) { |
| 11073 | printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue", |
| 11074 | xmlMemBlocks() - mem_base); |
| 11075 | ret++; |
| 11076 | printf(" %d", n_doc); |
| 11077 | printf(" %d", n_elem); |
| 11078 | printf(" %d", n_name); |
| 11079 | printf(" %d", n_value); |
| 11080 | printf("\n"); |
| 11081 | } |
| 11082 | } |
| 11083 | } |
| 11084 | } |
| 11085 | } |
| 11086 | #endif |
| 11087 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11088 | return(ret); |
| 11089 | } |
| 11090 | |
| 11091 | |
| 11092 | static int |
| 11093 | test_xmlValidateAttributeDecl(void) { |
| 11094 | int ret = 0; |
| 11095 | |
| 11096 | |
| 11097 | /* missing type support */ |
| 11098 | return(ret); |
| 11099 | } |
| 11100 | |
| 11101 | |
| 11102 | static int |
| 11103 | test_xmlValidateAttributeValue(void) { |
| 11104 | int ret = 0; |
| 11105 | |
| 11106 | |
| 11107 | /* missing type support */ |
| 11108 | return(ret); |
| 11109 | } |
| 11110 | |
| 11111 | |
| 11112 | static int |
| 11113 | test_xmlValidateDocument(void) { |
| 11114 | int ret = 0; |
| 11115 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11116 | #ifdef LIBXML_VALID_ENABLED |
| 11117 | int mem_base; |
| 11118 | int ret_val; |
| 11119 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11120 | int n_ctxt; |
| 11121 | xmlDocPtr doc; /* a document instance */ |
| 11122 | int n_doc; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11123 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11124 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11125 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11126 | mem_base = xmlMemBlocks(); |
| 11127 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11128 | doc = gen_xmlDocPtr(n_doc); |
| 11129 | |
| 11130 | ret_val = xmlValidateDocument(ctxt, doc); |
| 11131 | desret_int(ret_val); |
| 11132 | call_tests++; |
| 11133 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11134 | des_xmlDocPtr(n_doc, doc); |
| 11135 | xmlResetLastError(); |
| 11136 | if (mem_base != xmlMemBlocks()) { |
| 11137 | printf("Leak of %d blocks found in xmlValidateDocument", |
| 11138 | xmlMemBlocks() - mem_base); |
| 11139 | ret++; |
| 11140 | printf(" %d", n_ctxt); |
| 11141 | printf(" %d", n_doc); |
| 11142 | printf("\n"); |
| 11143 | } |
| 11144 | } |
| 11145 | } |
| 11146 | #endif |
| 11147 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11148 | return(ret); |
| 11149 | } |
| 11150 | |
| 11151 | |
| 11152 | static int |
| 11153 | test_xmlValidateDocumentFinal(void) { |
| 11154 | int ret = 0; |
| 11155 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11156 | #ifdef LIBXML_VALID_ENABLED |
| 11157 | int mem_base; |
| 11158 | int ret_val; |
| 11159 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11160 | int n_ctxt; |
| 11161 | xmlDocPtr doc; /* a document instance */ |
| 11162 | int n_doc; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11163 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11164 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11165 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11166 | mem_base = xmlMemBlocks(); |
| 11167 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11168 | doc = gen_xmlDocPtr(n_doc); |
| 11169 | |
| 11170 | ret_val = xmlValidateDocumentFinal(ctxt, doc); |
| 11171 | desret_int(ret_val); |
| 11172 | call_tests++; |
| 11173 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11174 | des_xmlDocPtr(n_doc, doc); |
| 11175 | xmlResetLastError(); |
| 11176 | if (mem_base != xmlMemBlocks()) { |
| 11177 | printf("Leak of %d blocks found in xmlValidateDocumentFinal", |
| 11178 | xmlMemBlocks() - mem_base); |
| 11179 | ret++; |
| 11180 | printf(" %d", n_ctxt); |
| 11181 | printf(" %d", n_doc); |
| 11182 | printf("\n"); |
| 11183 | } |
| 11184 | } |
| 11185 | } |
| 11186 | #endif |
| 11187 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11188 | return(ret); |
| 11189 | } |
| 11190 | |
| 11191 | |
| 11192 | static int |
| 11193 | test_xmlValidateDtd(void) { |
| 11194 | int ret = 0; |
| 11195 | |
| 11196 | |
| 11197 | /* missing type support */ |
| 11198 | return(ret); |
| 11199 | } |
| 11200 | |
| 11201 | |
| 11202 | static int |
| 11203 | test_xmlValidateDtdFinal(void) { |
| 11204 | int ret = 0; |
| 11205 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11206 | #ifdef LIBXML_VALID_ENABLED |
| 11207 | int mem_base; |
| 11208 | int ret_val; |
| 11209 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11210 | int n_ctxt; |
| 11211 | xmlDocPtr doc; /* a document instance */ |
| 11212 | int n_doc; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11213 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11214 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11215 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11216 | mem_base = xmlMemBlocks(); |
| 11217 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11218 | doc = gen_xmlDocPtr(n_doc); |
| 11219 | |
| 11220 | ret_val = xmlValidateDtdFinal(ctxt, doc); |
| 11221 | desret_int(ret_val); |
| 11222 | call_tests++; |
| 11223 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11224 | des_xmlDocPtr(n_doc, doc); |
| 11225 | xmlResetLastError(); |
| 11226 | if (mem_base != xmlMemBlocks()) { |
| 11227 | printf("Leak of %d blocks found in xmlValidateDtdFinal", |
| 11228 | xmlMemBlocks() - mem_base); |
| 11229 | ret++; |
| 11230 | printf(" %d", n_ctxt); |
| 11231 | printf(" %d", n_doc); |
| 11232 | printf("\n"); |
| 11233 | } |
| 11234 | } |
| 11235 | } |
| 11236 | #endif |
| 11237 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11238 | return(ret); |
| 11239 | } |
| 11240 | |
| 11241 | |
| 11242 | static int |
| 11243 | test_xmlValidateElement(void) { |
| 11244 | int ret = 0; |
| 11245 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11246 | #ifdef LIBXML_VALID_ENABLED |
| 11247 | int mem_base; |
| 11248 | int ret_val; |
| 11249 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11250 | int n_ctxt; |
| 11251 | xmlDocPtr doc; /* a document instance */ |
| 11252 | int n_doc; |
| 11253 | xmlNodePtr elem; /* an element instance */ |
| 11254 | int n_elem; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11255 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11256 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11257 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11258 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { |
| 11259 | mem_base = xmlMemBlocks(); |
| 11260 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11261 | doc = gen_xmlDocPtr(n_doc); |
| 11262 | elem = gen_xmlNodePtr(n_elem); |
| 11263 | |
| 11264 | ret_val = xmlValidateElement(ctxt, doc, elem); |
| 11265 | desret_int(ret_val); |
| 11266 | call_tests++; |
| 11267 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11268 | des_xmlDocPtr(n_doc, doc); |
| 11269 | des_xmlNodePtr(n_elem, elem); |
| 11270 | xmlResetLastError(); |
| 11271 | if (mem_base != xmlMemBlocks()) { |
| 11272 | printf("Leak of %d blocks found in xmlValidateElement", |
| 11273 | xmlMemBlocks() - mem_base); |
| 11274 | ret++; |
| 11275 | printf(" %d", n_ctxt); |
| 11276 | printf(" %d", n_doc); |
| 11277 | printf(" %d", n_elem); |
| 11278 | printf("\n"); |
| 11279 | } |
| 11280 | } |
| 11281 | } |
| 11282 | } |
| 11283 | #endif |
| 11284 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11285 | return(ret); |
| 11286 | } |
| 11287 | |
| 11288 | |
| 11289 | static int |
| 11290 | test_xmlValidateElementDecl(void) { |
| 11291 | int ret = 0; |
| 11292 | |
| 11293 | |
| 11294 | /* missing type support */ |
| 11295 | return(ret); |
| 11296 | } |
| 11297 | |
| 11298 | |
| 11299 | static int |
| 11300 | test_xmlValidateNameValue(void) { |
| 11301 | int ret = 0; |
| 11302 | |
| 11303 | #ifdef LIBXML_VALID_ENABLED |
| 11304 | int mem_base; |
| 11305 | int ret_val; |
| 11306 | const xmlChar * value; /* an Name value */ |
| 11307 | int n_value; |
| 11308 | |
| 11309 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 11310 | mem_base = xmlMemBlocks(); |
| 11311 | value = gen_const_xmlChar_ptr(n_value); |
| 11312 | |
| 11313 | ret_val = xmlValidateNameValue(value); |
| 11314 | desret_int(ret_val); |
| 11315 | call_tests++; |
| 11316 | des_const_xmlChar_ptr(n_value, value); |
| 11317 | xmlResetLastError(); |
| 11318 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11319 | printf("Leak of %d blocks found in xmlValidateNameValue", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11320 | xmlMemBlocks() - mem_base); |
| 11321 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11322 | printf(" %d", n_value); |
| 11323 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11324 | } |
| 11325 | } |
| 11326 | #endif |
| 11327 | |
| 11328 | return(ret); |
| 11329 | } |
| 11330 | |
| 11331 | |
| 11332 | static int |
| 11333 | test_xmlValidateNamesValue(void) { |
| 11334 | int ret = 0; |
| 11335 | |
| 11336 | #ifdef LIBXML_VALID_ENABLED |
| 11337 | int mem_base; |
| 11338 | int ret_val; |
| 11339 | const xmlChar * value; /* an Names value */ |
| 11340 | int n_value; |
| 11341 | |
| 11342 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 11343 | mem_base = xmlMemBlocks(); |
| 11344 | value = gen_const_xmlChar_ptr(n_value); |
| 11345 | |
| 11346 | ret_val = xmlValidateNamesValue(value); |
| 11347 | desret_int(ret_val); |
| 11348 | call_tests++; |
| 11349 | des_const_xmlChar_ptr(n_value, value); |
| 11350 | xmlResetLastError(); |
| 11351 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11352 | printf("Leak of %d blocks found in xmlValidateNamesValue", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11353 | xmlMemBlocks() - mem_base); |
| 11354 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11355 | printf(" %d", n_value); |
| 11356 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11357 | } |
| 11358 | } |
| 11359 | #endif |
| 11360 | |
| 11361 | return(ret); |
| 11362 | } |
| 11363 | |
| 11364 | |
| 11365 | static int |
| 11366 | test_xmlValidateNmtokenValue(void) { |
| 11367 | int ret = 0; |
| 11368 | |
| 11369 | #ifdef LIBXML_VALID_ENABLED |
| 11370 | int mem_base; |
| 11371 | int ret_val; |
| 11372 | const xmlChar * value; /* an Nmtoken value */ |
| 11373 | int n_value; |
| 11374 | |
| 11375 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 11376 | mem_base = xmlMemBlocks(); |
| 11377 | value = gen_const_xmlChar_ptr(n_value); |
| 11378 | |
| 11379 | ret_val = xmlValidateNmtokenValue(value); |
| 11380 | desret_int(ret_val); |
| 11381 | call_tests++; |
| 11382 | des_const_xmlChar_ptr(n_value, value); |
| 11383 | xmlResetLastError(); |
| 11384 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11385 | printf("Leak of %d blocks found in xmlValidateNmtokenValue", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11386 | xmlMemBlocks() - mem_base); |
| 11387 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11388 | printf(" %d", n_value); |
| 11389 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11390 | } |
| 11391 | } |
| 11392 | #endif |
| 11393 | |
| 11394 | return(ret); |
| 11395 | } |
| 11396 | |
| 11397 | |
| 11398 | static int |
| 11399 | test_xmlValidateNmtokensValue(void) { |
| 11400 | int ret = 0; |
| 11401 | |
| 11402 | #ifdef LIBXML_VALID_ENABLED |
| 11403 | int mem_base; |
| 11404 | int ret_val; |
| 11405 | const xmlChar * value; /* an Nmtokens value */ |
| 11406 | int n_value; |
| 11407 | |
| 11408 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 11409 | mem_base = xmlMemBlocks(); |
| 11410 | value = gen_const_xmlChar_ptr(n_value); |
| 11411 | |
| 11412 | ret_val = xmlValidateNmtokensValue(value); |
| 11413 | desret_int(ret_val); |
| 11414 | call_tests++; |
| 11415 | des_const_xmlChar_ptr(n_value, value); |
| 11416 | xmlResetLastError(); |
| 11417 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11418 | printf("Leak of %d blocks found in xmlValidateNmtokensValue", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11419 | xmlMemBlocks() - mem_base); |
| 11420 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11421 | printf(" %d", n_value); |
| 11422 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11423 | } |
| 11424 | } |
| 11425 | #endif |
| 11426 | |
| 11427 | return(ret); |
| 11428 | } |
| 11429 | |
| 11430 | |
| 11431 | static int |
| 11432 | test_xmlValidateNotationDecl(void) { |
| 11433 | int ret = 0; |
| 11434 | |
| 11435 | |
| 11436 | /* missing type support */ |
| 11437 | return(ret); |
| 11438 | } |
| 11439 | |
| 11440 | |
| 11441 | static int |
| 11442 | test_xmlValidateNotationUse(void) { |
| 11443 | int ret = 0; |
| 11444 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11445 | #ifdef LIBXML_VALID_ENABLED |
| 11446 | int mem_base; |
| 11447 | int ret_val; |
| 11448 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11449 | int n_ctxt; |
| 11450 | xmlDocPtr doc; /* the document */ |
| 11451 | int n_doc; |
| 11452 | const xmlChar * notationName; /* the notation name to check */ |
| 11453 | int n_notationName; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11454 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11455 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11456 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11457 | for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) { |
| 11458 | mem_base = xmlMemBlocks(); |
| 11459 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11460 | doc = gen_xmlDocPtr(n_doc); |
| 11461 | notationName = gen_const_xmlChar_ptr(n_notationName); |
| 11462 | |
| 11463 | ret_val = xmlValidateNotationUse(ctxt, doc, notationName); |
| 11464 | desret_int(ret_val); |
| 11465 | call_tests++; |
| 11466 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11467 | des_xmlDocPtr(n_doc, doc); |
| 11468 | des_const_xmlChar_ptr(n_notationName, notationName); |
| 11469 | xmlResetLastError(); |
| 11470 | if (mem_base != xmlMemBlocks()) { |
| 11471 | printf("Leak of %d blocks found in xmlValidateNotationUse", |
| 11472 | xmlMemBlocks() - mem_base); |
| 11473 | ret++; |
| 11474 | printf(" %d", n_ctxt); |
| 11475 | printf(" %d", n_doc); |
| 11476 | printf(" %d", n_notationName); |
| 11477 | printf("\n"); |
| 11478 | } |
| 11479 | } |
| 11480 | } |
| 11481 | } |
| 11482 | #endif |
| 11483 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11484 | return(ret); |
| 11485 | } |
| 11486 | |
| 11487 | |
| 11488 | static int |
| 11489 | test_xmlValidateOneAttribute(void) { |
| 11490 | int ret = 0; |
| 11491 | |
| 11492 | |
| 11493 | /* missing type support */ |
| 11494 | return(ret); |
| 11495 | } |
| 11496 | |
| 11497 | |
| 11498 | static int |
| 11499 | test_xmlValidateOneElement(void) { |
| 11500 | int ret = 0; |
| 11501 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11502 | #ifdef LIBXML_VALID_ENABLED |
| 11503 | int mem_base; |
| 11504 | int ret_val; |
| 11505 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11506 | int n_ctxt; |
| 11507 | xmlDocPtr doc; /* a document instance */ |
| 11508 | int n_doc; |
| 11509 | xmlNodePtr elem; /* an element instance */ |
| 11510 | int n_elem; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11511 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11512 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11513 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11514 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { |
| 11515 | mem_base = xmlMemBlocks(); |
| 11516 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11517 | doc = gen_xmlDocPtr(n_doc); |
| 11518 | elem = gen_xmlNodePtr(n_elem); |
| 11519 | |
| 11520 | ret_val = xmlValidateOneElement(ctxt, doc, elem); |
| 11521 | desret_int(ret_val); |
| 11522 | call_tests++; |
| 11523 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11524 | des_xmlDocPtr(n_doc, doc); |
| 11525 | des_xmlNodePtr(n_elem, elem); |
| 11526 | xmlResetLastError(); |
| 11527 | if (mem_base != xmlMemBlocks()) { |
| 11528 | printf("Leak of %d blocks found in xmlValidateOneElement", |
| 11529 | xmlMemBlocks() - mem_base); |
| 11530 | ret++; |
| 11531 | printf(" %d", n_ctxt); |
| 11532 | printf(" %d", n_doc); |
| 11533 | printf(" %d", n_elem); |
| 11534 | printf("\n"); |
| 11535 | } |
| 11536 | } |
| 11537 | } |
| 11538 | } |
| 11539 | #endif |
| 11540 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11541 | return(ret); |
| 11542 | } |
| 11543 | |
| 11544 | |
| 11545 | static int |
| 11546 | test_xmlValidateOneNamespace(void) { |
| 11547 | int ret = 0; |
| 11548 | |
| 11549 | |
| 11550 | /* missing type support */ |
| 11551 | return(ret); |
| 11552 | } |
| 11553 | |
| 11554 | |
| 11555 | static int |
| 11556 | test_xmlValidatePopElement(void) { |
| 11557 | int ret = 0; |
| 11558 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11559 | #ifdef LIBXML_REGEXP_ENABLED |
| 11560 | int mem_base; |
| 11561 | int ret_val; |
| 11562 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11563 | int n_ctxt; |
| 11564 | xmlDocPtr doc; /* a document instance */ |
| 11565 | int n_doc; |
| 11566 | xmlNodePtr elem; /* an element instance */ |
| 11567 | int n_elem; |
| 11568 | const xmlChar * qname; /* the qualified name as appearing in the serialization */ |
| 11569 | int n_qname; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11570 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11571 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11572 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11573 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { |
| 11574 | for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) { |
| 11575 | mem_base = xmlMemBlocks(); |
| 11576 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11577 | doc = gen_xmlDocPtr(n_doc); |
| 11578 | elem = gen_xmlNodePtr(n_elem); |
| 11579 | qname = gen_const_xmlChar_ptr(n_qname); |
| 11580 | |
| 11581 | ret_val = xmlValidatePopElement(ctxt, doc, elem, qname); |
| 11582 | desret_int(ret_val); |
| 11583 | call_tests++; |
| 11584 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11585 | des_xmlDocPtr(n_doc, doc); |
| 11586 | des_xmlNodePtr(n_elem, elem); |
| 11587 | des_const_xmlChar_ptr(n_qname, qname); |
| 11588 | xmlResetLastError(); |
| 11589 | if (mem_base != xmlMemBlocks()) { |
| 11590 | printf("Leak of %d blocks found in xmlValidatePopElement", |
| 11591 | xmlMemBlocks() - mem_base); |
| 11592 | ret++; |
| 11593 | printf(" %d", n_ctxt); |
| 11594 | printf(" %d", n_doc); |
| 11595 | printf(" %d", n_elem); |
| 11596 | printf(" %d", n_qname); |
| 11597 | printf("\n"); |
| 11598 | } |
| 11599 | } |
| 11600 | } |
| 11601 | } |
| 11602 | } |
| 11603 | #endif |
| 11604 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11605 | return(ret); |
| 11606 | } |
| 11607 | |
| 11608 | |
| 11609 | static int |
| 11610 | test_xmlValidatePushCData(void) { |
| 11611 | int ret = 0; |
| 11612 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11613 | #ifdef LIBXML_REGEXP_ENABLED |
| 11614 | int mem_base; |
| 11615 | int ret_val; |
| 11616 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11617 | int n_ctxt; |
| 11618 | const xmlChar * data; /* some character data read */ |
| 11619 | int n_data; |
| 11620 | int len; /* the lenght of the data */ |
| 11621 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11622 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11623 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11624 | for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { |
| 11625 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 11626 | mem_base = xmlMemBlocks(); |
| 11627 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11628 | data = gen_const_xmlChar_ptr(n_data); |
| 11629 | len = gen_int(n_len); |
| 11630 | |
| 11631 | ret_val = xmlValidatePushCData(ctxt, data, len); |
| 11632 | desret_int(ret_val); |
| 11633 | call_tests++; |
| 11634 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11635 | des_const_xmlChar_ptr(n_data, data); |
| 11636 | des_int(n_len, len); |
| 11637 | xmlResetLastError(); |
| 11638 | if (mem_base != xmlMemBlocks()) { |
| 11639 | printf("Leak of %d blocks found in xmlValidatePushCData", |
| 11640 | xmlMemBlocks() - mem_base); |
| 11641 | ret++; |
| 11642 | printf(" %d", n_ctxt); |
| 11643 | printf(" %d", n_data); |
| 11644 | printf(" %d", n_len); |
| 11645 | printf("\n"); |
| 11646 | } |
| 11647 | } |
| 11648 | } |
| 11649 | } |
| 11650 | #endif |
| 11651 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11652 | return(ret); |
| 11653 | } |
| 11654 | |
| 11655 | |
| 11656 | static int |
| 11657 | test_xmlValidatePushElement(void) { |
| 11658 | int ret = 0; |
| 11659 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11660 | #ifdef LIBXML_REGEXP_ENABLED |
| 11661 | int mem_base; |
| 11662 | int ret_val; |
| 11663 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11664 | int n_ctxt; |
| 11665 | xmlDocPtr doc; /* a document instance */ |
| 11666 | int n_doc; |
| 11667 | xmlNodePtr elem; /* an element instance */ |
| 11668 | int n_elem; |
| 11669 | const xmlChar * qname; /* the qualified name as appearing in the serialization */ |
| 11670 | int n_qname; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11671 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11672 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11673 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11674 | for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { |
| 11675 | for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) { |
| 11676 | mem_base = xmlMemBlocks(); |
| 11677 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11678 | doc = gen_xmlDocPtr(n_doc); |
| 11679 | elem = gen_xmlNodePtr(n_elem); |
| 11680 | qname = gen_const_xmlChar_ptr(n_qname); |
| 11681 | |
| 11682 | ret_val = xmlValidatePushElement(ctxt, doc, elem, qname); |
| 11683 | desret_int(ret_val); |
| 11684 | call_tests++; |
| 11685 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11686 | des_xmlDocPtr(n_doc, doc); |
| 11687 | des_xmlNodePtr(n_elem, elem); |
| 11688 | des_const_xmlChar_ptr(n_qname, qname); |
| 11689 | xmlResetLastError(); |
| 11690 | if (mem_base != xmlMemBlocks()) { |
| 11691 | printf("Leak of %d blocks found in xmlValidatePushElement", |
| 11692 | xmlMemBlocks() - mem_base); |
| 11693 | ret++; |
| 11694 | printf(" %d", n_ctxt); |
| 11695 | printf(" %d", n_doc); |
| 11696 | printf(" %d", n_elem); |
| 11697 | printf(" %d", n_qname); |
| 11698 | printf("\n"); |
| 11699 | } |
| 11700 | } |
| 11701 | } |
| 11702 | } |
| 11703 | } |
| 11704 | #endif |
| 11705 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11706 | return(ret); |
| 11707 | } |
| 11708 | |
| 11709 | |
| 11710 | static int |
| 11711 | test_xmlValidateRoot(void) { |
| 11712 | int ret = 0; |
| 11713 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11714 | #ifdef LIBXML_VALID_ENABLED |
| 11715 | int mem_base; |
| 11716 | int ret_val; |
| 11717 | xmlValidCtxtPtr ctxt; /* the validation context */ |
| 11718 | int n_ctxt; |
| 11719 | xmlDocPtr doc; /* a document instance */ |
| 11720 | int n_doc; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11721 | |
Daniel Veillard | c0be74b | 2004-11-03 19:16:55 +0000 | [diff] [blame^] | 11722 | for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { |
| 11723 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11724 | mem_base = xmlMemBlocks(); |
| 11725 | ctxt = gen_xmlValidCtxtPtr(n_ctxt); |
| 11726 | doc = gen_xmlDocPtr(n_doc); |
| 11727 | |
| 11728 | ret_val = xmlValidateRoot(ctxt, doc); |
| 11729 | desret_int(ret_val); |
| 11730 | call_tests++; |
| 11731 | des_xmlValidCtxtPtr(n_ctxt, ctxt); |
| 11732 | des_xmlDocPtr(n_doc, doc); |
| 11733 | xmlResetLastError(); |
| 11734 | if (mem_base != xmlMemBlocks()) { |
| 11735 | printf("Leak of %d blocks found in xmlValidateRoot", |
| 11736 | xmlMemBlocks() - mem_base); |
| 11737 | ret++; |
| 11738 | printf(" %d", n_ctxt); |
| 11739 | printf(" %d", n_doc); |
| 11740 | printf("\n"); |
| 11741 | } |
| 11742 | } |
| 11743 | } |
| 11744 | #endif |
| 11745 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11746 | return(ret); |
| 11747 | } |
| 11748 | |
| 11749 | static int |
| 11750 | test_valid(void) { |
| 11751 | int ret = 0; |
| 11752 | |
| 11753 | printf("Testing valid ...\n"); |
| 11754 | ret += test_xmlAddAttributeDecl(); |
| 11755 | ret += test_xmlAddElementDecl(); |
| 11756 | ret += test_xmlAddID(); |
| 11757 | ret += test_xmlAddNotationDecl(); |
| 11758 | ret += test_xmlAddRef(); |
| 11759 | ret += test_xmlCopyAttributeTable(); |
| 11760 | ret += test_xmlCopyElementContent(); |
| 11761 | ret += test_xmlCopyElementTable(); |
| 11762 | ret += test_xmlCopyEnumeration(); |
| 11763 | ret += test_xmlCopyNotationTable(); |
| 11764 | ret += test_xmlCreateEnumeration(); |
| 11765 | ret += test_xmlDumpAttributeDecl(); |
| 11766 | ret += test_xmlDumpAttributeTable(); |
| 11767 | ret += test_xmlDumpElementDecl(); |
| 11768 | ret += test_xmlDumpElementTable(); |
| 11769 | ret += test_xmlDumpNotationDecl(); |
| 11770 | ret += test_xmlDumpNotationTable(); |
| 11771 | ret += test_xmlGetDtdAttrDesc(); |
| 11772 | ret += test_xmlGetDtdElementDesc(); |
| 11773 | ret += test_xmlGetDtdNotationDesc(); |
| 11774 | ret += test_xmlGetDtdQAttrDesc(); |
| 11775 | ret += test_xmlGetDtdQElementDesc(); |
| 11776 | ret += test_xmlGetID(); |
| 11777 | ret += test_xmlGetRefs(); |
| 11778 | ret += test_xmlIsID(); |
| 11779 | ret += test_xmlIsMixedElement(); |
| 11780 | ret += test_xmlIsRef(); |
| 11781 | ret += test_xmlNewElementContent(); |
| 11782 | ret += test_xmlNewValidCtxt(); |
| 11783 | ret += test_xmlRemoveID(); |
| 11784 | ret += test_xmlRemoveRef(); |
| 11785 | ret += test_xmlSnprintfElementContent(); |
| 11786 | ret += test_xmlSprintfElementContent(); |
| 11787 | ret += test_xmlValidBuildContentModel(); |
| 11788 | ret += test_xmlValidCtxtNormalizeAttributeValue(); |
| 11789 | ret += test_xmlValidGetPotentialChildren(); |
| 11790 | ret += test_xmlValidGetValidElements(); |
| 11791 | ret += test_xmlValidNormalizeAttributeValue(); |
| 11792 | ret += test_xmlValidateAttributeDecl(); |
| 11793 | ret += test_xmlValidateAttributeValue(); |
| 11794 | ret += test_xmlValidateDocument(); |
| 11795 | ret += test_xmlValidateDocumentFinal(); |
| 11796 | ret += test_xmlValidateDtd(); |
| 11797 | ret += test_xmlValidateDtdFinal(); |
| 11798 | ret += test_xmlValidateElement(); |
| 11799 | ret += test_xmlValidateElementDecl(); |
| 11800 | ret += test_xmlValidateNameValue(); |
| 11801 | ret += test_xmlValidateNamesValue(); |
| 11802 | ret += test_xmlValidateNmtokenValue(); |
| 11803 | ret += test_xmlValidateNmtokensValue(); |
| 11804 | ret += test_xmlValidateNotationDecl(); |
| 11805 | ret += test_xmlValidateNotationUse(); |
| 11806 | ret += test_xmlValidateOneAttribute(); |
| 11807 | ret += test_xmlValidateOneElement(); |
| 11808 | ret += test_xmlValidateOneNamespace(); |
| 11809 | ret += test_xmlValidatePopElement(); |
| 11810 | ret += test_xmlValidatePushCData(); |
| 11811 | ret += test_xmlValidatePushElement(); |
| 11812 | ret += test_xmlValidateRoot(); |
| 11813 | |
| 11814 | if (ret != 0) |
| 11815 | printf("Module valid: %d errors\n", ret); |
| 11816 | return(ret); |
| 11817 | } |
| 11818 | |
| 11819 | static int |
| 11820 | test_xmlXIncludeNewContext(void) { |
| 11821 | int ret = 0; |
| 11822 | |
| 11823 | |
| 11824 | /* missing type support */ |
| 11825 | return(ret); |
| 11826 | } |
| 11827 | |
| 11828 | |
| 11829 | static int |
| 11830 | test_xmlXIncludeProcess(void) { |
| 11831 | int ret = 0; |
| 11832 | |
| 11833 | #ifdef LIBXML_XINCLUDE_ENABLED |
| 11834 | int mem_base; |
| 11835 | int ret_val; |
| 11836 | xmlDocPtr doc; /* an XML document */ |
| 11837 | int n_doc; |
| 11838 | |
| 11839 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11840 | mem_base = xmlMemBlocks(); |
| 11841 | doc = gen_xmlDocPtr(n_doc); |
| 11842 | |
| 11843 | ret_val = xmlXIncludeProcess(doc); |
| 11844 | desret_int(ret_val); |
| 11845 | call_tests++; |
| 11846 | des_xmlDocPtr(n_doc, doc); |
| 11847 | xmlResetLastError(); |
| 11848 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11849 | printf("Leak of %d blocks found in xmlXIncludeProcess", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11850 | xmlMemBlocks() - mem_base); |
| 11851 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11852 | printf(" %d", n_doc); |
| 11853 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11854 | } |
| 11855 | } |
| 11856 | #endif |
| 11857 | |
| 11858 | return(ret); |
| 11859 | } |
| 11860 | |
| 11861 | |
| 11862 | static int |
| 11863 | test_xmlXIncludeProcessFlags(void) { |
| 11864 | int ret = 0; |
| 11865 | |
| 11866 | #ifdef LIBXML_XINCLUDE_ENABLED |
| 11867 | int mem_base; |
| 11868 | int ret_val; |
| 11869 | xmlDocPtr doc; /* an XML document */ |
| 11870 | int n_doc; |
| 11871 | int flags; /* a set of xmlParserOption used for parsing XML includes */ |
| 11872 | int n_flags; |
| 11873 | |
| 11874 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 11875 | for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { |
| 11876 | mem_base = xmlMemBlocks(); |
| 11877 | doc = gen_xmlDocPtr(n_doc); |
| 11878 | flags = gen_int(n_flags); |
| 11879 | |
| 11880 | ret_val = xmlXIncludeProcessFlags(doc, flags); |
| 11881 | desret_int(ret_val); |
| 11882 | call_tests++; |
| 11883 | des_xmlDocPtr(n_doc, doc); |
| 11884 | des_int(n_flags, flags); |
| 11885 | xmlResetLastError(); |
| 11886 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11887 | printf("Leak of %d blocks found in xmlXIncludeProcessFlags", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11888 | xmlMemBlocks() - mem_base); |
| 11889 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11890 | printf(" %d", n_doc); |
| 11891 | printf(" %d", n_flags); |
| 11892 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11893 | } |
| 11894 | } |
| 11895 | } |
| 11896 | #endif |
| 11897 | |
| 11898 | return(ret); |
| 11899 | } |
| 11900 | |
| 11901 | |
| 11902 | static int |
| 11903 | test_xmlXIncludeProcessNode(void) { |
| 11904 | int ret = 0; |
| 11905 | |
| 11906 | |
| 11907 | /* missing type support */ |
| 11908 | return(ret); |
| 11909 | } |
| 11910 | |
| 11911 | |
| 11912 | static int |
| 11913 | test_xmlXIncludeProcessTree(void) { |
| 11914 | int ret = 0; |
| 11915 | |
| 11916 | #ifdef LIBXML_XINCLUDE_ENABLED |
| 11917 | int mem_base; |
| 11918 | int ret_val; |
| 11919 | xmlNodePtr tree; /* a node in an XML document */ |
| 11920 | int n_tree; |
| 11921 | |
| 11922 | for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { |
| 11923 | mem_base = xmlMemBlocks(); |
| 11924 | tree = gen_xmlNodePtr(n_tree); |
| 11925 | |
| 11926 | ret_val = xmlXIncludeProcessTree(tree); |
| 11927 | desret_int(ret_val); |
| 11928 | call_tests++; |
| 11929 | des_xmlNodePtr(n_tree, tree); |
| 11930 | xmlResetLastError(); |
| 11931 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11932 | printf("Leak of %d blocks found in xmlXIncludeProcessTree", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11933 | xmlMemBlocks() - mem_base); |
| 11934 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11935 | printf(" %d", n_tree); |
| 11936 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11937 | } |
| 11938 | } |
| 11939 | #endif |
| 11940 | |
| 11941 | return(ret); |
| 11942 | } |
| 11943 | |
| 11944 | |
| 11945 | static int |
| 11946 | test_xmlXIncludeProcessTreeFlags(void) { |
| 11947 | int ret = 0; |
| 11948 | |
| 11949 | #ifdef LIBXML_XINCLUDE_ENABLED |
| 11950 | int mem_base; |
| 11951 | int ret_val; |
| 11952 | xmlNodePtr tree; /* a node in an XML document */ |
| 11953 | int n_tree; |
| 11954 | int flags; /* a set of xmlParserOption used for parsing XML includes */ |
| 11955 | int n_flags; |
| 11956 | |
| 11957 | for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { |
| 11958 | for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { |
| 11959 | mem_base = xmlMemBlocks(); |
| 11960 | tree = gen_xmlNodePtr(n_tree); |
| 11961 | flags = gen_int(n_flags); |
| 11962 | |
| 11963 | ret_val = xmlXIncludeProcessTreeFlags(tree, flags); |
| 11964 | desret_int(ret_val); |
| 11965 | call_tests++; |
| 11966 | des_xmlNodePtr(n_tree, tree); |
| 11967 | des_int(n_flags, flags); |
| 11968 | xmlResetLastError(); |
| 11969 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11970 | printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11971 | xmlMemBlocks() - mem_base); |
| 11972 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 11973 | printf(" %d", n_tree); |
| 11974 | printf(" %d", n_flags); |
| 11975 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 11976 | } |
| 11977 | } |
| 11978 | } |
| 11979 | #endif |
| 11980 | |
| 11981 | return(ret); |
| 11982 | } |
| 11983 | |
| 11984 | |
| 11985 | static int |
| 11986 | test_xmlXIncludeSetFlags(void) { |
| 11987 | int ret = 0; |
| 11988 | |
| 11989 | |
| 11990 | /* missing type support */ |
| 11991 | return(ret); |
| 11992 | } |
| 11993 | |
| 11994 | static int |
| 11995 | test_xinclude(void) { |
| 11996 | int ret = 0; |
| 11997 | |
| 11998 | printf("Testing xinclude ...\n"); |
| 11999 | ret += test_xmlXIncludeNewContext(); |
| 12000 | ret += test_xmlXIncludeProcess(); |
| 12001 | ret += test_xmlXIncludeProcessFlags(); |
| 12002 | ret += test_xmlXIncludeProcessNode(); |
| 12003 | ret += test_xmlXIncludeProcessTree(); |
| 12004 | ret += test_xmlXIncludeProcessTreeFlags(); |
| 12005 | ret += test_xmlXIncludeSetFlags(); |
| 12006 | |
| 12007 | if (ret != 0) |
| 12008 | printf("Module xinclude: %d errors\n", ret); |
| 12009 | return(ret); |
| 12010 | } |
| 12011 | |
| 12012 | static int |
| 12013 | test_xmlAllocOutputBuffer(void) { |
| 12014 | int ret = 0; |
| 12015 | |
| 12016 | |
| 12017 | /* missing type support */ |
| 12018 | return(ret); |
| 12019 | } |
| 12020 | |
| 12021 | |
| 12022 | static int |
| 12023 | test_xmlAllocParserInputBuffer(void) { |
| 12024 | int ret = 0; |
| 12025 | |
| 12026 | |
| 12027 | /* missing type support */ |
| 12028 | return(ret); |
| 12029 | } |
| 12030 | |
| 12031 | |
| 12032 | static int |
| 12033 | test_xmlCheckFilename(void) { |
| 12034 | int ret = 0; |
| 12035 | |
| 12036 | int mem_base; |
| 12037 | int ret_val; |
| 12038 | const char * path; /* the path to check */ |
| 12039 | int n_path; |
| 12040 | |
| 12041 | for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) { |
| 12042 | mem_base = xmlMemBlocks(); |
| 12043 | path = gen_const_char_ptr(n_path); |
| 12044 | |
| 12045 | ret_val = xmlCheckFilename(path); |
| 12046 | desret_int(ret_val); |
| 12047 | call_tests++; |
| 12048 | des_const_char_ptr(n_path, path); |
| 12049 | xmlResetLastError(); |
| 12050 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12051 | printf("Leak of %d blocks found in xmlCheckFilename", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12052 | xmlMemBlocks() - mem_base); |
| 12053 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12054 | printf(" %d", n_path); |
| 12055 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12056 | } |
| 12057 | } |
| 12058 | |
| 12059 | return(ret); |
| 12060 | } |
| 12061 | |
| 12062 | |
| 12063 | static int |
| 12064 | test_xmlCheckHTTPInput(void) { |
| 12065 | int ret = 0; |
| 12066 | |
| 12067 | |
| 12068 | /* missing type support */ |
| 12069 | return(ret); |
| 12070 | } |
| 12071 | |
| 12072 | |
| 12073 | static int |
| 12074 | test_xmlCleanupInputCallbacks(void) { |
| 12075 | int ret = 0; |
| 12076 | |
| 12077 | int mem_base; |
| 12078 | |
| 12079 | mem_base = xmlMemBlocks(); |
| 12080 | |
| 12081 | xmlCleanupInputCallbacks(); |
| 12082 | call_tests++; |
| 12083 | xmlResetLastError(); |
| 12084 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12085 | printf("Leak of %d blocks found in xmlCleanupInputCallbacks", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12086 | xmlMemBlocks() - mem_base); |
| 12087 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12088 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12089 | } |
| 12090 | |
| 12091 | return(ret); |
| 12092 | } |
| 12093 | |
| 12094 | |
| 12095 | static int |
| 12096 | test_xmlCleanupOutputCallbacks(void) { |
| 12097 | int ret = 0; |
| 12098 | |
| 12099 | #ifdef LIBXML_OUTPUT_ENABLED |
| 12100 | int mem_base; |
| 12101 | |
| 12102 | mem_base = xmlMemBlocks(); |
| 12103 | |
| 12104 | xmlCleanupOutputCallbacks(); |
| 12105 | call_tests++; |
| 12106 | xmlResetLastError(); |
| 12107 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12108 | printf("Leak of %d blocks found in xmlCleanupOutputCallbacks", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12109 | xmlMemBlocks() - mem_base); |
| 12110 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12111 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12112 | } |
| 12113 | #endif |
| 12114 | |
| 12115 | return(ret); |
| 12116 | } |
| 12117 | |
| 12118 | |
| 12119 | static int |
| 12120 | test_xmlFileClose(void) { |
| 12121 | int ret = 0; |
| 12122 | |
| 12123 | |
| 12124 | /* missing type support */ |
| 12125 | return(ret); |
| 12126 | } |
| 12127 | |
| 12128 | |
| 12129 | static int |
| 12130 | test_xmlFileMatch(void) { |
| 12131 | int ret = 0; |
| 12132 | |
| 12133 | int mem_base; |
| 12134 | int ret_val; |
| 12135 | const char * filename; /* the URI for matching */ |
| 12136 | int n_filename; |
| 12137 | |
| 12138 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 12139 | mem_base = xmlMemBlocks(); |
| 12140 | filename = gen_filepath(n_filename); |
| 12141 | |
| 12142 | ret_val = xmlFileMatch(filename); |
| 12143 | desret_int(ret_val); |
| 12144 | call_tests++; |
| 12145 | des_filepath(n_filename, filename); |
| 12146 | xmlResetLastError(); |
| 12147 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12148 | printf("Leak of %d blocks found in xmlFileMatch", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12149 | xmlMemBlocks() - mem_base); |
| 12150 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12151 | printf(" %d", n_filename); |
| 12152 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12153 | } |
| 12154 | } |
| 12155 | |
| 12156 | return(ret); |
| 12157 | } |
| 12158 | |
| 12159 | |
| 12160 | static int |
| 12161 | test_xmlFileOpen(void) { |
| 12162 | int ret = 0; |
| 12163 | |
| 12164 | |
| 12165 | /* missing type support */ |
| 12166 | return(ret); |
| 12167 | } |
| 12168 | |
| 12169 | |
| 12170 | static int |
| 12171 | test_xmlFileRead(void) { |
| 12172 | int ret = 0; |
| 12173 | |
| 12174 | |
| 12175 | /* missing type support */ |
| 12176 | return(ret); |
| 12177 | } |
| 12178 | |
| 12179 | |
| 12180 | static int |
| 12181 | test_xmlIOFTPClose(void) { |
| 12182 | int ret = 0; |
| 12183 | |
| 12184 | |
| 12185 | /* missing type support */ |
| 12186 | return(ret); |
| 12187 | } |
| 12188 | |
| 12189 | |
| 12190 | static int |
| 12191 | test_xmlIOFTPMatch(void) { |
| 12192 | int ret = 0; |
| 12193 | |
| 12194 | #ifdef LIBXML_FTP_ENABLED |
| 12195 | int mem_base; |
| 12196 | int ret_val; |
| 12197 | const char * filename; /* the URI for matching */ |
| 12198 | int n_filename; |
| 12199 | |
| 12200 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 12201 | mem_base = xmlMemBlocks(); |
| 12202 | filename = gen_filepath(n_filename); |
| 12203 | |
| 12204 | ret_val = xmlIOFTPMatch(filename); |
| 12205 | desret_int(ret_val); |
| 12206 | call_tests++; |
| 12207 | des_filepath(n_filename, filename); |
| 12208 | xmlResetLastError(); |
| 12209 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12210 | printf("Leak of %d blocks found in xmlIOFTPMatch", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12211 | xmlMemBlocks() - mem_base); |
| 12212 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12213 | printf(" %d", n_filename); |
| 12214 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12215 | } |
| 12216 | } |
| 12217 | #endif |
| 12218 | |
| 12219 | return(ret); |
| 12220 | } |
| 12221 | |
| 12222 | |
| 12223 | static int |
| 12224 | test_xmlIOFTPOpen(void) { |
| 12225 | int ret = 0; |
| 12226 | |
| 12227 | |
| 12228 | /* missing type support */ |
| 12229 | return(ret); |
| 12230 | } |
| 12231 | |
| 12232 | |
| 12233 | static int |
| 12234 | test_xmlIOFTPRead(void) { |
| 12235 | int ret = 0; |
| 12236 | |
| 12237 | |
| 12238 | /* missing type support */ |
| 12239 | return(ret); |
| 12240 | } |
| 12241 | |
| 12242 | |
| 12243 | static int |
| 12244 | test_xmlIOHTTPClose(void) { |
| 12245 | int ret = 0; |
| 12246 | |
| 12247 | |
| 12248 | /* missing type support */ |
| 12249 | return(ret); |
| 12250 | } |
| 12251 | |
| 12252 | |
| 12253 | static int |
| 12254 | test_xmlIOHTTPMatch(void) { |
| 12255 | int ret = 0; |
| 12256 | |
| 12257 | #ifdef LIBXML_HTTP_ENABLED |
| 12258 | int mem_base; |
| 12259 | int ret_val; |
| 12260 | const char * filename; /* the URI for matching */ |
| 12261 | int n_filename; |
| 12262 | |
| 12263 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 12264 | mem_base = xmlMemBlocks(); |
| 12265 | filename = gen_filepath(n_filename); |
| 12266 | |
| 12267 | ret_val = xmlIOHTTPMatch(filename); |
| 12268 | desret_int(ret_val); |
| 12269 | call_tests++; |
| 12270 | des_filepath(n_filename, filename); |
| 12271 | xmlResetLastError(); |
| 12272 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12273 | printf("Leak of %d blocks found in xmlIOHTTPMatch", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12274 | xmlMemBlocks() - mem_base); |
| 12275 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12276 | printf(" %d", n_filename); |
| 12277 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12278 | } |
| 12279 | } |
| 12280 | #endif |
| 12281 | |
| 12282 | return(ret); |
| 12283 | } |
| 12284 | |
| 12285 | |
| 12286 | static int |
| 12287 | test_xmlIOHTTPOpen(void) { |
| 12288 | int ret = 0; |
| 12289 | |
| 12290 | |
| 12291 | /* missing type support */ |
| 12292 | return(ret); |
| 12293 | } |
| 12294 | |
| 12295 | |
| 12296 | static int |
| 12297 | test_xmlIOHTTPOpenW(void) { |
| 12298 | int ret = 0; |
| 12299 | |
| 12300 | |
| 12301 | /* missing type support */ |
| 12302 | return(ret); |
| 12303 | } |
| 12304 | |
| 12305 | |
| 12306 | static int |
| 12307 | test_xmlIOHTTPRead(void) { |
| 12308 | int ret = 0; |
| 12309 | |
| 12310 | |
| 12311 | /* missing type support */ |
| 12312 | return(ret); |
| 12313 | } |
| 12314 | |
| 12315 | |
| 12316 | static int |
| 12317 | test_xmlNoNetExternalEntityLoader(void) { |
| 12318 | int ret = 0; |
| 12319 | |
| 12320 | |
| 12321 | /* missing type support */ |
| 12322 | return(ret); |
| 12323 | } |
| 12324 | |
| 12325 | |
| 12326 | static int |
| 12327 | test_xmlNormalizeWindowsPath(void) { |
| 12328 | int ret = 0; |
| 12329 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 12330 | int mem_base; |
| 12331 | xmlChar * ret_val; |
| 12332 | const xmlChar * path; /* the input file path */ |
| 12333 | int n_path; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12334 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 12335 | for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { |
| 12336 | mem_base = xmlMemBlocks(); |
| 12337 | path = gen_const_xmlChar_ptr(n_path); |
| 12338 | |
| 12339 | ret_val = xmlNormalizeWindowsPath(path); |
| 12340 | desret_xmlChar_ptr(ret_val); |
| 12341 | call_tests++; |
| 12342 | des_const_xmlChar_ptr(n_path, path); |
| 12343 | xmlResetLastError(); |
| 12344 | if (mem_base != xmlMemBlocks()) { |
| 12345 | printf("Leak of %d blocks found in xmlNormalizeWindowsPath", |
| 12346 | xmlMemBlocks() - mem_base); |
| 12347 | ret++; |
| 12348 | printf(" %d", n_path); |
| 12349 | printf("\n"); |
| 12350 | } |
| 12351 | } |
| 12352 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12353 | return(ret); |
| 12354 | } |
| 12355 | |
| 12356 | |
| 12357 | static int |
| 12358 | test_xmlOutputBufferClose(void) { |
| 12359 | int ret = 0; |
| 12360 | |
| 12361 | |
| 12362 | /* missing type support */ |
| 12363 | return(ret); |
| 12364 | } |
| 12365 | |
| 12366 | |
| 12367 | static int |
| 12368 | test_xmlOutputBufferCreateFd(void) { |
| 12369 | int ret = 0; |
| 12370 | |
| 12371 | |
| 12372 | /* missing type support */ |
| 12373 | return(ret); |
| 12374 | } |
| 12375 | |
| 12376 | |
| 12377 | static int |
| 12378 | test_xmlOutputBufferCreateFile(void) { |
| 12379 | int ret = 0; |
| 12380 | |
| 12381 | |
| 12382 | /* missing type support */ |
| 12383 | return(ret); |
| 12384 | } |
| 12385 | |
| 12386 | |
| 12387 | static int |
| 12388 | test_xmlOutputBufferCreateFilename(void) { |
| 12389 | int ret = 0; |
| 12390 | |
| 12391 | |
| 12392 | /* missing type support */ |
| 12393 | return(ret); |
| 12394 | } |
| 12395 | |
| 12396 | |
| 12397 | static int |
| 12398 | test_xmlOutputBufferCreateIO(void) { |
| 12399 | int ret = 0; |
| 12400 | |
| 12401 | |
| 12402 | /* missing type support */ |
| 12403 | return(ret); |
| 12404 | } |
| 12405 | |
| 12406 | |
| 12407 | static int |
| 12408 | test_xmlOutputBufferFlush(void) { |
| 12409 | int ret = 0; |
| 12410 | |
| 12411 | |
| 12412 | /* missing type support */ |
| 12413 | return(ret); |
| 12414 | } |
| 12415 | |
| 12416 | |
| 12417 | static int |
| 12418 | test_xmlOutputBufferWrite(void) { |
| 12419 | int ret = 0; |
| 12420 | |
| 12421 | |
| 12422 | /* missing type support */ |
| 12423 | return(ret); |
| 12424 | } |
| 12425 | |
| 12426 | |
| 12427 | static int |
| 12428 | test_xmlOutputBufferWriteEscape(void) { |
| 12429 | int ret = 0; |
| 12430 | |
| 12431 | |
| 12432 | /* missing type support */ |
| 12433 | return(ret); |
| 12434 | } |
| 12435 | |
| 12436 | |
| 12437 | static int |
| 12438 | test_xmlOutputBufferWriteString(void) { |
| 12439 | int ret = 0; |
| 12440 | |
| 12441 | |
| 12442 | /* missing type support */ |
| 12443 | return(ret); |
| 12444 | } |
| 12445 | |
| 12446 | |
| 12447 | static int |
| 12448 | test_xmlParserGetDirectory(void) { |
| 12449 | int ret = 0; |
| 12450 | |
| 12451 | |
| 12452 | /* missing type support */ |
| 12453 | return(ret); |
| 12454 | } |
| 12455 | |
| 12456 | |
| 12457 | static int |
| 12458 | test_xmlParserInputBufferCreateFd(void) { |
| 12459 | int ret = 0; |
| 12460 | |
| 12461 | |
| 12462 | /* missing type support */ |
| 12463 | return(ret); |
| 12464 | } |
| 12465 | |
| 12466 | |
| 12467 | static int |
| 12468 | test_xmlParserInputBufferCreateFile(void) { |
| 12469 | int ret = 0; |
| 12470 | |
| 12471 | |
| 12472 | /* missing type support */ |
| 12473 | return(ret); |
| 12474 | } |
| 12475 | |
| 12476 | |
| 12477 | static int |
| 12478 | test_xmlParserInputBufferCreateFilename(void) { |
| 12479 | int ret = 0; |
| 12480 | |
| 12481 | |
| 12482 | /* missing type support */ |
| 12483 | return(ret); |
| 12484 | } |
| 12485 | |
| 12486 | |
| 12487 | static int |
| 12488 | test_xmlParserInputBufferCreateIO(void) { |
| 12489 | int ret = 0; |
| 12490 | |
| 12491 | |
| 12492 | /* missing type support */ |
| 12493 | return(ret); |
| 12494 | } |
| 12495 | |
| 12496 | |
| 12497 | static int |
| 12498 | test_xmlParserInputBufferCreateMem(void) { |
| 12499 | int ret = 0; |
| 12500 | |
| 12501 | |
| 12502 | /* missing type support */ |
| 12503 | return(ret); |
| 12504 | } |
| 12505 | |
| 12506 | |
| 12507 | static int |
| 12508 | test_xmlParserInputBufferCreateStatic(void) { |
| 12509 | int ret = 0; |
| 12510 | |
| 12511 | |
| 12512 | /* missing type support */ |
| 12513 | return(ret); |
| 12514 | } |
| 12515 | |
| 12516 | |
| 12517 | static int |
| 12518 | test_xmlParserInputBufferGrow(void) { |
| 12519 | int ret = 0; |
| 12520 | |
| 12521 | |
| 12522 | /* missing type support */ |
| 12523 | return(ret); |
| 12524 | } |
| 12525 | |
| 12526 | |
| 12527 | static int |
| 12528 | test_xmlParserInputBufferPush(void) { |
| 12529 | int ret = 0; |
| 12530 | |
| 12531 | |
| 12532 | /* missing type support */ |
| 12533 | return(ret); |
| 12534 | } |
| 12535 | |
| 12536 | |
| 12537 | static int |
| 12538 | test_xmlParserInputBufferRead(void) { |
| 12539 | int ret = 0; |
| 12540 | |
| 12541 | |
| 12542 | /* missing type support */ |
| 12543 | return(ret); |
| 12544 | } |
| 12545 | |
| 12546 | |
| 12547 | static int |
| 12548 | test_xmlPopInputCallbacks(void) { |
| 12549 | int ret = 0; |
| 12550 | |
| 12551 | int mem_base; |
| 12552 | int ret_val; |
| 12553 | |
| 12554 | mem_base = xmlMemBlocks(); |
| 12555 | |
| 12556 | ret_val = xmlPopInputCallbacks(); |
| 12557 | desret_int(ret_val); |
| 12558 | call_tests++; |
| 12559 | xmlResetLastError(); |
| 12560 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12561 | printf("Leak of %d blocks found in xmlPopInputCallbacks", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12562 | xmlMemBlocks() - mem_base); |
| 12563 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12564 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12565 | } |
| 12566 | |
| 12567 | return(ret); |
| 12568 | } |
| 12569 | |
| 12570 | |
| 12571 | static int |
| 12572 | test_xmlRegisterDefaultInputCallbacks(void) { |
| 12573 | int ret = 0; |
| 12574 | |
| 12575 | int mem_base; |
| 12576 | |
| 12577 | mem_base = xmlMemBlocks(); |
| 12578 | |
| 12579 | xmlRegisterDefaultInputCallbacks(); |
| 12580 | call_tests++; |
| 12581 | xmlResetLastError(); |
| 12582 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12583 | printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12584 | xmlMemBlocks() - mem_base); |
| 12585 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12586 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12587 | } |
| 12588 | |
| 12589 | return(ret); |
| 12590 | } |
| 12591 | |
| 12592 | |
| 12593 | static int |
| 12594 | test_xmlRegisterDefaultOutputCallbacks(void) { |
| 12595 | int ret = 0; |
| 12596 | |
| 12597 | #ifdef LIBXML_OUTPUT_ENABLED |
| 12598 | int mem_base; |
| 12599 | |
| 12600 | mem_base = xmlMemBlocks(); |
| 12601 | |
| 12602 | xmlRegisterDefaultOutputCallbacks(); |
| 12603 | call_tests++; |
| 12604 | xmlResetLastError(); |
| 12605 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12606 | printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12607 | xmlMemBlocks() - mem_base); |
| 12608 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12609 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12610 | } |
| 12611 | #endif |
| 12612 | |
| 12613 | return(ret); |
| 12614 | } |
| 12615 | |
| 12616 | |
| 12617 | static int |
| 12618 | test_xmlRegisterHTTPPostCallbacks(void) { |
| 12619 | int ret = 0; |
| 12620 | |
| 12621 | #ifdef LIBXML_HTTP_ENABLED |
| 12622 | int mem_base; |
| 12623 | |
| 12624 | mem_base = xmlMemBlocks(); |
| 12625 | |
| 12626 | xmlRegisterHTTPPostCallbacks(); |
| 12627 | call_tests++; |
| 12628 | xmlResetLastError(); |
| 12629 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12630 | printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12631 | xmlMemBlocks() - mem_base); |
| 12632 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 12633 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12634 | } |
| 12635 | #endif |
| 12636 | |
| 12637 | return(ret); |
| 12638 | } |
| 12639 | |
| 12640 | |
| 12641 | static int |
| 12642 | test_xmlRegisterInputCallbacks(void) { |
| 12643 | int ret = 0; |
| 12644 | |
| 12645 | |
| 12646 | /* missing type support */ |
| 12647 | return(ret); |
| 12648 | } |
| 12649 | |
| 12650 | |
| 12651 | static int |
| 12652 | test_xmlRegisterOutputCallbacks(void) { |
| 12653 | int ret = 0; |
| 12654 | |
| 12655 | |
| 12656 | /* missing type support */ |
| 12657 | return(ret); |
| 12658 | } |
| 12659 | |
| 12660 | static int |
| 12661 | test_xmlIO(void) { |
| 12662 | int ret = 0; |
| 12663 | |
| 12664 | printf("Testing xmlIO ...\n"); |
| 12665 | ret += test_xmlAllocOutputBuffer(); |
| 12666 | ret += test_xmlAllocParserInputBuffer(); |
| 12667 | ret += test_xmlCheckFilename(); |
| 12668 | ret += test_xmlCheckHTTPInput(); |
| 12669 | ret += test_xmlCleanupInputCallbacks(); |
| 12670 | ret += test_xmlCleanupOutputCallbacks(); |
| 12671 | ret += test_xmlFileClose(); |
| 12672 | ret += test_xmlFileMatch(); |
| 12673 | ret += test_xmlFileOpen(); |
| 12674 | ret += test_xmlFileRead(); |
| 12675 | ret += test_xmlIOFTPClose(); |
| 12676 | ret += test_xmlIOFTPMatch(); |
| 12677 | ret += test_xmlIOFTPOpen(); |
| 12678 | ret += test_xmlIOFTPRead(); |
| 12679 | ret += test_xmlIOHTTPClose(); |
| 12680 | ret += test_xmlIOHTTPMatch(); |
| 12681 | ret += test_xmlIOHTTPOpen(); |
| 12682 | ret += test_xmlIOHTTPOpenW(); |
| 12683 | ret += test_xmlIOHTTPRead(); |
| 12684 | ret += test_xmlNoNetExternalEntityLoader(); |
| 12685 | ret += test_xmlNormalizeWindowsPath(); |
| 12686 | ret += test_xmlOutputBufferClose(); |
| 12687 | ret += test_xmlOutputBufferCreateFd(); |
| 12688 | ret += test_xmlOutputBufferCreateFile(); |
| 12689 | ret += test_xmlOutputBufferCreateFilename(); |
| 12690 | ret += test_xmlOutputBufferCreateIO(); |
| 12691 | ret += test_xmlOutputBufferFlush(); |
| 12692 | ret += test_xmlOutputBufferWrite(); |
| 12693 | ret += test_xmlOutputBufferWriteEscape(); |
| 12694 | ret += test_xmlOutputBufferWriteString(); |
| 12695 | ret += test_xmlParserGetDirectory(); |
| 12696 | ret += test_xmlParserInputBufferCreateFd(); |
| 12697 | ret += test_xmlParserInputBufferCreateFile(); |
| 12698 | ret += test_xmlParserInputBufferCreateFilename(); |
| 12699 | ret += test_xmlParserInputBufferCreateIO(); |
| 12700 | ret += test_xmlParserInputBufferCreateMem(); |
| 12701 | ret += test_xmlParserInputBufferCreateStatic(); |
| 12702 | ret += test_xmlParserInputBufferGrow(); |
| 12703 | ret += test_xmlParserInputBufferPush(); |
| 12704 | ret += test_xmlParserInputBufferRead(); |
| 12705 | ret += test_xmlPopInputCallbacks(); |
| 12706 | ret += test_xmlRegisterDefaultInputCallbacks(); |
| 12707 | ret += test_xmlRegisterDefaultOutputCallbacks(); |
| 12708 | ret += test_xmlRegisterHTTPPostCallbacks(); |
| 12709 | ret += test_xmlRegisterInputCallbacks(); |
| 12710 | ret += test_xmlRegisterOutputCallbacks(); |
| 12711 | |
| 12712 | if (ret != 0) |
| 12713 | printf("Module xmlIO: %d errors\n", ret); |
| 12714 | return(ret); |
| 12715 | } |
| 12716 | |
| 12717 | static int |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12718 | test_initGenericErrorDefaultFunc(void) { |
| 12719 | int ret = 0; |
| 12720 | |
| 12721 | |
| 12722 | /* missing type support */ |
| 12723 | return(ret); |
| 12724 | } |
| 12725 | |
| 12726 | |
| 12727 | static int |
| 12728 | test_xmlCopyError(void) { |
| 12729 | int ret = 0; |
| 12730 | |
| 12731 | |
| 12732 | /* missing type support */ |
| 12733 | return(ret); |
| 12734 | } |
| 12735 | |
| 12736 | |
| 12737 | static int |
| 12738 | test_xmlCtxtGetLastError(void) { |
| 12739 | int ret = 0; |
| 12740 | |
| 12741 | |
| 12742 | /* missing type support */ |
| 12743 | return(ret); |
| 12744 | } |
| 12745 | |
| 12746 | |
| 12747 | static int |
| 12748 | test_xmlCtxtResetLastError(void) { |
| 12749 | int ret = 0; |
| 12750 | |
| 12751 | |
| 12752 | /* missing type support */ |
| 12753 | return(ret); |
| 12754 | } |
| 12755 | |
| 12756 | |
| 12757 | static int |
| 12758 | test_xmlGetLastError(void) { |
| 12759 | int ret = 0; |
| 12760 | |
| 12761 | |
| 12762 | /* missing type support */ |
| 12763 | return(ret); |
| 12764 | } |
| 12765 | |
| 12766 | |
| 12767 | static int |
| 12768 | test_xmlParserError(void) { |
| 12769 | int ret = 0; |
| 12770 | |
| 12771 | |
| 12772 | /* missing type support */ |
| 12773 | return(ret); |
| 12774 | } |
| 12775 | |
| 12776 | |
| 12777 | static int |
| 12778 | test_xmlParserPrintFileContext(void) { |
| 12779 | int ret = 0; |
| 12780 | |
| 12781 | |
| 12782 | /* missing type support */ |
| 12783 | return(ret); |
| 12784 | } |
| 12785 | |
| 12786 | |
| 12787 | static int |
| 12788 | test_xmlParserPrintFileInfo(void) { |
| 12789 | int ret = 0; |
| 12790 | |
| 12791 | |
| 12792 | /* missing type support */ |
| 12793 | return(ret); |
| 12794 | } |
| 12795 | |
| 12796 | |
| 12797 | static int |
| 12798 | test_xmlParserValidityError(void) { |
| 12799 | int ret = 0; |
| 12800 | |
| 12801 | |
| 12802 | /* missing type support */ |
| 12803 | return(ret); |
| 12804 | } |
| 12805 | |
| 12806 | |
| 12807 | static int |
| 12808 | test_xmlParserValidityWarning(void) { |
| 12809 | int ret = 0; |
| 12810 | |
| 12811 | |
| 12812 | /* missing type support */ |
| 12813 | return(ret); |
| 12814 | } |
| 12815 | |
| 12816 | |
| 12817 | static int |
| 12818 | test_xmlParserWarning(void) { |
| 12819 | int ret = 0; |
| 12820 | |
| 12821 | |
| 12822 | /* missing type support */ |
| 12823 | return(ret); |
| 12824 | } |
| 12825 | |
| 12826 | |
| 12827 | static int |
| 12828 | test_xmlResetError(void) { |
| 12829 | int ret = 0; |
| 12830 | |
| 12831 | |
| 12832 | /* missing type support */ |
| 12833 | return(ret); |
| 12834 | } |
| 12835 | |
| 12836 | |
| 12837 | static int |
| 12838 | test_xmlResetLastError(void) { |
| 12839 | int ret = 0; |
| 12840 | |
| 12841 | |
| 12842 | |
| 12843 | xmlResetLastError(); |
| 12844 | call_tests++; |
| 12845 | xmlResetLastError(); |
| 12846 | |
| 12847 | return(ret); |
| 12848 | } |
| 12849 | |
| 12850 | |
| 12851 | static int |
| 12852 | test_xmlSetGenericErrorFunc(void) { |
| 12853 | int ret = 0; |
| 12854 | |
| 12855 | |
| 12856 | /* missing type support */ |
| 12857 | return(ret); |
| 12858 | } |
| 12859 | |
| 12860 | |
| 12861 | static int |
| 12862 | test_xmlSetStructuredErrorFunc(void) { |
| 12863 | int ret = 0; |
| 12864 | |
| 12865 | |
| 12866 | /* missing type support */ |
| 12867 | return(ret); |
| 12868 | } |
| 12869 | |
| 12870 | static int |
| 12871 | test_xmlerror(void) { |
| 12872 | int ret = 0; |
| 12873 | |
| 12874 | printf("Testing xmlerror ...\n"); |
| 12875 | ret += test_initGenericErrorDefaultFunc(); |
| 12876 | ret += test_xmlCopyError(); |
| 12877 | ret += test_xmlCtxtGetLastError(); |
| 12878 | ret += test_xmlCtxtResetLastError(); |
| 12879 | ret += test_xmlGetLastError(); |
| 12880 | ret += test_xmlParserError(); |
| 12881 | ret += test_xmlParserPrintFileContext(); |
| 12882 | ret += test_xmlParserPrintFileInfo(); |
| 12883 | ret += test_xmlParserValidityError(); |
| 12884 | ret += test_xmlParserValidityWarning(); |
| 12885 | ret += test_xmlParserWarning(); |
| 12886 | ret += test_xmlResetError(); |
| 12887 | ret += test_xmlResetLastError(); |
| 12888 | ret += test_xmlSetGenericErrorFunc(); |
| 12889 | ret += test_xmlSetStructuredErrorFunc(); |
| 12890 | |
| 12891 | if (ret != 0) |
| 12892 | printf("Module xmlerror: %d errors\n", ret); |
| 12893 | return(ret); |
| 12894 | } |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12895 | |
| 12896 | static int |
| 12897 | test_xmlNewTextReader(void) { |
| 12898 | int ret = 0; |
| 12899 | |
| 12900 | |
| 12901 | /* missing type support */ |
| 12902 | return(ret); |
| 12903 | } |
| 12904 | |
| 12905 | |
| 12906 | static int |
| 12907 | test_xmlNewTextReaderFilename(void) { |
| 12908 | int ret = 0; |
| 12909 | |
| 12910 | |
| 12911 | /* missing type support */ |
| 12912 | return(ret); |
| 12913 | } |
| 12914 | |
| 12915 | |
| 12916 | static int |
| 12917 | test_xmlReaderForDoc(void) { |
| 12918 | int ret = 0; |
| 12919 | |
| 12920 | |
| 12921 | /* missing type support */ |
| 12922 | return(ret); |
| 12923 | } |
| 12924 | |
| 12925 | |
| 12926 | static int |
| 12927 | test_xmlReaderForFd(void) { |
| 12928 | int ret = 0; |
| 12929 | |
| 12930 | |
| 12931 | /* missing type support */ |
| 12932 | return(ret); |
| 12933 | } |
| 12934 | |
| 12935 | |
| 12936 | static int |
| 12937 | test_xmlReaderForFile(void) { |
| 12938 | int ret = 0; |
| 12939 | |
| 12940 | |
| 12941 | /* missing type support */ |
| 12942 | return(ret); |
| 12943 | } |
| 12944 | |
| 12945 | |
| 12946 | static int |
| 12947 | test_xmlReaderForIO(void) { |
| 12948 | int ret = 0; |
| 12949 | |
| 12950 | |
| 12951 | /* missing type support */ |
| 12952 | return(ret); |
| 12953 | } |
| 12954 | |
| 12955 | |
| 12956 | static int |
| 12957 | test_xmlReaderForMemory(void) { |
| 12958 | int ret = 0; |
| 12959 | |
| 12960 | |
| 12961 | /* missing type support */ |
| 12962 | return(ret); |
| 12963 | } |
| 12964 | |
| 12965 | |
| 12966 | static int |
| 12967 | test_xmlReaderNewDoc(void) { |
| 12968 | int ret = 0; |
| 12969 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 12970 | #ifdef LIBXML_READER_ENABLED |
| 12971 | int mem_base; |
| 12972 | int ret_val; |
| 12973 | xmlTextReaderPtr reader; /* an XML reader */ |
| 12974 | int n_reader; |
| 12975 | const xmlChar * cur; /* a pointer to a zero terminated string */ |
| 12976 | int n_cur; |
| 12977 | const char * URL; /* the base URL to use for the document */ |
| 12978 | int n_URL; |
| 12979 | const char * encoding; /* the document encoding, or NULL */ |
| 12980 | int n_encoding; |
| 12981 | int options; /* a combination of xmlParserOption */ |
| 12982 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12983 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 12984 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 12985 | for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { |
| 12986 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 12987 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 12988 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 12989 | mem_base = xmlMemBlocks(); |
| 12990 | reader = gen_xmlTextReaderPtr(n_reader); |
| 12991 | cur = gen_const_xmlChar_ptr(n_cur); |
| 12992 | URL = gen_filepath(n_URL); |
| 12993 | encoding = gen_const_char_ptr(n_encoding); |
| 12994 | options = gen_int(n_options); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 12995 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 12996 | ret_val = xmlReaderNewDoc(reader, cur, URL, encoding, options); |
| 12997 | desret_int(ret_val); |
| 12998 | call_tests++; |
| 12999 | des_xmlTextReaderPtr(n_reader, reader); |
| 13000 | des_const_xmlChar_ptr(n_cur, cur); |
| 13001 | des_filepath(n_URL, URL); |
| 13002 | des_const_char_ptr(n_encoding, encoding); |
| 13003 | des_int(n_options, options); |
| 13004 | xmlResetLastError(); |
| 13005 | if (mem_base != xmlMemBlocks()) { |
| 13006 | printf("Leak of %d blocks found in xmlReaderNewDoc", |
| 13007 | xmlMemBlocks() - mem_base); |
| 13008 | ret++; |
| 13009 | printf(" %d", n_reader); |
| 13010 | printf(" %d", n_cur); |
| 13011 | printf(" %d", n_URL); |
| 13012 | printf(" %d", n_encoding); |
| 13013 | printf(" %d", n_options); |
| 13014 | printf("\n"); |
| 13015 | } |
| 13016 | } |
| 13017 | } |
| 13018 | } |
| 13019 | } |
| 13020 | } |
| 13021 | #endif |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13022 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13023 | return(ret); |
| 13024 | } |
| 13025 | |
| 13026 | |
| 13027 | static int |
| 13028 | test_xmlReaderNewFile(void) { |
| 13029 | int ret = 0; |
| 13030 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13031 | #ifdef LIBXML_READER_ENABLED |
| 13032 | int mem_base; |
| 13033 | int ret_val; |
| 13034 | xmlTextReaderPtr reader; /* an XML reader */ |
| 13035 | int n_reader; |
| 13036 | const char * filename; /* a file or URL */ |
| 13037 | int n_filename; |
| 13038 | const char * encoding; /* the document encoding, or NULL */ |
| 13039 | int n_encoding; |
| 13040 | int options; /* a combination of xmlParserOption */ |
| 13041 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13042 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13043 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13044 | for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { |
| 13045 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 13046 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 13047 | mem_base = xmlMemBlocks(); |
| 13048 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13049 | filename = gen_filepath(n_filename); |
| 13050 | encoding = gen_const_char_ptr(n_encoding); |
| 13051 | options = gen_int(n_options); |
| 13052 | |
| 13053 | ret_val = xmlReaderNewFile(reader, filename, encoding, options); |
| 13054 | desret_int(ret_val); |
| 13055 | call_tests++; |
| 13056 | des_xmlTextReaderPtr(n_reader, reader); |
| 13057 | des_filepath(n_filename, filename); |
| 13058 | des_const_char_ptr(n_encoding, encoding); |
| 13059 | des_int(n_options, options); |
| 13060 | xmlResetLastError(); |
| 13061 | if (mem_base != xmlMemBlocks()) { |
| 13062 | printf("Leak of %d blocks found in xmlReaderNewFile", |
| 13063 | xmlMemBlocks() - mem_base); |
| 13064 | ret++; |
| 13065 | printf(" %d", n_reader); |
| 13066 | printf(" %d", n_filename); |
| 13067 | printf(" %d", n_encoding); |
| 13068 | printf(" %d", n_options); |
| 13069 | printf("\n"); |
| 13070 | } |
| 13071 | } |
| 13072 | } |
| 13073 | } |
| 13074 | } |
| 13075 | #endif |
| 13076 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13077 | return(ret); |
| 13078 | } |
| 13079 | |
| 13080 | |
| 13081 | static int |
| 13082 | test_xmlReaderNewIO(void) { |
| 13083 | int ret = 0; |
| 13084 | |
| 13085 | |
| 13086 | /* missing type support */ |
| 13087 | return(ret); |
| 13088 | } |
| 13089 | |
| 13090 | |
| 13091 | static int |
| 13092 | test_xmlReaderNewMemory(void) { |
| 13093 | int ret = 0; |
| 13094 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13095 | #ifdef LIBXML_READER_ENABLED |
| 13096 | int mem_base; |
| 13097 | int ret_val; |
| 13098 | xmlTextReaderPtr reader; /* an XML reader */ |
| 13099 | int n_reader; |
| 13100 | const char * buffer; /* a pointer to a char array */ |
| 13101 | int n_buffer; |
| 13102 | int size; /* the size of the array */ |
| 13103 | int n_size; |
| 13104 | const char * URL; /* the base URL to use for the document */ |
| 13105 | int n_URL; |
| 13106 | const char * encoding; /* the document encoding, or NULL */ |
| 13107 | int n_encoding; |
| 13108 | int options; /* a combination of xmlParserOption */ |
| 13109 | int n_options; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13110 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13111 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13112 | for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { |
| 13113 | for (n_size = 0;n_size < gen_nb_int;n_size++) { |
| 13114 | for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { |
| 13115 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 13116 | for (n_options = 0;n_options < gen_nb_int;n_options++) { |
| 13117 | mem_base = xmlMemBlocks(); |
| 13118 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13119 | buffer = gen_const_char_ptr(n_buffer); |
| 13120 | size = gen_int(n_size); |
| 13121 | URL = gen_filepath(n_URL); |
| 13122 | encoding = gen_const_char_ptr(n_encoding); |
| 13123 | options = gen_int(n_options); |
| 13124 | |
| 13125 | ret_val = xmlReaderNewMemory(reader, buffer, size, URL, encoding, options); |
| 13126 | desret_int(ret_val); |
| 13127 | call_tests++; |
| 13128 | des_xmlTextReaderPtr(n_reader, reader); |
| 13129 | des_const_char_ptr(n_buffer, buffer); |
| 13130 | des_int(n_size, size); |
| 13131 | des_filepath(n_URL, URL); |
| 13132 | des_const_char_ptr(n_encoding, encoding); |
| 13133 | des_int(n_options, options); |
| 13134 | xmlResetLastError(); |
| 13135 | if (mem_base != xmlMemBlocks()) { |
| 13136 | printf("Leak of %d blocks found in xmlReaderNewMemory", |
| 13137 | xmlMemBlocks() - mem_base); |
| 13138 | ret++; |
| 13139 | printf(" %d", n_reader); |
| 13140 | printf(" %d", n_buffer); |
| 13141 | printf(" %d", n_size); |
| 13142 | printf(" %d", n_URL); |
| 13143 | printf(" %d", n_encoding); |
| 13144 | printf(" %d", n_options); |
| 13145 | printf("\n"); |
| 13146 | } |
| 13147 | } |
| 13148 | } |
| 13149 | } |
| 13150 | } |
| 13151 | } |
| 13152 | } |
| 13153 | #endif |
| 13154 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13155 | return(ret); |
| 13156 | } |
| 13157 | |
| 13158 | |
| 13159 | static int |
| 13160 | test_xmlReaderNewWalker(void) { |
| 13161 | int ret = 0; |
| 13162 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13163 | #ifdef LIBXML_READER_ENABLED |
| 13164 | int mem_base; |
| 13165 | int ret_val; |
| 13166 | xmlTextReaderPtr reader; /* an XML reader */ |
| 13167 | int n_reader; |
| 13168 | xmlDocPtr doc; /* a preparsed document */ |
| 13169 | int n_doc; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13170 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13171 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13172 | for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { |
| 13173 | mem_base = xmlMemBlocks(); |
| 13174 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13175 | doc = gen_xmlDocPtr(n_doc); |
| 13176 | |
| 13177 | ret_val = xmlReaderNewWalker(reader, doc); |
| 13178 | desret_int(ret_val); |
| 13179 | call_tests++; |
| 13180 | des_xmlTextReaderPtr(n_reader, reader); |
| 13181 | des_xmlDocPtr(n_doc, doc); |
| 13182 | xmlResetLastError(); |
| 13183 | if (mem_base != xmlMemBlocks()) { |
| 13184 | printf("Leak of %d blocks found in xmlReaderNewWalker", |
| 13185 | xmlMemBlocks() - mem_base); |
| 13186 | ret++; |
| 13187 | printf(" %d", n_reader); |
| 13188 | printf(" %d", n_doc); |
| 13189 | printf("\n"); |
| 13190 | } |
| 13191 | } |
| 13192 | } |
| 13193 | #endif |
| 13194 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13195 | return(ret); |
| 13196 | } |
| 13197 | |
| 13198 | |
| 13199 | static int |
| 13200 | test_xmlReaderWalker(void) { |
| 13201 | int ret = 0; |
| 13202 | |
| 13203 | |
| 13204 | /* missing type support */ |
| 13205 | return(ret); |
| 13206 | } |
| 13207 | |
| 13208 | |
| 13209 | static int |
| 13210 | test_xmlTextReaderAttributeCount(void) { |
| 13211 | int ret = 0; |
| 13212 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13213 | #ifdef LIBXML_READER_ENABLED |
| 13214 | int mem_base; |
| 13215 | int ret_val; |
| 13216 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13217 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13218 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13219 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13220 | mem_base = xmlMemBlocks(); |
| 13221 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13222 | |
| 13223 | ret_val = xmlTextReaderAttributeCount(reader); |
| 13224 | desret_int(ret_val); |
| 13225 | call_tests++; |
| 13226 | des_xmlTextReaderPtr(n_reader, reader); |
| 13227 | xmlResetLastError(); |
| 13228 | if (mem_base != xmlMemBlocks()) { |
| 13229 | printf("Leak of %d blocks found in xmlTextReaderAttributeCount", |
| 13230 | xmlMemBlocks() - mem_base); |
| 13231 | ret++; |
| 13232 | printf(" %d", n_reader); |
| 13233 | printf("\n"); |
| 13234 | } |
| 13235 | } |
| 13236 | #endif |
| 13237 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13238 | return(ret); |
| 13239 | } |
| 13240 | |
| 13241 | |
| 13242 | static int |
| 13243 | test_xmlTextReaderBaseUri(void) { |
| 13244 | int ret = 0; |
| 13245 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13246 | #ifdef LIBXML_READER_ENABLED |
| 13247 | int mem_base; |
| 13248 | xmlChar * ret_val; |
| 13249 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13250 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13251 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13252 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13253 | mem_base = xmlMemBlocks(); |
| 13254 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13255 | |
| 13256 | ret_val = xmlTextReaderBaseUri(reader); |
| 13257 | desret_xmlChar_ptr(ret_val); |
| 13258 | call_tests++; |
| 13259 | des_xmlTextReaderPtr(n_reader, reader); |
| 13260 | xmlResetLastError(); |
| 13261 | if (mem_base != xmlMemBlocks()) { |
| 13262 | printf("Leak of %d blocks found in xmlTextReaderBaseUri", |
| 13263 | xmlMemBlocks() - mem_base); |
| 13264 | ret++; |
| 13265 | printf(" %d", n_reader); |
| 13266 | printf("\n"); |
| 13267 | } |
| 13268 | } |
| 13269 | #endif |
| 13270 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13271 | return(ret); |
| 13272 | } |
| 13273 | |
| 13274 | |
| 13275 | static int |
| 13276 | test_xmlTextReaderClose(void) { |
| 13277 | int ret = 0; |
| 13278 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13279 | #ifdef LIBXML_READER_ENABLED |
| 13280 | int mem_base; |
| 13281 | int ret_val; |
| 13282 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13283 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13284 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13285 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13286 | mem_base = xmlMemBlocks(); |
| 13287 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13288 | |
| 13289 | ret_val = xmlTextReaderClose(reader); |
| 13290 | desret_int(ret_val); |
| 13291 | call_tests++; |
| 13292 | des_xmlTextReaderPtr(n_reader, reader); |
| 13293 | xmlResetLastError(); |
| 13294 | if (mem_base != xmlMemBlocks()) { |
| 13295 | printf("Leak of %d blocks found in xmlTextReaderClose", |
| 13296 | xmlMemBlocks() - mem_base); |
| 13297 | ret++; |
| 13298 | printf(" %d", n_reader); |
| 13299 | printf("\n"); |
| 13300 | } |
| 13301 | } |
| 13302 | #endif |
| 13303 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13304 | return(ret); |
| 13305 | } |
| 13306 | |
| 13307 | |
| 13308 | static int |
| 13309 | test_xmlTextReaderConstBaseUri(void) { |
| 13310 | int ret = 0; |
| 13311 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13312 | #ifdef LIBXML_READER_ENABLED |
| 13313 | int mem_base; |
| 13314 | const xmlChar * ret_val; |
| 13315 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13316 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13317 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13318 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13319 | mem_base = xmlMemBlocks(); |
| 13320 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13321 | |
| 13322 | ret_val = xmlTextReaderConstBaseUri(reader); |
| 13323 | desret_const_xmlChar_ptr(ret_val); |
| 13324 | call_tests++; |
| 13325 | des_xmlTextReaderPtr(n_reader, reader); |
| 13326 | xmlResetLastError(); |
| 13327 | if (mem_base != xmlMemBlocks()) { |
| 13328 | printf("Leak of %d blocks found in xmlTextReaderConstBaseUri", |
| 13329 | xmlMemBlocks() - mem_base); |
| 13330 | ret++; |
| 13331 | printf(" %d", n_reader); |
| 13332 | printf("\n"); |
| 13333 | } |
| 13334 | } |
| 13335 | #endif |
| 13336 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13337 | return(ret); |
| 13338 | } |
| 13339 | |
| 13340 | |
| 13341 | static int |
| 13342 | test_xmlTextReaderConstEncoding(void) { |
| 13343 | int ret = 0; |
| 13344 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13345 | #ifdef LIBXML_READER_ENABLED |
| 13346 | int mem_base; |
| 13347 | const xmlChar * ret_val; |
| 13348 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13349 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13350 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13351 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13352 | mem_base = xmlMemBlocks(); |
| 13353 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13354 | |
| 13355 | ret_val = xmlTextReaderConstEncoding(reader); |
| 13356 | desret_const_xmlChar_ptr(ret_val); |
| 13357 | call_tests++; |
| 13358 | des_xmlTextReaderPtr(n_reader, reader); |
| 13359 | xmlResetLastError(); |
| 13360 | if (mem_base != xmlMemBlocks()) { |
| 13361 | printf("Leak of %d blocks found in xmlTextReaderConstEncoding", |
| 13362 | xmlMemBlocks() - mem_base); |
| 13363 | ret++; |
| 13364 | printf(" %d", n_reader); |
| 13365 | printf("\n"); |
| 13366 | } |
| 13367 | } |
| 13368 | #endif |
| 13369 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13370 | return(ret); |
| 13371 | } |
| 13372 | |
| 13373 | |
| 13374 | static int |
| 13375 | test_xmlTextReaderConstLocalName(void) { |
| 13376 | int ret = 0; |
| 13377 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13378 | #ifdef LIBXML_READER_ENABLED |
| 13379 | int mem_base; |
| 13380 | const xmlChar * ret_val; |
| 13381 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13382 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13383 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13384 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13385 | mem_base = xmlMemBlocks(); |
| 13386 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13387 | |
| 13388 | ret_val = xmlTextReaderConstLocalName(reader); |
| 13389 | desret_const_xmlChar_ptr(ret_val); |
| 13390 | call_tests++; |
| 13391 | des_xmlTextReaderPtr(n_reader, reader); |
| 13392 | xmlResetLastError(); |
| 13393 | if (mem_base != xmlMemBlocks()) { |
| 13394 | printf("Leak of %d blocks found in xmlTextReaderConstLocalName", |
| 13395 | xmlMemBlocks() - mem_base); |
| 13396 | ret++; |
| 13397 | printf(" %d", n_reader); |
| 13398 | printf("\n"); |
| 13399 | } |
| 13400 | } |
| 13401 | #endif |
| 13402 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13403 | return(ret); |
| 13404 | } |
| 13405 | |
| 13406 | |
| 13407 | static int |
| 13408 | test_xmlTextReaderConstName(void) { |
| 13409 | int ret = 0; |
| 13410 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13411 | #ifdef LIBXML_READER_ENABLED |
| 13412 | int mem_base; |
| 13413 | const xmlChar * ret_val; |
| 13414 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13415 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13416 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13417 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13418 | mem_base = xmlMemBlocks(); |
| 13419 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13420 | |
| 13421 | ret_val = xmlTextReaderConstName(reader); |
| 13422 | desret_const_xmlChar_ptr(ret_val); |
| 13423 | call_tests++; |
| 13424 | des_xmlTextReaderPtr(n_reader, reader); |
| 13425 | xmlResetLastError(); |
| 13426 | if (mem_base != xmlMemBlocks()) { |
| 13427 | printf("Leak of %d blocks found in xmlTextReaderConstName", |
| 13428 | xmlMemBlocks() - mem_base); |
| 13429 | ret++; |
| 13430 | printf(" %d", n_reader); |
| 13431 | printf("\n"); |
| 13432 | } |
| 13433 | } |
| 13434 | #endif |
| 13435 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13436 | return(ret); |
| 13437 | } |
| 13438 | |
| 13439 | |
| 13440 | static int |
| 13441 | test_xmlTextReaderConstNamespaceUri(void) { |
| 13442 | int ret = 0; |
| 13443 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13444 | #ifdef LIBXML_READER_ENABLED |
| 13445 | int mem_base; |
| 13446 | const xmlChar * ret_val; |
| 13447 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13448 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13449 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13450 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13451 | mem_base = xmlMemBlocks(); |
| 13452 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13453 | |
| 13454 | ret_val = xmlTextReaderConstNamespaceUri(reader); |
| 13455 | desret_const_xmlChar_ptr(ret_val); |
| 13456 | call_tests++; |
| 13457 | des_xmlTextReaderPtr(n_reader, reader); |
| 13458 | xmlResetLastError(); |
| 13459 | if (mem_base != xmlMemBlocks()) { |
| 13460 | printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri", |
| 13461 | xmlMemBlocks() - mem_base); |
| 13462 | ret++; |
| 13463 | printf(" %d", n_reader); |
| 13464 | printf("\n"); |
| 13465 | } |
| 13466 | } |
| 13467 | #endif |
| 13468 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13469 | return(ret); |
| 13470 | } |
| 13471 | |
| 13472 | |
| 13473 | static int |
| 13474 | test_xmlTextReaderConstPrefix(void) { |
| 13475 | int ret = 0; |
| 13476 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13477 | #ifdef LIBXML_READER_ENABLED |
| 13478 | int mem_base; |
| 13479 | const xmlChar * ret_val; |
| 13480 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13481 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13482 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13483 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13484 | mem_base = xmlMemBlocks(); |
| 13485 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13486 | |
| 13487 | ret_val = xmlTextReaderConstPrefix(reader); |
| 13488 | desret_const_xmlChar_ptr(ret_val); |
| 13489 | call_tests++; |
| 13490 | des_xmlTextReaderPtr(n_reader, reader); |
| 13491 | xmlResetLastError(); |
| 13492 | if (mem_base != xmlMemBlocks()) { |
| 13493 | printf("Leak of %d blocks found in xmlTextReaderConstPrefix", |
| 13494 | xmlMemBlocks() - mem_base); |
| 13495 | ret++; |
| 13496 | printf(" %d", n_reader); |
| 13497 | printf("\n"); |
| 13498 | } |
| 13499 | } |
| 13500 | #endif |
| 13501 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13502 | return(ret); |
| 13503 | } |
| 13504 | |
| 13505 | |
| 13506 | static int |
| 13507 | test_xmlTextReaderConstString(void) { |
| 13508 | int ret = 0; |
| 13509 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13510 | #ifdef LIBXML_READER_ENABLED |
| 13511 | int mem_base; |
| 13512 | const xmlChar * ret_val; |
| 13513 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13514 | int n_reader; |
| 13515 | const xmlChar * str; /* the string to intern. */ |
| 13516 | int n_str; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13517 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13518 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13519 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 13520 | mem_base = xmlMemBlocks(); |
| 13521 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13522 | str = gen_const_xmlChar_ptr(n_str); |
| 13523 | |
| 13524 | ret_val = xmlTextReaderConstString(reader, str); |
| 13525 | desret_const_xmlChar_ptr(ret_val); |
| 13526 | call_tests++; |
| 13527 | des_xmlTextReaderPtr(n_reader, reader); |
| 13528 | des_const_xmlChar_ptr(n_str, str); |
| 13529 | xmlResetLastError(); |
| 13530 | if (mem_base != xmlMemBlocks()) { |
| 13531 | printf("Leak of %d blocks found in xmlTextReaderConstString", |
| 13532 | xmlMemBlocks() - mem_base); |
| 13533 | ret++; |
| 13534 | printf(" %d", n_reader); |
| 13535 | printf(" %d", n_str); |
| 13536 | printf("\n"); |
| 13537 | } |
| 13538 | } |
| 13539 | } |
| 13540 | #endif |
| 13541 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13542 | return(ret); |
| 13543 | } |
| 13544 | |
| 13545 | |
| 13546 | static int |
| 13547 | test_xmlTextReaderConstValue(void) { |
| 13548 | int ret = 0; |
| 13549 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13550 | #ifdef LIBXML_READER_ENABLED |
| 13551 | int mem_base; |
| 13552 | const xmlChar * ret_val; |
| 13553 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13554 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13555 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13556 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13557 | mem_base = xmlMemBlocks(); |
| 13558 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13559 | |
| 13560 | ret_val = xmlTextReaderConstValue(reader); |
| 13561 | desret_const_xmlChar_ptr(ret_val); |
| 13562 | call_tests++; |
| 13563 | des_xmlTextReaderPtr(n_reader, reader); |
| 13564 | xmlResetLastError(); |
| 13565 | if (mem_base != xmlMemBlocks()) { |
| 13566 | printf("Leak of %d blocks found in xmlTextReaderConstValue", |
| 13567 | xmlMemBlocks() - mem_base); |
| 13568 | ret++; |
| 13569 | printf(" %d", n_reader); |
| 13570 | printf("\n"); |
| 13571 | } |
| 13572 | } |
| 13573 | #endif |
| 13574 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13575 | return(ret); |
| 13576 | } |
| 13577 | |
| 13578 | |
| 13579 | static int |
| 13580 | test_xmlTextReaderConstXmlLang(void) { |
| 13581 | int ret = 0; |
| 13582 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13583 | #ifdef LIBXML_READER_ENABLED |
| 13584 | int mem_base; |
| 13585 | const xmlChar * ret_val; |
| 13586 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13587 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13588 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13589 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13590 | mem_base = xmlMemBlocks(); |
| 13591 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13592 | |
| 13593 | ret_val = xmlTextReaderConstXmlLang(reader); |
| 13594 | desret_const_xmlChar_ptr(ret_val); |
| 13595 | call_tests++; |
| 13596 | des_xmlTextReaderPtr(n_reader, reader); |
| 13597 | xmlResetLastError(); |
| 13598 | if (mem_base != xmlMemBlocks()) { |
| 13599 | printf("Leak of %d blocks found in xmlTextReaderConstXmlLang", |
| 13600 | xmlMemBlocks() - mem_base); |
| 13601 | ret++; |
| 13602 | printf(" %d", n_reader); |
| 13603 | printf("\n"); |
| 13604 | } |
| 13605 | } |
| 13606 | #endif |
| 13607 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13608 | return(ret); |
| 13609 | } |
| 13610 | |
| 13611 | |
| 13612 | static int |
| 13613 | test_xmlTextReaderConstXmlVersion(void) { |
| 13614 | int ret = 0; |
| 13615 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13616 | #ifdef LIBXML_READER_ENABLED |
| 13617 | int mem_base; |
| 13618 | const xmlChar * ret_val; |
| 13619 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13620 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13621 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 13622 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13623 | mem_base = xmlMemBlocks(); |
| 13624 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13625 | |
| 13626 | ret_val = xmlTextReaderConstXmlVersion(reader); |
| 13627 | desret_const_xmlChar_ptr(ret_val); |
| 13628 | call_tests++; |
| 13629 | des_xmlTextReaderPtr(n_reader, reader); |
| 13630 | xmlResetLastError(); |
| 13631 | if (mem_base != xmlMemBlocks()) { |
| 13632 | printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion", |
| 13633 | xmlMemBlocks() - mem_base); |
| 13634 | ret++; |
| 13635 | printf(" %d", n_reader); |
| 13636 | printf("\n"); |
| 13637 | } |
| 13638 | } |
| 13639 | #endif |
| 13640 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13641 | return(ret); |
| 13642 | } |
| 13643 | |
| 13644 | |
| 13645 | static int |
| 13646 | test_xmlTextReaderCurrentDoc(void) { |
| 13647 | int ret = 0; |
| 13648 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13649 | #ifdef LIBXML_READER_ENABLED |
| 13650 | int mem_base; |
| 13651 | xmlDocPtr ret_val; |
| 13652 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13653 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13654 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13655 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13656 | mem_base = xmlMemBlocks(); |
| 13657 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13658 | |
| 13659 | ret_val = xmlTextReaderCurrentDoc(reader); |
| 13660 | desret_xmlDocPtr(ret_val); |
| 13661 | call_tests++; |
| 13662 | des_xmlTextReaderPtr(n_reader, reader); |
| 13663 | xmlResetLastError(); |
| 13664 | if (mem_base != xmlMemBlocks()) { |
| 13665 | printf("Leak of %d blocks found in xmlTextReaderCurrentDoc", |
| 13666 | xmlMemBlocks() - mem_base); |
| 13667 | ret++; |
| 13668 | printf(" %d", n_reader); |
| 13669 | printf("\n"); |
| 13670 | } |
| 13671 | } |
| 13672 | #endif |
| 13673 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13674 | return(ret); |
| 13675 | } |
| 13676 | |
| 13677 | |
| 13678 | static int |
| 13679 | test_xmlTextReaderCurrentNode(void) { |
| 13680 | int ret = 0; |
| 13681 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13682 | #ifdef LIBXML_READER_ENABLED |
| 13683 | int mem_base; |
| 13684 | xmlNodePtr ret_val; |
| 13685 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13686 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13687 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13688 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13689 | mem_base = xmlMemBlocks(); |
| 13690 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13691 | |
| 13692 | ret_val = xmlTextReaderCurrentNode(reader); |
| 13693 | desret_xmlNodePtr(ret_val); |
| 13694 | call_tests++; |
| 13695 | des_xmlTextReaderPtr(n_reader, reader); |
| 13696 | xmlResetLastError(); |
| 13697 | if (mem_base != xmlMemBlocks()) { |
| 13698 | printf("Leak of %d blocks found in xmlTextReaderCurrentNode", |
| 13699 | xmlMemBlocks() - mem_base); |
| 13700 | ret++; |
| 13701 | printf(" %d", n_reader); |
| 13702 | printf("\n"); |
| 13703 | } |
| 13704 | } |
| 13705 | #endif |
| 13706 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13707 | return(ret); |
| 13708 | } |
| 13709 | |
| 13710 | |
| 13711 | static int |
| 13712 | test_xmlTextReaderDepth(void) { |
| 13713 | int ret = 0; |
| 13714 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13715 | #ifdef LIBXML_READER_ENABLED |
| 13716 | int mem_base; |
| 13717 | int ret_val; |
| 13718 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13719 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13720 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13721 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13722 | mem_base = xmlMemBlocks(); |
| 13723 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13724 | |
| 13725 | ret_val = xmlTextReaderDepth(reader); |
| 13726 | desret_int(ret_val); |
| 13727 | call_tests++; |
| 13728 | des_xmlTextReaderPtr(n_reader, reader); |
| 13729 | xmlResetLastError(); |
| 13730 | if (mem_base != xmlMemBlocks()) { |
| 13731 | printf("Leak of %d blocks found in xmlTextReaderDepth", |
| 13732 | xmlMemBlocks() - mem_base); |
| 13733 | ret++; |
| 13734 | printf(" %d", n_reader); |
| 13735 | printf("\n"); |
| 13736 | } |
| 13737 | } |
| 13738 | #endif |
| 13739 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13740 | return(ret); |
| 13741 | } |
| 13742 | |
| 13743 | |
| 13744 | static int |
| 13745 | test_xmlTextReaderExpand(void) { |
| 13746 | int ret = 0; |
| 13747 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13748 | #ifdef LIBXML_READER_ENABLED |
| 13749 | int mem_base; |
| 13750 | xmlNodePtr ret_val; |
| 13751 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13752 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13753 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13754 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13755 | mem_base = xmlMemBlocks(); |
| 13756 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13757 | |
| 13758 | ret_val = xmlTextReaderExpand(reader); |
| 13759 | desret_xmlNodePtr(ret_val); |
| 13760 | call_tests++; |
| 13761 | des_xmlTextReaderPtr(n_reader, reader); |
| 13762 | xmlResetLastError(); |
| 13763 | if (mem_base != xmlMemBlocks()) { |
| 13764 | printf("Leak of %d blocks found in xmlTextReaderExpand", |
| 13765 | xmlMemBlocks() - mem_base); |
| 13766 | ret++; |
| 13767 | printf(" %d", n_reader); |
| 13768 | printf("\n"); |
| 13769 | } |
| 13770 | } |
| 13771 | #endif |
| 13772 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13773 | return(ret); |
| 13774 | } |
| 13775 | |
| 13776 | |
| 13777 | static int |
| 13778 | test_xmlTextReaderGetAttribute(void) { |
| 13779 | int ret = 0; |
| 13780 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13781 | #ifdef LIBXML_READER_ENABLED |
| 13782 | int mem_base; |
| 13783 | xmlChar * ret_val; |
| 13784 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13785 | int n_reader; |
| 13786 | const xmlChar * name; /* the qualified name of the attribute. */ |
| 13787 | int n_name; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13788 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13789 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13790 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 13791 | mem_base = xmlMemBlocks(); |
| 13792 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13793 | name = gen_const_xmlChar_ptr(n_name); |
| 13794 | |
| 13795 | ret_val = xmlTextReaderGetAttribute(reader, name); |
| 13796 | desret_xmlChar_ptr(ret_val); |
| 13797 | call_tests++; |
| 13798 | des_xmlTextReaderPtr(n_reader, reader); |
| 13799 | des_const_xmlChar_ptr(n_name, name); |
| 13800 | xmlResetLastError(); |
| 13801 | if (mem_base != xmlMemBlocks()) { |
| 13802 | printf("Leak of %d blocks found in xmlTextReaderGetAttribute", |
| 13803 | xmlMemBlocks() - mem_base); |
| 13804 | ret++; |
| 13805 | printf(" %d", n_reader); |
| 13806 | printf(" %d", n_name); |
| 13807 | printf("\n"); |
| 13808 | } |
| 13809 | } |
| 13810 | } |
| 13811 | #endif |
| 13812 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13813 | return(ret); |
| 13814 | } |
| 13815 | |
| 13816 | |
| 13817 | static int |
| 13818 | test_xmlTextReaderGetAttributeNo(void) { |
| 13819 | int ret = 0; |
| 13820 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13821 | #ifdef LIBXML_READER_ENABLED |
| 13822 | int mem_base; |
| 13823 | xmlChar * ret_val; |
| 13824 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13825 | int n_reader; |
| 13826 | int no; /* the zero-based index of the attribute relative to the containing element */ |
| 13827 | int n_no; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13828 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13829 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13830 | for (n_no = 0;n_no < gen_nb_int;n_no++) { |
| 13831 | mem_base = xmlMemBlocks(); |
| 13832 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13833 | no = gen_int(n_no); |
| 13834 | |
| 13835 | ret_val = xmlTextReaderGetAttributeNo(reader, no); |
| 13836 | desret_xmlChar_ptr(ret_val); |
| 13837 | call_tests++; |
| 13838 | des_xmlTextReaderPtr(n_reader, reader); |
| 13839 | des_int(n_no, no); |
| 13840 | xmlResetLastError(); |
| 13841 | if (mem_base != xmlMemBlocks()) { |
| 13842 | printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo", |
| 13843 | xmlMemBlocks() - mem_base); |
| 13844 | ret++; |
| 13845 | printf(" %d", n_reader); |
| 13846 | printf(" %d", n_no); |
| 13847 | printf("\n"); |
| 13848 | } |
| 13849 | } |
| 13850 | } |
| 13851 | #endif |
| 13852 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13853 | return(ret); |
| 13854 | } |
| 13855 | |
| 13856 | |
| 13857 | static int |
| 13858 | test_xmlTextReaderGetAttributeNs(void) { |
| 13859 | int ret = 0; |
| 13860 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13861 | #ifdef LIBXML_READER_ENABLED |
| 13862 | int mem_base; |
| 13863 | xmlChar * ret_val; |
| 13864 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13865 | int n_reader; |
| 13866 | const xmlChar * localName; /* the local name of the attribute. */ |
| 13867 | int n_localName; |
| 13868 | const xmlChar * namespaceURI; /* the namespace URI of the attribute. */ |
| 13869 | int n_namespaceURI; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13870 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13871 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13872 | for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) { |
| 13873 | for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { |
| 13874 | mem_base = xmlMemBlocks(); |
| 13875 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13876 | localName = gen_const_xmlChar_ptr(n_localName); |
| 13877 | namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI); |
| 13878 | |
| 13879 | ret_val = xmlTextReaderGetAttributeNs(reader, localName, namespaceURI); |
| 13880 | desret_xmlChar_ptr(ret_val); |
| 13881 | call_tests++; |
| 13882 | des_xmlTextReaderPtr(n_reader, reader); |
| 13883 | des_const_xmlChar_ptr(n_localName, localName); |
| 13884 | des_const_xmlChar_ptr(n_namespaceURI, namespaceURI); |
| 13885 | xmlResetLastError(); |
| 13886 | if (mem_base != xmlMemBlocks()) { |
| 13887 | printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs", |
| 13888 | xmlMemBlocks() - mem_base); |
| 13889 | ret++; |
| 13890 | printf(" %d", n_reader); |
| 13891 | printf(" %d", n_localName); |
| 13892 | printf(" %d", n_namespaceURI); |
| 13893 | printf("\n"); |
| 13894 | } |
| 13895 | } |
| 13896 | } |
| 13897 | } |
| 13898 | #endif |
| 13899 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13900 | return(ret); |
| 13901 | } |
| 13902 | |
| 13903 | |
| 13904 | static int |
| 13905 | test_xmlTextReaderGetErrorHandler(void) { |
| 13906 | int ret = 0; |
| 13907 | |
| 13908 | |
| 13909 | /* missing type support */ |
| 13910 | return(ret); |
| 13911 | } |
| 13912 | |
| 13913 | |
| 13914 | static int |
| 13915 | test_xmlTextReaderGetParserProp(void) { |
| 13916 | int ret = 0; |
| 13917 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13918 | #ifdef LIBXML_READER_ENABLED |
| 13919 | int mem_base; |
| 13920 | int ret_val; |
| 13921 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13922 | int n_reader; |
| 13923 | int prop; /* the xmlParserProperties to get */ |
| 13924 | int n_prop; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13925 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13926 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13927 | for (n_prop = 0;n_prop < gen_nb_int;n_prop++) { |
| 13928 | mem_base = xmlMemBlocks(); |
| 13929 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13930 | prop = gen_int(n_prop); |
| 13931 | |
| 13932 | ret_val = xmlTextReaderGetParserProp(reader, prop); |
| 13933 | desret_int(ret_val); |
| 13934 | call_tests++; |
| 13935 | des_xmlTextReaderPtr(n_reader, reader); |
| 13936 | des_int(n_prop, prop); |
| 13937 | xmlResetLastError(); |
| 13938 | if (mem_base != xmlMemBlocks()) { |
| 13939 | printf("Leak of %d blocks found in xmlTextReaderGetParserProp", |
| 13940 | xmlMemBlocks() - mem_base); |
| 13941 | ret++; |
| 13942 | printf(" %d", n_reader); |
| 13943 | printf(" %d", n_prop); |
| 13944 | printf("\n"); |
| 13945 | } |
| 13946 | } |
| 13947 | } |
| 13948 | #endif |
| 13949 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13950 | return(ret); |
| 13951 | } |
| 13952 | |
| 13953 | |
| 13954 | static int |
| 13955 | test_xmlTextReaderGetRemainder(void) { |
| 13956 | int ret = 0; |
| 13957 | |
| 13958 | |
| 13959 | /* missing type support */ |
| 13960 | return(ret); |
| 13961 | } |
| 13962 | |
| 13963 | |
| 13964 | static int |
| 13965 | test_xmlTextReaderHasAttributes(void) { |
| 13966 | int ret = 0; |
| 13967 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13968 | #ifdef LIBXML_READER_ENABLED |
| 13969 | int mem_base; |
| 13970 | int ret_val; |
| 13971 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 13972 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13973 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 13974 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 13975 | mem_base = xmlMemBlocks(); |
| 13976 | reader = gen_xmlTextReaderPtr(n_reader); |
| 13977 | |
| 13978 | ret_val = xmlTextReaderHasAttributes(reader); |
| 13979 | desret_int(ret_val); |
| 13980 | call_tests++; |
| 13981 | des_xmlTextReaderPtr(n_reader, reader); |
| 13982 | xmlResetLastError(); |
| 13983 | if (mem_base != xmlMemBlocks()) { |
| 13984 | printf("Leak of %d blocks found in xmlTextReaderHasAttributes", |
| 13985 | xmlMemBlocks() - mem_base); |
| 13986 | ret++; |
| 13987 | printf(" %d", n_reader); |
| 13988 | printf("\n"); |
| 13989 | } |
| 13990 | } |
| 13991 | #endif |
| 13992 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 13993 | return(ret); |
| 13994 | } |
| 13995 | |
| 13996 | |
| 13997 | static int |
| 13998 | test_xmlTextReaderHasValue(void) { |
| 13999 | int ret = 0; |
| 14000 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14001 | #ifdef LIBXML_READER_ENABLED |
| 14002 | int mem_base; |
| 14003 | int ret_val; |
| 14004 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14005 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14006 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14007 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14008 | mem_base = xmlMemBlocks(); |
| 14009 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14010 | |
| 14011 | ret_val = xmlTextReaderHasValue(reader); |
| 14012 | desret_int(ret_val); |
| 14013 | call_tests++; |
| 14014 | des_xmlTextReaderPtr(n_reader, reader); |
| 14015 | xmlResetLastError(); |
| 14016 | if (mem_base != xmlMemBlocks()) { |
| 14017 | printf("Leak of %d blocks found in xmlTextReaderHasValue", |
| 14018 | xmlMemBlocks() - mem_base); |
| 14019 | ret++; |
| 14020 | printf(" %d", n_reader); |
| 14021 | printf("\n"); |
| 14022 | } |
| 14023 | } |
| 14024 | #endif |
| 14025 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14026 | return(ret); |
| 14027 | } |
| 14028 | |
| 14029 | |
| 14030 | static int |
| 14031 | test_xmlTextReaderIsDefault(void) { |
| 14032 | int ret = 0; |
| 14033 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14034 | #ifdef LIBXML_READER_ENABLED |
| 14035 | int mem_base; |
| 14036 | int ret_val; |
| 14037 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14038 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14039 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14040 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14041 | mem_base = xmlMemBlocks(); |
| 14042 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14043 | |
| 14044 | ret_val = xmlTextReaderIsDefault(reader); |
| 14045 | desret_int(ret_val); |
| 14046 | call_tests++; |
| 14047 | des_xmlTextReaderPtr(n_reader, reader); |
| 14048 | xmlResetLastError(); |
| 14049 | if (mem_base != xmlMemBlocks()) { |
| 14050 | printf("Leak of %d blocks found in xmlTextReaderIsDefault", |
| 14051 | xmlMemBlocks() - mem_base); |
| 14052 | ret++; |
| 14053 | printf(" %d", n_reader); |
| 14054 | printf("\n"); |
| 14055 | } |
| 14056 | } |
| 14057 | #endif |
| 14058 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14059 | return(ret); |
| 14060 | } |
| 14061 | |
| 14062 | |
| 14063 | static int |
| 14064 | test_xmlTextReaderIsEmptyElement(void) { |
| 14065 | int ret = 0; |
| 14066 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14067 | #ifdef LIBXML_READER_ENABLED |
| 14068 | int mem_base; |
| 14069 | int ret_val; |
| 14070 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14071 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14072 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14073 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14074 | mem_base = xmlMemBlocks(); |
| 14075 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14076 | |
| 14077 | ret_val = xmlTextReaderIsEmptyElement(reader); |
| 14078 | desret_int(ret_val); |
| 14079 | call_tests++; |
| 14080 | des_xmlTextReaderPtr(n_reader, reader); |
| 14081 | xmlResetLastError(); |
| 14082 | if (mem_base != xmlMemBlocks()) { |
| 14083 | printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement", |
| 14084 | xmlMemBlocks() - mem_base); |
| 14085 | ret++; |
| 14086 | printf(" %d", n_reader); |
| 14087 | printf("\n"); |
| 14088 | } |
| 14089 | } |
| 14090 | #endif |
| 14091 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14092 | return(ret); |
| 14093 | } |
| 14094 | |
| 14095 | |
| 14096 | static int |
| 14097 | test_xmlTextReaderIsNamespaceDecl(void) { |
| 14098 | int ret = 0; |
| 14099 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14100 | #ifdef LIBXML_READER_ENABLED |
| 14101 | int mem_base; |
| 14102 | int ret_val; |
| 14103 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14104 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14105 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14106 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14107 | mem_base = xmlMemBlocks(); |
| 14108 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14109 | |
| 14110 | ret_val = xmlTextReaderIsNamespaceDecl(reader); |
| 14111 | desret_int(ret_val); |
| 14112 | call_tests++; |
| 14113 | des_xmlTextReaderPtr(n_reader, reader); |
| 14114 | xmlResetLastError(); |
| 14115 | if (mem_base != xmlMemBlocks()) { |
| 14116 | printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl", |
| 14117 | xmlMemBlocks() - mem_base); |
| 14118 | ret++; |
| 14119 | printf(" %d", n_reader); |
| 14120 | printf("\n"); |
| 14121 | } |
| 14122 | } |
| 14123 | #endif |
| 14124 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14125 | return(ret); |
| 14126 | } |
| 14127 | |
| 14128 | |
| 14129 | static int |
| 14130 | test_xmlTextReaderIsValid(void) { |
| 14131 | int ret = 0; |
| 14132 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14133 | #ifdef LIBXML_READER_ENABLED |
| 14134 | int mem_base; |
| 14135 | int ret_val; |
| 14136 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14137 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14138 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14139 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14140 | mem_base = xmlMemBlocks(); |
| 14141 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14142 | |
| 14143 | ret_val = xmlTextReaderIsValid(reader); |
| 14144 | desret_int(ret_val); |
| 14145 | call_tests++; |
| 14146 | des_xmlTextReaderPtr(n_reader, reader); |
| 14147 | xmlResetLastError(); |
| 14148 | if (mem_base != xmlMemBlocks()) { |
| 14149 | printf("Leak of %d blocks found in xmlTextReaderIsValid", |
| 14150 | xmlMemBlocks() - mem_base); |
| 14151 | ret++; |
| 14152 | printf(" %d", n_reader); |
| 14153 | printf("\n"); |
| 14154 | } |
| 14155 | } |
| 14156 | #endif |
| 14157 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14158 | return(ret); |
| 14159 | } |
| 14160 | |
| 14161 | |
| 14162 | static int |
| 14163 | test_xmlTextReaderLocalName(void) { |
| 14164 | int ret = 0; |
| 14165 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14166 | #ifdef LIBXML_READER_ENABLED |
| 14167 | int mem_base; |
| 14168 | xmlChar * ret_val; |
| 14169 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14170 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14171 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14172 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14173 | mem_base = xmlMemBlocks(); |
| 14174 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14175 | |
| 14176 | ret_val = xmlTextReaderLocalName(reader); |
| 14177 | desret_xmlChar_ptr(ret_val); |
| 14178 | call_tests++; |
| 14179 | des_xmlTextReaderPtr(n_reader, reader); |
| 14180 | xmlResetLastError(); |
| 14181 | if (mem_base != xmlMemBlocks()) { |
| 14182 | printf("Leak of %d blocks found in xmlTextReaderLocalName", |
| 14183 | xmlMemBlocks() - mem_base); |
| 14184 | ret++; |
| 14185 | printf(" %d", n_reader); |
| 14186 | printf("\n"); |
| 14187 | } |
| 14188 | } |
| 14189 | #endif |
| 14190 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14191 | return(ret); |
| 14192 | } |
| 14193 | |
| 14194 | |
| 14195 | static int |
| 14196 | test_xmlTextReaderLocatorBaseURI(void) { |
| 14197 | int ret = 0; |
| 14198 | |
| 14199 | |
| 14200 | /* missing type support */ |
| 14201 | return(ret); |
| 14202 | } |
| 14203 | |
| 14204 | |
| 14205 | static int |
| 14206 | test_xmlTextReaderLocatorLineNumber(void) { |
| 14207 | int ret = 0; |
| 14208 | |
| 14209 | |
| 14210 | /* missing type support */ |
| 14211 | return(ret); |
| 14212 | } |
| 14213 | |
| 14214 | |
| 14215 | static int |
| 14216 | test_xmlTextReaderLookupNamespace(void) { |
| 14217 | int ret = 0; |
| 14218 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14219 | #ifdef LIBXML_READER_ENABLED |
| 14220 | int mem_base; |
| 14221 | xmlChar * ret_val; |
| 14222 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14223 | int n_reader; |
| 14224 | const xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */ |
| 14225 | int n_prefix; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14226 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14227 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14228 | for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { |
| 14229 | mem_base = xmlMemBlocks(); |
| 14230 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14231 | prefix = gen_const_xmlChar_ptr(n_prefix); |
| 14232 | |
| 14233 | ret_val = xmlTextReaderLookupNamespace(reader, prefix); |
| 14234 | desret_xmlChar_ptr(ret_val); |
| 14235 | call_tests++; |
| 14236 | des_xmlTextReaderPtr(n_reader, reader); |
| 14237 | des_const_xmlChar_ptr(n_prefix, prefix); |
| 14238 | xmlResetLastError(); |
| 14239 | if (mem_base != xmlMemBlocks()) { |
| 14240 | printf("Leak of %d blocks found in xmlTextReaderLookupNamespace", |
| 14241 | xmlMemBlocks() - mem_base); |
| 14242 | ret++; |
| 14243 | printf(" %d", n_reader); |
| 14244 | printf(" %d", n_prefix); |
| 14245 | printf("\n"); |
| 14246 | } |
| 14247 | } |
| 14248 | } |
| 14249 | #endif |
| 14250 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14251 | return(ret); |
| 14252 | } |
| 14253 | |
| 14254 | |
| 14255 | static int |
| 14256 | test_xmlTextReaderMoveToAttribute(void) { |
| 14257 | int ret = 0; |
| 14258 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14259 | #ifdef LIBXML_READER_ENABLED |
| 14260 | int mem_base; |
| 14261 | int ret_val; |
| 14262 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14263 | int n_reader; |
| 14264 | const xmlChar * name; /* the qualified name of the attribute. */ |
| 14265 | int n_name; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14266 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14267 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14268 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 14269 | mem_base = xmlMemBlocks(); |
| 14270 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14271 | name = gen_const_xmlChar_ptr(n_name); |
| 14272 | |
| 14273 | ret_val = xmlTextReaderMoveToAttribute(reader, name); |
| 14274 | desret_int(ret_val); |
| 14275 | call_tests++; |
| 14276 | des_xmlTextReaderPtr(n_reader, reader); |
| 14277 | des_const_xmlChar_ptr(n_name, name); |
| 14278 | xmlResetLastError(); |
| 14279 | if (mem_base != xmlMemBlocks()) { |
| 14280 | printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute", |
| 14281 | xmlMemBlocks() - mem_base); |
| 14282 | ret++; |
| 14283 | printf(" %d", n_reader); |
| 14284 | printf(" %d", n_name); |
| 14285 | printf("\n"); |
| 14286 | } |
| 14287 | } |
| 14288 | } |
| 14289 | #endif |
| 14290 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14291 | return(ret); |
| 14292 | } |
| 14293 | |
| 14294 | |
| 14295 | static int |
| 14296 | test_xmlTextReaderMoveToAttributeNo(void) { |
| 14297 | int ret = 0; |
| 14298 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14299 | #ifdef LIBXML_READER_ENABLED |
| 14300 | int mem_base; |
| 14301 | int ret_val; |
| 14302 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14303 | int n_reader; |
| 14304 | int no; /* the zero-based index of the attribute relative to the containing element. */ |
| 14305 | int n_no; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14306 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14307 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14308 | for (n_no = 0;n_no < gen_nb_int;n_no++) { |
| 14309 | mem_base = xmlMemBlocks(); |
| 14310 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14311 | no = gen_int(n_no); |
| 14312 | |
| 14313 | ret_val = xmlTextReaderMoveToAttributeNo(reader, no); |
| 14314 | desret_int(ret_val); |
| 14315 | call_tests++; |
| 14316 | des_xmlTextReaderPtr(n_reader, reader); |
| 14317 | des_int(n_no, no); |
| 14318 | xmlResetLastError(); |
| 14319 | if (mem_base != xmlMemBlocks()) { |
| 14320 | printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo", |
| 14321 | xmlMemBlocks() - mem_base); |
| 14322 | ret++; |
| 14323 | printf(" %d", n_reader); |
| 14324 | printf(" %d", n_no); |
| 14325 | printf("\n"); |
| 14326 | } |
| 14327 | } |
| 14328 | } |
| 14329 | #endif |
| 14330 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14331 | return(ret); |
| 14332 | } |
| 14333 | |
| 14334 | |
| 14335 | static int |
| 14336 | test_xmlTextReaderMoveToAttributeNs(void) { |
| 14337 | int ret = 0; |
| 14338 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14339 | #ifdef LIBXML_READER_ENABLED |
| 14340 | int mem_base; |
| 14341 | int ret_val; |
| 14342 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14343 | int n_reader; |
| 14344 | const xmlChar * localName; /* the local name of the attribute. */ |
| 14345 | int n_localName; |
| 14346 | const xmlChar * namespaceURI; /* the namespace URI of the attribute. */ |
| 14347 | int n_namespaceURI; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14348 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14349 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14350 | for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) { |
| 14351 | for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { |
| 14352 | mem_base = xmlMemBlocks(); |
| 14353 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14354 | localName = gen_const_xmlChar_ptr(n_localName); |
| 14355 | namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI); |
| 14356 | |
| 14357 | ret_val = xmlTextReaderMoveToAttributeNs(reader, localName, namespaceURI); |
| 14358 | desret_int(ret_val); |
| 14359 | call_tests++; |
| 14360 | des_xmlTextReaderPtr(n_reader, reader); |
| 14361 | des_const_xmlChar_ptr(n_localName, localName); |
| 14362 | des_const_xmlChar_ptr(n_namespaceURI, namespaceURI); |
| 14363 | xmlResetLastError(); |
| 14364 | if (mem_base != xmlMemBlocks()) { |
| 14365 | printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs", |
| 14366 | xmlMemBlocks() - mem_base); |
| 14367 | ret++; |
| 14368 | printf(" %d", n_reader); |
| 14369 | printf(" %d", n_localName); |
| 14370 | printf(" %d", n_namespaceURI); |
| 14371 | printf("\n"); |
| 14372 | } |
| 14373 | } |
| 14374 | } |
| 14375 | } |
| 14376 | #endif |
| 14377 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14378 | return(ret); |
| 14379 | } |
| 14380 | |
| 14381 | |
| 14382 | static int |
| 14383 | test_xmlTextReaderMoveToElement(void) { |
| 14384 | int ret = 0; |
| 14385 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14386 | #ifdef LIBXML_READER_ENABLED |
| 14387 | int mem_base; |
| 14388 | int ret_val; |
| 14389 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14390 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14391 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14392 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14393 | mem_base = xmlMemBlocks(); |
| 14394 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14395 | |
| 14396 | ret_val = xmlTextReaderMoveToElement(reader); |
| 14397 | desret_int(ret_val); |
| 14398 | call_tests++; |
| 14399 | des_xmlTextReaderPtr(n_reader, reader); |
| 14400 | xmlResetLastError(); |
| 14401 | if (mem_base != xmlMemBlocks()) { |
| 14402 | printf("Leak of %d blocks found in xmlTextReaderMoveToElement", |
| 14403 | xmlMemBlocks() - mem_base); |
| 14404 | ret++; |
| 14405 | printf(" %d", n_reader); |
| 14406 | printf("\n"); |
| 14407 | } |
| 14408 | } |
| 14409 | #endif |
| 14410 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14411 | return(ret); |
| 14412 | } |
| 14413 | |
| 14414 | |
| 14415 | static int |
| 14416 | test_xmlTextReaderMoveToFirstAttribute(void) { |
| 14417 | int ret = 0; |
| 14418 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14419 | #ifdef LIBXML_READER_ENABLED |
| 14420 | int mem_base; |
| 14421 | int ret_val; |
| 14422 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14423 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14424 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14425 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14426 | mem_base = xmlMemBlocks(); |
| 14427 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14428 | |
| 14429 | ret_val = xmlTextReaderMoveToFirstAttribute(reader); |
| 14430 | desret_int(ret_val); |
| 14431 | call_tests++; |
| 14432 | des_xmlTextReaderPtr(n_reader, reader); |
| 14433 | xmlResetLastError(); |
| 14434 | if (mem_base != xmlMemBlocks()) { |
| 14435 | printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute", |
| 14436 | xmlMemBlocks() - mem_base); |
| 14437 | ret++; |
| 14438 | printf(" %d", n_reader); |
| 14439 | printf("\n"); |
| 14440 | } |
| 14441 | } |
| 14442 | #endif |
| 14443 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14444 | return(ret); |
| 14445 | } |
| 14446 | |
| 14447 | |
| 14448 | static int |
| 14449 | test_xmlTextReaderMoveToNextAttribute(void) { |
| 14450 | int ret = 0; |
| 14451 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14452 | #ifdef LIBXML_READER_ENABLED |
| 14453 | int mem_base; |
| 14454 | int ret_val; |
| 14455 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14456 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14457 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14458 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14459 | mem_base = xmlMemBlocks(); |
| 14460 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14461 | |
| 14462 | ret_val = xmlTextReaderMoveToNextAttribute(reader); |
| 14463 | desret_int(ret_val); |
| 14464 | call_tests++; |
| 14465 | des_xmlTextReaderPtr(n_reader, reader); |
| 14466 | xmlResetLastError(); |
| 14467 | if (mem_base != xmlMemBlocks()) { |
| 14468 | printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute", |
| 14469 | xmlMemBlocks() - mem_base); |
| 14470 | ret++; |
| 14471 | printf(" %d", n_reader); |
| 14472 | printf("\n"); |
| 14473 | } |
| 14474 | } |
| 14475 | #endif |
| 14476 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14477 | return(ret); |
| 14478 | } |
| 14479 | |
| 14480 | |
| 14481 | static int |
| 14482 | test_xmlTextReaderName(void) { |
| 14483 | int ret = 0; |
| 14484 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14485 | #ifdef LIBXML_READER_ENABLED |
| 14486 | int mem_base; |
| 14487 | xmlChar * ret_val; |
| 14488 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14489 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14490 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14491 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14492 | mem_base = xmlMemBlocks(); |
| 14493 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14494 | |
| 14495 | ret_val = xmlTextReaderName(reader); |
| 14496 | desret_xmlChar_ptr(ret_val); |
| 14497 | call_tests++; |
| 14498 | des_xmlTextReaderPtr(n_reader, reader); |
| 14499 | xmlResetLastError(); |
| 14500 | if (mem_base != xmlMemBlocks()) { |
| 14501 | printf("Leak of %d blocks found in xmlTextReaderName", |
| 14502 | xmlMemBlocks() - mem_base); |
| 14503 | ret++; |
| 14504 | printf(" %d", n_reader); |
| 14505 | printf("\n"); |
| 14506 | } |
| 14507 | } |
| 14508 | #endif |
| 14509 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14510 | return(ret); |
| 14511 | } |
| 14512 | |
| 14513 | |
| 14514 | static int |
| 14515 | test_xmlTextReaderNamespaceUri(void) { |
| 14516 | int ret = 0; |
| 14517 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14518 | #ifdef LIBXML_READER_ENABLED |
| 14519 | int mem_base; |
| 14520 | xmlChar * ret_val; |
| 14521 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14522 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14523 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14524 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14525 | mem_base = xmlMemBlocks(); |
| 14526 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14527 | |
| 14528 | ret_val = xmlTextReaderNamespaceUri(reader); |
| 14529 | desret_xmlChar_ptr(ret_val); |
| 14530 | call_tests++; |
| 14531 | des_xmlTextReaderPtr(n_reader, reader); |
| 14532 | xmlResetLastError(); |
| 14533 | if (mem_base != xmlMemBlocks()) { |
| 14534 | printf("Leak of %d blocks found in xmlTextReaderNamespaceUri", |
| 14535 | xmlMemBlocks() - mem_base); |
| 14536 | ret++; |
| 14537 | printf(" %d", n_reader); |
| 14538 | printf("\n"); |
| 14539 | } |
| 14540 | } |
| 14541 | #endif |
| 14542 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14543 | return(ret); |
| 14544 | } |
| 14545 | |
| 14546 | |
| 14547 | static int |
| 14548 | test_xmlTextReaderNext(void) { |
| 14549 | int ret = 0; |
| 14550 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14551 | #ifdef LIBXML_READER_ENABLED |
| 14552 | int mem_base; |
| 14553 | int ret_val; |
| 14554 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14555 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14556 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14557 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14558 | mem_base = xmlMemBlocks(); |
| 14559 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14560 | |
| 14561 | ret_val = xmlTextReaderNext(reader); |
| 14562 | desret_int(ret_val); |
| 14563 | call_tests++; |
| 14564 | des_xmlTextReaderPtr(n_reader, reader); |
| 14565 | xmlResetLastError(); |
| 14566 | if (mem_base != xmlMemBlocks()) { |
| 14567 | printf("Leak of %d blocks found in xmlTextReaderNext", |
| 14568 | xmlMemBlocks() - mem_base); |
| 14569 | ret++; |
| 14570 | printf(" %d", n_reader); |
| 14571 | printf("\n"); |
| 14572 | } |
| 14573 | } |
| 14574 | #endif |
| 14575 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14576 | return(ret); |
| 14577 | } |
| 14578 | |
| 14579 | |
| 14580 | static int |
| 14581 | test_xmlTextReaderNextSibling(void) { |
| 14582 | int ret = 0; |
| 14583 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14584 | #ifdef LIBXML_READER_ENABLED |
| 14585 | int mem_base; |
| 14586 | int ret_val; |
| 14587 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14588 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14589 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14590 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14591 | mem_base = xmlMemBlocks(); |
| 14592 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14593 | |
| 14594 | ret_val = xmlTextReaderNextSibling(reader); |
| 14595 | desret_int(ret_val); |
| 14596 | call_tests++; |
| 14597 | des_xmlTextReaderPtr(n_reader, reader); |
| 14598 | xmlResetLastError(); |
| 14599 | if (mem_base != xmlMemBlocks()) { |
| 14600 | printf("Leak of %d blocks found in xmlTextReaderNextSibling", |
| 14601 | xmlMemBlocks() - mem_base); |
| 14602 | ret++; |
| 14603 | printf(" %d", n_reader); |
| 14604 | printf("\n"); |
| 14605 | } |
| 14606 | } |
| 14607 | #endif |
| 14608 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14609 | return(ret); |
| 14610 | } |
| 14611 | |
| 14612 | |
| 14613 | static int |
| 14614 | test_xmlTextReaderNodeType(void) { |
| 14615 | int ret = 0; |
| 14616 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14617 | #ifdef LIBXML_READER_ENABLED |
| 14618 | int mem_base; |
| 14619 | int ret_val; |
| 14620 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14621 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14622 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14623 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14624 | mem_base = xmlMemBlocks(); |
| 14625 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14626 | |
| 14627 | ret_val = xmlTextReaderNodeType(reader); |
| 14628 | desret_int(ret_val); |
| 14629 | call_tests++; |
| 14630 | des_xmlTextReaderPtr(n_reader, reader); |
| 14631 | xmlResetLastError(); |
| 14632 | if (mem_base != xmlMemBlocks()) { |
| 14633 | printf("Leak of %d blocks found in xmlTextReaderNodeType", |
| 14634 | xmlMemBlocks() - mem_base); |
| 14635 | ret++; |
| 14636 | printf(" %d", n_reader); |
| 14637 | printf("\n"); |
| 14638 | } |
| 14639 | } |
| 14640 | #endif |
| 14641 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14642 | return(ret); |
| 14643 | } |
| 14644 | |
| 14645 | |
| 14646 | static int |
| 14647 | test_xmlTextReaderNormalization(void) { |
| 14648 | int ret = 0; |
| 14649 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14650 | #ifdef LIBXML_READER_ENABLED |
| 14651 | int mem_base; |
| 14652 | int ret_val; |
| 14653 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14654 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14655 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14656 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14657 | mem_base = xmlMemBlocks(); |
| 14658 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14659 | |
| 14660 | ret_val = xmlTextReaderNormalization(reader); |
| 14661 | desret_int(ret_val); |
| 14662 | call_tests++; |
| 14663 | des_xmlTextReaderPtr(n_reader, reader); |
| 14664 | xmlResetLastError(); |
| 14665 | if (mem_base != xmlMemBlocks()) { |
| 14666 | printf("Leak of %d blocks found in xmlTextReaderNormalization", |
| 14667 | xmlMemBlocks() - mem_base); |
| 14668 | ret++; |
| 14669 | printf(" %d", n_reader); |
| 14670 | printf("\n"); |
| 14671 | } |
| 14672 | } |
| 14673 | #endif |
| 14674 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14675 | return(ret); |
| 14676 | } |
| 14677 | |
| 14678 | |
| 14679 | static int |
| 14680 | test_xmlTextReaderPrefix(void) { |
| 14681 | int ret = 0; |
| 14682 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14683 | #ifdef LIBXML_READER_ENABLED |
| 14684 | int mem_base; |
| 14685 | xmlChar * ret_val; |
| 14686 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14687 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14688 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14689 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14690 | mem_base = xmlMemBlocks(); |
| 14691 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14692 | |
| 14693 | ret_val = xmlTextReaderPrefix(reader); |
| 14694 | desret_xmlChar_ptr(ret_val); |
| 14695 | call_tests++; |
| 14696 | des_xmlTextReaderPtr(n_reader, reader); |
| 14697 | xmlResetLastError(); |
| 14698 | if (mem_base != xmlMemBlocks()) { |
| 14699 | printf("Leak of %d blocks found in xmlTextReaderPrefix", |
| 14700 | xmlMemBlocks() - mem_base); |
| 14701 | ret++; |
| 14702 | printf(" %d", n_reader); |
| 14703 | printf("\n"); |
| 14704 | } |
| 14705 | } |
| 14706 | #endif |
| 14707 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14708 | return(ret); |
| 14709 | } |
| 14710 | |
| 14711 | |
| 14712 | static int |
| 14713 | test_xmlTextReaderPreserve(void) { |
| 14714 | int ret = 0; |
| 14715 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14716 | #ifdef LIBXML_READER_ENABLED |
| 14717 | int mem_base; |
| 14718 | xmlNodePtr ret_val; |
| 14719 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14720 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14721 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14722 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14723 | mem_base = xmlMemBlocks(); |
| 14724 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14725 | |
| 14726 | ret_val = xmlTextReaderPreserve(reader); |
| 14727 | desret_xmlNodePtr(ret_val); |
| 14728 | call_tests++; |
| 14729 | des_xmlTextReaderPtr(n_reader, reader); |
| 14730 | xmlResetLastError(); |
| 14731 | if (mem_base != xmlMemBlocks()) { |
| 14732 | printf("Leak of %d blocks found in xmlTextReaderPreserve", |
| 14733 | xmlMemBlocks() - mem_base); |
| 14734 | ret++; |
| 14735 | printf(" %d", n_reader); |
| 14736 | printf("\n"); |
| 14737 | } |
| 14738 | } |
| 14739 | #endif |
| 14740 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14741 | return(ret); |
| 14742 | } |
| 14743 | |
| 14744 | |
| 14745 | static int |
| 14746 | test_xmlTextReaderPreservePattern(void) { |
| 14747 | int ret = 0; |
| 14748 | |
| 14749 | |
| 14750 | /* missing type support */ |
| 14751 | return(ret); |
| 14752 | } |
| 14753 | |
| 14754 | |
| 14755 | static int |
| 14756 | test_xmlTextReaderQuoteChar(void) { |
| 14757 | int ret = 0; |
| 14758 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14759 | #ifdef LIBXML_READER_ENABLED |
| 14760 | int mem_base; |
| 14761 | int ret_val; |
| 14762 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14763 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14764 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14765 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14766 | mem_base = xmlMemBlocks(); |
| 14767 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14768 | |
| 14769 | ret_val = xmlTextReaderQuoteChar(reader); |
| 14770 | desret_int(ret_val); |
| 14771 | call_tests++; |
| 14772 | des_xmlTextReaderPtr(n_reader, reader); |
| 14773 | xmlResetLastError(); |
| 14774 | if (mem_base != xmlMemBlocks()) { |
| 14775 | printf("Leak of %d blocks found in xmlTextReaderQuoteChar", |
| 14776 | xmlMemBlocks() - mem_base); |
| 14777 | ret++; |
| 14778 | printf(" %d", n_reader); |
| 14779 | printf("\n"); |
| 14780 | } |
| 14781 | } |
| 14782 | #endif |
| 14783 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14784 | return(ret); |
| 14785 | } |
| 14786 | |
| 14787 | |
| 14788 | static int |
| 14789 | test_xmlTextReaderRead(void) { |
| 14790 | int ret = 0; |
| 14791 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14792 | #ifdef LIBXML_READER_ENABLED |
| 14793 | int mem_base; |
| 14794 | int ret_val; |
| 14795 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14796 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14797 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14798 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14799 | mem_base = xmlMemBlocks(); |
| 14800 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14801 | |
| 14802 | ret_val = xmlTextReaderRead(reader); |
| 14803 | desret_int(ret_val); |
| 14804 | call_tests++; |
| 14805 | des_xmlTextReaderPtr(n_reader, reader); |
| 14806 | xmlResetLastError(); |
| 14807 | if (mem_base != xmlMemBlocks()) { |
| 14808 | printf("Leak of %d blocks found in xmlTextReaderRead", |
| 14809 | xmlMemBlocks() - mem_base); |
| 14810 | ret++; |
| 14811 | printf(" %d", n_reader); |
| 14812 | printf("\n"); |
| 14813 | } |
| 14814 | } |
| 14815 | #endif |
| 14816 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14817 | return(ret); |
| 14818 | } |
| 14819 | |
| 14820 | |
| 14821 | static int |
| 14822 | test_xmlTextReaderReadAttributeValue(void) { |
| 14823 | int ret = 0; |
| 14824 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14825 | #ifdef LIBXML_READER_ENABLED |
| 14826 | int mem_base; |
| 14827 | int ret_val; |
| 14828 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14829 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14830 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14831 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14832 | mem_base = xmlMemBlocks(); |
| 14833 | reader = gen_xmlTextReaderPtr(n_reader); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14834 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14835 | ret_val = xmlTextReaderReadAttributeValue(reader); |
| 14836 | desret_int(ret_val); |
| 14837 | call_tests++; |
| 14838 | des_xmlTextReaderPtr(n_reader, reader); |
| 14839 | xmlResetLastError(); |
| 14840 | if (mem_base != xmlMemBlocks()) { |
| 14841 | printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue", |
| 14842 | xmlMemBlocks() - mem_base); |
| 14843 | ret++; |
| 14844 | printf(" %d", n_reader); |
| 14845 | printf("\n"); |
| 14846 | } |
| 14847 | } |
| 14848 | #endif |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14849 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14850 | return(ret); |
| 14851 | } |
| 14852 | |
| 14853 | |
| 14854 | static int |
| 14855 | test_xmlTextReaderReadState(void) { |
| 14856 | int ret = 0; |
| 14857 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14858 | #ifdef LIBXML_READER_ENABLED |
| 14859 | int mem_base; |
| 14860 | int ret_val; |
| 14861 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14862 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14863 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14864 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14865 | mem_base = xmlMemBlocks(); |
| 14866 | reader = gen_xmlTextReaderPtr(n_reader); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14867 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14868 | ret_val = xmlTextReaderReadState(reader); |
| 14869 | desret_int(ret_val); |
| 14870 | call_tests++; |
| 14871 | des_xmlTextReaderPtr(n_reader, reader); |
| 14872 | xmlResetLastError(); |
| 14873 | if (mem_base != xmlMemBlocks()) { |
| 14874 | printf("Leak of %d blocks found in xmlTextReaderReadState", |
| 14875 | xmlMemBlocks() - mem_base); |
| 14876 | ret++; |
| 14877 | printf(" %d", n_reader); |
| 14878 | printf("\n"); |
| 14879 | } |
| 14880 | } |
| 14881 | #endif |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14882 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14883 | return(ret); |
| 14884 | } |
| 14885 | |
| 14886 | |
| 14887 | static int |
| 14888 | test_xmlTextReaderRelaxNGSetSchema(void) { |
| 14889 | int ret = 0; |
| 14890 | |
| 14891 | |
| 14892 | /* missing type support */ |
| 14893 | return(ret); |
| 14894 | } |
| 14895 | |
| 14896 | |
| 14897 | static int |
| 14898 | test_xmlTextReaderRelaxNGValidate(void) { |
| 14899 | int ret = 0; |
| 14900 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14901 | #ifdef LIBXML_READER_ENABLED |
| 14902 | #ifdef LIBXML_SCHEMAS_ENABLED |
| 14903 | int mem_base; |
| 14904 | int ret_val; |
| 14905 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14906 | int n_reader; |
| 14907 | const char * rng; /* the path to a RelaxNG schema or NULL */ |
| 14908 | int n_rng; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14909 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14910 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14911 | for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) { |
| 14912 | mem_base = xmlMemBlocks(); |
| 14913 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14914 | rng = gen_const_char_ptr(n_rng); |
| 14915 | |
| 14916 | ret_val = xmlTextReaderRelaxNGValidate(reader, rng); |
| 14917 | desret_int(ret_val); |
| 14918 | call_tests++; |
| 14919 | des_xmlTextReaderPtr(n_reader, reader); |
| 14920 | des_const_char_ptr(n_rng, rng); |
| 14921 | xmlResetLastError(); |
| 14922 | if (mem_base != xmlMemBlocks()) { |
| 14923 | printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate", |
| 14924 | xmlMemBlocks() - mem_base); |
| 14925 | ret++; |
| 14926 | printf(" %d", n_reader); |
| 14927 | printf(" %d", n_rng); |
| 14928 | printf("\n"); |
| 14929 | } |
| 14930 | } |
| 14931 | } |
| 14932 | #endif |
| 14933 | #endif |
| 14934 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14935 | return(ret); |
| 14936 | } |
| 14937 | |
| 14938 | |
| 14939 | static int |
| 14940 | test_xmlTextReaderSetErrorHandler(void) { |
| 14941 | int ret = 0; |
| 14942 | |
| 14943 | |
| 14944 | /* missing type support */ |
| 14945 | return(ret); |
| 14946 | } |
| 14947 | |
| 14948 | |
| 14949 | static int |
| 14950 | test_xmlTextReaderSetParserProp(void) { |
| 14951 | int ret = 0; |
| 14952 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14953 | #ifdef LIBXML_READER_ENABLED |
| 14954 | int mem_base; |
| 14955 | int ret_val; |
| 14956 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 14957 | int n_reader; |
| 14958 | int prop; /* the xmlParserProperties to set */ |
| 14959 | int n_prop; |
| 14960 | int value; /* usually 0 or 1 to (de)activate it */ |
| 14961 | int n_value; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14962 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 14963 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 14964 | for (n_prop = 0;n_prop < gen_nb_int;n_prop++) { |
| 14965 | for (n_value = 0;n_value < gen_nb_int;n_value++) { |
| 14966 | mem_base = xmlMemBlocks(); |
| 14967 | reader = gen_xmlTextReaderPtr(n_reader); |
| 14968 | prop = gen_int(n_prop); |
| 14969 | value = gen_int(n_value); |
| 14970 | |
| 14971 | ret_val = xmlTextReaderSetParserProp(reader, prop, value); |
| 14972 | desret_int(ret_val); |
| 14973 | call_tests++; |
| 14974 | des_xmlTextReaderPtr(n_reader, reader); |
| 14975 | des_int(n_prop, prop); |
| 14976 | des_int(n_value, value); |
| 14977 | xmlResetLastError(); |
| 14978 | if (mem_base != xmlMemBlocks()) { |
| 14979 | printf("Leak of %d blocks found in xmlTextReaderSetParserProp", |
| 14980 | xmlMemBlocks() - mem_base); |
| 14981 | ret++; |
| 14982 | printf(" %d", n_reader); |
| 14983 | printf(" %d", n_prop); |
| 14984 | printf(" %d", n_value); |
| 14985 | printf("\n"); |
| 14986 | } |
| 14987 | } |
| 14988 | } |
| 14989 | } |
| 14990 | #endif |
| 14991 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 14992 | return(ret); |
| 14993 | } |
| 14994 | |
| 14995 | |
| 14996 | static int |
| 14997 | test_xmlTextReaderSetStructuredErrorHandler(void) { |
| 14998 | int ret = 0; |
| 14999 | |
| 15000 | |
| 15001 | /* missing type support */ |
| 15002 | return(ret); |
| 15003 | } |
| 15004 | |
| 15005 | |
| 15006 | static int |
| 15007 | test_xmlTextReaderStandalone(void) { |
| 15008 | int ret = 0; |
| 15009 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 15010 | #ifdef LIBXML_READER_ENABLED |
| 15011 | int mem_base; |
| 15012 | int ret_val; |
| 15013 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 15014 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15015 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 15016 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 15017 | mem_base = xmlMemBlocks(); |
| 15018 | reader = gen_xmlTextReaderPtr(n_reader); |
| 15019 | |
| 15020 | ret_val = xmlTextReaderStandalone(reader); |
| 15021 | desret_int(ret_val); |
| 15022 | call_tests++; |
| 15023 | des_xmlTextReaderPtr(n_reader, reader); |
| 15024 | xmlResetLastError(); |
| 15025 | if (mem_base != xmlMemBlocks()) { |
| 15026 | printf("Leak of %d blocks found in xmlTextReaderStandalone", |
| 15027 | xmlMemBlocks() - mem_base); |
| 15028 | ret++; |
| 15029 | printf(" %d", n_reader); |
| 15030 | printf("\n"); |
| 15031 | } |
| 15032 | } |
| 15033 | #endif |
| 15034 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15035 | return(ret); |
| 15036 | } |
| 15037 | |
| 15038 | |
| 15039 | static int |
| 15040 | test_xmlTextReaderValue(void) { |
| 15041 | int ret = 0; |
| 15042 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 15043 | #ifdef LIBXML_READER_ENABLED |
| 15044 | int mem_base; |
| 15045 | xmlChar * ret_val; |
| 15046 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 15047 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15048 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 15049 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 15050 | mem_base = xmlMemBlocks(); |
| 15051 | reader = gen_xmlTextReaderPtr(n_reader); |
| 15052 | |
| 15053 | ret_val = xmlTextReaderValue(reader); |
| 15054 | desret_xmlChar_ptr(ret_val); |
| 15055 | call_tests++; |
| 15056 | des_xmlTextReaderPtr(n_reader, reader); |
| 15057 | xmlResetLastError(); |
| 15058 | if (mem_base != xmlMemBlocks()) { |
| 15059 | printf("Leak of %d blocks found in xmlTextReaderValue", |
| 15060 | xmlMemBlocks() - mem_base); |
| 15061 | ret++; |
| 15062 | printf(" %d", n_reader); |
| 15063 | printf("\n"); |
| 15064 | } |
| 15065 | } |
| 15066 | #endif |
| 15067 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15068 | return(ret); |
| 15069 | } |
| 15070 | |
| 15071 | |
| 15072 | static int |
| 15073 | test_xmlTextReaderXmlLang(void) { |
| 15074 | int ret = 0; |
| 15075 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 15076 | #ifdef LIBXML_READER_ENABLED |
| 15077 | int mem_base; |
| 15078 | xmlChar * ret_val; |
| 15079 | xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
| 15080 | int n_reader; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15081 | |
Daniel Veillard | dd6d300 | 2004-11-03 14:20:29 +0000 | [diff] [blame] | 15082 | for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
| 15083 | mem_base = xmlMemBlocks(); |
| 15084 | reader = gen_xmlTextReaderPtr(n_reader); |
| 15085 | |
| 15086 | ret_val = xmlTextReaderXmlLang(reader); |
| 15087 | desret_xmlChar_ptr(ret_val); |
| 15088 | call_tests++; |
| 15089 | des_xmlTextReaderPtr(n_reader, reader); |
| 15090 | xmlResetLastError(); |
| 15091 | if (mem_base != xmlMemBlocks()) { |
| 15092 | printf("Leak of %d blocks found in xmlTextReaderXmlLang", |
| 15093 | xmlMemBlocks() - mem_base); |
| 15094 | ret++; |
| 15095 | printf(" %d", n_reader); |
| 15096 | printf("\n"); |
| 15097 | } |
| 15098 | } |
| 15099 | #endif |
| 15100 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15101 | return(ret); |
| 15102 | } |
| 15103 | |
| 15104 | static int |
| 15105 | test_xmlreader(void) { |
| 15106 | int ret = 0; |
| 15107 | |
| 15108 | printf("Testing xmlreader ...\n"); |
| 15109 | ret += test_xmlNewTextReader(); |
| 15110 | ret += test_xmlNewTextReaderFilename(); |
| 15111 | ret += test_xmlReaderForDoc(); |
| 15112 | ret += test_xmlReaderForFd(); |
| 15113 | ret += test_xmlReaderForFile(); |
| 15114 | ret += test_xmlReaderForIO(); |
| 15115 | ret += test_xmlReaderForMemory(); |
| 15116 | ret += test_xmlReaderNewDoc(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15117 | ret += test_xmlReaderNewFile(); |
| 15118 | ret += test_xmlReaderNewIO(); |
| 15119 | ret += test_xmlReaderNewMemory(); |
| 15120 | ret += test_xmlReaderNewWalker(); |
| 15121 | ret += test_xmlReaderWalker(); |
| 15122 | ret += test_xmlTextReaderAttributeCount(); |
| 15123 | ret += test_xmlTextReaderBaseUri(); |
| 15124 | ret += test_xmlTextReaderClose(); |
| 15125 | ret += test_xmlTextReaderConstBaseUri(); |
| 15126 | ret += test_xmlTextReaderConstEncoding(); |
| 15127 | ret += test_xmlTextReaderConstLocalName(); |
| 15128 | ret += test_xmlTextReaderConstName(); |
| 15129 | ret += test_xmlTextReaderConstNamespaceUri(); |
| 15130 | ret += test_xmlTextReaderConstPrefix(); |
| 15131 | ret += test_xmlTextReaderConstString(); |
| 15132 | ret += test_xmlTextReaderConstValue(); |
| 15133 | ret += test_xmlTextReaderConstXmlLang(); |
| 15134 | ret += test_xmlTextReaderConstXmlVersion(); |
| 15135 | ret += test_xmlTextReaderCurrentDoc(); |
| 15136 | ret += test_xmlTextReaderCurrentNode(); |
| 15137 | ret += test_xmlTextReaderDepth(); |
| 15138 | ret += test_xmlTextReaderExpand(); |
| 15139 | ret += test_xmlTextReaderGetAttribute(); |
| 15140 | ret += test_xmlTextReaderGetAttributeNo(); |
| 15141 | ret += test_xmlTextReaderGetAttributeNs(); |
| 15142 | ret += test_xmlTextReaderGetErrorHandler(); |
| 15143 | ret += test_xmlTextReaderGetParserProp(); |
| 15144 | ret += test_xmlTextReaderGetRemainder(); |
| 15145 | ret += test_xmlTextReaderHasAttributes(); |
| 15146 | ret += test_xmlTextReaderHasValue(); |
| 15147 | ret += test_xmlTextReaderIsDefault(); |
| 15148 | ret += test_xmlTextReaderIsEmptyElement(); |
| 15149 | ret += test_xmlTextReaderIsNamespaceDecl(); |
| 15150 | ret += test_xmlTextReaderIsValid(); |
| 15151 | ret += test_xmlTextReaderLocalName(); |
| 15152 | ret += test_xmlTextReaderLocatorBaseURI(); |
| 15153 | ret += test_xmlTextReaderLocatorLineNumber(); |
| 15154 | ret += test_xmlTextReaderLookupNamespace(); |
| 15155 | ret += test_xmlTextReaderMoveToAttribute(); |
| 15156 | ret += test_xmlTextReaderMoveToAttributeNo(); |
| 15157 | ret += test_xmlTextReaderMoveToAttributeNs(); |
| 15158 | ret += test_xmlTextReaderMoveToElement(); |
| 15159 | ret += test_xmlTextReaderMoveToFirstAttribute(); |
| 15160 | ret += test_xmlTextReaderMoveToNextAttribute(); |
| 15161 | ret += test_xmlTextReaderName(); |
| 15162 | ret += test_xmlTextReaderNamespaceUri(); |
| 15163 | ret += test_xmlTextReaderNext(); |
| 15164 | ret += test_xmlTextReaderNextSibling(); |
| 15165 | ret += test_xmlTextReaderNodeType(); |
| 15166 | ret += test_xmlTextReaderNormalization(); |
| 15167 | ret += test_xmlTextReaderPrefix(); |
| 15168 | ret += test_xmlTextReaderPreserve(); |
| 15169 | ret += test_xmlTextReaderPreservePattern(); |
| 15170 | ret += test_xmlTextReaderQuoteChar(); |
| 15171 | ret += test_xmlTextReaderRead(); |
| 15172 | ret += test_xmlTextReaderReadAttributeValue(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15173 | ret += test_xmlTextReaderReadState(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15174 | ret += test_xmlTextReaderRelaxNGSetSchema(); |
| 15175 | ret += test_xmlTextReaderRelaxNGValidate(); |
| 15176 | ret += test_xmlTextReaderSetErrorHandler(); |
| 15177 | ret += test_xmlTextReaderSetParserProp(); |
| 15178 | ret += test_xmlTextReaderSetStructuredErrorHandler(); |
| 15179 | ret += test_xmlTextReaderStandalone(); |
| 15180 | ret += test_xmlTextReaderValue(); |
| 15181 | ret += test_xmlTextReaderXmlLang(); |
| 15182 | |
| 15183 | if (ret != 0) |
| 15184 | printf("Module xmlreader: %d errors\n", ret); |
| 15185 | return(ret); |
| 15186 | } |
| 15187 | |
| 15188 | static int |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15189 | test_xmlSaveClose(void) { |
| 15190 | int ret = 0; |
| 15191 | |
| 15192 | |
| 15193 | /* missing type support */ |
| 15194 | return(ret); |
| 15195 | } |
| 15196 | |
| 15197 | |
| 15198 | static int |
| 15199 | test_xmlSaveDoc(void) { |
| 15200 | int ret = 0; |
| 15201 | |
| 15202 | |
| 15203 | /* missing type support */ |
| 15204 | return(ret); |
| 15205 | } |
| 15206 | |
| 15207 | |
| 15208 | static int |
| 15209 | test_xmlSaveFlush(void) { |
| 15210 | int ret = 0; |
| 15211 | |
| 15212 | |
| 15213 | /* missing type support */ |
| 15214 | return(ret); |
| 15215 | } |
| 15216 | |
| 15217 | |
| 15218 | static int |
| 15219 | test_xmlSaveSetAttrEscape(void) { |
| 15220 | int ret = 0; |
| 15221 | |
| 15222 | |
| 15223 | /* missing type support */ |
| 15224 | return(ret); |
| 15225 | } |
| 15226 | |
| 15227 | |
| 15228 | static int |
| 15229 | test_xmlSaveSetEscape(void) { |
| 15230 | int ret = 0; |
| 15231 | |
| 15232 | |
| 15233 | /* missing type support */ |
| 15234 | return(ret); |
| 15235 | } |
| 15236 | |
| 15237 | |
| 15238 | static int |
| 15239 | test_xmlSaveToFd(void) { |
| 15240 | int ret = 0; |
| 15241 | |
| 15242 | |
| 15243 | /* missing type support */ |
| 15244 | return(ret); |
| 15245 | } |
| 15246 | |
| 15247 | |
| 15248 | static int |
| 15249 | test_xmlSaveToFilename(void) { |
| 15250 | int ret = 0; |
| 15251 | |
| 15252 | |
| 15253 | /* missing type support */ |
| 15254 | return(ret); |
| 15255 | } |
| 15256 | |
| 15257 | |
| 15258 | static int |
| 15259 | test_xmlSaveToIO(void) { |
| 15260 | int ret = 0; |
| 15261 | |
| 15262 | |
| 15263 | /* missing type support */ |
| 15264 | return(ret); |
| 15265 | } |
| 15266 | |
| 15267 | |
| 15268 | static int |
| 15269 | test_xmlSaveTree(void) { |
| 15270 | int ret = 0; |
| 15271 | |
| 15272 | |
| 15273 | /* missing type support */ |
| 15274 | return(ret); |
| 15275 | } |
| 15276 | |
| 15277 | static int |
| 15278 | test_xmlsave(void) { |
| 15279 | int ret = 0; |
| 15280 | |
| 15281 | printf("Testing xmlsave ...\n"); |
| 15282 | ret += test_xmlSaveClose(); |
| 15283 | ret += test_xmlSaveDoc(); |
| 15284 | ret += test_xmlSaveFlush(); |
| 15285 | ret += test_xmlSaveSetAttrEscape(); |
| 15286 | ret += test_xmlSaveSetEscape(); |
| 15287 | ret += test_xmlSaveToFd(); |
| 15288 | ret += test_xmlSaveToFilename(); |
| 15289 | ret += test_xmlSaveToIO(); |
| 15290 | ret += test_xmlSaveTree(); |
| 15291 | |
| 15292 | if (ret != 0) |
| 15293 | printf("Module xmlsave: %d errors\n", ret); |
| 15294 | return(ret); |
| 15295 | } |
| 15296 | |
| 15297 | static int |
| 15298 | test_xmlSchemaDump(void) { |
| 15299 | int ret = 0; |
| 15300 | |
| 15301 | |
| 15302 | /* missing type support */ |
| 15303 | return(ret); |
| 15304 | } |
| 15305 | |
| 15306 | |
| 15307 | static int |
| 15308 | test_xmlSchemaGetParserErrors(void) { |
| 15309 | int ret = 0; |
| 15310 | |
| 15311 | |
| 15312 | /* missing type support */ |
| 15313 | return(ret); |
| 15314 | } |
| 15315 | |
| 15316 | |
| 15317 | static int |
| 15318 | test_xmlSchemaGetValidErrors(void) { |
| 15319 | int ret = 0; |
| 15320 | |
| 15321 | |
| 15322 | /* missing type support */ |
| 15323 | return(ret); |
| 15324 | } |
| 15325 | |
| 15326 | |
| 15327 | static int |
| 15328 | test_xmlSchemaNewDocParserCtxt(void) { |
| 15329 | int ret = 0; |
| 15330 | |
| 15331 | |
| 15332 | /* missing type support */ |
| 15333 | return(ret); |
| 15334 | } |
| 15335 | |
| 15336 | |
| 15337 | static int |
| 15338 | test_xmlSchemaNewMemParserCtxt(void) { |
| 15339 | int ret = 0; |
| 15340 | |
| 15341 | |
| 15342 | /* missing type support */ |
| 15343 | return(ret); |
| 15344 | } |
| 15345 | |
| 15346 | |
| 15347 | static int |
| 15348 | test_xmlSchemaNewParserCtxt(void) { |
| 15349 | int ret = 0; |
| 15350 | |
| 15351 | |
| 15352 | /* missing type support */ |
| 15353 | return(ret); |
| 15354 | } |
| 15355 | |
| 15356 | |
| 15357 | static int |
| 15358 | test_xmlSchemaNewValidCtxt(void) { |
| 15359 | int ret = 0; |
| 15360 | |
| 15361 | |
| 15362 | /* missing type support */ |
| 15363 | return(ret); |
| 15364 | } |
| 15365 | |
| 15366 | |
| 15367 | static int |
| 15368 | test_xmlSchemaParse(void) { |
| 15369 | int ret = 0; |
| 15370 | |
| 15371 | |
| 15372 | /* missing type support */ |
| 15373 | return(ret); |
| 15374 | } |
| 15375 | |
| 15376 | |
| 15377 | static int |
| 15378 | test_xmlSchemaSetParserErrors(void) { |
| 15379 | int ret = 0; |
| 15380 | |
| 15381 | |
| 15382 | /* missing type support */ |
| 15383 | return(ret); |
| 15384 | } |
| 15385 | |
| 15386 | |
| 15387 | static int |
| 15388 | test_xmlSchemaSetValidErrors(void) { |
| 15389 | int ret = 0; |
| 15390 | |
| 15391 | |
| 15392 | /* missing type support */ |
| 15393 | return(ret); |
| 15394 | } |
| 15395 | |
| 15396 | |
| 15397 | static int |
| 15398 | test_xmlSchemaSetValidOptions(void) { |
| 15399 | int ret = 0; |
| 15400 | |
| 15401 | |
| 15402 | /* missing type support */ |
| 15403 | return(ret); |
| 15404 | } |
| 15405 | |
| 15406 | |
| 15407 | static int |
| 15408 | test_xmlSchemaValidCtxtGetOptions(void) { |
| 15409 | int ret = 0; |
| 15410 | |
| 15411 | |
| 15412 | /* missing type support */ |
| 15413 | return(ret); |
| 15414 | } |
| 15415 | |
| 15416 | |
| 15417 | static int |
| 15418 | test_xmlSchemaValidateDoc(void) { |
| 15419 | int ret = 0; |
| 15420 | |
| 15421 | |
| 15422 | /* missing type support */ |
| 15423 | return(ret); |
| 15424 | } |
| 15425 | |
| 15426 | |
| 15427 | static int |
| 15428 | test_xmlSchemaValidateOneElement(void) { |
| 15429 | int ret = 0; |
| 15430 | |
| 15431 | |
| 15432 | /* missing type support */ |
| 15433 | return(ret); |
| 15434 | } |
| 15435 | |
| 15436 | |
| 15437 | static int |
| 15438 | test_xmlSchemaValidateStream(void) { |
| 15439 | int ret = 0; |
| 15440 | |
| 15441 | |
| 15442 | /* missing type support */ |
| 15443 | return(ret); |
| 15444 | } |
| 15445 | |
| 15446 | static int |
| 15447 | test_xmlschemas(void) { |
| 15448 | int ret = 0; |
| 15449 | |
| 15450 | printf("Testing xmlschemas ...\n"); |
| 15451 | ret += test_xmlSchemaDump(); |
| 15452 | ret += test_xmlSchemaGetParserErrors(); |
| 15453 | ret += test_xmlSchemaGetValidErrors(); |
| 15454 | ret += test_xmlSchemaNewDocParserCtxt(); |
| 15455 | ret += test_xmlSchemaNewMemParserCtxt(); |
| 15456 | ret += test_xmlSchemaNewParserCtxt(); |
| 15457 | ret += test_xmlSchemaNewValidCtxt(); |
| 15458 | ret += test_xmlSchemaParse(); |
| 15459 | ret += test_xmlSchemaSetParserErrors(); |
| 15460 | ret += test_xmlSchemaSetValidErrors(); |
| 15461 | ret += test_xmlSchemaSetValidOptions(); |
| 15462 | ret += test_xmlSchemaValidCtxtGetOptions(); |
| 15463 | ret += test_xmlSchemaValidateDoc(); |
| 15464 | ret += test_xmlSchemaValidateOneElement(); |
| 15465 | ret += test_xmlSchemaValidateStream(); |
| 15466 | |
| 15467 | if (ret != 0) |
| 15468 | printf("Module xmlschemas: %d errors\n", ret); |
| 15469 | return(ret); |
| 15470 | } |
| 15471 | |
| 15472 | static int |
| 15473 | test_xmlSchemaCheckFacet(void) { |
| 15474 | int ret = 0; |
| 15475 | |
| 15476 | |
| 15477 | /* missing type support */ |
| 15478 | return(ret); |
| 15479 | } |
| 15480 | |
| 15481 | |
| 15482 | static int |
| 15483 | test_xmlSchemaCleanupTypes(void) { |
| 15484 | int ret = 0; |
| 15485 | |
| 15486 | #ifdef LIBXML_SCHEMAS_ENABLED |
| 15487 | int mem_base; |
| 15488 | |
| 15489 | mem_base = xmlMemBlocks(); |
| 15490 | |
| 15491 | xmlSchemaCleanupTypes(); |
| 15492 | call_tests++; |
| 15493 | xmlResetLastError(); |
| 15494 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 15495 | printf("Leak of %d blocks found in xmlSchemaCleanupTypes", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15496 | xmlMemBlocks() - mem_base); |
| 15497 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 15498 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15499 | } |
| 15500 | #endif |
| 15501 | |
| 15502 | return(ret); |
| 15503 | } |
| 15504 | |
| 15505 | |
| 15506 | static int |
| 15507 | test_xmlSchemaCollapseString(void) { |
| 15508 | int ret = 0; |
| 15509 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 15510 | #ifdef LIBXML_SCHEMAS_ENABLED |
| 15511 | int mem_base; |
| 15512 | xmlChar * ret_val; |
| 15513 | const xmlChar * value; /* a value */ |
| 15514 | int n_value; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15515 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 15516 | for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { |
| 15517 | mem_base = xmlMemBlocks(); |
| 15518 | value = gen_const_xmlChar_ptr(n_value); |
| 15519 | |
| 15520 | ret_val = xmlSchemaCollapseString(value); |
| 15521 | desret_xmlChar_ptr(ret_val); |
| 15522 | call_tests++; |
| 15523 | des_const_xmlChar_ptr(n_value, value); |
| 15524 | xmlResetLastError(); |
| 15525 | if (mem_base != xmlMemBlocks()) { |
| 15526 | printf("Leak of %d blocks found in xmlSchemaCollapseString", |
| 15527 | xmlMemBlocks() - mem_base); |
| 15528 | ret++; |
| 15529 | printf(" %d", n_value); |
| 15530 | printf("\n"); |
| 15531 | } |
| 15532 | } |
| 15533 | #endif |
| 15534 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15535 | return(ret); |
| 15536 | } |
| 15537 | |
| 15538 | |
| 15539 | static int |
| 15540 | test_xmlSchemaCompareValues(void) { |
| 15541 | int ret = 0; |
| 15542 | |
| 15543 | |
| 15544 | /* missing type support */ |
| 15545 | return(ret); |
| 15546 | } |
| 15547 | |
| 15548 | |
| 15549 | static int |
| 15550 | test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) { |
| 15551 | int ret = 0; |
| 15552 | |
| 15553 | |
| 15554 | /* missing type support */ |
| 15555 | return(ret); |
| 15556 | } |
| 15557 | |
| 15558 | |
| 15559 | static int |
| 15560 | test_xmlSchemaGetBuiltInType(void) { |
| 15561 | int ret = 0; |
| 15562 | |
| 15563 | |
| 15564 | /* missing type support */ |
| 15565 | return(ret); |
| 15566 | } |
| 15567 | |
| 15568 | |
| 15569 | static int |
| 15570 | test_xmlSchemaGetFacetValueAsULong(void) { |
| 15571 | int ret = 0; |
| 15572 | |
| 15573 | |
| 15574 | /* missing type support */ |
| 15575 | return(ret); |
| 15576 | } |
| 15577 | |
| 15578 | |
| 15579 | static int |
| 15580 | test_xmlSchemaGetPredefinedType(void) { |
| 15581 | int ret = 0; |
| 15582 | |
| 15583 | |
| 15584 | /* missing type support */ |
| 15585 | return(ret); |
| 15586 | } |
| 15587 | |
| 15588 | |
| 15589 | static int |
| 15590 | test_xmlSchemaInitTypes(void) { |
| 15591 | int ret = 0; |
| 15592 | |
| 15593 | #ifdef LIBXML_SCHEMAS_ENABLED |
| 15594 | |
| 15595 | |
| 15596 | xmlSchemaInitTypes(); |
| 15597 | call_tests++; |
| 15598 | xmlResetLastError(); |
| 15599 | #endif |
| 15600 | |
| 15601 | return(ret); |
| 15602 | } |
| 15603 | |
| 15604 | |
| 15605 | static int |
| 15606 | test_xmlSchemaIsBuiltInTypeFacet(void) { |
| 15607 | int ret = 0; |
| 15608 | |
| 15609 | |
| 15610 | /* missing type support */ |
| 15611 | return(ret); |
| 15612 | } |
| 15613 | |
| 15614 | |
| 15615 | static int |
| 15616 | test_xmlSchemaNewFacet(void) { |
| 15617 | int ret = 0; |
| 15618 | |
| 15619 | |
| 15620 | /* missing type support */ |
| 15621 | return(ret); |
| 15622 | } |
| 15623 | |
| 15624 | |
| 15625 | static int |
| 15626 | test_xmlSchemaValPredefTypeNode(void) { |
| 15627 | int ret = 0; |
| 15628 | |
| 15629 | |
| 15630 | /* missing type support */ |
| 15631 | return(ret); |
| 15632 | } |
| 15633 | |
| 15634 | |
| 15635 | static int |
| 15636 | test_xmlSchemaValPredefTypeNodeNoNorm(void) { |
| 15637 | int ret = 0; |
| 15638 | |
| 15639 | |
| 15640 | /* missing type support */ |
| 15641 | return(ret); |
| 15642 | } |
| 15643 | |
| 15644 | |
| 15645 | static int |
| 15646 | test_xmlSchemaValidateFacet(void) { |
| 15647 | int ret = 0; |
| 15648 | |
| 15649 | |
| 15650 | /* missing type support */ |
| 15651 | return(ret); |
| 15652 | } |
| 15653 | |
| 15654 | |
| 15655 | static int |
| 15656 | test_xmlSchemaValidateLengthFacet(void) { |
| 15657 | int ret = 0; |
| 15658 | |
| 15659 | |
| 15660 | /* missing type support */ |
| 15661 | return(ret); |
| 15662 | } |
| 15663 | |
| 15664 | |
| 15665 | static int |
| 15666 | test_xmlSchemaValidateListSimpleTypeFacet(void) { |
| 15667 | int ret = 0; |
| 15668 | |
| 15669 | |
| 15670 | /* missing type support */ |
| 15671 | return(ret); |
| 15672 | } |
| 15673 | |
| 15674 | |
| 15675 | static int |
| 15676 | test_xmlSchemaValidatePredefinedType(void) { |
| 15677 | int ret = 0; |
| 15678 | |
| 15679 | |
| 15680 | /* missing type support */ |
| 15681 | return(ret); |
| 15682 | } |
| 15683 | |
| 15684 | static int |
| 15685 | test_xmlschemastypes(void) { |
| 15686 | int ret = 0; |
| 15687 | |
| 15688 | printf("Testing xmlschemastypes ...\n"); |
| 15689 | ret += test_xmlSchemaCheckFacet(); |
| 15690 | ret += test_xmlSchemaCleanupTypes(); |
| 15691 | ret += test_xmlSchemaCollapseString(); |
| 15692 | ret += test_xmlSchemaCompareValues(); |
| 15693 | ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType(); |
| 15694 | ret += test_xmlSchemaGetBuiltInType(); |
| 15695 | ret += test_xmlSchemaGetFacetValueAsULong(); |
| 15696 | ret += test_xmlSchemaGetPredefinedType(); |
| 15697 | ret += test_xmlSchemaInitTypes(); |
| 15698 | ret += test_xmlSchemaIsBuiltInTypeFacet(); |
| 15699 | ret += test_xmlSchemaNewFacet(); |
| 15700 | ret += test_xmlSchemaValPredefTypeNode(); |
| 15701 | ret += test_xmlSchemaValPredefTypeNodeNoNorm(); |
| 15702 | ret += test_xmlSchemaValidateFacet(); |
| 15703 | ret += test_xmlSchemaValidateLengthFacet(); |
| 15704 | ret += test_xmlSchemaValidateListSimpleTypeFacet(); |
| 15705 | ret += test_xmlSchemaValidatePredefinedType(); |
| 15706 | |
| 15707 | if (ret != 0) |
| 15708 | printf("Module xmlschemastypes: %d errors\n", ret); |
| 15709 | return(ret); |
| 15710 | } |
| 15711 | |
| 15712 | static int |
| 15713 | test_xmlCharStrdup(void) { |
| 15714 | int ret = 0; |
| 15715 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 15716 | int mem_base; |
| 15717 | xmlChar * ret_val; |
| 15718 | const char * cur; /* the input char * */ |
| 15719 | int n_cur; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15720 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 15721 | for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) { |
| 15722 | mem_base = xmlMemBlocks(); |
| 15723 | cur = gen_const_char_ptr(n_cur); |
| 15724 | |
| 15725 | ret_val = xmlCharStrdup(cur); |
| 15726 | desret_xmlChar_ptr(ret_val); |
| 15727 | call_tests++; |
| 15728 | des_const_char_ptr(n_cur, cur); |
| 15729 | xmlResetLastError(); |
| 15730 | if (mem_base != xmlMemBlocks()) { |
| 15731 | printf("Leak of %d blocks found in xmlCharStrdup", |
| 15732 | xmlMemBlocks() - mem_base); |
| 15733 | ret++; |
| 15734 | printf(" %d", n_cur); |
| 15735 | printf("\n"); |
| 15736 | } |
| 15737 | } |
| 15738 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15739 | return(ret); |
| 15740 | } |
| 15741 | |
| 15742 | |
| 15743 | static int |
| 15744 | test_xmlCharStrndup(void) { |
| 15745 | int ret = 0; |
| 15746 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 15747 | int mem_base; |
| 15748 | xmlChar * ret_val; |
| 15749 | const char * cur; /* the input char * */ |
| 15750 | int n_cur; |
| 15751 | int len; /* the len of @cur */ |
| 15752 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15753 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 15754 | for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) { |
| 15755 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 15756 | mem_base = xmlMemBlocks(); |
| 15757 | cur = gen_const_char_ptr(n_cur); |
| 15758 | len = gen_int(n_len); |
| 15759 | |
| 15760 | ret_val = xmlCharStrndup(cur, len); |
| 15761 | desret_xmlChar_ptr(ret_val); |
| 15762 | call_tests++; |
| 15763 | des_const_char_ptr(n_cur, cur); |
| 15764 | des_int(n_len, len); |
| 15765 | xmlResetLastError(); |
| 15766 | if (mem_base != xmlMemBlocks()) { |
| 15767 | printf("Leak of %d blocks found in xmlCharStrndup", |
| 15768 | xmlMemBlocks() - mem_base); |
| 15769 | ret++; |
| 15770 | printf(" %d", n_cur); |
| 15771 | printf(" %d", n_len); |
| 15772 | printf("\n"); |
| 15773 | } |
| 15774 | } |
| 15775 | } |
| 15776 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15777 | return(ret); |
| 15778 | } |
| 15779 | |
| 15780 | |
| 15781 | static int |
| 15782 | test_xmlCheckUTF8(void) { |
| 15783 | int ret = 0; |
| 15784 | |
| 15785 | |
| 15786 | /* missing type support */ |
| 15787 | return(ret); |
| 15788 | } |
| 15789 | |
| 15790 | |
| 15791 | static int |
| 15792 | test_xmlGetUTF8Char(void) { |
| 15793 | int ret = 0; |
| 15794 | |
| 15795 | |
| 15796 | /* missing type support */ |
| 15797 | return(ret); |
| 15798 | } |
| 15799 | |
| 15800 | |
| 15801 | static int |
| 15802 | test_xmlStrEqual(void) { |
| 15803 | int ret = 0; |
| 15804 | |
| 15805 | int mem_base; |
| 15806 | int ret_val; |
| 15807 | const xmlChar * str1; /* the first xmlChar * */ |
| 15808 | int n_str1; |
| 15809 | const xmlChar * str2; /* the second xmlChar * */ |
| 15810 | int n_str2; |
| 15811 | |
| 15812 | for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { |
| 15813 | for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { |
| 15814 | mem_base = xmlMemBlocks(); |
| 15815 | str1 = gen_const_xmlChar_ptr(n_str1); |
| 15816 | str2 = gen_const_xmlChar_ptr(n_str2); |
| 15817 | |
| 15818 | ret_val = xmlStrEqual(str1, str2); |
| 15819 | desret_int(ret_val); |
| 15820 | call_tests++; |
| 15821 | des_const_xmlChar_ptr(n_str1, str1); |
| 15822 | des_const_xmlChar_ptr(n_str2, str2); |
| 15823 | xmlResetLastError(); |
| 15824 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 15825 | printf("Leak of %d blocks found in xmlStrEqual", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15826 | xmlMemBlocks() - mem_base); |
| 15827 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 15828 | printf(" %d", n_str1); |
| 15829 | printf(" %d", n_str2); |
| 15830 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15831 | } |
| 15832 | } |
| 15833 | } |
| 15834 | |
| 15835 | return(ret); |
| 15836 | } |
| 15837 | |
| 15838 | |
| 15839 | static int |
| 15840 | test_xmlStrPrintf(void) { |
| 15841 | int ret = 0; |
| 15842 | |
| 15843 | |
| 15844 | /* missing type support */ |
| 15845 | return(ret); |
| 15846 | } |
| 15847 | |
| 15848 | |
| 15849 | static int |
| 15850 | test_xmlStrQEqual(void) { |
| 15851 | int ret = 0; |
| 15852 | |
| 15853 | int mem_base; |
| 15854 | int ret_val; |
| 15855 | const xmlChar * pref; /* the prefix of the QName */ |
| 15856 | int n_pref; |
| 15857 | const xmlChar * name; /* the localname of the QName */ |
| 15858 | int n_name; |
| 15859 | const xmlChar * str; /* the second xmlChar * */ |
| 15860 | int n_str; |
| 15861 | |
| 15862 | for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) { |
| 15863 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 15864 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 15865 | mem_base = xmlMemBlocks(); |
| 15866 | pref = gen_const_xmlChar_ptr(n_pref); |
| 15867 | name = gen_const_xmlChar_ptr(n_name); |
| 15868 | str = gen_const_xmlChar_ptr(n_str); |
| 15869 | |
| 15870 | ret_val = xmlStrQEqual(pref, name, str); |
| 15871 | desret_int(ret_val); |
| 15872 | call_tests++; |
| 15873 | des_const_xmlChar_ptr(n_pref, pref); |
| 15874 | des_const_xmlChar_ptr(n_name, name); |
| 15875 | des_const_xmlChar_ptr(n_str, str); |
| 15876 | xmlResetLastError(); |
| 15877 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 15878 | printf("Leak of %d blocks found in xmlStrQEqual", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15879 | xmlMemBlocks() - mem_base); |
| 15880 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 15881 | printf(" %d", n_pref); |
| 15882 | printf(" %d", n_name); |
| 15883 | printf(" %d", n_str); |
| 15884 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15885 | } |
| 15886 | } |
| 15887 | } |
| 15888 | } |
| 15889 | |
| 15890 | return(ret); |
| 15891 | } |
| 15892 | |
| 15893 | |
| 15894 | static int |
| 15895 | test_xmlStrVPrintf(void) { |
| 15896 | int ret = 0; |
| 15897 | |
| 15898 | |
| 15899 | /* missing type support */ |
| 15900 | return(ret); |
| 15901 | } |
| 15902 | |
| 15903 | |
| 15904 | static int |
| 15905 | test_xmlStrcasecmp(void) { |
| 15906 | int ret = 0; |
| 15907 | |
| 15908 | int mem_base; |
| 15909 | int ret_val; |
| 15910 | const xmlChar * str1; /* the first xmlChar * */ |
| 15911 | int n_str1; |
| 15912 | const xmlChar * str2; /* the second xmlChar * */ |
| 15913 | int n_str2; |
| 15914 | |
| 15915 | for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { |
| 15916 | for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { |
| 15917 | mem_base = xmlMemBlocks(); |
| 15918 | str1 = gen_const_xmlChar_ptr(n_str1); |
| 15919 | str2 = gen_const_xmlChar_ptr(n_str2); |
| 15920 | |
| 15921 | ret_val = xmlStrcasecmp(str1, str2); |
| 15922 | desret_int(ret_val); |
| 15923 | call_tests++; |
| 15924 | des_const_xmlChar_ptr(n_str1, str1); |
| 15925 | des_const_xmlChar_ptr(n_str2, str2); |
| 15926 | xmlResetLastError(); |
| 15927 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 15928 | printf("Leak of %d blocks found in xmlStrcasecmp", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15929 | xmlMemBlocks() - mem_base); |
| 15930 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 15931 | printf(" %d", n_str1); |
| 15932 | printf(" %d", n_str2); |
| 15933 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15934 | } |
| 15935 | } |
| 15936 | } |
| 15937 | |
| 15938 | return(ret); |
| 15939 | } |
| 15940 | |
| 15941 | |
| 15942 | static int |
| 15943 | test_xmlStrcasestr(void) { |
| 15944 | int ret = 0; |
| 15945 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 15946 | int mem_base; |
| 15947 | const xmlChar * ret_val; |
| 15948 | const xmlChar * str; /* the xmlChar * array (haystack) */ |
| 15949 | int n_str; |
| 15950 | xmlChar * val; /* the xmlChar to search (needle) */ |
| 15951 | int n_val; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15952 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 15953 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 15954 | for (n_val = 0;n_val < gen_nb_xmlChar_ptr;n_val++) { |
| 15955 | mem_base = xmlMemBlocks(); |
| 15956 | str = gen_const_xmlChar_ptr(n_str); |
| 15957 | val = gen_xmlChar_ptr(n_val); |
| 15958 | |
| 15959 | ret_val = xmlStrcasestr(str, val); |
| 15960 | desret_const_xmlChar_ptr(ret_val); |
| 15961 | call_tests++; |
| 15962 | des_const_xmlChar_ptr(n_str, str); |
| 15963 | des_xmlChar_ptr(n_val, val); |
| 15964 | xmlResetLastError(); |
| 15965 | if (mem_base != xmlMemBlocks()) { |
| 15966 | printf("Leak of %d blocks found in xmlStrcasestr", |
| 15967 | xmlMemBlocks() - mem_base); |
| 15968 | ret++; |
| 15969 | printf(" %d", n_str); |
| 15970 | printf(" %d", n_val); |
| 15971 | printf("\n"); |
| 15972 | } |
| 15973 | } |
| 15974 | } |
| 15975 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15976 | return(ret); |
| 15977 | } |
| 15978 | |
| 15979 | |
| 15980 | static int |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 15981 | test_xmlStrchr(void) { |
| 15982 | int ret = 0; |
| 15983 | |
| 15984 | |
| 15985 | /* missing type support */ |
| 15986 | return(ret); |
| 15987 | } |
| 15988 | |
| 15989 | |
| 15990 | static int |
| 15991 | test_xmlStrcmp(void) { |
| 15992 | int ret = 0; |
| 15993 | |
| 15994 | int mem_base; |
| 15995 | int ret_val; |
| 15996 | const xmlChar * str1; /* the first xmlChar * */ |
| 15997 | int n_str1; |
| 15998 | const xmlChar * str2; /* the second xmlChar * */ |
| 15999 | int n_str2; |
| 16000 | |
| 16001 | for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { |
| 16002 | for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { |
| 16003 | mem_base = xmlMemBlocks(); |
| 16004 | str1 = gen_const_xmlChar_ptr(n_str1); |
| 16005 | str2 = gen_const_xmlChar_ptr(n_str2); |
| 16006 | |
| 16007 | ret_val = xmlStrcmp(str1, str2); |
| 16008 | desret_int(ret_val); |
| 16009 | call_tests++; |
| 16010 | des_const_xmlChar_ptr(n_str1, str1); |
| 16011 | des_const_xmlChar_ptr(n_str2, str2); |
| 16012 | xmlResetLastError(); |
| 16013 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16014 | printf("Leak of %d blocks found in xmlStrcmp", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16015 | xmlMemBlocks() - mem_base); |
| 16016 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16017 | printf(" %d", n_str1); |
| 16018 | printf(" %d", n_str2); |
| 16019 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16020 | } |
| 16021 | } |
| 16022 | } |
| 16023 | |
| 16024 | return(ret); |
| 16025 | } |
| 16026 | |
| 16027 | |
| 16028 | static int |
| 16029 | test_xmlStrdup(void) { |
| 16030 | int ret = 0; |
| 16031 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16032 | int mem_base; |
| 16033 | xmlChar * ret_val; |
| 16034 | const xmlChar * cur; /* the input xmlChar * */ |
| 16035 | int n_cur; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16036 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16037 | for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { |
| 16038 | mem_base = xmlMemBlocks(); |
| 16039 | cur = gen_const_xmlChar_ptr(n_cur); |
| 16040 | |
| 16041 | ret_val = xmlStrdup(cur); |
| 16042 | desret_xmlChar_ptr(ret_val); |
| 16043 | call_tests++; |
| 16044 | des_const_xmlChar_ptr(n_cur, cur); |
| 16045 | xmlResetLastError(); |
| 16046 | if (mem_base != xmlMemBlocks()) { |
| 16047 | printf("Leak of %d blocks found in xmlStrdup", |
| 16048 | xmlMemBlocks() - mem_base); |
| 16049 | ret++; |
| 16050 | printf(" %d", n_cur); |
| 16051 | printf("\n"); |
| 16052 | } |
| 16053 | } |
| 16054 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16055 | return(ret); |
| 16056 | } |
| 16057 | |
| 16058 | |
| 16059 | static int |
| 16060 | test_xmlStrlen(void) { |
| 16061 | int ret = 0; |
| 16062 | |
| 16063 | int mem_base; |
| 16064 | int ret_val; |
| 16065 | const xmlChar * str; /* the xmlChar * array */ |
| 16066 | int n_str; |
| 16067 | |
| 16068 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 16069 | mem_base = xmlMemBlocks(); |
| 16070 | str = gen_const_xmlChar_ptr(n_str); |
| 16071 | |
| 16072 | ret_val = xmlStrlen(str); |
| 16073 | desret_int(ret_val); |
| 16074 | call_tests++; |
| 16075 | des_const_xmlChar_ptr(n_str, str); |
| 16076 | xmlResetLastError(); |
| 16077 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16078 | printf("Leak of %d blocks found in xmlStrlen", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16079 | xmlMemBlocks() - mem_base); |
| 16080 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16081 | printf(" %d", n_str); |
| 16082 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16083 | } |
| 16084 | } |
| 16085 | |
| 16086 | return(ret); |
| 16087 | } |
| 16088 | |
| 16089 | |
| 16090 | static int |
| 16091 | test_xmlStrncasecmp(void) { |
| 16092 | int ret = 0; |
| 16093 | |
| 16094 | int mem_base; |
| 16095 | int ret_val; |
| 16096 | const xmlChar * str1; /* the first xmlChar * */ |
| 16097 | int n_str1; |
| 16098 | const xmlChar * str2; /* the second xmlChar * */ |
| 16099 | int n_str2; |
| 16100 | int len; /* the max comparison length */ |
| 16101 | int n_len; |
| 16102 | |
| 16103 | for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { |
| 16104 | for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { |
| 16105 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 16106 | mem_base = xmlMemBlocks(); |
| 16107 | str1 = gen_const_xmlChar_ptr(n_str1); |
| 16108 | str2 = gen_const_xmlChar_ptr(n_str2); |
| 16109 | len = gen_int(n_len); |
| 16110 | |
| 16111 | ret_val = xmlStrncasecmp(str1, str2, len); |
| 16112 | desret_int(ret_val); |
| 16113 | call_tests++; |
| 16114 | des_const_xmlChar_ptr(n_str1, str1); |
| 16115 | des_const_xmlChar_ptr(n_str2, str2); |
| 16116 | des_int(n_len, len); |
| 16117 | xmlResetLastError(); |
| 16118 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16119 | printf("Leak of %d blocks found in xmlStrncasecmp", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16120 | xmlMemBlocks() - mem_base); |
| 16121 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16122 | printf(" %d", n_str1); |
| 16123 | printf(" %d", n_str2); |
| 16124 | printf(" %d", n_len); |
| 16125 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16126 | } |
| 16127 | } |
| 16128 | } |
| 16129 | } |
| 16130 | |
| 16131 | return(ret); |
| 16132 | } |
| 16133 | |
| 16134 | |
| 16135 | static int |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16136 | test_xmlStrncatNew(void) { |
| 16137 | int ret = 0; |
| 16138 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16139 | int mem_base; |
| 16140 | xmlChar * ret_val; |
| 16141 | const xmlChar * str1; /* first xmlChar string */ |
| 16142 | int n_str1; |
| 16143 | const xmlChar * str2; /* second xmlChar string */ |
| 16144 | int n_str2; |
| 16145 | int len; /* the len of @str2 */ |
| 16146 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16147 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16148 | for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { |
| 16149 | for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { |
| 16150 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 16151 | mem_base = xmlMemBlocks(); |
| 16152 | str1 = gen_const_xmlChar_ptr(n_str1); |
| 16153 | str2 = gen_const_xmlChar_ptr(n_str2); |
| 16154 | len = gen_int(n_len); |
| 16155 | |
| 16156 | ret_val = xmlStrncatNew(str1, str2, len); |
| 16157 | desret_xmlChar_ptr(ret_val); |
| 16158 | call_tests++; |
| 16159 | des_const_xmlChar_ptr(n_str1, str1); |
| 16160 | des_const_xmlChar_ptr(n_str2, str2); |
| 16161 | des_int(n_len, len); |
| 16162 | xmlResetLastError(); |
| 16163 | if (mem_base != xmlMemBlocks()) { |
| 16164 | printf("Leak of %d blocks found in xmlStrncatNew", |
| 16165 | xmlMemBlocks() - mem_base); |
| 16166 | ret++; |
| 16167 | printf(" %d", n_str1); |
| 16168 | printf(" %d", n_str2); |
| 16169 | printf(" %d", n_len); |
| 16170 | printf("\n"); |
| 16171 | } |
| 16172 | } |
| 16173 | } |
| 16174 | } |
| 16175 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16176 | return(ret); |
| 16177 | } |
| 16178 | |
| 16179 | |
| 16180 | static int |
| 16181 | test_xmlStrncmp(void) { |
| 16182 | int ret = 0; |
| 16183 | |
| 16184 | int mem_base; |
| 16185 | int ret_val; |
| 16186 | const xmlChar * str1; /* the first xmlChar * */ |
| 16187 | int n_str1; |
| 16188 | const xmlChar * str2; /* the second xmlChar * */ |
| 16189 | int n_str2; |
| 16190 | int len; /* the max comparison length */ |
| 16191 | int n_len; |
| 16192 | |
| 16193 | for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { |
| 16194 | for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { |
| 16195 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 16196 | mem_base = xmlMemBlocks(); |
| 16197 | str1 = gen_const_xmlChar_ptr(n_str1); |
| 16198 | str2 = gen_const_xmlChar_ptr(n_str2); |
| 16199 | len = gen_int(n_len); |
| 16200 | |
| 16201 | ret_val = xmlStrncmp(str1, str2, len); |
| 16202 | desret_int(ret_val); |
| 16203 | call_tests++; |
| 16204 | des_const_xmlChar_ptr(n_str1, str1); |
| 16205 | des_const_xmlChar_ptr(n_str2, str2); |
| 16206 | des_int(n_len, len); |
| 16207 | xmlResetLastError(); |
| 16208 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16209 | printf("Leak of %d blocks found in xmlStrncmp", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16210 | xmlMemBlocks() - mem_base); |
| 16211 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16212 | printf(" %d", n_str1); |
| 16213 | printf(" %d", n_str2); |
| 16214 | printf(" %d", n_len); |
| 16215 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16216 | } |
| 16217 | } |
| 16218 | } |
| 16219 | } |
| 16220 | |
| 16221 | return(ret); |
| 16222 | } |
| 16223 | |
| 16224 | |
| 16225 | static int |
| 16226 | test_xmlStrndup(void) { |
| 16227 | int ret = 0; |
| 16228 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16229 | int mem_base; |
| 16230 | xmlChar * ret_val; |
| 16231 | const xmlChar * cur; /* the input xmlChar * */ |
| 16232 | int n_cur; |
| 16233 | int len; /* the len of @cur */ |
| 16234 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16235 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16236 | for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { |
| 16237 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 16238 | mem_base = xmlMemBlocks(); |
| 16239 | cur = gen_const_xmlChar_ptr(n_cur); |
| 16240 | len = gen_int(n_len); |
| 16241 | |
| 16242 | ret_val = xmlStrndup(cur, len); |
| 16243 | desret_xmlChar_ptr(ret_val); |
| 16244 | call_tests++; |
| 16245 | des_const_xmlChar_ptr(n_cur, cur); |
| 16246 | des_int(n_len, len); |
| 16247 | xmlResetLastError(); |
| 16248 | if (mem_base != xmlMemBlocks()) { |
| 16249 | printf("Leak of %d blocks found in xmlStrndup", |
| 16250 | xmlMemBlocks() - mem_base); |
| 16251 | ret++; |
| 16252 | printf(" %d", n_cur); |
| 16253 | printf(" %d", n_len); |
| 16254 | printf("\n"); |
| 16255 | } |
| 16256 | } |
| 16257 | } |
| 16258 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16259 | return(ret); |
| 16260 | } |
| 16261 | |
| 16262 | |
| 16263 | static int |
| 16264 | test_xmlStrstr(void) { |
| 16265 | int ret = 0; |
| 16266 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 16267 | int mem_base; |
| 16268 | const xmlChar * ret_val; |
| 16269 | const xmlChar * str; /* the xmlChar * array (haystack) */ |
| 16270 | int n_str; |
| 16271 | const xmlChar * val; /* the xmlChar to search (needle) */ |
| 16272 | int n_val; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16273 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 16274 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 16275 | for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) { |
| 16276 | mem_base = xmlMemBlocks(); |
| 16277 | str = gen_const_xmlChar_ptr(n_str); |
| 16278 | val = gen_const_xmlChar_ptr(n_val); |
| 16279 | |
| 16280 | ret_val = xmlStrstr(str, val); |
| 16281 | desret_const_xmlChar_ptr(ret_val); |
| 16282 | call_tests++; |
| 16283 | des_const_xmlChar_ptr(n_str, str); |
| 16284 | des_const_xmlChar_ptr(n_val, val); |
| 16285 | xmlResetLastError(); |
| 16286 | if (mem_base != xmlMemBlocks()) { |
| 16287 | printf("Leak of %d blocks found in xmlStrstr", |
| 16288 | xmlMemBlocks() - mem_base); |
| 16289 | ret++; |
| 16290 | printf(" %d", n_str); |
| 16291 | printf(" %d", n_val); |
| 16292 | printf("\n"); |
| 16293 | } |
| 16294 | } |
| 16295 | } |
| 16296 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16297 | return(ret); |
| 16298 | } |
| 16299 | |
| 16300 | |
| 16301 | static int |
| 16302 | test_xmlStrsub(void) { |
| 16303 | int ret = 0; |
| 16304 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16305 | int mem_base; |
| 16306 | xmlChar * ret_val; |
| 16307 | const xmlChar * str; /* the xmlChar * array (haystack) */ |
| 16308 | int n_str; |
| 16309 | int start; /* the index of the first char (zero based) */ |
| 16310 | int n_start; |
| 16311 | int len; /* the length of the substring */ |
| 16312 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16313 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16314 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 16315 | for (n_start = 0;n_start < gen_nb_int;n_start++) { |
| 16316 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 16317 | mem_base = xmlMemBlocks(); |
| 16318 | str = gen_const_xmlChar_ptr(n_str); |
| 16319 | start = gen_int(n_start); |
| 16320 | len = gen_int(n_len); |
| 16321 | |
| 16322 | ret_val = xmlStrsub(str, start, len); |
| 16323 | desret_xmlChar_ptr(ret_val); |
| 16324 | call_tests++; |
| 16325 | des_const_xmlChar_ptr(n_str, str); |
| 16326 | des_int(n_start, start); |
| 16327 | des_int(n_len, len); |
| 16328 | xmlResetLastError(); |
| 16329 | if (mem_base != xmlMemBlocks()) { |
| 16330 | printf("Leak of %d blocks found in xmlStrsub", |
| 16331 | xmlMemBlocks() - mem_base); |
| 16332 | ret++; |
| 16333 | printf(" %d", n_str); |
| 16334 | printf(" %d", n_start); |
| 16335 | printf(" %d", n_len); |
| 16336 | printf("\n"); |
| 16337 | } |
| 16338 | } |
| 16339 | } |
| 16340 | } |
| 16341 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16342 | return(ret); |
| 16343 | } |
| 16344 | |
| 16345 | |
| 16346 | static int |
| 16347 | test_xmlUTF8Charcmp(void) { |
| 16348 | int ret = 0; |
| 16349 | |
| 16350 | int mem_base; |
| 16351 | int ret_val; |
| 16352 | const xmlChar * utf1; /* pointer to first UTF8 char */ |
| 16353 | int n_utf1; |
| 16354 | const xmlChar * utf2; /* pointer to second UTF8 char */ |
| 16355 | int n_utf2; |
| 16356 | |
| 16357 | for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) { |
| 16358 | for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) { |
| 16359 | mem_base = xmlMemBlocks(); |
| 16360 | utf1 = gen_const_xmlChar_ptr(n_utf1); |
| 16361 | utf2 = gen_const_xmlChar_ptr(n_utf2); |
| 16362 | |
| 16363 | ret_val = xmlUTF8Charcmp(utf1, utf2); |
| 16364 | desret_int(ret_val); |
| 16365 | call_tests++; |
| 16366 | des_const_xmlChar_ptr(n_utf1, utf1); |
| 16367 | des_const_xmlChar_ptr(n_utf2, utf2); |
| 16368 | xmlResetLastError(); |
| 16369 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16370 | printf("Leak of %d blocks found in xmlUTF8Charcmp", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16371 | xmlMemBlocks() - mem_base); |
| 16372 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16373 | printf(" %d", n_utf1); |
| 16374 | printf(" %d", n_utf2); |
| 16375 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16376 | } |
| 16377 | } |
| 16378 | } |
| 16379 | |
| 16380 | return(ret); |
| 16381 | } |
| 16382 | |
| 16383 | |
| 16384 | static int |
| 16385 | test_xmlUTF8Size(void) { |
| 16386 | int ret = 0; |
| 16387 | |
| 16388 | int mem_base; |
| 16389 | int ret_val; |
| 16390 | const xmlChar * utf; /* pointer to the UTF8 character */ |
| 16391 | int n_utf; |
| 16392 | |
| 16393 | for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { |
| 16394 | mem_base = xmlMemBlocks(); |
| 16395 | utf = gen_const_xmlChar_ptr(n_utf); |
| 16396 | |
| 16397 | ret_val = xmlUTF8Size(utf); |
| 16398 | desret_int(ret_val); |
| 16399 | call_tests++; |
| 16400 | des_const_xmlChar_ptr(n_utf, utf); |
| 16401 | xmlResetLastError(); |
| 16402 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16403 | printf("Leak of %d blocks found in xmlUTF8Size", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16404 | xmlMemBlocks() - mem_base); |
| 16405 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16406 | printf(" %d", n_utf); |
| 16407 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16408 | } |
| 16409 | } |
| 16410 | |
| 16411 | return(ret); |
| 16412 | } |
| 16413 | |
| 16414 | |
| 16415 | static int |
| 16416 | test_xmlUTF8Strlen(void) { |
| 16417 | int ret = 0; |
| 16418 | |
| 16419 | int mem_base; |
| 16420 | int ret_val; |
| 16421 | const xmlChar * utf; /* a sequence of UTF-8 encoded bytes */ |
| 16422 | int n_utf; |
| 16423 | |
| 16424 | for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { |
| 16425 | mem_base = xmlMemBlocks(); |
| 16426 | utf = gen_const_xmlChar_ptr(n_utf); |
| 16427 | |
| 16428 | ret_val = xmlUTF8Strlen(utf); |
| 16429 | desret_int(ret_val); |
| 16430 | call_tests++; |
| 16431 | des_const_xmlChar_ptr(n_utf, utf); |
| 16432 | xmlResetLastError(); |
| 16433 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16434 | printf("Leak of %d blocks found in xmlUTF8Strlen", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16435 | xmlMemBlocks() - mem_base); |
| 16436 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16437 | printf(" %d", n_utf); |
| 16438 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16439 | } |
| 16440 | } |
| 16441 | |
| 16442 | return(ret); |
| 16443 | } |
| 16444 | |
| 16445 | |
| 16446 | static int |
| 16447 | test_xmlUTF8Strloc(void) { |
| 16448 | int ret = 0; |
| 16449 | |
| 16450 | int mem_base; |
| 16451 | int ret_val; |
| 16452 | const xmlChar * utf; /* the input UTF8 * */ |
| 16453 | int n_utf; |
| 16454 | const xmlChar * utfchar; /* the UTF8 character to be found */ |
| 16455 | int n_utfchar; |
| 16456 | |
| 16457 | for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { |
| 16458 | for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) { |
| 16459 | mem_base = xmlMemBlocks(); |
| 16460 | utf = gen_const_xmlChar_ptr(n_utf); |
| 16461 | utfchar = gen_const_xmlChar_ptr(n_utfchar); |
| 16462 | |
| 16463 | ret_val = xmlUTF8Strloc(utf, utfchar); |
| 16464 | desret_int(ret_val); |
| 16465 | call_tests++; |
| 16466 | des_const_xmlChar_ptr(n_utf, utf); |
| 16467 | des_const_xmlChar_ptr(n_utfchar, utfchar); |
| 16468 | xmlResetLastError(); |
| 16469 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16470 | printf("Leak of %d blocks found in xmlUTF8Strloc", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16471 | xmlMemBlocks() - mem_base); |
| 16472 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16473 | printf(" %d", n_utf); |
| 16474 | printf(" %d", n_utfchar); |
| 16475 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16476 | } |
| 16477 | } |
| 16478 | } |
| 16479 | |
| 16480 | return(ret); |
| 16481 | } |
| 16482 | |
| 16483 | |
| 16484 | static int |
| 16485 | test_xmlUTF8Strndup(void) { |
| 16486 | int ret = 0; |
| 16487 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16488 | int mem_base; |
| 16489 | xmlChar * ret_val; |
| 16490 | const xmlChar * utf; /* the input UTF8 * */ |
| 16491 | int n_utf; |
| 16492 | int len; /* the len of @utf (in chars) */ |
| 16493 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16494 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16495 | for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { |
| 16496 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 16497 | mem_base = xmlMemBlocks(); |
| 16498 | utf = gen_const_xmlChar_ptr(n_utf); |
| 16499 | len = gen_int(n_len); |
| 16500 | |
| 16501 | ret_val = xmlUTF8Strndup(utf, len); |
| 16502 | desret_xmlChar_ptr(ret_val); |
| 16503 | call_tests++; |
| 16504 | des_const_xmlChar_ptr(n_utf, utf); |
| 16505 | des_int(n_len, len); |
| 16506 | xmlResetLastError(); |
| 16507 | if (mem_base != xmlMemBlocks()) { |
| 16508 | printf("Leak of %d blocks found in xmlUTF8Strndup", |
| 16509 | xmlMemBlocks() - mem_base); |
| 16510 | ret++; |
| 16511 | printf(" %d", n_utf); |
| 16512 | printf(" %d", n_len); |
| 16513 | printf("\n"); |
| 16514 | } |
| 16515 | } |
| 16516 | } |
| 16517 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16518 | return(ret); |
| 16519 | } |
| 16520 | |
| 16521 | |
| 16522 | static int |
| 16523 | test_xmlUTF8Strpos(void) { |
| 16524 | int ret = 0; |
| 16525 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 16526 | int mem_base; |
| 16527 | const xmlChar * ret_val; |
| 16528 | const xmlChar * utf; /* the input UTF8 * */ |
| 16529 | int n_utf; |
| 16530 | int pos; /* the position of the desired UTF8 char (in chars) */ |
| 16531 | int n_pos; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16532 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 16533 | for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { |
| 16534 | for (n_pos = 0;n_pos < gen_nb_int;n_pos++) { |
| 16535 | mem_base = xmlMemBlocks(); |
| 16536 | utf = gen_const_xmlChar_ptr(n_utf); |
| 16537 | pos = gen_int(n_pos); |
| 16538 | |
| 16539 | ret_val = xmlUTF8Strpos(utf, pos); |
| 16540 | desret_const_xmlChar_ptr(ret_val); |
| 16541 | call_tests++; |
| 16542 | des_const_xmlChar_ptr(n_utf, utf); |
| 16543 | des_int(n_pos, pos); |
| 16544 | xmlResetLastError(); |
| 16545 | if (mem_base != xmlMemBlocks()) { |
| 16546 | printf("Leak of %d blocks found in xmlUTF8Strpos", |
| 16547 | xmlMemBlocks() - mem_base); |
| 16548 | ret++; |
| 16549 | printf(" %d", n_utf); |
| 16550 | printf(" %d", n_pos); |
| 16551 | printf("\n"); |
| 16552 | } |
| 16553 | } |
| 16554 | } |
| 16555 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16556 | return(ret); |
| 16557 | } |
| 16558 | |
| 16559 | |
| 16560 | static int |
| 16561 | test_xmlUTF8Strsize(void) { |
| 16562 | int ret = 0; |
| 16563 | |
| 16564 | int mem_base; |
| 16565 | int ret_val; |
| 16566 | const xmlChar * utf; /* a sequence of UTF-8 encoded bytes */ |
| 16567 | int n_utf; |
| 16568 | int len; /* the number of characters in the array */ |
| 16569 | int n_len; |
| 16570 | |
| 16571 | for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { |
| 16572 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 16573 | mem_base = xmlMemBlocks(); |
| 16574 | utf = gen_const_xmlChar_ptr(n_utf); |
| 16575 | len = gen_int(n_len); |
| 16576 | |
| 16577 | ret_val = xmlUTF8Strsize(utf, len); |
| 16578 | desret_int(ret_val); |
| 16579 | call_tests++; |
| 16580 | des_const_xmlChar_ptr(n_utf, utf); |
| 16581 | des_int(n_len, len); |
| 16582 | xmlResetLastError(); |
| 16583 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16584 | printf("Leak of %d blocks found in xmlUTF8Strsize", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16585 | xmlMemBlocks() - mem_base); |
| 16586 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 16587 | printf(" %d", n_utf); |
| 16588 | printf(" %d", n_len); |
| 16589 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16590 | } |
| 16591 | } |
| 16592 | } |
| 16593 | |
| 16594 | return(ret); |
| 16595 | } |
| 16596 | |
| 16597 | |
| 16598 | static int |
| 16599 | test_xmlUTF8Strsub(void) { |
| 16600 | int ret = 0; |
| 16601 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16602 | int mem_base; |
| 16603 | xmlChar * ret_val; |
| 16604 | const xmlChar * utf; /* a sequence of UTF-8 encoded bytes */ |
| 16605 | int n_utf; |
| 16606 | int start; /* relative pos of first char */ |
| 16607 | int n_start; |
| 16608 | int len; /* total number to copy */ |
| 16609 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16610 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 16611 | for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { |
| 16612 | for (n_start = 0;n_start < gen_nb_int;n_start++) { |
| 16613 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 16614 | mem_base = xmlMemBlocks(); |
| 16615 | utf = gen_const_xmlChar_ptr(n_utf); |
| 16616 | start = gen_int(n_start); |
| 16617 | len = gen_int(n_len); |
| 16618 | |
| 16619 | ret_val = xmlUTF8Strsub(utf, start, len); |
| 16620 | desret_xmlChar_ptr(ret_val); |
| 16621 | call_tests++; |
| 16622 | des_const_xmlChar_ptr(n_utf, utf); |
| 16623 | des_int(n_start, start); |
| 16624 | des_int(n_len, len); |
| 16625 | xmlResetLastError(); |
| 16626 | if (mem_base != xmlMemBlocks()) { |
| 16627 | printf("Leak of %d blocks found in xmlUTF8Strsub", |
| 16628 | xmlMemBlocks() - mem_base); |
| 16629 | ret++; |
| 16630 | printf(" %d", n_utf); |
| 16631 | printf(" %d", n_start); |
| 16632 | printf(" %d", n_len); |
| 16633 | printf("\n"); |
| 16634 | } |
| 16635 | } |
| 16636 | } |
| 16637 | } |
| 16638 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16639 | return(ret); |
| 16640 | } |
| 16641 | |
| 16642 | static int |
| 16643 | test_xmlstring(void) { |
| 16644 | int ret = 0; |
| 16645 | |
| 16646 | printf("Testing xmlstring ...\n"); |
| 16647 | ret += test_xmlCharStrdup(); |
| 16648 | ret += test_xmlCharStrndup(); |
| 16649 | ret += test_xmlCheckUTF8(); |
| 16650 | ret += test_xmlGetUTF8Char(); |
| 16651 | ret += test_xmlStrEqual(); |
| 16652 | ret += test_xmlStrPrintf(); |
| 16653 | ret += test_xmlStrQEqual(); |
| 16654 | ret += test_xmlStrVPrintf(); |
| 16655 | ret += test_xmlStrcasecmp(); |
| 16656 | ret += test_xmlStrcasestr(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16657 | ret += test_xmlStrchr(); |
| 16658 | ret += test_xmlStrcmp(); |
| 16659 | ret += test_xmlStrdup(); |
| 16660 | ret += test_xmlStrlen(); |
| 16661 | ret += test_xmlStrncasecmp(); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16662 | ret += test_xmlStrncatNew(); |
| 16663 | ret += test_xmlStrncmp(); |
| 16664 | ret += test_xmlStrndup(); |
| 16665 | ret += test_xmlStrstr(); |
| 16666 | ret += test_xmlStrsub(); |
| 16667 | ret += test_xmlUTF8Charcmp(); |
| 16668 | ret += test_xmlUTF8Size(); |
| 16669 | ret += test_xmlUTF8Strlen(); |
| 16670 | ret += test_xmlUTF8Strloc(); |
| 16671 | ret += test_xmlUTF8Strndup(); |
| 16672 | ret += test_xmlUTF8Strpos(); |
| 16673 | ret += test_xmlUTF8Strsize(); |
| 16674 | ret += test_xmlUTF8Strsub(); |
| 16675 | |
| 16676 | if (ret != 0) |
| 16677 | printf("Module xmlstring: %d errors\n", ret); |
| 16678 | return(ret); |
| 16679 | } |
| 16680 | |
| 16681 | static int |
| 16682 | test_xmlNewTextWriter(void) { |
| 16683 | int ret = 0; |
| 16684 | |
| 16685 | |
| 16686 | /* missing type support */ |
| 16687 | return(ret); |
| 16688 | } |
| 16689 | |
| 16690 | |
| 16691 | static int |
| 16692 | test_xmlNewTextWriterDoc(void) { |
| 16693 | int ret = 0; |
| 16694 | |
| 16695 | |
| 16696 | /* missing type support */ |
| 16697 | return(ret); |
| 16698 | } |
| 16699 | |
| 16700 | |
| 16701 | static int |
| 16702 | test_xmlNewTextWriterFilename(void) { |
| 16703 | int ret = 0; |
| 16704 | |
| 16705 | |
| 16706 | /* missing type support */ |
| 16707 | return(ret); |
| 16708 | } |
| 16709 | |
| 16710 | |
| 16711 | static int |
| 16712 | test_xmlNewTextWriterMemory(void) { |
| 16713 | int ret = 0; |
| 16714 | |
| 16715 | |
| 16716 | /* missing type support */ |
| 16717 | return(ret); |
| 16718 | } |
| 16719 | |
| 16720 | |
| 16721 | static int |
| 16722 | test_xmlNewTextWriterPushParser(void) { |
| 16723 | int ret = 0; |
| 16724 | |
| 16725 | |
| 16726 | /* missing type support */ |
| 16727 | return(ret); |
| 16728 | } |
| 16729 | |
| 16730 | |
| 16731 | static int |
| 16732 | test_xmlNewTextWriterTree(void) { |
| 16733 | int ret = 0; |
| 16734 | |
| 16735 | |
| 16736 | /* missing type support */ |
| 16737 | return(ret); |
| 16738 | } |
| 16739 | |
| 16740 | |
| 16741 | static int |
| 16742 | test_xmlTextWriterEndAttribute(void) { |
| 16743 | int ret = 0; |
| 16744 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16745 | #ifdef LIBXML_WRITER_ENABLED |
| 16746 | int mem_base; |
| 16747 | int ret_val; |
| 16748 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 16749 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16750 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16751 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 16752 | mem_base = xmlMemBlocks(); |
| 16753 | writer = gen_xmlTextWriterPtr(n_writer); |
| 16754 | |
| 16755 | ret_val = xmlTextWriterEndAttribute(writer); |
| 16756 | desret_int(ret_val); |
| 16757 | call_tests++; |
| 16758 | des_xmlTextWriterPtr(n_writer, writer); |
| 16759 | xmlResetLastError(); |
| 16760 | if (mem_base != xmlMemBlocks()) { |
| 16761 | printf("Leak of %d blocks found in xmlTextWriterEndAttribute", |
| 16762 | xmlMemBlocks() - mem_base); |
| 16763 | ret++; |
| 16764 | printf(" %d", n_writer); |
| 16765 | printf("\n"); |
| 16766 | } |
| 16767 | } |
| 16768 | #endif |
| 16769 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16770 | return(ret); |
| 16771 | } |
| 16772 | |
| 16773 | |
| 16774 | static int |
| 16775 | test_xmlTextWriterEndCDATA(void) { |
| 16776 | int ret = 0; |
| 16777 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16778 | #ifdef LIBXML_WRITER_ENABLED |
| 16779 | int mem_base; |
| 16780 | int ret_val; |
| 16781 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 16782 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16783 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16784 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 16785 | mem_base = xmlMemBlocks(); |
| 16786 | writer = gen_xmlTextWriterPtr(n_writer); |
| 16787 | |
| 16788 | ret_val = xmlTextWriterEndCDATA(writer); |
| 16789 | desret_int(ret_val); |
| 16790 | call_tests++; |
| 16791 | des_xmlTextWriterPtr(n_writer, writer); |
| 16792 | xmlResetLastError(); |
| 16793 | if (mem_base != xmlMemBlocks()) { |
| 16794 | printf("Leak of %d blocks found in xmlTextWriterEndCDATA", |
| 16795 | xmlMemBlocks() - mem_base); |
| 16796 | ret++; |
| 16797 | printf(" %d", n_writer); |
| 16798 | printf("\n"); |
| 16799 | } |
| 16800 | } |
| 16801 | #endif |
| 16802 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16803 | return(ret); |
| 16804 | } |
| 16805 | |
| 16806 | |
| 16807 | static int |
| 16808 | test_xmlTextWriterEndComment(void) { |
| 16809 | int ret = 0; |
| 16810 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16811 | #ifdef LIBXML_WRITER_ENABLED |
| 16812 | int mem_base; |
| 16813 | int ret_val; |
| 16814 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 16815 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16816 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16817 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 16818 | mem_base = xmlMemBlocks(); |
| 16819 | writer = gen_xmlTextWriterPtr(n_writer); |
| 16820 | |
| 16821 | ret_val = xmlTextWriterEndComment(writer); |
| 16822 | desret_int(ret_val); |
| 16823 | call_tests++; |
| 16824 | des_xmlTextWriterPtr(n_writer, writer); |
| 16825 | xmlResetLastError(); |
| 16826 | if (mem_base != xmlMemBlocks()) { |
| 16827 | printf("Leak of %d blocks found in xmlTextWriterEndComment", |
| 16828 | xmlMemBlocks() - mem_base); |
| 16829 | ret++; |
| 16830 | printf(" %d", n_writer); |
| 16831 | printf("\n"); |
| 16832 | } |
| 16833 | } |
| 16834 | #endif |
| 16835 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16836 | return(ret); |
| 16837 | } |
| 16838 | |
| 16839 | |
| 16840 | static int |
| 16841 | test_xmlTextWriterEndDTD(void) { |
| 16842 | int ret = 0; |
| 16843 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16844 | #ifdef LIBXML_WRITER_ENABLED |
| 16845 | int mem_base; |
| 16846 | int ret_val; |
| 16847 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 16848 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16849 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16850 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 16851 | mem_base = xmlMemBlocks(); |
| 16852 | writer = gen_xmlTextWriterPtr(n_writer); |
| 16853 | |
| 16854 | ret_val = xmlTextWriterEndDTD(writer); |
| 16855 | desret_int(ret_val); |
| 16856 | call_tests++; |
| 16857 | des_xmlTextWriterPtr(n_writer, writer); |
| 16858 | xmlResetLastError(); |
| 16859 | if (mem_base != xmlMemBlocks()) { |
| 16860 | printf("Leak of %d blocks found in xmlTextWriterEndDTD", |
| 16861 | xmlMemBlocks() - mem_base); |
| 16862 | ret++; |
| 16863 | printf(" %d", n_writer); |
| 16864 | printf("\n"); |
| 16865 | } |
| 16866 | } |
| 16867 | #endif |
| 16868 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16869 | return(ret); |
| 16870 | } |
| 16871 | |
| 16872 | |
| 16873 | static int |
| 16874 | test_xmlTextWriterEndDTDAttlist(void) { |
| 16875 | int ret = 0; |
| 16876 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16877 | #ifdef LIBXML_WRITER_ENABLED |
| 16878 | int mem_base; |
| 16879 | int ret_val; |
| 16880 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 16881 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16882 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16883 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 16884 | mem_base = xmlMemBlocks(); |
| 16885 | writer = gen_xmlTextWriterPtr(n_writer); |
| 16886 | |
| 16887 | ret_val = xmlTextWriterEndDTDAttlist(writer); |
| 16888 | desret_int(ret_val); |
| 16889 | call_tests++; |
| 16890 | des_xmlTextWriterPtr(n_writer, writer); |
| 16891 | xmlResetLastError(); |
| 16892 | if (mem_base != xmlMemBlocks()) { |
| 16893 | printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist", |
| 16894 | xmlMemBlocks() - mem_base); |
| 16895 | ret++; |
| 16896 | printf(" %d", n_writer); |
| 16897 | printf("\n"); |
| 16898 | } |
| 16899 | } |
| 16900 | #endif |
| 16901 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16902 | return(ret); |
| 16903 | } |
| 16904 | |
| 16905 | |
| 16906 | static int |
| 16907 | test_xmlTextWriterEndDTDElement(void) { |
| 16908 | int ret = 0; |
| 16909 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16910 | #ifdef LIBXML_WRITER_ENABLED |
| 16911 | int mem_base; |
| 16912 | int ret_val; |
| 16913 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 16914 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16915 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16916 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 16917 | mem_base = xmlMemBlocks(); |
| 16918 | writer = gen_xmlTextWriterPtr(n_writer); |
| 16919 | |
| 16920 | ret_val = xmlTextWriterEndDTDElement(writer); |
| 16921 | desret_int(ret_val); |
| 16922 | call_tests++; |
| 16923 | des_xmlTextWriterPtr(n_writer, writer); |
| 16924 | xmlResetLastError(); |
| 16925 | if (mem_base != xmlMemBlocks()) { |
| 16926 | printf("Leak of %d blocks found in xmlTextWriterEndDTDElement", |
| 16927 | xmlMemBlocks() - mem_base); |
| 16928 | ret++; |
| 16929 | printf(" %d", n_writer); |
| 16930 | printf("\n"); |
| 16931 | } |
| 16932 | } |
| 16933 | #endif |
| 16934 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16935 | return(ret); |
| 16936 | } |
| 16937 | |
| 16938 | |
| 16939 | static int |
| 16940 | test_xmlTextWriterEndDTDEntity(void) { |
| 16941 | int ret = 0; |
| 16942 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16943 | #ifdef LIBXML_WRITER_ENABLED |
| 16944 | int mem_base; |
| 16945 | int ret_val; |
| 16946 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 16947 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16948 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16949 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 16950 | mem_base = xmlMemBlocks(); |
| 16951 | writer = gen_xmlTextWriterPtr(n_writer); |
| 16952 | |
| 16953 | ret_val = xmlTextWriterEndDTDEntity(writer); |
| 16954 | desret_int(ret_val); |
| 16955 | call_tests++; |
| 16956 | des_xmlTextWriterPtr(n_writer, writer); |
| 16957 | xmlResetLastError(); |
| 16958 | if (mem_base != xmlMemBlocks()) { |
| 16959 | printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity", |
| 16960 | xmlMemBlocks() - mem_base); |
| 16961 | ret++; |
| 16962 | printf(" %d", n_writer); |
| 16963 | printf("\n"); |
| 16964 | } |
| 16965 | } |
| 16966 | #endif |
| 16967 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16968 | return(ret); |
| 16969 | } |
| 16970 | |
| 16971 | |
| 16972 | static int |
| 16973 | test_xmlTextWriterEndDocument(void) { |
| 16974 | int ret = 0; |
| 16975 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16976 | #ifdef LIBXML_WRITER_ENABLED |
| 16977 | int mem_base; |
| 16978 | int ret_val; |
| 16979 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 16980 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 16981 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 16982 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 16983 | mem_base = xmlMemBlocks(); |
| 16984 | writer = gen_xmlTextWriterPtr(n_writer); |
| 16985 | |
| 16986 | ret_val = xmlTextWriterEndDocument(writer); |
| 16987 | desret_int(ret_val); |
| 16988 | call_tests++; |
| 16989 | des_xmlTextWriterPtr(n_writer, writer); |
| 16990 | xmlResetLastError(); |
| 16991 | if (mem_base != xmlMemBlocks()) { |
| 16992 | printf("Leak of %d blocks found in xmlTextWriterEndDocument", |
| 16993 | xmlMemBlocks() - mem_base); |
| 16994 | ret++; |
| 16995 | printf(" %d", n_writer); |
| 16996 | printf("\n"); |
| 16997 | } |
| 16998 | } |
| 16999 | #endif |
| 17000 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17001 | return(ret); |
| 17002 | } |
| 17003 | |
| 17004 | |
| 17005 | static int |
| 17006 | test_xmlTextWriterEndElement(void) { |
| 17007 | int ret = 0; |
| 17008 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17009 | #ifdef LIBXML_WRITER_ENABLED |
| 17010 | int mem_base; |
| 17011 | int ret_val; |
| 17012 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17013 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17014 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17015 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17016 | mem_base = xmlMemBlocks(); |
| 17017 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17018 | |
| 17019 | ret_val = xmlTextWriterEndElement(writer); |
| 17020 | desret_int(ret_val); |
| 17021 | call_tests++; |
| 17022 | des_xmlTextWriterPtr(n_writer, writer); |
| 17023 | xmlResetLastError(); |
| 17024 | if (mem_base != xmlMemBlocks()) { |
| 17025 | printf("Leak of %d blocks found in xmlTextWriterEndElement", |
| 17026 | xmlMemBlocks() - mem_base); |
| 17027 | ret++; |
| 17028 | printf(" %d", n_writer); |
| 17029 | printf("\n"); |
| 17030 | } |
| 17031 | } |
| 17032 | #endif |
| 17033 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17034 | return(ret); |
| 17035 | } |
| 17036 | |
| 17037 | |
| 17038 | static int |
| 17039 | test_xmlTextWriterEndPI(void) { |
| 17040 | int ret = 0; |
| 17041 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17042 | #ifdef LIBXML_WRITER_ENABLED |
| 17043 | int mem_base; |
| 17044 | int ret_val; |
| 17045 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17046 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17047 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17048 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17049 | mem_base = xmlMemBlocks(); |
| 17050 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17051 | |
| 17052 | ret_val = xmlTextWriterEndPI(writer); |
| 17053 | desret_int(ret_val); |
| 17054 | call_tests++; |
| 17055 | des_xmlTextWriterPtr(n_writer, writer); |
| 17056 | xmlResetLastError(); |
| 17057 | if (mem_base != xmlMemBlocks()) { |
| 17058 | printf("Leak of %d blocks found in xmlTextWriterEndPI", |
| 17059 | xmlMemBlocks() - mem_base); |
| 17060 | ret++; |
| 17061 | printf(" %d", n_writer); |
| 17062 | printf("\n"); |
| 17063 | } |
| 17064 | } |
| 17065 | #endif |
| 17066 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17067 | return(ret); |
| 17068 | } |
| 17069 | |
| 17070 | |
| 17071 | static int |
| 17072 | test_xmlTextWriterFlush(void) { |
| 17073 | int ret = 0; |
| 17074 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17075 | #ifdef LIBXML_WRITER_ENABLED |
| 17076 | int mem_base; |
| 17077 | int ret_val; |
| 17078 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17079 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17080 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17081 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17082 | mem_base = xmlMemBlocks(); |
| 17083 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17084 | |
| 17085 | ret_val = xmlTextWriterFlush(writer); |
| 17086 | desret_int(ret_val); |
| 17087 | call_tests++; |
| 17088 | des_xmlTextWriterPtr(n_writer, writer); |
| 17089 | xmlResetLastError(); |
| 17090 | if (mem_base != xmlMemBlocks()) { |
| 17091 | printf("Leak of %d blocks found in xmlTextWriterFlush", |
| 17092 | xmlMemBlocks() - mem_base); |
| 17093 | ret++; |
| 17094 | printf(" %d", n_writer); |
| 17095 | printf("\n"); |
| 17096 | } |
| 17097 | } |
| 17098 | #endif |
| 17099 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17100 | return(ret); |
| 17101 | } |
| 17102 | |
| 17103 | |
| 17104 | static int |
| 17105 | test_xmlTextWriterFullEndElement(void) { |
| 17106 | int ret = 0; |
| 17107 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17108 | #ifdef LIBXML_WRITER_ENABLED |
| 17109 | int mem_base; |
| 17110 | int ret_val; |
| 17111 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17112 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17113 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17114 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17115 | mem_base = xmlMemBlocks(); |
| 17116 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17117 | |
| 17118 | ret_val = xmlTextWriterFullEndElement(writer); |
| 17119 | desret_int(ret_val); |
| 17120 | call_tests++; |
| 17121 | des_xmlTextWriterPtr(n_writer, writer); |
| 17122 | xmlResetLastError(); |
| 17123 | if (mem_base != xmlMemBlocks()) { |
| 17124 | printf("Leak of %d blocks found in xmlTextWriterFullEndElement", |
| 17125 | xmlMemBlocks() - mem_base); |
| 17126 | ret++; |
| 17127 | printf(" %d", n_writer); |
| 17128 | printf("\n"); |
| 17129 | } |
| 17130 | } |
| 17131 | #endif |
| 17132 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17133 | return(ret); |
| 17134 | } |
| 17135 | |
| 17136 | |
| 17137 | static int |
| 17138 | test_xmlTextWriterSetIndent(void) { |
| 17139 | int ret = 0; |
| 17140 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17141 | #ifdef LIBXML_WRITER_ENABLED |
| 17142 | int mem_base; |
| 17143 | int ret_val; |
| 17144 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17145 | int n_writer; |
| 17146 | int indent; /* do indentation? */ |
| 17147 | int n_indent; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17148 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17149 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17150 | for (n_indent = 0;n_indent < gen_nb_int;n_indent++) { |
| 17151 | mem_base = xmlMemBlocks(); |
| 17152 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17153 | indent = gen_int(n_indent); |
| 17154 | |
| 17155 | ret_val = xmlTextWriterSetIndent(writer, indent); |
| 17156 | desret_int(ret_val); |
| 17157 | call_tests++; |
| 17158 | des_xmlTextWriterPtr(n_writer, writer); |
| 17159 | des_int(n_indent, indent); |
| 17160 | xmlResetLastError(); |
| 17161 | if (mem_base != xmlMemBlocks()) { |
| 17162 | printf("Leak of %d blocks found in xmlTextWriterSetIndent", |
| 17163 | xmlMemBlocks() - mem_base); |
| 17164 | ret++; |
| 17165 | printf(" %d", n_writer); |
| 17166 | printf(" %d", n_indent); |
| 17167 | printf("\n"); |
| 17168 | } |
| 17169 | } |
| 17170 | } |
| 17171 | #endif |
| 17172 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17173 | return(ret); |
| 17174 | } |
| 17175 | |
| 17176 | |
| 17177 | static int |
| 17178 | test_xmlTextWriterSetIndentString(void) { |
| 17179 | int ret = 0; |
| 17180 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17181 | #ifdef LIBXML_WRITER_ENABLED |
| 17182 | int mem_base; |
| 17183 | int ret_val; |
| 17184 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17185 | int n_writer; |
| 17186 | const xmlChar * str; /* the xmlChar string */ |
| 17187 | int n_str; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17188 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17189 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17190 | for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { |
| 17191 | mem_base = xmlMemBlocks(); |
| 17192 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17193 | str = gen_const_xmlChar_ptr(n_str); |
| 17194 | |
| 17195 | ret_val = xmlTextWriterSetIndentString(writer, str); |
| 17196 | desret_int(ret_val); |
| 17197 | call_tests++; |
| 17198 | des_xmlTextWriterPtr(n_writer, writer); |
| 17199 | des_const_xmlChar_ptr(n_str, str); |
| 17200 | xmlResetLastError(); |
| 17201 | if (mem_base != xmlMemBlocks()) { |
| 17202 | printf("Leak of %d blocks found in xmlTextWriterSetIndentString", |
| 17203 | xmlMemBlocks() - mem_base); |
| 17204 | ret++; |
| 17205 | printf(" %d", n_writer); |
| 17206 | printf(" %d", n_str); |
| 17207 | printf("\n"); |
| 17208 | } |
| 17209 | } |
| 17210 | } |
| 17211 | #endif |
| 17212 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17213 | return(ret); |
| 17214 | } |
| 17215 | |
| 17216 | |
| 17217 | static int |
| 17218 | test_xmlTextWriterStartAttribute(void) { |
| 17219 | int ret = 0; |
| 17220 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17221 | #ifdef LIBXML_WRITER_ENABLED |
| 17222 | int mem_base; |
| 17223 | int ret_val; |
| 17224 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17225 | int n_writer; |
| 17226 | const xmlChar * name; /* element name */ |
| 17227 | int n_name; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17228 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17229 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17230 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17231 | mem_base = xmlMemBlocks(); |
| 17232 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17233 | name = gen_const_xmlChar_ptr(n_name); |
| 17234 | |
| 17235 | ret_val = xmlTextWriterStartAttribute(writer, name); |
| 17236 | desret_int(ret_val); |
| 17237 | call_tests++; |
| 17238 | des_xmlTextWriterPtr(n_writer, writer); |
| 17239 | des_const_xmlChar_ptr(n_name, name); |
| 17240 | xmlResetLastError(); |
| 17241 | if (mem_base != xmlMemBlocks()) { |
| 17242 | printf("Leak of %d blocks found in xmlTextWriterStartAttribute", |
| 17243 | xmlMemBlocks() - mem_base); |
| 17244 | ret++; |
| 17245 | printf(" %d", n_writer); |
| 17246 | printf(" %d", n_name); |
| 17247 | printf("\n"); |
| 17248 | } |
| 17249 | } |
| 17250 | } |
| 17251 | #endif |
| 17252 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17253 | return(ret); |
| 17254 | } |
| 17255 | |
| 17256 | |
| 17257 | static int |
| 17258 | test_xmlTextWriterStartAttributeNS(void) { |
| 17259 | int ret = 0; |
| 17260 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17261 | #ifdef LIBXML_WRITER_ENABLED |
| 17262 | int mem_base; |
| 17263 | int ret_val; |
| 17264 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17265 | int n_writer; |
| 17266 | const xmlChar * prefix; /* namespace prefix or NULL */ |
| 17267 | int n_prefix; |
| 17268 | const xmlChar * name; /* element local name */ |
| 17269 | int n_name; |
| 17270 | const xmlChar * namespaceURI; /* namespace URI or NULL */ |
| 17271 | int n_namespaceURI; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17272 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17273 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17274 | for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { |
| 17275 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17276 | for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { |
| 17277 | mem_base = xmlMemBlocks(); |
| 17278 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17279 | prefix = gen_const_xmlChar_ptr(n_prefix); |
| 17280 | name = gen_const_xmlChar_ptr(n_name); |
| 17281 | namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI); |
| 17282 | |
| 17283 | ret_val = xmlTextWriterStartAttributeNS(writer, prefix, name, namespaceURI); |
| 17284 | desret_int(ret_val); |
| 17285 | call_tests++; |
| 17286 | des_xmlTextWriterPtr(n_writer, writer); |
| 17287 | des_const_xmlChar_ptr(n_prefix, prefix); |
| 17288 | des_const_xmlChar_ptr(n_name, name); |
| 17289 | des_const_xmlChar_ptr(n_namespaceURI, namespaceURI); |
| 17290 | xmlResetLastError(); |
| 17291 | if (mem_base != xmlMemBlocks()) { |
| 17292 | printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS", |
| 17293 | xmlMemBlocks() - mem_base); |
| 17294 | ret++; |
| 17295 | printf(" %d", n_writer); |
| 17296 | printf(" %d", n_prefix); |
| 17297 | printf(" %d", n_name); |
| 17298 | printf(" %d", n_namespaceURI); |
| 17299 | printf("\n"); |
| 17300 | } |
| 17301 | } |
| 17302 | } |
| 17303 | } |
| 17304 | } |
| 17305 | #endif |
| 17306 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17307 | return(ret); |
| 17308 | } |
| 17309 | |
| 17310 | |
| 17311 | static int |
| 17312 | test_xmlTextWriterStartCDATA(void) { |
| 17313 | int ret = 0; |
| 17314 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17315 | #ifdef LIBXML_WRITER_ENABLED |
| 17316 | int mem_base; |
| 17317 | int ret_val; |
| 17318 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17319 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17320 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17321 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17322 | mem_base = xmlMemBlocks(); |
| 17323 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17324 | |
| 17325 | ret_val = xmlTextWriterStartCDATA(writer); |
| 17326 | desret_int(ret_val); |
| 17327 | call_tests++; |
| 17328 | des_xmlTextWriterPtr(n_writer, writer); |
| 17329 | xmlResetLastError(); |
| 17330 | if (mem_base != xmlMemBlocks()) { |
| 17331 | printf("Leak of %d blocks found in xmlTextWriterStartCDATA", |
| 17332 | xmlMemBlocks() - mem_base); |
| 17333 | ret++; |
| 17334 | printf(" %d", n_writer); |
| 17335 | printf("\n"); |
| 17336 | } |
| 17337 | } |
| 17338 | #endif |
| 17339 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17340 | return(ret); |
| 17341 | } |
| 17342 | |
| 17343 | |
| 17344 | static int |
| 17345 | test_xmlTextWriterStartComment(void) { |
| 17346 | int ret = 0; |
| 17347 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17348 | #ifdef LIBXML_WRITER_ENABLED |
| 17349 | int mem_base; |
| 17350 | int ret_val; |
| 17351 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17352 | int n_writer; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17353 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17354 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17355 | mem_base = xmlMemBlocks(); |
| 17356 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17357 | |
| 17358 | ret_val = xmlTextWriterStartComment(writer); |
| 17359 | desret_int(ret_val); |
| 17360 | call_tests++; |
| 17361 | des_xmlTextWriterPtr(n_writer, writer); |
| 17362 | xmlResetLastError(); |
| 17363 | if (mem_base != xmlMemBlocks()) { |
| 17364 | printf("Leak of %d blocks found in xmlTextWriterStartComment", |
| 17365 | xmlMemBlocks() - mem_base); |
| 17366 | ret++; |
| 17367 | printf(" %d", n_writer); |
| 17368 | printf("\n"); |
| 17369 | } |
| 17370 | } |
| 17371 | #endif |
| 17372 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17373 | return(ret); |
| 17374 | } |
| 17375 | |
| 17376 | |
| 17377 | static int |
| 17378 | test_xmlTextWriterStartDTD(void) { |
| 17379 | int ret = 0; |
| 17380 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17381 | #ifdef LIBXML_WRITER_ENABLED |
| 17382 | int mem_base; |
| 17383 | int ret_val; |
| 17384 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17385 | int n_writer; |
| 17386 | const xmlChar * name; /* the name of the DTD */ |
| 17387 | int n_name; |
| 17388 | const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ |
| 17389 | int n_pubid; |
| 17390 | const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ |
| 17391 | int n_sysid; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17392 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17393 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17394 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17395 | for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { |
| 17396 | for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { |
| 17397 | mem_base = xmlMemBlocks(); |
| 17398 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17399 | name = gen_const_xmlChar_ptr(n_name); |
| 17400 | pubid = gen_const_xmlChar_ptr(n_pubid); |
| 17401 | sysid = gen_const_xmlChar_ptr(n_sysid); |
| 17402 | |
| 17403 | ret_val = xmlTextWriterStartDTD(writer, name, pubid, sysid); |
| 17404 | desret_int(ret_val); |
| 17405 | call_tests++; |
| 17406 | des_xmlTextWriterPtr(n_writer, writer); |
| 17407 | des_const_xmlChar_ptr(n_name, name); |
| 17408 | des_const_xmlChar_ptr(n_pubid, pubid); |
| 17409 | des_const_xmlChar_ptr(n_sysid, sysid); |
| 17410 | xmlResetLastError(); |
| 17411 | if (mem_base != xmlMemBlocks()) { |
| 17412 | printf("Leak of %d blocks found in xmlTextWriterStartDTD", |
| 17413 | xmlMemBlocks() - mem_base); |
| 17414 | ret++; |
| 17415 | printf(" %d", n_writer); |
| 17416 | printf(" %d", n_name); |
| 17417 | printf(" %d", n_pubid); |
| 17418 | printf(" %d", n_sysid); |
| 17419 | printf("\n"); |
| 17420 | } |
| 17421 | } |
| 17422 | } |
| 17423 | } |
| 17424 | } |
| 17425 | #endif |
| 17426 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17427 | return(ret); |
| 17428 | } |
| 17429 | |
| 17430 | |
| 17431 | static int |
| 17432 | test_xmlTextWriterStartDTDAttlist(void) { |
| 17433 | int ret = 0; |
| 17434 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17435 | #ifdef LIBXML_WRITER_ENABLED |
| 17436 | int mem_base; |
| 17437 | int ret_val; |
| 17438 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17439 | int n_writer; |
| 17440 | const xmlChar * name; /* the name of the DTD ATTLIST */ |
| 17441 | int n_name; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17442 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17443 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17444 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17445 | mem_base = xmlMemBlocks(); |
| 17446 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17447 | name = gen_const_xmlChar_ptr(n_name); |
| 17448 | |
| 17449 | ret_val = xmlTextWriterStartDTDAttlist(writer, name); |
| 17450 | desret_int(ret_val); |
| 17451 | call_tests++; |
| 17452 | des_xmlTextWriterPtr(n_writer, writer); |
| 17453 | des_const_xmlChar_ptr(n_name, name); |
| 17454 | xmlResetLastError(); |
| 17455 | if (mem_base != xmlMemBlocks()) { |
| 17456 | printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist", |
| 17457 | xmlMemBlocks() - mem_base); |
| 17458 | ret++; |
| 17459 | printf(" %d", n_writer); |
| 17460 | printf(" %d", n_name); |
| 17461 | printf("\n"); |
| 17462 | } |
| 17463 | } |
| 17464 | } |
| 17465 | #endif |
| 17466 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17467 | return(ret); |
| 17468 | } |
| 17469 | |
| 17470 | |
| 17471 | static int |
| 17472 | test_xmlTextWriterStartDTDElement(void) { |
| 17473 | int ret = 0; |
| 17474 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17475 | #ifdef LIBXML_WRITER_ENABLED |
| 17476 | int mem_base; |
| 17477 | int ret_val; |
| 17478 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17479 | int n_writer; |
| 17480 | const xmlChar * name; /* the name of the DTD element */ |
| 17481 | int n_name; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17482 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17483 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17484 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17485 | mem_base = xmlMemBlocks(); |
| 17486 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17487 | name = gen_const_xmlChar_ptr(n_name); |
| 17488 | |
| 17489 | ret_val = xmlTextWriterStartDTDElement(writer, name); |
| 17490 | desret_int(ret_val); |
| 17491 | call_tests++; |
| 17492 | des_xmlTextWriterPtr(n_writer, writer); |
| 17493 | des_const_xmlChar_ptr(n_name, name); |
| 17494 | xmlResetLastError(); |
| 17495 | if (mem_base != xmlMemBlocks()) { |
| 17496 | printf("Leak of %d blocks found in xmlTextWriterStartDTDElement", |
| 17497 | xmlMemBlocks() - mem_base); |
| 17498 | ret++; |
| 17499 | printf(" %d", n_writer); |
| 17500 | printf(" %d", n_name); |
| 17501 | printf("\n"); |
| 17502 | } |
| 17503 | } |
| 17504 | } |
| 17505 | #endif |
| 17506 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17507 | return(ret); |
| 17508 | } |
| 17509 | |
| 17510 | |
| 17511 | static int |
| 17512 | test_xmlTextWriterStartDTDEntity(void) { |
| 17513 | int ret = 0; |
| 17514 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17515 | #ifdef LIBXML_WRITER_ENABLED |
| 17516 | int mem_base; |
| 17517 | int ret_val; |
| 17518 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17519 | int n_writer; |
| 17520 | int pe; /* TRUE if this is a parameter entity, FALSE if not */ |
| 17521 | int n_pe; |
| 17522 | const xmlChar * name; /* the name of the DTD ATTLIST */ |
| 17523 | int n_name; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17524 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17525 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17526 | for (n_pe = 0;n_pe < gen_nb_int;n_pe++) { |
| 17527 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17528 | mem_base = xmlMemBlocks(); |
| 17529 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17530 | pe = gen_int(n_pe); |
| 17531 | name = gen_const_xmlChar_ptr(n_name); |
| 17532 | |
| 17533 | ret_val = xmlTextWriterStartDTDEntity(writer, pe, name); |
| 17534 | desret_int(ret_val); |
| 17535 | call_tests++; |
| 17536 | des_xmlTextWriterPtr(n_writer, writer); |
| 17537 | des_int(n_pe, pe); |
| 17538 | des_const_xmlChar_ptr(n_name, name); |
| 17539 | xmlResetLastError(); |
| 17540 | if (mem_base != xmlMemBlocks()) { |
| 17541 | printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity", |
| 17542 | xmlMemBlocks() - mem_base); |
| 17543 | ret++; |
| 17544 | printf(" %d", n_writer); |
| 17545 | printf(" %d", n_pe); |
| 17546 | printf(" %d", n_name); |
| 17547 | printf("\n"); |
| 17548 | } |
| 17549 | } |
| 17550 | } |
| 17551 | } |
| 17552 | #endif |
| 17553 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17554 | return(ret); |
| 17555 | } |
| 17556 | |
| 17557 | |
| 17558 | static int |
| 17559 | test_xmlTextWriterStartDocument(void) { |
| 17560 | int ret = 0; |
| 17561 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17562 | #ifdef LIBXML_WRITER_ENABLED |
| 17563 | int mem_base; |
| 17564 | int ret_val; |
| 17565 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17566 | int n_writer; |
| 17567 | const char * version; /* the xml version ("1.0") or NULL for default ("1.0") */ |
| 17568 | int n_version; |
| 17569 | const char * encoding; /* the encoding or NULL for default */ |
| 17570 | int n_encoding; |
| 17571 | const char * standalone; /* "yes" or "no" or NULL for default */ |
| 17572 | int n_standalone; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17573 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17574 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17575 | for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) { |
| 17576 | for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { |
| 17577 | for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) { |
| 17578 | mem_base = xmlMemBlocks(); |
| 17579 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17580 | version = gen_const_char_ptr(n_version); |
| 17581 | encoding = gen_const_char_ptr(n_encoding); |
| 17582 | standalone = gen_const_char_ptr(n_standalone); |
| 17583 | |
| 17584 | ret_val = xmlTextWriterStartDocument(writer, version, encoding, standalone); |
| 17585 | desret_int(ret_val); |
| 17586 | call_tests++; |
| 17587 | des_xmlTextWriterPtr(n_writer, writer); |
| 17588 | des_const_char_ptr(n_version, version); |
| 17589 | des_const_char_ptr(n_encoding, encoding); |
| 17590 | des_const_char_ptr(n_standalone, standalone); |
| 17591 | xmlResetLastError(); |
| 17592 | if (mem_base != xmlMemBlocks()) { |
| 17593 | printf("Leak of %d blocks found in xmlTextWriterStartDocument", |
| 17594 | xmlMemBlocks() - mem_base); |
| 17595 | ret++; |
| 17596 | printf(" %d", n_writer); |
| 17597 | printf(" %d", n_version); |
| 17598 | printf(" %d", n_encoding); |
| 17599 | printf(" %d", n_standalone); |
| 17600 | printf("\n"); |
| 17601 | } |
| 17602 | } |
| 17603 | } |
| 17604 | } |
| 17605 | } |
| 17606 | #endif |
| 17607 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17608 | return(ret); |
| 17609 | } |
| 17610 | |
| 17611 | |
| 17612 | static int |
| 17613 | test_xmlTextWriterStartElement(void) { |
| 17614 | int ret = 0; |
| 17615 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17616 | #ifdef LIBXML_WRITER_ENABLED |
| 17617 | int mem_base; |
| 17618 | int ret_val; |
| 17619 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17620 | int n_writer; |
| 17621 | const xmlChar * name; /* element name */ |
| 17622 | int n_name; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17623 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17624 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17625 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17626 | mem_base = xmlMemBlocks(); |
| 17627 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17628 | name = gen_const_xmlChar_ptr(n_name); |
| 17629 | |
| 17630 | ret_val = xmlTextWriterStartElement(writer, name); |
| 17631 | desret_int(ret_val); |
| 17632 | call_tests++; |
| 17633 | des_xmlTextWriterPtr(n_writer, writer); |
| 17634 | des_const_xmlChar_ptr(n_name, name); |
| 17635 | xmlResetLastError(); |
| 17636 | if (mem_base != xmlMemBlocks()) { |
| 17637 | printf("Leak of %d blocks found in xmlTextWriterStartElement", |
| 17638 | xmlMemBlocks() - mem_base); |
| 17639 | ret++; |
| 17640 | printf(" %d", n_writer); |
| 17641 | printf(" %d", n_name); |
| 17642 | printf("\n"); |
| 17643 | } |
| 17644 | } |
| 17645 | } |
| 17646 | #endif |
| 17647 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17648 | return(ret); |
| 17649 | } |
| 17650 | |
| 17651 | |
| 17652 | static int |
| 17653 | test_xmlTextWriterStartElementNS(void) { |
| 17654 | int ret = 0; |
| 17655 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17656 | #ifdef LIBXML_WRITER_ENABLED |
| 17657 | int mem_base; |
| 17658 | int ret_val; |
| 17659 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17660 | int n_writer; |
| 17661 | const xmlChar * prefix; /* namespace prefix or NULL */ |
| 17662 | int n_prefix; |
| 17663 | const xmlChar * name; /* element local name */ |
| 17664 | int n_name; |
| 17665 | const xmlChar * namespaceURI; /* namespace URI or NULL */ |
| 17666 | int n_namespaceURI; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17667 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17668 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17669 | for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { |
| 17670 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17671 | for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { |
| 17672 | mem_base = xmlMemBlocks(); |
| 17673 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17674 | prefix = gen_const_xmlChar_ptr(n_prefix); |
| 17675 | name = gen_const_xmlChar_ptr(n_name); |
| 17676 | namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI); |
| 17677 | |
| 17678 | ret_val = xmlTextWriterStartElementNS(writer, prefix, name, namespaceURI); |
| 17679 | desret_int(ret_val); |
| 17680 | call_tests++; |
| 17681 | des_xmlTextWriterPtr(n_writer, writer); |
| 17682 | des_const_xmlChar_ptr(n_prefix, prefix); |
| 17683 | des_const_xmlChar_ptr(n_name, name); |
| 17684 | des_const_xmlChar_ptr(n_namespaceURI, namespaceURI); |
| 17685 | xmlResetLastError(); |
| 17686 | if (mem_base != xmlMemBlocks()) { |
| 17687 | printf("Leak of %d blocks found in xmlTextWriterStartElementNS", |
| 17688 | xmlMemBlocks() - mem_base); |
| 17689 | ret++; |
| 17690 | printf(" %d", n_writer); |
| 17691 | printf(" %d", n_prefix); |
| 17692 | printf(" %d", n_name); |
| 17693 | printf(" %d", n_namespaceURI); |
| 17694 | printf("\n"); |
| 17695 | } |
| 17696 | } |
| 17697 | } |
| 17698 | } |
| 17699 | } |
| 17700 | #endif |
| 17701 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17702 | return(ret); |
| 17703 | } |
| 17704 | |
| 17705 | |
| 17706 | static int |
| 17707 | test_xmlTextWriterStartPI(void) { |
| 17708 | int ret = 0; |
| 17709 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17710 | #ifdef LIBXML_WRITER_ENABLED |
| 17711 | int mem_base; |
| 17712 | int ret_val; |
| 17713 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17714 | int n_writer; |
| 17715 | const xmlChar * target; /* PI target */ |
| 17716 | int n_target; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17717 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17718 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17719 | for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) { |
| 17720 | mem_base = xmlMemBlocks(); |
| 17721 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17722 | target = gen_const_xmlChar_ptr(n_target); |
| 17723 | |
| 17724 | ret_val = xmlTextWriterStartPI(writer, target); |
| 17725 | desret_int(ret_val); |
| 17726 | call_tests++; |
| 17727 | des_xmlTextWriterPtr(n_writer, writer); |
| 17728 | des_const_xmlChar_ptr(n_target, target); |
| 17729 | xmlResetLastError(); |
| 17730 | if (mem_base != xmlMemBlocks()) { |
| 17731 | printf("Leak of %d blocks found in xmlTextWriterStartPI", |
| 17732 | xmlMemBlocks() - mem_base); |
| 17733 | ret++; |
| 17734 | printf(" %d", n_writer); |
| 17735 | printf(" %d", n_target); |
| 17736 | printf("\n"); |
| 17737 | } |
| 17738 | } |
| 17739 | } |
| 17740 | #endif |
| 17741 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17742 | return(ret); |
| 17743 | } |
| 17744 | |
| 17745 | |
| 17746 | static int |
| 17747 | test_xmlTextWriterWriteAttribute(void) { |
| 17748 | int ret = 0; |
| 17749 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17750 | #ifdef LIBXML_WRITER_ENABLED |
| 17751 | int mem_base; |
| 17752 | int ret_val; |
| 17753 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17754 | int n_writer; |
| 17755 | const xmlChar * name; /* attribute name */ |
| 17756 | int n_name; |
| 17757 | const xmlChar * content; /* attribute content */ |
| 17758 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17759 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17760 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17761 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17762 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 17763 | mem_base = xmlMemBlocks(); |
| 17764 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17765 | name = gen_const_xmlChar_ptr(n_name); |
| 17766 | content = gen_const_xmlChar_ptr(n_content); |
| 17767 | |
| 17768 | ret_val = xmlTextWriterWriteAttribute(writer, name, content); |
| 17769 | desret_int(ret_val); |
| 17770 | call_tests++; |
| 17771 | des_xmlTextWriterPtr(n_writer, writer); |
| 17772 | des_const_xmlChar_ptr(n_name, name); |
| 17773 | des_const_xmlChar_ptr(n_content, content); |
| 17774 | xmlResetLastError(); |
| 17775 | if (mem_base != xmlMemBlocks()) { |
| 17776 | printf("Leak of %d blocks found in xmlTextWriterWriteAttribute", |
| 17777 | xmlMemBlocks() - mem_base); |
| 17778 | ret++; |
| 17779 | printf(" %d", n_writer); |
| 17780 | printf(" %d", n_name); |
| 17781 | printf(" %d", n_content); |
| 17782 | printf("\n"); |
| 17783 | } |
| 17784 | } |
| 17785 | } |
| 17786 | } |
| 17787 | #endif |
| 17788 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17789 | return(ret); |
| 17790 | } |
| 17791 | |
| 17792 | |
| 17793 | static int |
| 17794 | test_xmlTextWriterWriteAttributeNS(void) { |
| 17795 | int ret = 0; |
| 17796 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17797 | #ifdef LIBXML_WRITER_ENABLED |
| 17798 | int mem_base; |
| 17799 | int ret_val; |
| 17800 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17801 | int n_writer; |
| 17802 | const xmlChar * prefix; /* namespace prefix */ |
| 17803 | int n_prefix; |
| 17804 | const xmlChar * name; /* attribute local name */ |
| 17805 | int n_name; |
| 17806 | const xmlChar * namespaceURI; /* namespace URI */ |
| 17807 | int n_namespaceURI; |
| 17808 | const xmlChar * content; /* attribute content */ |
| 17809 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17810 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17811 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17812 | for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { |
| 17813 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 17814 | for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { |
| 17815 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 17816 | mem_base = xmlMemBlocks(); |
| 17817 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17818 | prefix = gen_const_xmlChar_ptr(n_prefix); |
| 17819 | name = gen_const_xmlChar_ptr(n_name); |
| 17820 | namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI); |
| 17821 | content = gen_const_xmlChar_ptr(n_content); |
| 17822 | |
| 17823 | ret_val = xmlTextWriterWriteAttributeNS(writer, prefix, name, namespaceURI, content); |
| 17824 | desret_int(ret_val); |
| 17825 | call_tests++; |
| 17826 | des_xmlTextWriterPtr(n_writer, writer); |
| 17827 | des_const_xmlChar_ptr(n_prefix, prefix); |
| 17828 | des_const_xmlChar_ptr(n_name, name); |
| 17829 | des_const_xmlChar_ptr(n_namespaceURI, namespaceURI); |
| 17830 | des_const_xmlChar_ptr(n_content, content); |
| 17831 | xmlResetLastError(); |
| 17832 | if (mem_base != xmlMemBlocks()) { |
| 17833 | printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS", |
| 17834 | xmlMemBlocks() - mem_base); |
| 17835 | ret++; |
| 17836 | printf(" %d", n_writer); |
| 17837 | printf(" %d", n_prefix); |
| 17838 | printf(" %d", n_name); |
| 17839 | printf(" %d", n_namespaceURI); |
| 17840 | printf(" %d", n_content); |
| 17841 | printf("\n"); |
| 17842 | } |
| 17843 | } |
| 17844 | } |
| 17845 | } |
| 17846 | } |
| 17847 | } |
| 17848 | #endif |
| 17849 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17850 | return(ret); |
| 17851 | } |
| 17852 | |
| 17853 | |
| 17854 | static int |
| 17855 | test_xmlTextWriterWriteBase64(void) { |
| 17856 | int ret = 0; |
| 17857 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17858 | #ifdef LIBXML_WRITER_ENABLED |
| 17859 | int mem_base; |
| 17860 | int ret_val; |
| 17861 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17862 | int n_writer; |
| 17863 | const char * data; /* binary data */ |
| 17864 | int n_data; |
| 17865 | int start; /* the position within the data of the first byte to encode */ |
| 17866 | int n_start; |
| 17867 | int len; /* the number of bytes to encode */ |
| 17868 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17869 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17870 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17871 | for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) { |
| 17872 | for (n_start = 0;n_start < gen_nb_int;n_start++) { |
| 17873 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 17874 | mem_base = xmlMemBlocks(); |
| 17875 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17876 | data = gen_const_char_ptr(n_data); |
| 17877 | start = gen_int(n_start); |
| 17878 | len = gen_int(n_len); |
| 17879 | |
| 17880 | ret_val = xmlTextWriterWriteBase64(writer, data, start, len); |
| 17881 | desret_int(ret_val); |
| 17882 | call_tests++; |
| 17883 | des_xmlTextWriterPtr(n_writer, writer); |
| 17884 | des_const_char_ptr(n_data, data); |
| 17885 | des_int(n_start, start); |
| 17886 | des_int(n_len, len); |
| 17887 | xmlResetLastError(); |
| 17888 | if (mem_base != xmlMemBlocks()) { |
| 17889 | printf("Leak of %d blocks found in xmlTextWriterWriteBase64", |
| 17890 | xmlMemBlocks() - mem_base); |
| 17891 | ret++; |
| 17892 | printf(" %d", n_writer); |
| 17893 | printf(" %d", n_data); |
| 17894 | printf(" %d", n_start); |
| 17895 | printf(" %d", n_len); |
| 17896 | printf("\n"); |
| 17897 | } |
| 17898 | } |
| 17899 | } |
| 17900 | } |
| 17901 | } |
| 17902 | #endif |
| 17903 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17904 | return(ret); |
| 17905 | } |
| 17906 | |
| 17907 | |
| 17908 | static int |
| 17909 | test_xmlTextWriterWriteBinHex(void) { |
| 17910 | int ret = 0; |
| 17911 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17912 | #ifdef LIBXML_WRITER_ENABLED |
| 17913 | int mem_base; |
| 17914 | int ret_val; |
| 17915 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17916 | int n_writer; |
| 17917 | const char * data; /* binary data */ |
| 17918 | int n_data; |
| 17919 | int start; /* the position within the data of the first byte to encode */ |
| 17920 | int n_start; |
| 17921 | int len; /* the number of bytes to encode */ |
| 17922 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17923 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17924 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17925 | for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) { |
| 17926 | for (n_start = 0;n_start < gen_nb_int;n_start++) { |
| 17927 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 17928 | mem_base = xmlMemBlocks(); |
| 17929 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17930 | data = gen_const_char_ptr(n_data); |
| 17931 | start = gen_int(n_start); |
| 17932 | len = gen_int(n_len); |
| 17933 | |
| 17934 | ret_val = xmlTextWriterWriteBinHex(writer, data, start, len); |
| 17935 | desret_int(ret_val); |
| 17936 | call_tests++; |
| 17937 | des_xmlTextWriterPtr(n_writer, writer); |
| 17938 | des_const_char_ptr(n_data, data); |
| 17939 | des_int(n_start, start); |
| 17940 | des_int(n_len, len); |
| 17941 | xmlResetLastError(); |
| 17942 | if (mem_base != xmlMemBlocks()) { |
| 17943 | printf("Leak of %d blocks found in xmlTextWriterWriteBinHex", |
| 17944 | xmlMemBlocks() - mem_base); |
| 17945 | ret++; |
| 17946 | printf(" %d", n_writer); |
| 17947 | printf(" %d", n_data); |
| 17948 | printf(" %d", n_start); |
| 17949 | printf(" %d", n_len); |
| 17950 | printf("\n"); |
| 17951 | } |
| 17952 | } |
| 17953 | } |
| 17954 | } |
| 17955 | } |
| 17956 | #endif |
| 17957 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17958 | return(ret); |
| 17959 | } |
| 17960 | |
| 17961 | |
| 17962 | static int |
| 17963 | test_xmlTextWriterWriteCDATA(void) { |
| 17964 | int ret = 0; |
| 17965 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17966 | #ifdef LIBXML_WRITER_ENABLED |
| 17967 | int mem_base; |
| 17968 | int ret_val; |
| 17969 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 17970 | int n_writer; |
| 17971 | const xmlChar * content; /* CDATA content */ |
| 17972 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17973 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 17974 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 17975 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 17976 | mem_base = xmlMemBlocks(); |
| 17977 | writer = gen_xmlTextWriterPtr(n_writer); |
| 17978 | content = gen_const_xmlChar_ptr(n_content); |
| 17979 | |
| 17980 | ret_val = xmlTextWriterWriteCDATA(writer, content); |
| 17981 | desret_int(ret_val); |
| 17982 | call_tests++; |
| 17983 | des_xmlTextWriterPtr(n_writer, writer); |
| 17984 | des_const_xmlChar_ptr(n_content, content); |
| 17985 | xmlResetLastError(); |
| 17986 | if (mem_base != xmlMemBlocks()) { |
| 17987 | printf("Leak of %d blocks found in xmlTextWriterWriteCDATA", |
| 17988 | xmlMemBlocks() - mem_base); |
| 17989 | ret++; |
| 17990 | printf(" %d", n_writer); |
| 17991 | printf(" %d", n_content); |
| 17992 | printf("\n"); |
| 17993 | } |
| 17994 | } |
| 17995 | } |
| 17996 | #endif |
| 17997 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 17998 | return(ret); |
| 17999 | } |
| 18000 | |
| 18001 | |
| 18002 | static int |
| 18003 | test_xmlTextWriterWriteComment(void) { |
| 18004 | int ret = 0; |
| 18005 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18006 | #ifdef LIBXML_WRITER_ENABLED |
| 18007 | int mem_base; |
| 18008 | int ret_val; |
| 18009 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18010 | int n_writer; |
| 18011 | const xmlChar * content; /* comment string */ |
| 18012 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18013 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18014 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18015 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18016 | mem_base = xmlMemBlocks(); |
| 18017 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18018 | content = gen_const_xmlChar_ptr(n_content); |
| 18019 | |
| 18020 | ret_val = xmlTextWriterWriteComment(writer, content); |
| 18021 | desret_int(ret_val); |
| 18022 | call_tests++; |
| 18023 | des_xmlTextWriterPtr(n_writer, writer); |
| 18024 | des_const_xmlChar_ptr(n_content, content); |
| 18025 | xmlResetLastError(); |
| 18026 | if (mem_base != xmlMemBlocks()) { |
| 18027 | printf("Leak of %d blocks found in xmlTextWriterWriteComment", |
| 18028 | xmlMemBlocks() - mem_base); |
| 18029 | ret++; |
| 18030 | printf(" %d", n_writer); |
| 18031 | printf(" %d", n_content); |
| 18032 | printf("\n"); |
| 18033 | } |
| 18034 | } |
| 18035 | } |
| 18036 | #endif |
| 18037 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18038 | return(ret); |
| 18039 | } |
| 18040 | |
| 18041 | |
| 18042 | static int |
| 18043 | test_xmlTextWriterWriteDTD(void) { |
| 18044 | int ret = 0; |
| 18045 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18046 | #ifdef LIBXML_WRITER_ENABLED |
| 18047 | int mem_base; |
| 18048 | int ret_val; |
| 18049 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18050 | int n_writer; |
| 18051 | const xmlChar * name; /* the name of the DTD */ |
| 18052 | int n_name; |
| 18053 | const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ |
| 18054 | int n_pubid; |
| 18055 | const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ |
| 18056 | int n_sysid; |
| 18057 | const xmlChar * subset; /* string content of the DTD */ |
| 18058 | int n_subset; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18059 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18060 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18061 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 18062 | for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { |
| 18063 | for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { |
| 18064 | for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) { |
| 18065 | mem_base = xmlMemBlocks(); |
| 18066 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18067 | name = gen_const_xmlChar_ptr(n_name); |
| 18068 | pubid = gen_const_xmlChar_ptr(n_pubid); |
| 18069 | sysid = gen_const_xmlChar_ptr(n_sysid); |
| 18070 | subset = gen_const_xmlChar_ptr(n_subset); |
| 18071 | |
| 18072 | ret_val = xmlTextWriterWriteDTD(writer, name, pubid, sysid, subset); |
| 18073 | desret_int(ret_val); |
| 18074 | call_tests++; |
| 18075 | des_xmlTextWriterPtr(n_writer, writer); |
| 18076 | des_const_xmlChar_ptr(n_name, name); |
| 18077 | des_const_xmlChar_ptr(n_pubid, pubid); |
| 18078 | des_const_xmlChar_ptr(n_sysid, sysid); |
| 18079 | des_const_xmlChar_ptr(n_subset, subset); |
| 18080 | xmlResetLastError(); |
| 18081 | if (mem_base != xmlMemBlocks()) { |
| 18082 | printf("Leak of %d blocks found in xmlTextWriterWriteDTD", |
| 18083 | xmlMemBlocks() - mem_base); |
| 18084 | ret++; |
| 18085 | printf(" %d", n_writer); |
| 18086 | printf(" %d", n_name); |
| 18087 | printf(" %d", n_pubid); |
| 18088 | printf(" %d", n_sysid); |
| 18089 | printf(" %d", n_subset); |
| 18090 | printf("\n"); |
| 18091 | } |
| 18092 | } |
| 18093 | } |
| 18094 | } |
| 18095 | } |
| 18096 | } |
| 18097 | #endif |
| 18098 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18099 | return(ret); |
| 18100 | } |
| 18101 | |
| 18102 | |
| 18103 | static int |
| 18104 | test_xmlTextWriterWriteDTDAttlist(void) { |
| 18105 | int ret = 0; |
| 18106 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18107 | #ifdef LIBXML_WRITER_ENABLED |
| 18108 | int mem_base; |
| 18109 | int ret_val; |
| 18110 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18111 | int n_writer; |
| 18112 | const xmlChar * name; /* the name of the DTD ATTLIST */ |
| 18113 | int n_name; |
| 18114 | const xmlChar * content; /* content of the ATTLIST */ |
| 18115 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18116 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18117 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18118 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 18119 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18120 | mem_base = xmlMemBlocks(); |
| 18121 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18122 | name = gen_const_xmlChar_ptr(n_name); |
| 18123 | content = gen_const_xmlChar_ptr(n_content); |
| 18124 | |
| 18125 | ret_val = xmlTextWriterWriteDTDAttlist(writer, name, content); |
| 18126 | desret_int(ret_val); |
| 18127 | call_tests++; |
| 18128 | des_xmlTextWriterPtr(n_writer, writer); |
| 18129 | des_const_xmlChar_ptr(n_name, name); |
| 18130 | des_const_xmlChar_ptr(n_content, content); |
| 18131 | xmlResetLastError(); |
| 18132 | if (mem_base != xmlMemBlocks()) { |
| 18133 | printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist", |
| 18134 | xmlMemBlocks() - mem_base); |
| 18135 | ret++; |
| 18136 | printf(" %d", n_writer); |
| 18137 | printf(" %d", n_name); |
| 18138 | printf(" %d", n_content); |
| 18139 | printf("\n"); |
| 18140 | } |
| 18141 | } |
| 18142 | } |
| 18143 | } |
| 18144 | #endif |
| 18145 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18146 | return(ret); |
| 18147 | } |
| 18148 | |
| 18149 | |
| 18150 | static int |
| 18151 | test_xmlTextWriterWriteDTDElement(void) { |
| 18152 | int ret = 0; |
| 18153 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18154 | #ifdef LIBXML_WRITER_ENABLED |
| 18155 | int mem_base; |
| 18156 | int ret_val; |
| 18157 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18158 | int n_writer; |
| 18159 | const xmlChar * name; /* the name of the DTD element */ |
| 18160 | int n_name; |
| 18161 | const xmlChar * content; /* content of the element */ |
| 18162 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18163 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18164 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18165 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 18166 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18167 | mem_base = xmlMemBlocks(); |
| 18168 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18169 | name = gen_const_xmlChar_ptr(n_name); |
| 18170 | content = gen_const_xmlChar_ptr(n_content); |
| 18171 | |
| 18172 | ret_val = xmlTextWriterWriteDTDElement(writer, name, content); |
| 18173 | desret_int(ret_val); |
| 18174 | call_tests++; |
| 18175 | des_xmlTextWriterPtr(n_writer, writer); |
| 18176 | des_const_xmlChar_ptr(n_name, name); |
| 18177 | des_const_xmlChar_ptr(n_content, content); |
| 18178 | xmlResetLastError(); |
| 18179 | if (mem_base != xmlMemBlocks()) { |
| 18180 | printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement", |
| 18181 | xmlMemBlocks() - mem_base); |
| 18182 | ret++; |
| 18183 | printf(" %d", n_writer); |
| 18184 | printf(" %d", n_name); |
| 18185 | printf(" %d", n_content); |
| 18186 | printf("\n"); |
| 18187 | } |
| 18188 | } |
| 18189 | } |
| 18190 | } |
| 18191 | #endif |
| 18192 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18193 | return(ret); |
| 18194 | } |
| 18195 | |
| 18196 | |
| 18197 | static int |
| 18198 | test_xmlTextWriterWriteDTDEntity(void) { |
| 18199 | int ret = 0; |
| 18200 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18201 | #ifdef LIBXML_WRITER_ENABLED |
| 18202 | int mem_base; |
| 18203 | int ret_val; |
| 18204 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18205 | int n_writer; |
| 18206 | int pe; /* TRUE if this is a parameter entity, FALSE if not */ |
| 18207 | int n_pe; |
| 18208 | const xmlChar * name; /* the name of the DTD entity */ |
| 18209 | int n_name; |
| 18210 | const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ |
| 18211 | int n_pubid; |
| 18212 | const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ |
| 18213 | int n_sysid; |
| 18214 | const xmlChar * ndataid; /* the xml notation name. */ |
| 18215 | int n_ndataid; |
| 18216 | const xmlChar * content; /* content of the entity */ |
| 18217 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18218 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18219 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18220 | for (n_pe = 0;n_pe < gen_nb_int;n_pe++) { |
| 18221 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 18222 | for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { |
| 18223 | for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { |
| 18224 | for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) { |
| 18225 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18226 | mem_base = xmlMemBlocks(); |
| 18227 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18228 | pe = gen_int(n_pe); |
| 18229 | name = gen_const_xmlChar_ptr(n_name); |
| 18230 | pubid = gen_const_xmlChar_ptr(n_pubid); |
| 18231 | sysid = gen_const_xmlChar_ptr(n_sysid); |
| 18232 | ndataid = gen_const_xmlChar_ptr(n_ndataid); |
| 18233 | content = gen_const_xmlChar_ptr(n_content); |
| 18234 | |
| 18235 | ret_val = xmlTextWriterWriteDTDEntity(writer, pe, name, pubid, sysid, ndataid, content); |
| 18236 | desret_int(ret_val); |
| 18237 | call_tests++; |
| 18238 | des_xmlTextWriterPtr(n_writer, writer); |
| 18239 | des_int(n_pe, pe); |
| 18240 | des_const_xmlChar_ptr(n_name, name); |
| 18241 | des_const_xmlChar_ptr(n_pubid, pubid); |
| 18242 | des_const_xmlChar_ptr(n_sysid, sysid); |
| 18243 | des_const_xmlChar_ptr(n_ndataid, ndataid); |
| 18244 | des_const_xmlChar_ptr(n_content, content); |
| 18245 | xmlResetLastError(); |
| 18246 | if (mem_base != xmlMemBlocks()) { |
| 18247 | printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity", |
| 18248 | xmlMemBlocks() - mem_base); |
| 18249 | ret++; |
| 18250 | printf(" %d", n_writer); |
| 18251 | printf(" %d", n_pe); |
| 18252 | printf(" %d", n_name); |
| 18253 | printf(" %d", n_pubid); |
| 18254 | printf(" %d", n_sysid); |
| 18255 | printf(" %d", n_ndataid); |
| 18256 | printf(" %d", n_content); |
| 18257 | printf("\n"); |
| 18258 | } |
| 18259 | } |
| 18260 | } |
| 18261 | } |
| 18262 | } |
| 18263 | } |
| 18264 | } |
| 18265 | } |
| 18266 | #endif |
| 18267 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18268 | return(ret); |
| 18269 | } |
| 18270 | |
| 18271 | |
| 18272 | static int |
| 18273 | test_xmlTextWriterWriteDTDExternalEntity(void) { |
| 18274 | int ret = 0; |
| 18275 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18276 | #ifdef LIBXML_WRITER_ENABLED |
| 18277 | int mem_base; |
| 18278 | int ret_val; |
| 18279 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18280 | int n_writer; |
| 18281 | int pe; /* TRUE if this is a parameter entity, FALSE if not */ |
| 18282 | int n_pe; |
| 18283 | const xmlChar * name; /* the name of the DTD entity */ |
| 18284 | int n_name; |
| 18285 | const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ |
| 18286 | int n_pubid; |
| 18287 | const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ |
| 18288 | int n_sysid; |
| 18289 | const xmlChar * ndataid; /* the xml notation name. */ |
| 18290 | int n_ndataid; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18291 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18292 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18293 | for (n_pe = 0;n_pe < gen_nb_int;n_pe++) { |
| 18294 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 18295 | for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { |
| 18296 | for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { |
| 18297 | for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) { |
| 18298 | mem_base = xmlMemBlocks(); |
| 18299 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18300 | pe = gen_int(n_pe); |
| 18301 | name = gen_const_xmlChar_ptr(n_name); |
| 18302 | pubid = gen_const_xmlChar_ptr(n_pubid); |
| 18303 | sysid = gen_const_xmlChar_ptr(n_sysid); |
| 18304 | ndataid = gen_const_xmlChar_ptr(n_ndataid); |
| 18305 | |
| 18306 | ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, name, pubid, sysid, ndataid); |
| 18307 | desret_int(ret_val); |
| 18308 | call_tests++; |
| 18309 | des_xmlTextWriterPtr(n_writer, writer); |
| 18310 | des_int(n_pe, pe); |
| 18311 | des_const_xmlChar_ptr(n_name, name); |
| 18312 | des_const_xmlChar_ptr(n_pubid, pubid); |
| 18313 | des_const_xmlChar_ptr(n_sysid, sysid); |
| 18314 | des_const_xmlChar_ptr(n_ndataid, ndataid); |
| 18315 | xmlResetLastError(); |
| 18316 | if (mem_base != xmlMemBlocks()) { |
| 18317 | printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity", |
| 18318 | xmlMemBlocks() - mem_base); |
| 18319 | ret++; |
| 18320 | printf(" %d", n_writer); |
| 18321 | printf(" %d", n_pe); |
| 18322 | printf(" %d", n_name); |
| 18323 | printf(" %d", n_pubid); |
| 18324 | printf(" %d", n_sysid); |
| 18325 | printf(" %d", n_ndataid); |
| 18326 | printf("\n"); |
| 18327 | } |
| 18328 | } |
| 18329 | } |
| 18330 | } |
| 18331 | } |
| 18332 | } |
| 18333 | } |
| 18334 | #endif |
| 18335 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18336 | return(ret); |
| 18337 | } |
| 18338 | |
| 18339 | |
| 18340 | static int |
| 18341 | test_xmlTextWriterWriteDTDExternalEntityContents(void) { |
| 18342 | int ret = 0; |
| 18343 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18344 | #ifdef LIBXML_WRITER_ENABLED |
| 18345 | int mem_base; |
| 18346 | int ret_val; |
| 18347 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18348 | int n_writer; |
| 18349 | const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ |
| 18350 | int n_pubid; |
| 18351 | const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ |
| 18352 | int n_sysid; |
| 18353 | const xmlChar * ndataid; /* the xml notation name. */ |
| 18354 | int n_ndataid; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18355 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18356 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18357 | for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { |
| 18358 | for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { |
| 18359 | for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) { |
| 18360 | mem_base = xmlMemBlocks(); |
| 18361 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18362 | pubid = gen_const_xmlChar_ptr(n_pubid); |
| 18363 | sysid = gen_const_xmlChar_ptr(n_sysid); |
| 18364 | ndataid = gen_const_xmlChar_ptr(n_ndataid); |
| 18365 | |
| 18366 | ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, pubid, sysid, ndataid); |
| 18367 | desret_int(ret_val); |
| 18368 | call_tests++; |
| 18369 | des_xmlTextWriterPtr(n_writer, writer); |
| 18370 | des_const_xmlChar_ptr(n_pubid, pubid); |
| 18371 | des_const_xmlChar_ptr(n_sysid, sysid); |
| 18372 | des_const_xmlChar_ptr(n_ndataid, ndataid); |
| 18373 | xmlResetLastError(); |
| 18374 | if (mem_base != xmlMemBlocks()) { |
| 18375 | printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents", |
| 18376 | xmlMemBlocks() - mem_base); |
| 18377 | ret++; |
| 18378 | printf(" %d", n_writer); |
| 18379 | printf(" %d", n_pubid); |
| 18380 | printf(" %d", n_sysid); |
| 18381 | printf(" %d", n_ndataid); |
| 18382 | printf("\n"); |
| 18383 | } |
| 18384 | } |
| 18385 | } |
| 18386 | } |
| 18387 | } |
| 18388 | #endif |
| 18389 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18390 | return(ret); |
| 18391 | } |
| 18392 | |
| 18393 | |
| 18394 | static int |
| 18395 | test_xmlTextWriterWriteDTDInternalEntity(void) { |
| 18396 | int ret = 0; |
| 18397 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18398 | #ifdef LIBXML_WRITER_ENABLED |
| 18399 | int mem_base; |
| 18400 | int ret_val; |
| 18401 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18402 | int n_writer; |
| 18403 | int pe; /* TRUE if this is a parameter entity, FALSE if not */ |
| 18404 | int n_pe; |
| 18405 | const xmlChar * name; /* the name of the DTD entity */ |
| 18406 | int n_name; |
| 18407 | const xmlChar * content; /* content of the entity */ |
| 18408 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18409 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18410 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18411 | for (n_pe = 0;n_pe < gen_nb_int;n_pe++) { |
| 18412 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 18413 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18414 | mem_base = xmlMemBlocks(); |
| 18415 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18416 | pe = gen_int(n_pe); |
| 18417 | name = gen_const_xmlChar_ptr(n_name); |
| 18418 | content = gen_const_xmlChar_ptr(n_content); |
| 18419 | |
| 18420 | ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, name, content); |
| 18421 | desret_int(ret_val); |
| 18422 | call_tests++; |
| 18423 | des_xmlTextWriterPtr(n_writer, writer); |
| 18424 | des_int(n_pe, pe); |
| 18425 | des_const_xmlChar_ptr(n_name, name); |
| 18426 | des_const_xmlChar_ptr(n_content, content); |
| 18427 | xmlResetLastError(); |
| 18428 | if (mem_base != xmlMemBlocks()) { |
| 18429 | printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity", |
| 18430 | xmlMemBlocks() - mem_base); |
| 18431 | ret++; |
| 18432 | printf(" %d", n_writer); |
| 18433 | printf(" %d", n_pe); |
| 18434 | printf(" %d", n_name); |
| 18435 | printf(" %d", n_content); |
| 18436 | printf("\n"); |
| 18437 | } |
| 18438 | } |
| 18439 | } |
| 18440 | } |
| 18441 | } |
| 18442 | #endif |
| 18443 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18444 | return(ret); |
| 18445 | } |
| 18446 | |
| 18447 | |
| 18448 | static int |
| 18449 | test_xmlTextWriterWriteDTDNotation(void) { |
| 18450 | int ret = 0; |
| 18451 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18452 | #ifdef LIBXML_WRITER_ENABLED |
| 18453 | int mem_base; |
| 18454 | int ret_val; |
| 18455 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18456 | int n_writer; |
| 18457 | const xmlChar * name; /* the name of the xml notation */ |
| 18458 | int n_name; |
| 18459 | const xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ |
| 18460 | int n_pubid; |
| 18461 | const xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ |
| 18462 | int n_sysid; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18463 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18464 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18465 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 18466 | for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { |
| 18467 | for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { |
| 18468 | mem_base = xmlMemBlocks(); |
| 18469 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18470 | name = gen_const_xmlChar_ptr(n_name); |
| 18471 | pubid = gen_const_xmlChar_ptr(n_pubid); |
| 18472 | sysid = gen_const_xmlChar_ptr(n_sysid); |
| 18473 | |
| 18474 | ret_val = xmlTextWriterWriteDTDNotation(writer, name, pubid, sysid); |
| 18475 | desret_int(ret_val); |
| 18476 | call_tests++; |
| 18477 | des_xmlTextWriterPtr(n_writer, writer); |
| 18478 | des_const_xmlChar_ptr(n_name, name); |
| 18479 | des_const_xmlChar_ptr(n_pubid, pubid); |
| 18480 | des_const_xmlChar_ptr(n_sysid, sysid); |
| 18481 | xmlResetLastError(); |
| 18482 | if (mem_base != xmlMemBlocks()) { |
| 18483 | printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation", |
| 18484 | xmlMemBlocks() - mem_base); |
| 18485 | ret++; |
| 18486 | printf(" %d", n_writer); |
| 18487 | printf(" %d", n_name); |
| 18488 | printf(" %d", n_pubid); |
| 18489 | printf(" %d", n_sysid); |
| 18490 | printf("\n"); |
| 18491 | } |
| 18492 | } |
| 18493 | } |
| 18494 | } |
| 18495 | } |
| 18496 | #endif |
| 18497 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18498 | return(ret); |
| 18499 | } |
| 18500 | |
| 18501 | |
| 18502 | static int |
| 18503 | test_xmlTextWriterWriteElement(void) { |
| 18504 | int ret = 0; |
| 18505 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18506 | #ifdef LIBXML_WRITER_ENABLED |
| 18507 | int mem_base; |
| 18508 | int ret_val; |
| 18509 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18510 | int n_writer; |
| 18511 | const xmlChar * name; /* element name */ |
| 18512 | int n_name; |
| 18513 | const xmlChar * content; /* element content */ |
| 18514 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18515 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18516 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18517 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 18518 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18519 | mem_base = xmlMemBlocks(); |
| 18520 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18521 | name = gen_const_xmlChar_ptr(n_name); |
| 18522 | content = gen_const_xmlChar_ptr(n_content); |
| 18523 | |
| 18524 | ret_val = xmlTextWriterWriteElement(writer, name, content); |
| 18525 | desret_int(ret_val); |
| 18526 | call_tests++; |
| 18527 | des_xmlTextWriterPtr(n_writer, writer); |
| 18528 | des_const_xmlChar_ptr(n_name, name); |
| 18529 | des_const_xmlChar_ptr(n_content, content); |
| 18530 | xmlResetLastError(); |
| 18531 | if (mem_base != xmlMemBlocks()) { |
| 18532 | printf("Leak of %d blocks found in xmlTextWriterWriteElement", |
| 18533 | xmlMemBlocks() - mem_base); |
| 18534 | ret++; |
| 18535 | printf(" %d", n_writer); |
| 18536 | printf(" %d", n_name); |
| 18537 | printf(" %d", n_content); |
| 18538 | printf("\n"); |
| 18539 | } |
| 18540 | } |
| 18541 | } |
| 18542 | } |
| 18543 | #endif |
| 18544 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18545 | return(ret); |
| 18546 | } |
| 18547 | |
| 18548 | |
| 18549 | static int |
| 18550 | test_xmlTextWriterWriteElementNS(void) { |
| 18551 | int ret = 0; |
| 18552 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18553 | #ifdef LIBXML_WRITER_ENABLED |
| 18554 | int mem_base; |
| 18555 | int ret_val; |
| 18556 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18557 | int n_writer; |
| 18558 | const xmlChar * prefix; /* namespace prefix */ |
| 18559 | int n_prefix; |
| 18560 | const xmlChar * name; /* element local name */ |
| 18561 | int n_name; |
| 18562 | const xmlChar * namespaceURI; /* namespace URI */ |
| 18563 | int n_namespaceURI; |
| 18564 | const xmlChar * content; /* element content */ |
| 18565 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18566 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18567 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18568 | for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { |
| 18569 | for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { |
| 18570 | for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { |
| 18571 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18572 | mem_base = xmlMemBlocks(); |
| 18573 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18574 | prefix = gen_const_xmlChar_ptr(n_prefix); |
| 18575 | name = gen_const_xmlChar_ptr(n_name); |
| 18576 | namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI); |
| 18577 | content = gen_const_xmlChar_ptr(n_content); |
| 18578 | |
| 18579 | ret_val = xmlTextWriterWriteElementNS(writer, prefix, name, namespaceURI, content); |
| 18580 | desret_int(ret_val); |
| 18581 | call_tests++; |
| 18582 | des_xmlTextWriterPtr(n_writer, writer); |
| 18583 | des_const_xmlChar_ptr(n_prefix, prefix); |
| 18584 | des_const_xmlChar_ptr(n_name, name); |
| 18585 | des_const_xmlChar_ptr(n_namespaceURI, namespaceURI); |
| 18586 | des_const_xmlChar_ptr(n_content, content); |
| 18587 | xmlResetLastError(); |
| 18588 | if (mem_base != xmlMemBlocks()) { |
| 18589 | printf("Leak of %d blocks found in xmlTextWriterWriteElementNS", |
| 18590 | xmlMemBlocks() - mem_base); |
| 18591 | ret++; |
| 18592 | printf(" %d", n_writer); |
| 18593 | printf(" %d", n_prefix); |
| 18594 | printf(" %d", n_name); |
| 18595 | printf(" %d", n_namespaceURI); |
| 18596 | printf(" %d", n_content); |
| 18597 | printf("\n"); |
| 18598 | } |
| 18599 | } |
| 18600 | } |
| 18601 | } |
| 18602 | } |
| 18603 | } |
| 18604 | #endif |
| 18605 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18606 | return(ret); |
| 18607 | } |
| 18608 | |
| 18609 | |
| 18610 | static int |
| 18611 | test_xmlTextWriterWriteFormatAttribute(void) { |
| 18612 | int ret = 0; |
| 18613 | |
| 18614 | |
| 18615 | /* missing type support */ |
| 18616 | return(ret); |
| 18617 | } |
| 18618 | |
| 18619 | |
| 18620 | static int |
| 18621 | test_xmlTextWriterWriteFormatAttributeNS(void) { |
| 18622 | int ret = 0; |
| 18623 | |
| 18624 | |
| 18625 | /* missing type support */ |
| 18626 | return(ret); |
| 18627 | } |
| 18628 | |
| 18629 | |
| 18630 | static int |
| 18631 | test_xmlTextWriterWriteFormatCDATA(void) { |
| 18632 | int ret = 0; |
| 18633 | |
| 18634 | |
| 18635 | /* missing type support */ |
| 18636 | return(ret); |
| 18637 | } |
| 18638 | |
| 18639 | |
| 18640 | static int |
| 18641 | test_xmlTextWriterWriteFormatComment(void) { |
| 18642 | int ret = 0; |
| 18643 | |
| 18644 | |
| 18645 | /* missing type support */ |
| 18646 | return(ret); |
| 18647 | } |
| 18648 | |
| 18649 | |
| 18650 | static int |
| 18651 | test_xmlTextWriterWriteFormatDTD(void) { |
| 18652 | int ret = 0; |
| 18653 | |
| 18654 | |
| 18655 | /* missing type support */ |
| 18656 | return(ret); |
| 18657 | } |
| 18658 | |
| 18659 | |
| 18660 | static int |
| 18661 | test_xmlTextWriterWriteFormatDTDAttlist(void) { |
| 18662 | int ret = 0; |
| 18663 | |
| 18664 | |
| 18665 | /* missing type support */ |
| 18666 | return(ret); |
| 18667 | } |
| 18668 | |
| 18669 | |
| 18670 | static int |
| 18671 | test_xmlTextWriterWriteFormatDTDElement(void) { |
| 18672 | int ret = 0; |
| 18673 | |
| 18674 | |
| 18675 | /* missing type support */ |
| 18676 | return(ret); |
| 18677 | } |
| 18678 | |
| 18679 | |
| 18680 | static int |
| 18681 | test_xmlTextWriterWriteFormatDTDInternalEntity(void) { |
| 18682 | int ret = 0; |
| 18683 | |
| 18684 | |
| 18685 | /* missing type support */ |
| 18686 | return(ret); |
| 18687 | } |
| 18688 | |
| 18689 | |
| 18690 | static int |
| 18691 | test_xmlTextWriterWriteFormatElement(void) { |
| 18692 | int ret = 0; |
| 18693 | |
| 18694 | |
| 18695 | /* missing type support */ |
| 18696 | return(ret); |
| 18697 | } |
| 18698 | |
| 18699 | |
| 18700 | static int |
| 18701 | test_xmlTextWriterWriteFormatElementNS(void) { |
| 18702 | int ret = 0; |
| 18703 | |
| 18704 | |
| 18705 | /* missing type support */ |
| 18706 | return(ret); |
| 18707 | } |
| 18708 | |
| 18709 | |
| 18710 | static int |
| 18711 | test_xmlTextWriterWriteFormatPI(void) { |
| 18712 | int ret = 0; |
| 18713 | |
| 18714 | |
| 18715 | /* missing type support */ |
| 18716 | return(ret); |
| 18717 | } |
| 18718 | |
| 18719 | |
| 18720 | static int |
| 18721 | test_xmlTextWriterWriteFormatRaw(void) { |
| 18722 | int ret = 0; |
| 18723 | |
| 18724 | |
| 18725 | /* missing type support */ |
| 18726 | return(ret); |
| 18727 | } |
| 18728 | |
| 18729 | |
| 18730 | static int |
| 18731 | test_xmlTextWriterWriteFormatString(void) { |
| 18732 | int ret = 0; |
| 18733 | |
| 18734 | |
| 18735 | /* missing type support */ |
| 18736 | return(ret); |
| 18737 | } |
| 18738 | |
| 18739 | |
| 18740 | static int |
| 18741 | test_xmlTextWriterWritePI(void) { |
| 18742 | int ret = 0; |
| 18743 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18744 | #ifdef LIBXML_WRITER_ENABLED |
| 18745 | int mem_base; |
| 18746 | int ret_val; |
| 18747 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18748 | int n_writer; |
| 18749 | const xmlChar * target; /* PI target */ |
| 18750 | int n_target; |
| 18751 | const xmlChar * content; /* PI content */ |
| 18752 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18753 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18754 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18755 | for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) { |
| 18756 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18757 | mem_base = xmlMemBlocks(); |
| 18758 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18759 | target = gen_const_xmlChar_ptr(n_target); |
| 18760 | content = gen_const_xmlChar_ptr(n_content); |
| 18761 | |
| 18762 | ret_val = xmlTextWriterWritePI(writer, target, content); |
| 18763 | desret_int(ret_val); |
| 18764 | call_tests++; |
| 18765 | des_xmlTextWriterPtr(n_writer, writer); |
| 18766 | des_const_xmlChar_ptr(n_target, target); |
| 18767 | des_const_xmlChar_ptr(n_content, content); |
| 18768 | xmlResetLastError(); |
| 18769 | if (mem_base != xmlMemBlocks()) { |
| 18770 | printf("Leak of %d blocks found in xmlTextWriterWritePI", |
| 18771 | xmlMemBlocks() - mem_base); |
| 18772 | ret++; |
| 18773 | printf(" %d", n_writer); |
| 18774 | printf(" %d", n_target); |
| 18775 | printf(" %d", n_content); |
| 18776 | printf("\n"); |
| 18777 | } |
| 18778 | } |
| 18779 | } |
| 18780 | } |
| 18781 | #endif |
| 18782 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18783 | return(ret); |
| 18784 | } |
| 18785 | |
| 18786 | |
| 18787 | static int |
| 18788 | test_xmlTextWriterWriteRaw(void) { |
| 18789 | int ret = 0; |
| 18790 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18791 | #ifdef LIBXML_WRITER_ENABLED |
| 18792 | int mem_base; |
| 18793 | int ret_val; |
| 18794 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18795 | int n_writer; |
| 18796 | const xmlChar * content; /* text string */ |
| 18797 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18798 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18799 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18800 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18801 | mem_base = xmlMemBlocks(); |
| 18802 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18803 | content = gen_const_xmlChar_ptr(n_content); |
| 18804 | |
| 18805 | ret_val = xmlTextWriterWriteRaw(writer, content); |
| 18806 | desret_int(ret_val); |
| 18807 | call_tests++; |
| 18808 | des_xmlTextWriterPtr(n_writer, writer); |
| 18809 | des_const_xmlChar_ptr(n_content, content); |
| 18810 | xmlResetLastError(); |
| 18811 | if (mem_base != xmlMemBlocks()) { |
| 18812 | printf("Leak of %d blocks found in xmlTextWriterWriteRaw", |
| 18813 | xmlMemBlocks() - mem_base); |
| 18814 | ret++; |
| 18815 | printf(" %d", n_writer); |
| 18816 | printf(" %d", n_content); |
| 18817 | printf("\n"); |
| 18818 | } |
| 18819 | } |
| 18820 | } |
| 18821 | #endif |
| 18822 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18823 | return(ret); |
| 18824 | } |
| 18825 | |
| 18826 | |
| 18827 | static int |
| 18828 | test_xmlTextWriterWriteRawLen(void) { |
| 18829 | int ret = 0; |
| 18830 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18831 | #ifdef LIBXML_WRITER_ENABLED |
| 18832 | int mem_base; |
| 18833 | int ret_val; |
| 18834 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18835 | int n_writer; |
| 18836 | const xmlChar * content; /* text string */ |
| 18837 | int n_content; |
| 18838 | int len; /* length of the text string */ |
| 18839 | int n_len; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18840 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18841 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18842 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18843 | for (n_len = 0;n_len < gen_nb_int;n_len++) { |
| 18844 | mem_base = xmlMemBlocks(); |
| 18845 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18846 | content = gen_const_xmlChar_ptr(n_content); |
| 18847 | len = gen_int(n_len); |
| 18848 | |
| 18849 | ret_val = xmlTextWriterWriteRawLen(writer, content, len); |
| 18850 | desret_int(ret_val); |
| 18851 | call_tests++; |
| 18852 | des_xmlTextWriterPtr(n_writer, writer); |
| 18853 | des_const_xmlChar_ptr(n_content, content); |
| 18854 | des_int(n_len, len); |
| 18855 | xmlResetLastError(); |
| 18856 | if (mem_base != xmlMemBlocks()) { |
| 18857 | printf("Leak of %d blocks found in xmlTextWriterWriteRawLen", |
| 18858 | xmlMemBlocks() - mem_base); |
| 18859 | ret++; |
| 18860 | printf(" %d", n_writer); |
| 18861 | printf(" %d", n_content); |
| 18862 | printf(" %d", n_len); |
| 18863 | printf("\n"); |
| 18864 | } |
| 18865 | } |
| 18866 | } |
| 18867 | } |
| 18868 | #endif |
| 18869 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18870 | return(ret); |
| 18871 | } |
| 18872 | |
| 18873 | |
| 18874 | static int |
| 18875 | test_xmlTextWriterWriteString(void) { |
| 18876 | int ret = 0; |
| 18877 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18878 | #ifdef LIBXML_WRITER_ENABLED |
| 18879 | int mem_base; |
| 18880 | int ret_val; |
| 18881 | xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ |
| 18882 | int n_writer; |
| 18883 | const xmlChar * content; /* text string */ |
| 18884 | int n_content; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18885 | |
Daniel Veillard | e43cc57 | 2004-11-03 11:50:29 +0000 | [diff] [blame] | 18886 | for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { |
| 18887 | for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { |
| 18888 | mem_base = xmlMemBlocks(); |
| 18889 | writer = gen_xmlTextWriterPtr(n_writer); |
| 18890 | content = gen_const_xmlChar_ptr(n_content); |
| 18891 | |
| 18892 | ret_val = xmlTextWriterWriteString(writer, content); |
| 18893 | desret_int(ret_val); |
| 18894 | call_tests++; |
| 18895 | des_xmlTextWriterPtr(n_writer, writer); |
| 18896 | des_const_xmlChar_ptr(n_content, content); |
| 18897 | xmlResetLastError(); |
| 18898 | if (mem_base != xmlMemBlocks()) { |
| 18899 | printf("Leak of %d blocks found in xmlTextWriterWriteString", |
| 18900 | xmlMemBlocks() - mem_base); |
| 18901 | ret++; |
| 18902 | printf(" %d", n_writer); |
| 18903 | printf(" %d", n_content); |
| 18904 | printf("\n"); |
| 18905 | } |
| 18906 | } |
| 18907 | } |
| 18908 | #endif |
| 18909 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 18910 | return(ret); |
| 18911 | } |
| 18912 | |
| 18913 | |
| 18914 | static int |
| 18915 | test_xmlTextWriterWriteVFormatAttribute(void) { |
| 18916 | int ret = 0; |
| 18917 | |
| 18918 | |
| 18919 | /* missing type support */ |
| 18920 | return(ret); |
| 18921 | } |
| 18922 | |
| 18923 | |
| 18924 | static int |
| 18925 | test_xmlTextWriterWriteVFormatAttributeNS(void) { |
| 18926 | int ret = 0; |
| 18927 | |
| 18928 | |
| 18929 | /* missing type support */ |
| 18930 | return(ret); |
| 18931 | } |
| 18932 | |
| 18933 | |
| 18934 | static int |
| 18935 | test_xmlTextWriterWriteVFormatCDATA(void) { |
| 18936 | int ret = 0; |
| 18937 | |
| 18938 | |
| 18939 | /* missing type support */ |
| 18940 | return(ret); |
| 18941 | } |
| 18942 | |
| 18943 | |
| 18944 | static int |
| 18945 | test_xmlTextWriterWriteVFormatComment(void) { |
| 18946 | int ret = 0; |
| 18947 | |
| 18948 | |
| 18949 | /* missing type support */ |
| 18950 | return(ret); |
| 18951 | } |
| 18952 | |
| 18953 | |
| 18954 | static int |
| 18955 | test_xmlTextWriterWriteVFormatDTD(void) { |
| 18956 | int ret = 0; |
| 18957 | |
| 18958 | |
| 18959 | /* missing type support */ |
| 18960 | return(ret); |
| 18961 | } |
| 18962 | |
| 18963 | |
| 18964 | static int |
| 18965 | test_xmlTextWriterWriteVFormatDTDAttlist(void) { |
| 18966 | int ret = 0; |
| 18967 | |
| 18968 | |
| 18969 | /* missing type support */ |
| 18970 | return(ret); |
| 18971 | } |
| 18972 | |
| 18973 | |
| 18974 | static int |
| 18975 | test_xmlTextWriterWriteVFormatDTDElement(void) { |
| 18976 | int ret = 0; |
| 18977 | |
| 18978 | |
| 18979 | /* missing type support */ |
| 18980 | return(ret); |
| 18981 | } |
| 18982 | |
| 18983 | |
| 18984 | static int |
| 18985 | test_xmlTextWriterWriteVFormatDTDInternalEntity(void) { |
| 18986 | int ret = 0; |
| 18987 | |
| 18988 | |
| 18989 | /* missing type support */ |
| 18990 | return(ret); |
| 18991 | } |
| 18992 | |
| 18993 | |
| 18994 | static int |
| 18995 | test_xmlTextWriterWriteVFormatElement(void) { |
| 18996 | int ret = 0; |
| 18997 | |
| 18998 | |
| 18999 | /* missing type support */ |
| 19000 | return(ret); |
| 19001 | } |
| 19002 | |
| 19003 | |
| 19004 | static int |
| 19005 | test_xmlTextWriterWriteVFormatElementNS(void) { |
| 19006 | int ret = 0; |
| 19007 | |
| 19008 | |
| 19009 | /* missing type support */ |
| 19010 | return(ret); |
| 19011 | } |
| 19012 | |
| 19013 | |
| 19014 | static int |
| 19015 | test_xmlTextWriterWriteVFormatPI(void) { |
| 19016 | int ret = 0; |
| 19017 | |
| 19018 | |
| 19019 | /* missing type support */ |
| 19020 | return(ret); |
| 19021 | } |
| 19022 | |
| 19023 | |
| 19024 | static int |
| 19025 | test_xmlTextWriterWriteVFormatRaw(void) { |
| 19026 | int ret = 0; |
| 19027 | |
| 19028 | |
| 19029 | /* missing type support */ |
| 19030 | return(ret); |
| 19031 | } |
| 19032 | |
| 19033 | |
| 19034 | static int |
| 19035 | test_xmlTextWriterWriteVFormatString(void) { |
| 19036 | int ret = 0; |
| 19037 | |
| 19038 | |
| 19039 | /* missing type support */ |
| 19040 | return(ret); |
| 19041 | } |
| 19042 | |
| 19043 | static int |
| 19044 | test_xmlwriter(void) { |
| 19045 | int ret = 0; |
| 19046 | |
| 19047 | printf("Testing xmlwriter ...\n"); |
| 19048 | ret += test_xmlNewTextWriter(); |
| 19049 | ret += test_xmlNewTextWriterDoc(); |
| 19050 | ret += test_xmlNewTextWriterFilename(); |
| 19051 | ret += test_xmlNewTextWriterMemory(); |
| 19052 | ret += test_xmlNewTextWriterPushParser(); |
| 19053 | ret += test_xmlNewTextWriterTree(); |
| 19054 | ret += test_xmlTextWriterEndAttribute(); |
| 19055 | ret += test_xmlTextWriterEndCDATA(); |
| 19056 | ret += test_xmlTextWriterEndComment(); |
| 19057 | ret += test_xmlTextWriterEndDTD(); |
| 19058 | ret += test_xmlTextWriterEndDTDAttlist(); |
| 19059 | ret += test_xmlTextWriterEndDTDElement(); |
| 19060 | ret += test_xmlTextWriterEndDTDEntity(); |
| 19061 | ret += test_xmlTextWriterEndDocument(); |
| 19062 | ret += test_xmlTextWriterEndElement(); |
| 19063 | ret += test_xmlTextWriterEndPI(); |
| 19064 | ret += test_xmlTextWriterFlush(); |
| 19065 | ret += test_xmlTextWriterFullEndElement(); |
| 19066 | ret += test_xmlTextWriterSetIndent(); |
| 19067 | ret += test_xmlTextWriterSetIndentString(); |
| 19068 | ret += test_xmlTextWriterStartAttribute(); |
| 19069 | ret += test_xmlTextWriterStartAttributeNS(); |
| 19070 | ret += test_xmlTextWriterStartCDATA(); |
| 19071 | ret += test_xmlTextWriterStartComment(); |
| 19072 | ret += test_xmlTextWriterStartDTD(); |
| 19073 | ret += test_xmlTextWriterStartDTDAttlist(); |
| 19074 | ret += test_xmlTextWriterStartDTDElement(); |
| 19075 | ret += test_xmlTextWriterStartDTDEntity(); |
| 19076 | ret += test_xmlTextWriterStartDocument(); |
| 19077 | ret += test_xmlTextWriterStartElement(); |
| 19078 | ret += test_xmlTextWriterStartElementNS(); |
| 19079 | ret += test_xmlTextWriterStartPI(); |
| 19080 | ret += test_xmlTextWriterWriteAttribute(); |
| 19081 | ret += test_xmlTextWriterWriteAttributeNS(); |
| 19082 | ret += test_xmlTextWriterWriteBase64(); |
| 19083 | ret += test_xmlTextWriterWriteBinHex(); |
| 19084 | ret += test_xmlTextWriterWriteCDATA(); |
| 19085 | ret += test_xmlTextWriterWriteComment(); |
| 19086 | ret += test_xmlTextWriterWriteDTD(); |
| 19087 | ret += test_xmlTextWriterWriteDTDAttlist(); |
| 19088 | ret += test_xmlTextWriterWriteDTDElement(); |
| 19089 | ret += test_xmlTextWriterWriteDTDEntity(); |
| 19090 | ret += test_xmlTextWriterWriteDTDExternalEntity(); |
| 19091 | ret += test_xmlTextWriterWriteDTDExternalEntityContents(); |
| 19092 | ret += test_xmlTextWriterWriteDTDInternalEntity(); |
| 19093 | ret += test_xmlTextWriterWriteDTDNotation(); |
| 19094 | ret += test_xmlTextWriterWriteElement(); |
| 19095 | ret += test_xmlTextWriterWriteElementNS(); |
| 19096 | ret += test_xmlTextWriterWriteFormatAttribute(); |
| 19097 | ret += test_xmlTextWriterWriteFormatAttributeNS(); |
| 19098 | ret += test_xmlTextWriterWriteFormatCDATA(); |
| 19099 | ret += test_xmlTextWriterWriteFormatComment(); |
| 19100 | ret += test_xmlTextWriterWriteFormatDTD(); |
| 19101 | ret += test_xmlTextWriterWriteFormatDTDAttlist(); |
| 19102 | ret += test_xmlTextWriterWriteFormatDTDElement(); |
| 19103 | ret += test_xmlTextWriterWriteFormatDTDInternalEntity(); |
| 19104 | ret += test_xmlTextWriterWriteFormatElement(); |
| 19105 | ret += test_xmlTextWriterWriteFormatElementNS(); |
| 19106 | ret += test_xmlTextWriterWriteFormatPI(); |
| 19107 | ret += test_xmlTextWriterWriteFormatRaw(); |
| 19108 | ret += test_xmlTextWriterWriteFormatString(); |
| 19109 | ret += test_xmlTextWriterWritePI(); |
| 19110 | ret += test_xmlTextWriterWriteRaw(); |
| 19111 | ret += test_xmlTextWriterWriteRawLen(); |
| 19112 | ret += test_xmlTextWriterWriteString(); |
| 19113 | ret += test_xmlTextWriterWriteVFormatAttribute(); |
| 19114 | ret += test_xmlTextWriterWriteVFormatAttributeNS(); |
| 19115 | ret += test_xmlTextWriterWriteVFormatCDATA(); |
| 19116 | ret += test_xmlTextWriterWriteVFormatComment(); |
| 19117 | ret += test_xmlTextWriterWriteVFormatDTD(); |
| 19118 | ret += test_xmlTextWriterWriteVFormatDTDAttlist(); |
| 19119 | ret += test_xmlTextWriterWriteVFormatDTDElement(); |
| 19120 | ret += test_xmlTextWriterWriteVFormatDTDInternalEntity(); |
| 19121 | ret += test_xmlTextWriterWriteVFormatElement(); |
| 19122 | ret += test_xmlTextWriterWriteVFormatElementNS(); |
| 19123 | ret += test_xmlTextWriterWriteVFormatPI(); |
| 19124 | ret += test_xmlTextWriterWriteVFormatRaw(); |
| 19125 | ret += test_xmlTextWriterWriteVFormatString(); |
| 19126 | |
| 19127 | if (ret != 0) |
| 19128 | printf("Module xmlwriter: %d errors\n", ret); |
| 19129 | return(ret); |
| 19130 | } |
| 19131 | |
| 19132 | static int |
| 19133 | test_xmlXPathCastBooleanToNumber(void) { |
| 19134 | int ret = 0; |
| 19135 | |
| 19136 | |
| 19137 | /* missing type support */ |
| 19138 | return(ret); |
| 19139 | } |
| 19140 | |
| 19141 | |
| 19142 | static int |
| 19143 | test_xmlXPathCastBooleanToString(void) { |
| 19144 | int ret = 0; |
| 19145 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 19146 | #ifdef LIBXML_XPATH_ENABLED |
| 19147 | int mem_base; |
| 19148 | xmlChar * ret_val; |
| 19149 | int val; /* a boolean */ |
| 19150 | int n_val; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19151 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 19152 | for (n_val = 0;n_val < gen_nb_int;n_val++) { |
| 19153 | mem_base = xmlMemBlocks(); |
| 19154 | val = gen_int(n_val); |
| 19155 | |
| 19156 | ret_val = xmlXPathCastBooleanToString(val); |
| 19157 | desret_xmlChar_ptr(ret_val); |
| 19158 | call_tests++; |
| 19159 | des_int(n_val, val); |
| 19160 | xmlResetLastError(); |
| 19161 | if (mem_base != xmlMemBlocks()) { |
| 19162 | printf("Leak of %d blocks found in xmlXPathCastBooleanToString", |
| 19163 | xmlMemBlocks() - mem_base); |
| 19164 | ret++; |
| 19165 | printf(" %d", n_val); |
| 19166 | printf("\n"); |
| 19167 | } |
| 19168 | } |
| 19169 | #endif |
| 19170 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19171 | return(ret); |
| 19172 | } |
| 19173 | |
| 19174 | |
| 19175 | static int |
| 19176 | test_xmlXPathCastNodeSetToBoolean(void) { |
| 19177 | int ret = 0; |
| 19178 | |
| 19179 | |
| 19180 | /* missing type support */ |
| 19181 | return(ret); |
| 19182 | } |
| 19183 | |
| 19184 | |
| 19185 | static int |
| 19186 | test_xmlXPathCastNodeSetToNumber(void) { |
| 19187 | int ret = 0; |
| 19188 | |
| 19189 | |
| 19190 | /* missing type support */ |
| 19191 | return(ret); |
| 19192 | } |
| 19193 | |
| 19194 | |
| 19195 | static int |
| 19196 | test_xmlXPathCastNodeSetToString(void) { |
| 19197 | int ret = 0; |
| 19198 | |
| 19199 | |
| 19200 | /* missing type support */ |
| 19201 | return(ret); |
| 19202 | } |
| 19203 | |
| 19204 | |
| 19205 | static int |
| 19206 | test_xmlXPathCastNodeToNumber(void) { |
| 19207 | int ret = 0; |
| 19208 | |
| 19209 | |
| 19210 | /* missing type support */ |
| 19211 | return(ret); |
| 19212 | } |
| 19213 | |
| 19214 | |
| 19215 | static int |
| 19216 | test_xmlXPathCastNodeToString(void) { |
| 19217 | int ret = 0; |
| 19218 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 19219 | #ifdef LIBXML_XPATH_ENABLED |
| 19220 | int mem_base; |
| 19221 | xmlChar * ret_val; |
| 19222 | xmlNodePtr node; /* a node */ |
| 19223 | int n_node; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19224 | |
Daniel Veillard | 8a32fe4 | 2004-11-02 22:10:16 +0000 | [diff] [blame] | 19225 | for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { |
| 19226 | mem_base = xmlMemBlocks(); |
| 19227 | node = gen_xmlNodePtr(n_node); |
| 19228 | |
| 19229 | ret_val = xmlXPathCastNodeToString(node); |
| 19230 | desret_xmlChar_ptr(ret_val); |
| 19231 | call_tests++; |
| 19232 | des_xmlNodePtr(n_node, node); |
| 19233 | xmlResetLastError(); |
| 19234 | if (mem_base != xmlMemBlocks()) { |
| 19235 | printf("Leak of %d blocks found in xmlXPathCastNodeToString", |
| 19236 | xmlMemBlocks() - mem_base); |
| 19237 | ret++; |
| 19238 | printf(" %d", n_node); |
| 19239 | printf("\n"); |
| 19240 | } |
| 19241 | } |
| 19242 | #endif |
| 19243 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19244 | return(ret); |
| 19245 | } |
| 19246 | |
| 19247 | |
| 19248 | static int |
| 19249 | test_xmlXPathCastNumberToBoolean(void) { |
| 19250 | int ret = 0; |
| 19251 | |
| 19252 | |
| 19253 | /* missing type support */ |
| 19254 | return(ret); |
| 19255 | } |
| 19256 | |
| 19257 | |
| 19258 | static int |
| 19259 | test_xmlXPathCastNumberToString(void) { |
| 19260 | int ret = 0; |
| 19261 | |
| 19262 | |
| 19263 | /* missing type support */ |
| 19264 | return(ret); |
| 19265 | } |
| 19266 | |
| 19267 | |
| 19268 | static int |
| 19269 | test_xmlXPathCastStringToBoolean(void) { |
| 19270 | int ret = 0; |
| 19271 | |
| 19272 | #ifdef LIBXML_XPATH_ENABLED |
| 19273 | int mem_base; |
| 19274 | int ret_val; |
| 19275 | const xmlChar * val; /* a string */ |
| 19276 | int n_val; |
| 19277 | |
| 19278 | for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) { |
| 19279 | mem_base = xmlMemBlocks(); |
| 19280 | val = gen_const_xmlChar_ptr(n_val); |
| 19281 | |
| 19282 | ret_val = xmlXPathCastStringToBoolean(val); |
| 19283 | desret_int(ret_val); |
| 19284 | call_tests++; |
| 19285 | des_const_xmlChar_ptr(n_val, val); |
| 19286 | xmlResetLastError(); |
| 19287 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 19288 | printf("Leak of %d blocks found in xmlXPathCastStringToBoolean", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19289 | xmlMemBlocks() - mem_base); |
| 19290 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 19291 | printf(" %d", n_val); |
| 19292 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19293 | } |
| 19294 | } |
| 19295 | #endif |
| 19296 | |
| 19297 | return(ret); |
| 19298 | } |
| 19299 | |
| 19300 | |
| 19301 | static int |
| 19302 | test_xmlXPathCastStringToNumber(void) { |
| 19303 | int ret = 0; |
| 19304 | |
| 19305 | |
| 19306 | /* missing type support */ |
| 19307 | return(ret); |
| 19308 | } |
| 19309 | |
| 19310 | |
| 19311 | static int |
| 19312 | test_xmlXPathCastToBoolean(void) { |
| 19313 | int ret = 0; |
| 19314 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 19315 | #ifdef LIBXML_XPATH_ENABLED |
| 19316 | int mem_base; |
| 19317 | int ret_val; |
| 19318 | xmlXPathObjectPtr val; /* an XPath object */ |
| 19319 | int n_val; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19320 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 19321 | for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { |
| 19322 | mem_base = xmlMemBlocks(); |
| 19323 | val = gen_xmlXPathObjectPtr(n_val); |
| 19324 | |
| 19325 | ret_val = xmlXPathCastToBoolean(val); |
| 19326 | desret_int(ret_val); |
| 19327 | call_tests++; |
| 19328 | des_xmlXPathObjectPtr(n_val, val); |
| 19329 | xmlResetLastError(); |
| 19330 | if (mem_base != xmlMemBlocks()) { |
| 19331 | printf("Leak of %d blocks found in xmlXPathCastToBoolean", |
| 19332 | xmlMemBlocks() - mem_base); |
| 19333 | ret++; |
| 19334 | printf(" %d", n_val); |
| 19335 | printf("\n"); |
| 19336 | } |
| 19337 | } |
| 19338 | #endif |
| 19339 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19340 | return(ret); |
| 19341 | } |
| 19342 | |
| 19343 | |
| 19344 | static int |
| 19345 | test_xmlXPathCastToNumber(void) { |
| 19346 | int ret = 0; |
| 19347 | |
| 19348 | |
| 19349 | /* missing type support */ |
| 19350 | return(ret); |
| 19351 | } |
| 19352 | |
| 19353 | |
| 19354 | static int |
| 19355 | test_xmlXPathCastToString(void) { |
| 19356 | int ret = 0; |
| 19357 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 19358 | #ifdef LIBXML_XPATH_ENABLED |
| 19359 | int mem_base; |
| 19360 | xmlChar * ret_val; |
| 19361 | xmlXPathObjectPtr val; /* an XPath object */ |
| 19362 | int n_val; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19363 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 19364 | for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { |
| 19365 | mem_base = xmlMemBlocks(); |
| 19366 | val = gen_xmlXPathObjectPtr(n_val); |
| 19367 | |
| 19368 | ret_val = xmlXPathCastToString(val); |
| 19369 | desret_xmlChar_ptr(ret_val); |
| 19370 | call_tests++; |
| 19371 | des_xmlXPathObjectPtr(n_val, val); |
| 19372 | xmlResetLastError(); |
| 19373 | if (mem_base != xmlMemBlocks()) { |
| 19374 | printf("Leak of %d blocks found in xmlXPathCastToString", |
| 19375 | xmlMemBlocks() - mem_base); |
| 19376 | ret++; |
| 19377 | printf(" %d", n_val); |
| 19378 | printf("\n"); |
| 19379 | } |
| 19380 | } |
| 19381 | #endif |
| 19382 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19383 | return(ret); |
| 19384 | } |
| 19385 | |
| 19386 | |
| 19387 | static int |
| 19388 | test_xmlXPathCmpNodes(void) { |
| 19389 | int ret = 0; |
| 19390 | |
| 19391 | #ifdef LIBXML_XPATH_ENABLED |
| 19392 | int mem_base; |
| 19393 | int ret_val; |
| 19394 | xmlNodePtr node1; /* the first node */ |
| 19395 | int n_node1; |
| 19396 | xmlNodePtr node2; /* the second node */ |
| 19397 | int n_node2; |
| 19398 | |
| 19399 | for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) { |
| 19400 | for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { |
| 19401 | mem_base = xmlMemBlocks(); |
| 19402 | node1 = gen_xmlNodePtr(n_node1); |
| 19403 | node2 = gen_xmlNodePtr(n_node2); |
| 19404 | |
| 19405 | ret_val = xmlXPathCmpNodes(node1, node2); |
| 19406 | desret_int(ret_val); |
| 19407 | call_tests++; |
| 19408 | des_xmlNodePtr(n_node1, node1); |
| 19409 | des_xmlNodePtr(n_node2, node2); |
| 19410 | xmlResetLastError(); |
| 19411 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 19412 | printf("Leak of %d blocks found in xmlXPathCmpNodes", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19413 | xmlMemBlocks() - mem_base); |
| 19414 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 19415 | printf(" %d", n_node1); |
| 19416 | printf(" %d", n_node2); |
| 19417 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19418 | } |
| 19419 | } |
| 19420 | } |
| 19421 | #endif |
| 19422 | |
| 19423 | return(ret); |
| 19424 | } |
| 19425 | |
| 19426 | |
| 19427 | static int |
| 19428 | test_xmlXPathCompile(void) { |
| 19429 | int ret = 0; |
| 19430 | |
| 19431 | |
| 19432 | /* missing type support */ |
| 19433 | return(ret); |
| 19434 | } |
| 19435 | |
| 19436 | |
| 19437 | static int |
| 19438 | test_xmlXPathCompiledEval(void) { |
| 19439 | int ret = 0; |
| 19440 | |
| 19441 | |
| 19442 | /* missing type support */ |
| 19443 | return(ret); |
| 19444 | } |
| 19445 | |
| 19446 | |
| 19447 | static int |
| 19448 | test_xmlXPathConvertBoolean(void) { |
| 19449 | int ret = 0; |
| 19450 | |
| 19451 | |
| 19452 | /* missing type support */ |
| 19453 | return(ret); |
| 19454 | } |
| 19455 | |
| 19456 | |
| 19457 | static int |
| 19458 | test_xmlXPathConvertNumber(void) { |
| 19459 | int ret = 0; |
| 19460 | |
| 19461 | |
| 19462 | /* missing type support */ |
| 19463 | return(ret); |
| 19464 | } |
| 19465 | |
| 19466 | |
| 19467 | static int |
| 19468 | test_xmlXPathConvertString(void) { |
| 19469 | int ret = 0; |
| 19470 | |
| 19471 | |
| 19472 | /* missing type support */ |
| 19473 | return(ret); |
| 19474 | } |
| 19475 | |
| 19476 | |
| 19477 | static int |
| 19478 | test_xmlXPathCtxtCompile(void) { |
| 19479 | int ret = 0; |
| 19480 | |
| 19481 | |
| 19482 | /* missing type support */ |
| 19483 | return(ret); |
| 19484 | } |
| 19485 | |
| 19486 | |
| 19487 | static int |
| 19488 | test_xmlXPathEval(void) { |
| 19489 | int ret = 0; |
| 19490 | |
| 19491 | |
| 19492 | /* missing type support */ |
| 19493 | return(ret); |
| 19494 | } |
| 19495 | |
| 19496 | |
| 19497 | static int |
| 19498 | test_xmlXPathEvalExpression(void) { |
| 19499 | int ret = 0; |
| 19500 | |
| 19501 | |
| 19502 | /* missing type support */ |
| 19503 | return(ret); |
| 19504 | } |
| 19505 | |
| 19506 | |
| 19507 | static int |
| 19508 | test_xmlXPathEvalPredicate(void) { |
| 19509 | int ret = 0; |
| 19510 | |
| 19511 | |
| 19512 | /* missing type support */ |
| 19513 | return(ret); |
| 19514 | } |
| 19515 | |
| 19516 | |
| 19517 | static int |
| 19518 | test_xmlXPathInit(void) { |
| 19519 | int ret = 0; |
| 19520 | |
| 19521 | #ifdef LIBXML_XPATH_ENABLED |
| 19522 | int mem_base; |
| 19523 | |
| 19524 | mem_base = xmlMemBlocks(); |
| 19525 | |
| 19526 | xmlXPathInit(); |
| 19527 | call_tests++; |
| 19528 | xmlResetLastError(); |
| 19529 | if (mem_base != xmlMemBlocks()) { |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 19530 | printf("Leak of %d blocks found in xmlXPathInit", |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19531 | xmlMemBlocks() - mem_base); |
| 19532 | ret++; |
Daniel Veillard | a03e365 | 2004-11-02 18:45:30 +0000 | [diff] [blame] | 19533 | printf("\n"); |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19534 | } |
| 19535 | #endif |
| 19536 | |
| 19537 | return(ret); |
| 19538 | } |
| 19539 | |
| 19540 | |
| 19541 | static int |
| 19542 | test_xmlXPathIsInf(void) { |
| 19543 | int ret = 0; |
| 19544 | |
| 19545 | |
| 19546 | /* missing type support */ |
| 19547 | return(ret); |
| 19548 | } |
| 19549 | |
| 19550 | |
| 19551 | static int |
| 19552 | test_xmlXPathIsNaN(void) { |
| 19553 | int ret = 0; |
| 19554 | |
| 19555 | |
| 19556 | /* missing type support */ |
| 19557 | return(ret); |
| 19558 | } |
| 19559 | |
| 19560 | |
| 19561 | static int |
| 19562 | test_xmlXPathNewContext(void) { |
| 19563 | int ret = 0; |
| 19564 | |
| 19565 | |
| 19566 | /* missing type support */ |
| 19567 | return(ret); |
| 19568 | } |
| 19569 | |
| 19570 | |
| 19571 | static int |
| 19572 | test_xmlXPathNodeSetCreate(void) { |
| 19573 | int ret = 0; |
| 19574 | |
| 19575 | |
| 19576 | /* missing type support */ |
| 19577 | return(ret); |
| 19578 | } |
| 19579 | |
| 19580 | |
| 19581 | static int |
| 19582 | test_xmlXPathObjectCopy(void) { |
| 19583 | int ret = 0; |
| 19584 | |
| 19585 | |
| 19586 | /* missing type support */ |
| 19587 | return(ret); |
| 19588 | } |
| 19589 | |
| 19590 | |
| 19591 | static int |
| 19592 | test_xmlXPathOrderDocElems(void) { |
| 19593 | int ret = 0; |
| 19594 | |
| 19595 | |
| 19596 | /* missing type support */ |
| 19597 | return(ret); |
| 19598 | } |
| 19599 | |
| 19600 | static int |
| 19601 | test_xpath(void) { |
| 19602 | int ret = 0; |
| 19603 | |
| 19604 | printf("Testing xpath ...\n"); |
| 19605 | ret += test_xmlXPathCastBooleanToNumber(); |
| 19606 | ret += test_xmlXPathCastBooleanToString(); |
| 19607 | ret += test_xmlXPathCastNodeSetToBoolean(); |
| 19608 | ret += test_xmlXPathCastNodeSetToNumber(); |
| 19609 | ret += test_xmlXPathCastNodeSetToString(); |
| 19610 | ret += test_xmlXPathCastNodeToNumber(); |
| 19611 | ret += test_xmlXPathCastNodeToString(); |
| 19612 | ret += test_xmlXPathCastNumberToBoolean(); |
| 19613 | ret += test_xmlXPathCastNumberToString(); |
| 19614 | ret += test_xmlXPathCastStringToBoolean(); |
| 19615 | ret += test_xmlXPathCastStringToNumber(); |
| 19616 | ret += test_xmlXPathCastToBoolean(); |
| 19617 | ret += test_xmlXPathCastToNumber(); |
| 19618 | ret += test_xmlXPathCastToString(); |
| 19619 | ret += test_xmlXPathCmpNodes(); |
| 19620 | ret += test_xmlXPathCompile(); |
| 19621 | ret += test_xmlXPathCompiledEval(); |
| 19622 | ret += test_xmlXPathConvertBoolean(); |
| 19623 | ret += test_xmlXPathConvertNumber(); |
| 19624 | ret += test_xmlXPathConvertString(); |
| 19625 | ret += test_xmlXPathCtxtCompile(); |
| 19626 | ret += test_xmlXPathEval(); |
| 19627 | ret += test_xmlXPathEvalExpression(); |
| 19628 | ret += test_xmlXPathEvalPredicate(); |
| 19629 | ret += test_xmlXPathInit(); |
| 19630 | ret += test_xmlXPathIsInf(); |
| 19631 | ret += test_xmlXPathIsNaN(); |
| 19632 | ret += test_xmlXPathNewContext(); |
| 19633 | ret += test_xmlXPathNodeSetCreate(); |
| 19634 | ret += test_xmlXPathObjectCopy(); |
| 19635 | ret += test_xmlXPathOrderDocElems(); |
| 19636 | |
| 19637 | if (ret != 0) |
| 19638 | printf("Module xpath: %d errors\n", ret); |
| 19639 | return(ret); |
| 19640 | } |
| 19641 | |
| 19642 | static int |
| 19643 | test_xmlXPtrBuildNodeList(void) { |
| 19644 | int ret = 0; |
| 19645 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 19646 | #ifdef LIBXML_XPTR_ENABLED |
| 19647 | int mem_base; |
| 19648 | xmlNodePtr ret_val; |
| 19649 | xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */ |
| 19650 | int n_obj; |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19651 | |
Daniel Veillard | d005b9e | 2004-11-03 17:07:05 +0000 | [diff] [blame] | 19652 | for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) { |
| 19653 | mem_base = xmlMemBlocks(); |
| 19654 | obj = gen_xmlXPathObjectPtr(n_obj); |
| 19655 | |
| 19656 | ret_val = xmlXPtrBuildNodeList(obj); |
| 19657 | desret_xmlNodePtr(ret_val); |
| 19658 | call_tests++; |
| 19659 | des_xmlXPathObjectPtr(n_obj, obj); |
| 19660 | xmlResetLastError(); |
| 19661 | if (mem_base != xmlMemBlocks()) { |
| 19662 | printf("Leak of %d blocks found in xmlXPtrBuildNodeList", |
| 19663 | xmlMemBlocks() - mem_base); |
| 19664 | ret++; |
| 19665 | printf(" %d", n_obj); |
| 19666 | printf("\n"); |
| 19667 | } |
| 19668 | } |
| 19669 | #endif |
| 19670 | |
Daniel Veillard | d93f625 | 2004-11-02 15:53:51 +0000 | [diff] [blame] | 19671 | return(ret); |
| 19672 | } |
| 19673 | |
| 19674 | |
| 19675 | static int |
| 19676 | test_xmlXPtrEval(void) { |
| 19677 | int ret = 0; |
| 19678 | |
| 19679 | |
| 19680 | /* missing type support */ |
| 19681 | return(ret); |
| 19682 | } |
| 19683 | |
| 19684 | |
| 19685 | static int |
| 19686 | test_xmlXPtrEvalRangePredicate(void) { |
| 19687 | int ret = 0; |
| 19688 | |
| 19689 | |
| 19690 | /* missing type support */ |
| 19691 | return(ret); |
| 19692 | } |
| 19693 | |
| 19694 | |
| 19695 | static int |
| 19696 | test_xmlXPtrLocationSetAdd(void) { |
| 19697 | int ret = 0; |
| 19698 | |
| 19699 | |
| 19700 | /* missing type support */ |
| 19701 | return(ret); |
| 19702 | } |
| 19703 | |
| 19704 | |
| 19705 | static int |
| 19706 | test_xmlXPtrLocationSetCreate(void) { |
| 19707 | int ret = 0; |
| 19708 | |
| 19709 | |
| 19710 | /* missing type support */ |
| 19711 | return(ret); |
| 19712 | } |
| 19713 | |
| 19714 | |
| 19715 | static int |
| 19716 | test_xmlXPtrLocationSetDel(void) { |
| 19717 | int ret = 0; |
| 19718 | |
| 19719 | |
| 19720 | /* missing type support */ |
| 19721 | return(ret); |
| 19722 | } |
| 19723 | |
| 19724 | |
| 19725 | static int |
| 19726 | test_xmlXPtrLocationSetMerge(void) { |
| 19727 | int ret = 0; |
| 19728 | |
| 19729 | |
| 19730 | /* missing type support */ |
| 19731 | return(ret); |
| 19732 | } |
| 19733 | |
| 19734 | |
| 19735 | static int |
| 19736 | test_xmlXPtrLocationSetRemove(void) { |
| 19737 | int ret = 0; |
| 19738 | |
| 19739 | |
| 19740 | /* missing type support */ |
| 19741 | return(ret); |
| 19742 | } |
| 19743 | |
| 19744 | |
| 19745 | static int |
| 19746 | test_xmlXPtrNewCollapsedRange(void) { |
| 19747 | int ret = 0; |
| 19748 | |
| 19749 | |
| 19750 | /* missing type support */ |
| 19751 | return(ret); |
| 19752 | } |
| 19753 | |
| 19754 | |
| 19755 | static int |
| 19756 | test_xmlXPtrNewContext(void) { |
| 19757 | int ret = 0; |
| 19758 | |
| 19759 | |
| 19760 | /* missing type support */ |
| 19761 | return(ret); |
| 19762 | } |
| 19763 | |
| 19764 | |
| 19765 | static int |
| 19766 | test_xmlXPtrNewLocationSetNodeSet(void) { |
| 19767 | int ret = 0; |
| 19768 | |
| 19769 | |
| 19770 | /* missing type support */ |
| 19771 | return(ret); |
| 19772 | } |
| 19773 | |
| 19774 | |
| 19775 | static int |
| 19776 | test_xmlXPtrNewLocationSetNodes(void) { |
| 19777 | int ret = 0; |
| 19778 | |
| 19779 | |
| 19780 | /* missing type support */ |
| 19781 | return(ret); |
| 19782 | } |
| 19783 | |
| 19784 | |
| 19785 | static int |
| 19786 | test_xmlXPtrNewRange(void) { |
| 19787 | int ret = 0; |
| 19788 | |
| 19789 | |
| 19790 | /* missing type support */ |
| 19791 | return(ret); |
| 19792 | } |
| 19793 | |
| 19794 | |
| 19795 | static int |
| 19796 | test_xmlXPtrNewRangeNodeObject(void) { |
| 19797 | int ret = 0; |
| 19798 | |
| 19799 | |
| 19800 | /* missing type support */ |
| 19801 | return(ret); |
| 19802 | } |
| 19803 | |
| 19804 | |
| 19805 | static int |
| 19806 | test_xmlXPtrNewRangeNodePoint(void) { |
| 19807 | int ret = 0; |
| 19808 | |
| 19809 | |
| 19810 | /* missing type support */ |
| 19811 | return(ret); |
| 19812 | } |
| 19813 | |
| 19814 | |
| 19815 | static int |
| 19816 | test_xmlXPtrNewRangeNodes(void) { |
| 19817 | int ret = 0; |
| 19818 | |
| 19819 | |
| 19820 | /* missing type support */ |
| 19821 | return(ret); |
| 19822 | } |
| 19823 | |
| 19824 | |
| 19825 | static int |
| 19826 | test_xmlXPtrNewRangePointNode(void) { |
| 19827 | int ret = 0; |
| 19828 | |
| 19829 | |
| 19830 | /* missing type support */ |
| 19831 | return(ret); |
| 19832 | } |
| 19833 | |
| 19834 | |
| 19835 | static int |
| 19836 | test_xmlXPtrNewRangePoints(void) { |
| 19837 | int ret = 0; |
| 19838 | |
| 19839 | |
| 19840 | /* missing type support */ |
| 19841 | return(ret); |
| 19842 | } |
| 19843 | |
| 19844 | |
| 19845 | static int |
| 19846 | test_xmlXPtrRangeToFunction(void) { |
| 19847 | int ret = 0; |
| 19848 | |
| 19849 | |
| 19850 | /* missing type support */ |
| 19851 | return(ret); |
| 19852 | } |
| 19853 | |
| 19854 | |
| 19855 | static int |
| 19856 | test_xmlXPtrWrapLocationSet(void) { |
| 19857 | int ret = 0; |
| 19858 | |
| 19859 | |
| 19860 | /* missing type support */ |
| 19861 | return(ret); |
| 19862 | } |
| 19863 | |
| 19864 | static int |
| 19865 | test_xpointer(void) { |
| 19866 | int ret = 0; |
| 19867 | |
| 19868 | printf("Testing xpointer ...\n"); |
| 19869 | ret += test_xmlXPtrBuildNodeList(); |
| 19870 | ret += test_xmlXPtrEval(); |
| 19871 | ret += test_xmlXPtrEvalRangePredicate(); |
| 19872 | ret += test_xmlXPtrLocationSetAdd(); |
| 19873 | ret += test_xmlXPtrLocationSetCreate(); |
| 19874 | ret += test_xmlXPtrLocationSetDel(); |
| 19875 | ret += test_xmlXPtrLocationSetMerge(); |
| 19876 | ret += test_xmlXPtrLocationSetRemove(); |
| 19877 | ret += test_xmlXPtrNewCollapsedRange(); |
| 19878 | ret += test_xmlXPtrNewContext(); |
| 19879 | ret += test_xmlXPtrNewLocationSetNodeSet(); |
| 19880 | ret += test_xmlXPtrNewLocationSetNodes(); |
| 19881 | ret += test_xmlXPtrNewRange(); |
| 19882 | ret += test_xmlXPtrNewRangeNodeObject(); |
| 19883 | ret += test_xmlXPtrNewRangeNodePoint(); |
| 19884 | ret += test_xmlXPtrNewRangeNodes(); |
| 19885 | ret += test_xmlXPtrNewRangePointNode(); |
| 19886 | ret += test_xmlXPtrNewRangePoints(); |
| 19887 | ret += test_xmlXPtrRangeToFunction(); |
| 19888 | ret += test_xmlXPtrWrapLocationSet(); |
| 19889 | |
| 19890 | if (ret != 0) |
| 19891 | printf("Module xpointer: %d errors\n", ret); |
| 19892 | return(ret); |
| 19893 | } |