summaryrefslogtreecommitdiff
path: root/testchar.c
diff options
context:
space:
mode:
authorAron Xu <aron@debian.org>2012-09-18 01:15:22 +0800
committerAron Xu <aron@debian.org>2012-09-18 01:15:22 +0800
commitf660f9d2924c7549bc87e7f9b4ece7c9727b3682 (patch)
tree816b3ef0e89d1601803b5dc1b90b50ade0567043 /testchar.c
parentd7372d053bbd1d58216fbb04d1771ffa4cc3e624 (diff)
downloadlibxml2-f660f9d2924c7549bc87e7f9b4ece7c9727b3682.tar.gz
Imported Upstream version 2.9.0upstream/2.9.0
Diffstat (limited to 'testchar.c')
-rw-r--r--testchar.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/testchar.c b/testchar.c
index 3bfd9c0..0d08792 100644
--- a/testchar.c
+++ b/testchar.c
@@ -10,6 +10,8 @@
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
+#include "buf.h"
+
int lastError;
static void errorHandler(void *unused, xmlErrorPtr err) {
@@ -121,7 +123,7 @@ static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
* We should see no error in remaning cases
*/
else if ((lastError != 0) || (res == NULL)) {
- fprintf(stderr,
+ fprintf(stderr,
"Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j);
}
if (res != NULL)
@@ -409,7 +411,7 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
* We should see no error in remaining cases
*/
else if ((lastError != 0) || (len != 3)) {
- fprintf(stderr,
+ fprintf(stderr,
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
i, j, K);
}
@@ -418,7 +420,7 @@ static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
* Finally check the value is right
*/
else if (c != value) {
- fprintf(stderr,
+ fprintf(stderr,
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
i, j, data[2], value, c);
}
@@ -489,7 +491,7 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
* There are values in that range that are not allowed in XML-1.0
*/
else if (((value > 0xD7FF) && (value <0xE000)) ||
- ((value > 0xFFFD) && (value <0x10000)) ||
+ ((value > 0xFFFD) && (value <0x10000)) ||
(value > 0x10FFFF)) {
if (lastError != XML_ERR_INVALID_CHAR)
fprintf(stderr,
@@ -501,7 +503,7 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
* We should see no error in remaining cases
*/
else if ((lastError != 0) || (len != 4)) {
- fprintf(stderr,
+ fprintf(stderr,
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
i, j, K);
}
@@ -510,7 +512,7 @@ static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
* Finally check the value is right
*/
else if (c != value) {
- fprintf(stderr,
+ fprintf(stderr,
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
i, j, data[2], value, c);
}
@@ -558,9 +560,9 @@ static void testCharRanges(void) {
}
input->filename = NULL;
input->buf = buf;
- input->base = input->buf->buffer->content;
- input->cur = input->buf->buffer->content;
- input->end = &input->buf->buffer->content[4];
+ input->cur =
+ input->base = xmlBufContent(input->buf->buffer);
+ input->end = input->base + 4;
inputPush(ctxt, input);
printf("testing char range: 1");