| OLD | NEW |
| 1 /* | 1 /* |
| 2 * runtest.c: C program to run libxml2 regression tests without | 2 * runtest.c: C program to run libxml2 regression tests without |
| 3 * requiring make or Python, and reducing platform dependancies | 3 * requiring make or Python, and reducing platform dependancies |
| 4 * to a strict minimum. | 4 * to a strict minimum. |
| 5 * | 5 * |
| 6 * To compile on Unixes: | 6 * To compile on Unixes: |
| 7 * cc -o runtest `xml2-config --cflags` runtest.c `xml2-config --libs` -lpthread | 7 * cc -o runtest `xml2-config --cflags` runtest.c `xml2-config --libs` -lpthread |
| 8 * | 8 * |
| 9 * See Copyright for the status of this software. | 9 * See Copyright for the status of this software. |
| 10 * | 10 * |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 close(fd); | 681 close(fd); |
| 682 return(res != size); | 682 return(res != size); |
| 683 } | 683 } |
| 684 | 684 |
| 685 if (stat(filename, &info) < 0) { | 685 if (stat(filename, &info) < 0) { |
| 686 fprintf(stderr, "failed to stat %s\n", filename); | 686 fprintf(stderr, "failed to stat %s\n", filename); |
| 687 return(-1); | 687 return(-1); |
| 688 } | 688 } |
| 689 if (info.st_size != size) { | 689 if (info.st_size != size) { |
| 690 fprintf(stderr, "file %s is %ld bytes, result is %d bytes\n", | 690 fprintf(stderr, "file %s is %ld bytes, result is %d bytes\n", |
| 691 » filename, info.st_size, size); | 691 » filename, (long) info.st_size, size); |
| 692 return(-1); | 692 return(-1); |
| 693 } | 693 } |
| 694 fd = open(filename, RD_FLAGS); | 694 fd = open(filename, RD_FLAGS); |
| 695 if (fd < 0) { | 695 if (fd < 0) { |
| 696 fprintf(stderr, "failed to open %s for reading", filename); | 696 fprintf(stderr, "failed to open %s for reading", filename); |
| 697 return(-1); | 697 return(-1); |
| 698 } | 698 } |
| 699 while (idx < size) { | 699 while (idx < size) { |
| 700 res = read(fd, bytes, 4096); | 700 res = read(fd, bytes, 4096); |
| 701 if (res <= 0) | 701 if (res <= 0) |
| (...skipping 3829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4531 return(ret); | 4531 return(ret); |
| 4532 } | 4532 } |
| 4533 | 4533 |
| 4534 #else /* ! LIBXML_OUTPUT_ENABLED */ | 4534 #else /* ! LIBXML_OUTPUT_ENABLED */ |
| 4535 int | 4535 int |
| 4536 main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { | 4536 main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { |
| 4537 fprintf(stderr, "runtest requires output to be enabled in libxml2\n"); | 4537 fprintf(stderr, "runtest requires output to be enabled in libxml2\n"); |
| 4538 return(1); | 4538 return(1); |
| 4539 } | 4539 } |
| 4540 #endif | 4540 #endif |
| OLD | NEW |