version 1.1.1.1, 2012/02/21 23:37:57
|
version 1.1.1.2, 2014/06/15 19:53:28
|
Line 10
|
Line 10
|
#include <libxml/parser.h> |
#include <libxml/parser.h> |
#include <libxml/parserInternals.h> |
#include <libxml/parserInternals.h> |
|
|
|
#include "buf.h" |
|
|
int lastError; |
int lastError; |
|
|
static void errorHandler(void *unused, xmlErrorPtr err) { |
static void errorHandler(void *unused, xmlErrorPtr err) { |
Line 121 static void testDocumentRangeByte2(xmlParserCtxtPtr ct
|
Line 123 static void testDocumentRangeByte2(xmlParserCtxtPtr ct
|
* We should see no error in remaning cases |
* We should see no error in remaning cases |
*/ |
*/ |
else if ((lastError != 0) || (res == NULL)) { |
else if ((lastError != 0) || (res == NULL)) { |
fprintf(stderr, | fprintf(stderr, |
"Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j); |
"Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j); |
} |
} |
if (res != NULL) |
if (res != NULL) |
Line 409 static void testCharRangeByte3(xmlParserCtxtPtr ctxt,
|
Line 411 static void testCharRangeByte3(xmlParserCtxtPtr ctxt,
|
* We should see no error in remaining cases |
* We should see no error in remaining cases |
*/ |
*/ |
else if ((lastError != 0) || (len != 3)) { |
else if ((lastError != 0) || (len != 3)) { |
fprintf(stderr, | fprintf(stderr, |
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", |
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", |
i, j, K); |
i, j, K); |
} |
} |
Line 418 static void testCharRangeByte3(xmlParserCtxtPtr ctxt,
|
Line 420 static void testCharRangeByte3(xmlParserCtxtPtr ctxt,
|
* Finally check the value is right |
* Finally check the value is right |
*/ |
*/ |
else if (c != value) { |
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", |
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", |
i, j, data[2], value, c); |
i, j, data[2], value, c); |
} |
} |
Line 489 static void testCharRangeByte4(xmlParserCtxtPtr ctxt,
|
Line 491 static void testCharRangeByte4(xmlParserCtxtPtr ctxt,
|
* There are values in that range that are not allowed in XML-1.0 |
* There are values in that range that are not allowed in XML-1.0 |
*/ |
*/ |
else if (((value > 0xD7FF) && (value <0xE000)) || |
else if (((value > 0xD7FF) && (value <0xE000)) || |
((value > 0xFFFD) && (value <0x10000)) || | ((value > 0xFFFD) && (value <0x10000)) || |
(value > 0x10FFFF)) { |
(value > 0x10FFFF)) { |
if (lastError != XML_ERR_INVALID_CHAR) |
if (lastError != XML_ERR_INVALID_CHAR) |
fprintf(stderr, |
fprintf(stderr, |
Line 501 static void testCharRangeByte4(xmlParserCtxtPtr ctxt,
|
Line 503 static void testCharRangeByte4(xmlParserCtxtPtr ctxt,
|
* We should see no error in remaining cases |
* We should see no error in remaining cases |
*/ |
*/ |
else if ((lastError != 0) || (len != 4)) { |
else if ((lastError != 0) || (len != 4)) { |
fprintf(stderr, | fprintf(stderr, |
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", |
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", |
i, j, K); |
i, j, K); |
} |
} |
Line 510 static void testCharRangeByte4(xmlParserCtxtPtr ctxt,
|
Line 512 static void testCharRangeByte4(xmlParserCtxtPtr ctxt,
|
* Finally check the value is right |
* Finally check the value is right |
*/ |
*/ |
else if (c != value) { |
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", |
"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", |
i, j, data[2], value, c); |
i, j, data[2], value, c); |
} |
} |
Line 558 static void testCharRanges(void) {
|
Line 560 static void testCharRanges(void) {
|
} |
} |
input->filename = NULL; |
input->filename = NULL; |
input->buf = buf; |
input->buf = buf; |
input->base = input->buf->buffer->content; | input->cur = |
input->cur = input->buf->buffer->content; | input->base = xmlBufContent(input->buf->buffer); |
input->end = &input->buf->buffer->content[4]; | input->end = input->base + 4; |
inputPush(ctxt, input); |
inputPush(ctxt, input); |
|
|
printf("testing char range: 1"); |
printf("testing char range: 1"); |