Imported Upstream version 2.9.5_rc2
[platform/upstream/libxml2.git] / testlimits.c
index 41994c4..68c94db 100644 (file)
  * daniel@veillard.com
  */
 
-#ifdef HAVE_CONFIG_H
 #include "libxml.h"
-#else
 #include <stdio.h>
-#endif
 
 #if !defined(_WIN32) || defined(__CYGWIN__)
 #include <unistd.h>
@@ -1287,13 +1284,14 @@ saxTest(const char *filename, size_t limit, int options, int fail) {
         if (fail)
             res = 0;
         else {
-            fprintf(stderr, "Failed to parse '%s' %lu\n", filename, limit);
+            fprintf(stderr, "Failed to parse '%s' %lu\n", filename,
+                    (unsigned long) limit);
             res = 1;
         }
     } else {
         if (fail) {
             fprintf(stderr, "Failed to get failure for '%s' %lu\n",
-                    filename, limit);
+                    filename, (unsigned long) limit);
             res = 1;
         } else
             res = 0;
@@ -1342,7 +1340,7 @@ readerTest(const char *filename, size_t limit, int options, int fail) {
                         filename, crazy_indx);
             else
                 fprintf(stderr, "Failed to parse '%s' %lu\n",
-                        filename, limit);
+                        filename, (unsigned long) limit);
             res = 1;
         }
     } else {
@@ -1352,7 +1350,7 @@ readerTest(const char *filename, size_t limit, int options, int fail) {
                         filename, crazy_indx);
             else
                 fprintf(stderr, "Failed to get failure for '%s' %lu\n",
-                        filename, limit);
+                        filename, (unsigned long) limit);
             res = 1;
         } else
             res = 0;
@@ -1512,6 +1510,7 @@ launchCrazySAX(unsigned int test, int fail) {
     return(err);
 }
 
+#ifdef LIBXML_READER_ENABLED
 static int
 launchCrazy(unsigned int test, int fail) {
     int res = 0, err = 0;
@@ -1528,6 +1527,7 @@ launchCrazy(unsigned int test, int fail) {
 
     return(err);
 }
+#endif
 
 static int get_crazy_fail(int test) {
     /*
@@ -1565,6 +1565,8 @@ runcrazy(void) {
     old_errors = nb_errors;
     old_tests = nb_tests;
     old_leaks = nb_leaks;
+
+#ifdef LIBXML_READER_ENABLED
     if (tests_quiet == 0) {
        printf("## Crazy tests on reader\n");
     }
@@ -1573,6 +1575,8 @@ runcrazy(void) {
         if (res != 0)
             ret++;
     }
+#endif
+
     if (tests_quiet == 0) {
        printf("\n## Crazy tests on SAX\n");
     }