version 1.1.1.1, 2012/02/21 23:37:58
|
version 1.1.1.2, 2013/07/22 01:22:20
|
Line 19
|
Line 19
|
#include <libxml/xmlerror.h> |
#include <libxml/xmlerror.h> |
#include <libxml/relaxng.h> |
#include <libxml/relaxng.h> |
|
|
#if defined(_WIN32) && !defined(__CYGWIN__) | #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) |
#define snprintf _snprintf |
#define snprintf _snprintf |
#endif |
#endif |
|
|
Line 599 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUS
|
Line 599 static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUS
|
#endif |
#endif |
|
|
#define gen_nb_xmlBufferPtr 3 |
#define gen_nb_xmlBufferPtr 3 |
static const char *static_buf_content = "a static buffer"; | static const xmlChar *static_buf_content = (xmlChar *)"a static buffer"; |
static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) { |
static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) { |
if (no == 0) return(xmlBufferCreate()); |
if (no == 0) return(xmlBufferCreate()); |
if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13)); |
if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13)); |
Line 1040 static void des_xmlAttributeType(int no ATTRIBUTE_UNUS
|
Line 1040 static void des_xmlAttributeType(int no ATTRIBUTE_UNUS
|
static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) { |
static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) { |
if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT); |
if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT); |
if (no == 2) return(XML_BUFFER_ALLOC_EXACT); |
if (no == 2) return(XML_BUFFER_ALLOC_EXACT); |
if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE); | if (no == 3) return(XML_BUFFER_ALLOC_HYBRID); |
if (no == 4) return(XML_BUFFER_ALLOC_IO); | if (no == 4) return(XML_BUFFER_ALLOC_IMMUTABLE); |
return(0); |
return(0); |
} |
} |
|
|
Line 8446 test_xmlDictSize(void) {
|
Line 8446 test_xmlDictSize(void) {
|
return(test_ret); |
return(test_ret); |
} |
} |
|
|
|
|
static int |
static int |
|
test_xmlInitializeDict(void) { |
|
int test_ret = 0; |
|
|
|
int mem_base; |
|
int ret_val; |
|
|
|
mem_base = xmlMemBlocks(); |
|
|
|
ret_val = xmlInitializeDict(); |
|
desret_int(ret_val); |
|
call_tests++; |
|
xmlResetLastError(); |
|
if (mem_base != xmlMemBlocks()) { |
|
printf("Leak of %d blocks found in xmlInitializeDict", |
|
xmlMemBlocks() - mem_base); |
|
test_ret++; |
|
printf("\n"); |
|
} |
|
function_tests++; |
|
|
|
return(test_ret); |
|
} |
|
|
|
static int |
test_dict(void) { |
test_dict(void) { |
int test_ret = 0; |
int test_ret = 0; |
|
|
if (quiet == 0) printf("Testing dict : 9 of 10 functions ...\n"); | if (quiet == 0) printf("Testing dict : 10 of 11 functions ...\n"); |
test_ret += test_xmlDictCleanup(); |
test_ret += test_xmlDictCleanup(); |
test_ret += test_xmlDictCreate(); |
test_ret += test_xmlDictCreate(); |
test_ret += test_xmlDictCreateSub(); |
test_ret += test_xmlDictCreateSub(); |
Line 8460 test_dict(void) {
|
Line 8485 test_dict(void) {
|
test_ret += test_xmlDictQLookup(); |
test_ret += test_xmlDictQLookup(); |
test_ret += test_xmlDictReference(); |
test_ret += test_xmlDictReference(); |
test_ret += test_xmlDictSize(); |
test_ret += test_xmlDictSize(); |
|
test_ret += test_xmlInitializeDict(); |
|
|
if (test_ret != 0) |
if (test_ret != 0) |
printf("Module dict: %d errors\n", test_ret); |
printf("Module dict: %d errors\n", test_ret); |
Line 18614 test_xmlBufferCreateStatic(void) {
|
Line 18640 test_xmlBufferCreateStatic(void) {
|
|
|
|
|
static int |
static int |
|
test_xmlBufferDetach(void) { |
|
int test_ret = 0; |
|
|
|
int mem_base; |
|
xmlChar * ret_val; |
|
xmlBufferPtr buf; /* the buffer */ |
|
int n_buf; |
|
|
|
for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { |
|
mem_base = xmlMemBlocks(); |
|
buf = gen_xmlBufferPtr(n_buf, 0); |
|
|
|
ret_val = xmlBufferDetach(buf); |
|
desret_xmlChar_ptr(ret_val); |
|
call_tests++; |
|
des_xmlBufferPtr(n_buf, buf, 0); |
|
xmlResetLastError(); |
|
if (mem_base != xmlMemBlocks()) { |
|
printf("Leak of %d blocks found in xmlBufferDetach", |
|
xmlMemBlocks() - mem_base); |
|
test_ret++; |
|
printf(" %d", n_buf); |
|
printf("\n"); |
|
} |
|
} |
|
function_tests++; |
|
|
|
return(test_ret); |
|
} |
|
|
|
|
|
static int |
test_xmlBufferEmpty(void) { |
test_xmlBufferEmpty(void) { |
int test_ret = 0; |
int test_ret = 0; |
|
|
Line 23957 static int
|
Line 24015 static int
|
test_tree(void) { |
test_tree(void) { |
int test_ret = 0; |
int test_ret = 0; |
|
|
if (quiet == 0) printf("Testing tree : 138 of 157 functions ...\n"); | if (quiet == 0) printf("Testing tree : 139 of 158 functions ...\n"); |
test_ret += test_xmlAddChild(); |
test_ret += test_xmlAddChild(); |
test_ret += test_xmlAddChildList(); |
test_ret += test_xmlAddChildList(); |
test_ret += test_xmlAddNextSibling(); |
test_ret += test_xmlAddNextSibling(); |
Line 23972 test_tree(void) {
|
Line 24030 test_tree(void) {
|
test_ret += test_xmlBufferCreate(); |
test_ret += test_xmlBufferCreate(); |
test_ret += test_xmlBufferCreateSize(); |
test_ret += test_xmlBufferCreateSize(); |
test_ret += test_xmlBufferCreateStatic(); |
test_ret += test_xmlBufferCreateStatic(); |
|
test_ret += test_xmlBufferDetach(); |
test_ret += test_xmlBufferEmpty(); |
test_ret += test_xmlBufferEmpty(); |
test_ret += test_xmlBufferGrow(); |
test_ret += test_xmlBufferGrow(); |
test_ret += test_xmlBufferLength(); |
test_ret += test_xmlBufferLength(); |
Line 32275 test_xmlTextReaderRelaxNGValidate(void) {
|
Line 32334 test_xmlTextReaderRelaxNGValidate(void) {
|
|
|
|
|
static int |
static int |
|
test_xmlTextReaderRelaxNGValidateCtxt(void) { |
|
int test_ret = 0; |
|
|
|
#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) |
|
int mem_base; |
|
int ret_val; |
|
xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ |
|
int n_reader; |
|
xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */ |
|
int n_ctxt; |
|
int options; /* options (not used yet) */ |
|
int n_options; |
|
|
|
for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { |
|
for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { |
|
for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { |
|
mem_base = xmlMemBlocks(); |
|
reader = gen_xmlTextReaderPtr(n_reader, 0); |
|
ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1); |
|
options = gen_parseroptions(n_options, 2); |
|
|
|
ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options); |
|
desret_int(ret_val); |
|
call_tests++; |
|
des_xmlTextReaderPtr(n_reader, reader, 0); |
|
des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1); |
|
des_parseroptions(n_options, options, 2); |
|
xmlResetLastError(); |
|
if (mem_base != xmlMemBlocks()) { |
|
printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt", |
|
xmlMemBlocks() - mem_base); |
|
test_ret++; |
|
printf(" %d", n_reader); |
|
printf(" %d", n_ctxt); |
|
printf(" %d", n_options); |
|
printf("\n"); |
|
} |
|
} |
|
} |
|
} |
|
function_tests++; |
|
#endif |
|
|
|
return(test_ret); |
|
} |
|
|
|
|
|
static int |
test_xmlTextReaderSchemaValidate(void) { |
test_xmlTextReaderSchemaValidate(void) { |
int test_ret = 0; |
int test_ret = 0; |
|
|
Line 32628 static int
|
Line 32735 static int
|
test_xmlreader(void) { |
test_xmlreader(void) { |
int test_ret = 0; |
int test_ret = 0; |
|
|
if (quiet == 0) printf("Testing xmlreader : 75 of 85 functions ...\n"); | if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n"); |
test_ret += test_xmlNewTextReader(); |
test_ret += test_xmlNewTextReader(); |
test_ret += test_xmlNewTextReaderFilename(); |
test_ret += test_xmlNewTextReaderFilename(); |
test_ret += test_xmlReaderForDoc(); |
test_ret += test_xmlReaderForDoc(); |
Line 32696 test_xmlreader(void) {
|
Line 32803 test_xmlreader(void) {
|
test_ret += test_xmlTextReaderReadState(); |
test_ret += test_xmlTextReaderReadState(); |
test_ret += test_xmlTextReaderRelaxNGSetSchema(); |
test_ret += test_xmlTextReaderRelaxNGSetSchema(); |
test_ret += test_xmlTextReaderRelaxNGValidate(); |
test_ret += test_xmlTextReaderRelaxNGValidate(); |
|
test_ret += test_xmlTextReaderRelaxNGValidateCtxt(); |
test_ret += test_xmlTextReaderSchemaValidate(); |
test_ret += test_xmlTextReaderSchemaValidate(); |
test_ret += test_xmlTextReaderSchemaValidateCtxt(); |
test_ret += test_xmlTextReaderSchemaValidateCtxt(); |
test_ret += test_xmlTextReaderSetErrorHandler(); |
test_ret += test_xmlTextReaderSetErrorHandler(); |