diff options
Diffstat (limited to 'testapi.c')
| -rw-r--r-- | testapi.c | 766 |
1 files changed, 745 insertions, 21 deletions
@@ -171,6 +171,7 @@ int main(int argc, char **argv) { #include <libxml/pattern.h> #include <libxml/relaxng.h> #include <libxml/schemasInternals.h> +#include <libxml/schematron.h> #include <libxml/tree.h> #include <libxml/uri.h> #include <libxml/valid.h> @@ -1051,23 +1052,20 @@ static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { } -static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) { -} - -#ifdef LIBXML_PATTERN_ENABLED -#define gen_nb_xmlPatternFlags 4 -static xmlPatternFlags gen_xmlPatternFlags(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_PATTERN_DEFAULT); - if (no == 2) return(XML_PATTERN_XPATH); - if (no == 3) return(XML_PATTERN_XSFIELD); - if (no == 4) return(XML_PATTERN_XSSEL); +#define gen_nb_xmlFeature 4 +static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) { + if (no == 1) return(XML_FEATURE_AUTOMATA); + if (no == 2) return(XML_FEATURE_C14N); + if (no == 3) return(XML_FEATURE_CATALOG); + if (no == 4) return(XML_FEATURE_DEBUG); return(0); } -static void des_xmlPatternFlags(int no ATTRIBUTE_UNUSED, xmlPatternFlags val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { } -#endif +static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) { +} #ifdef LIBXML_SCHEMAS_ENABLED #define gen_nb_xmlSchemaValType 4 @@ -1121,6 +1119,7 @@ static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaW #include <libxml/pattern.h> #include <libxml/relaxng.h> #include <libxml/schemasInternals.h> +#include <libxml/schematron.h> #include <libxml/tree.h> #include <libxml/uri.h> #include <libxml/valid.h> @@ -1159,6 +1158,7 @@ static int test_parserInternals(void); static int test_pattern(void); static int test_relaxng(void); static int test_schemasInternals(void); +static int test_schematron(void); static int test_tree(void); static int test_uri(void); static int test_valid(void); @@ -1211,6 +1211,7 @@ testlibxml2(void) test_ret += test_pattern(); test_ret += test_relaxng(); test_ret += test_schemasInternals(); + test_ret += test_schematron(); test_ret += test_tree(); test_ret += test_uri(); test_ret += test_valid(); @@ -3924,7 +3925,7 @@ static int test_xmlSAX2EndElement(void) { int test_ret = 0; -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) +#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) #ifdef LIBXML_SAX1_ENABLED int mem_base; void * ctx; /* the user data (XML parser context) */ @@ -4889,7 +4890,7 @@ static int test_xmlSAX2StartElement(void) { int test_ret = 0; -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) +#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) #ifdef LIBXML_SAX1_ENABLED int mem_base; void * ctx; /* the user data (XML parser context) */ @@ -12985,6 +12986,38 @@ test_xmlGetFeaturesList(void) { static int +test_xmlHasFeature(void) { + int test_ret = 0; + + int mem_base; + int ret_val; + xmlFeature feature; /* the feature to be examined */ + int n_feature; + + for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) { + mem_base = xmlMemBlocks(); + feature = gen_xmlFeature(n_feature, 0); + + ret_val = xmlHasFeature(feature); + desret_int(ret_val); + call_tests++; + des_xmlFeature(n_feature, feature, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlHasFeature", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_feature); + printf("\n"); + } + } + function_tests++; + + return(test_ret); +} + + +static int test_xmlIOParseDTD(void) { int test_ret = 0; @@ -15172,7 +15205,7 @@ static int test_parser(void) { int test_ret = 0; - if (quiet == 0) printf("Testing parser : 60 of 69 functions ...\n"); + if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n"); test_ret += test_xmlByteConsumed(); test_ret += test_xmlClearNodeInfoSeq(); test_ret += test_xmlClearParserCtxt(); @@ -15187,6 +15220,7 @@ test_parser(void) { test_ret += test_xmlGetExternalEntityLoader(); test_ret += test_xmlGetFeature(); test_ret += test_xmlGetFeaturesList(); + test_ret += test_xmlHasFeature(); test_ret += test_xmlIOParseDTD(); test_ret += test_xmlInitNodeInfoSeq(); test_ret += test_xmlInitParser(); @@ -16710,6 +16744,40 @@ test_xmlPatternMaxDepth(void) { static int +test_xmlPatternMinDepth(void) { + int test_ret = 0; + +#if defined(LIBXML_PATTERN_ENABLED) + int mem_base; + int ret_val; + xmlPatternPtr comp; /* the precompiled pattern */ + int n_comp; + + for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { + mem_base = xmlMemBlocks(); + comp = gen_xmlPatternPtr(n_comp, 0); + + ret_val = xmlPatternMinDepth(comp); + desret_int(ret_val); + call_tests++; + des_xmlPatternPtr(n_comp, comp, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlPatternMinDepth", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_comp); + printf("\n"); + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int test_xmlPatternStreamable(void) { int test_ret = 0; @@ -16896,11 +16964,12 @@ static int test_pattern(void) { int test_ret = 0; - if (quiet == 0) printf("Testing pattern : 7 of 12 functions ...\n"); + if (quiet == 0) printf("Testing pattern : 8 of 13 functions ...\n"); test_ret += test_xmlPatternFromRoot(); test_ret += test_xmlPatternGetStreamCtxt(); test_ret += test_xmlPatternMatch(); test_ret += test_xmlPatternMaxDepth(); + test_ret += test_xmlPatternMinDepth(); test_ret += test_xmlPatternStreamable(); test_ret += test_xmlPatterncompile(); test_ret += test_xmlStreamPop(); @@ -17337,6 +17406,16 @@ test_xmlRelaxNGSetValidErrors(void) { static int +test_xmlRelaxNGSetValidStructuredErrors(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int test_xmlRelaxNGValidateDoc(void) { int test_ret = 0; @@ -17613,7 +17692,7 @@ static int test_relaxng(void) { int test_ret = 0; - if (quiet == 0) printf("Testing relaxng : 14 of 22 functions ...\n"); + if (quiet == 0) printf("Testing relaxng : 14 of 23 functions ...\n"); test_ret += test_xmlRelaxNGDump(); test_ret += test_xmlRelaxNGDumpTree(); test_ret += test_xmlRelaxNGGetParserErrors(); @@ -17626,6 +17705,7 @@ test_relaxng(void) { test_ret += test_xmlRelaxNGParse(); test_ret += test_xmlRelaxNGSetParserErrors(); test_ret += test_xmlRelaxNGSetValidErrors(); + test_ret += test_xmlRelaxNGSetValidStructuredErrors(); test_ret += test_xmlRelaxNGValidateDoc(); test_ret += test_xmlRelaxNGValidateFullElement(); test_ret += test_xmlRelaxNGValidatePopElement(); @@ -17649,6 +17729,134 @@ test_schemasInternals(void) { } static int +test_xmlSchematronNewDocParserCtxt(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlSchematronNewMemParserCtxt(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlSchematronNewParserCtxt(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +#define gen_nb_xmlSchematronPtr 1 +static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { + return(NULL); +} +static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} + +static int +test_xmlSchematronNewValidCtxt(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +#define gen_nb_xmlSchematronParserCtxtPtr 1 +static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { + return(NULL); +} +static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} + +static int +test_xmlSchematronParse(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +#define gen_nb_xmlSchematronValidCtxtPtr 1 +static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { + return(NULL); +} +static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} + +static int +test_xmlSchematronValidateDoc(void) { + int test_ret = 0; + +#if defined(LIBXML_SCHEMATRON_ENABLED) + int mem_base; + int ret_val; + xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */ + int n_ctxt; + xmlDocPtr instance; /* the document instace tree */ + int n_instance; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) { + for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0); + instance = gen_xmlDocPtr(n_instance, 1); + + ret_val = xmlSchematronValidateDoc(ctxt, instance); + desret_int(ret_val); + call_tests++; + des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0); + des_xmlDocPtr(n_instance, instance, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlSchematronValidateDoc", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_instance); + printf("\n"); + } + } + } + function_tests++; +#endif + + return(test_ret); +} + +static int +test_schematron(void) { + int test_ret = 0; + + if (quiet == 0) printf("Testing schematron : 1 of 9 functions ...\n"); + test_ret += test_xmlSchematronNewDocParserCtxt(); + test_ret += test_xmlSchematronNewMemParserCtxt(); + test_ret += test_xmlSchematronNewParserCtxt(); + test_ret += test_xmlSchematronNewValidCtxt(); + test_ret += test_xmlSchematronParse(); + test_ret += test_xmlSchematronValidateDoc(); + + if (test_ret != 0) + printf("Module schematron: %d errors\n", test_ret); + return(test_ret); +} + +static int test_xmlAddChild(void) { int test_ret = 0; @@ -23558,6 +23766,16 @@ test_xmlParseURI(void) { } +static int +test_xmlParseURIRaw(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + #define gen_nb_xmlURIPtr 1 static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { return(NULL); @@ -23757,13 +23975,14 @@ static int test_uri(void) { int test_ret = 0; - if (quiet == 0) printf("Testing uri : 9 of 13 functions ...\n"); + if (quiet == 0) printf("Testing uri : 9 of 14 functions ...\n"); test_ret += test_xmlBuildRelativeURI(); test_ret += test_xmlBuildURI(); test_ret += test_xmlCanonicPath(); test_ret += test_xmlCreateURI(); test_ret += test_xmlNormalizeURIPath(); test_ret += test_xmlParseURI(); + test_ret += test_xmlParseURIRaw(); test_ret += test_xmlParseURIReference(); test_ret += test_xmlPrintURI(); test_ret += test_xmlSaveUri(); @@ -28226,6 +28445,16 @@ test_xmlAutomataNewEpsilon(void) { static int +test_xmlAutomataNewNegTrans(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int test_xmlAutomataNewOnceTrans(void) { int test_ret = 0; @@ -28329,7 +28558,7 @@ static int test_xmlautomata(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xmlautomata : 3 of 18 functions ...\n"); + if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n"); test_ret += test_xmlAutomataCompile(); test_ret += test_xmlAutomataGetInitState(); test_ret += test_xmlAutomataIsDeterminist(); @@ -28340,6 +28569,7 @@ test_xmlautomata(void) { test_ret += test_xmlAutomataNewCounter(); test_ret += test_xmlAutomataNewCounterTrans(); test_ret += test_xmlAutomataNewEpsilon(); + test_ret += test_xmlAutomataNewNegTrans(); test_ret += test_xmlAutomataNewOnceTrans(); test_ret += test_xmlAutomataNewOnceTrans2(); test_ret += test_xmlAutomataNewState(); @@ -31707,6 +31937,471 @@ test_xmlreader(void) { } #ifdef LIBXML_REGEXP_ENABLED +#define gen_nb_xmlExpCtxtPtr 1 +static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { + return(NULL); +} +static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} +#endif + + +static int +test_xmlExpCtxtNbCons(void) { + int test_ret = 0; + +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + int mem_base; + int ret_val; + xmlExpCtxtPtr ctxt; /* an expression context */ + int n_ctxt; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); + + ret_val = xmlExpCtxtNbCons(ctxt); + desret_int(ret_val); + call_tests++; + des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlExpCtxtNbCons", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf("\n"); + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlExpCtxtNbNodes(void) { + int test_ret = 0; + +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + int mem_base; + int ret_val; + xmlExpCtxtPtr ctxt; /* an expression context */ + int n_ctxt; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); + + ret_val = xmlExpCtxtNbNodes(ctxt); + desret_int(ret_val); + call_tests++; + des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlExpCtxtNbNodes", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf("\n"); + } + } + function_tests++; +#endif + + return(test_ret); +} + +#ifdef LIBXML_REGEXP_ENABLED + +#define gen_nb_xmlExpNodePtr 1 +static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { + return(NULL); +} +static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { +} +#endif + + +static int +test_xmlExpDump(void) { + int test_ret = 0; + +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + int mem_base; + xmlBufferPtr buf; /* a buffer to receive the output */ + int n_buf; + xmlExpNodePtr expr; /* the compiled expression */ + int n_expr; + + for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { + for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) { + mem_base = xmlMemBlocks(); + buf = gen_xmlBufferPtr(n_buf, 0); + expr = gen_xmlExpNodePtr(n_expr, 1); + + xmlExpDump(buf, expr); + call_tests++; + des_xmlBufferPtr(n_buf, buf, 0); + des_xmlExpNodePtr(n_expr, expr, 1); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlExpDump", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_buf); + printf(" %d", n_expr); + printf("\n"); + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlExpExpDerive(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlExpGetLanguage(void) { + int test_ret = 0; + +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + int mem_base; + int ret_val; + xmlExpCtxtPtr ctxt; /* the expression context */ + int n_ctxt; + xmlExpNodePtr exp; /* the expression */ + int n_exp; + xmlChar ** list; /* where to store the tokens */ + int n_list; + int len; /* the allocated lenght of @list */ + int n_len; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { + for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { + for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) { + for (n_len = 0;n_len < gen_nb_int;n_len++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); + exp = gen_xmlExpNodePtr(n_exp, 1); + list = gen_const_xmlChar_ptr_ptr(n_list, 2); + len = gen_int(n_len, 3); + + ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)list, len); + desret_int(ret_val); + call_tests++; + des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); + des_xmlExpNodePtr(n_exp, exp, 1); + des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 2); + des_int(n_len, len, 3); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlExpGetLanguage", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_exp); + printf(" %d", n_list); + printf(" %d", n_len); + printf("\n"); + } + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlExpGetStart(void) { + int test_ret = 0; + +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + int mem_base; + int ret_val; + xmlExpCtxtPtr ctxt; /* the expression context */ + int n_ctxt; + xmlExpNodePtr exp; /* the expression */ + int n_exp; + xmlChar ** list; /* where to store the tokens */ + int n_list; + int len; /* the allocated lenght of @list */ + int n_len; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { + for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { + for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr_ptr;n_list++) { + for (n_len = 0;n_len < gen_nb_int;n_len++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); + exp = gen_xmlExpNodePtr(n_exp, 1); + list = gen_const_xmlChar_ptr_ptr(n_list, 2); + len = gen_int(n_len, 3); + + ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)list, len); + desret_int(ret_val); + call_tests++; + des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); + des_xmlExpNodePtr(n_exp, exp, 1); + des_const_xmlChar_ptr_ptr(n_list, (const xmlChar **)list, 2); + des_int(n_len, len, 3); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlExpGetStart", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_exp); + printf(" %d", n_list); + printf(" %d", n_len); + printf("\n"); + } + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlExpIsNillable(void) { + int test_ret = 0; + +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + int mem_base; + int ret_val; + xmlExpNodePtr exp; /* the expression */ + int n_exp; + + for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { + mem_base = xmlMemBlocks(); + exp = gen_xmlExpNodePtr(n_exp, 0); + + ret_val = xmlExpIsNillable(exp); + desret_int(ret_val); + call_tests++; + des_xmlExpNodePtr(n_exp, exp, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlExpIsNillable", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_exp); + printf("\n"); + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlExpMaxToken(void) { + int test_ret = 0; + +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + int mem_base; + int ret_val; + xmlExpNodePtr expr; /* a compiled expression */ + int n_expr; + + for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) { + mem_base = xmlMemBlocks(); + expr = gen_xmlExpNodePtr(n_expr, 0); + + ret_val = xmlExpMaxToken(expr); + desret_int(ret_val); + call_tests++; + des_xmlExpNodePtr(n_expr, expr, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlExpMaxToken", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_expr); + printf("\n"); + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlExpNewAtom(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlExpNewCtxt(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlExpNewOr(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlExpNewRange(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlExpNewSeq(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlExpParse(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlExpRef(void) { + int test_ret = 0; + +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + int mem_base; + xmlExpNodePtr exp; /* the expression */ + int n_exp; + + for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { + mem_base = xmlMemBlocks(); + exp = gen_xmlExpNodePtr(n_exp, 0); + + xmlExpRef(exp); + call_tests++; + des_xmlExpNodePtr(n_exp, exp, 0); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlExpRef", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_exp); + printf("\n"); + } + } + function_tests++; +#endif + + return(test_ret); +} + + +static int +test_xmlExpStringDerive(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int +test_xmlExpSubsume(void) { + int test_ret = 0; + +#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) + int mem_base; + int ret_val; + xmlExpCtxtPtr ctxt; /* the expressions context */ + int n_ctxt; + xmlExpNodePtr exp; /* the englobing expression */ + int n_exp; + xmlExpNodePtr sub; /* the subexpression */ + int n_sub; + + for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { + for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { + for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) { + mem_base = xmlMemBlocks(); + ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); + exp = gen_xmlExpNodePtr(n_exp, 1); + sub = gen_xmlExpNodePtr(n_sub, 2); + + ret_val = xmlExpSubsume(ctxt, exp, sub); + desret_int(ret_val); + call_tests++; + des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); + des_xmlExpNodePtr(n_exp, exp, 1); + des_xmlExpNodePtr(n_sub, sub, 2); + xmlResetLastError(); + if (mem_base != xmlMemBlocks()) { + printf("Leak of %d blocks found in xmlExpSubsume", + xmlMemBlocks() - mem_base); + test_ret++; + printf(" %d", n_ctxt); + printf(" %d", n_exp); + printf(" %d", n_sub); + printf("\n"); + } + } + } + } + function_tests++; +#endif + + return(test_ret); +} + +#ifdef LIBXML_REGEXP_ENABLED + #define gen_nb_xmlRegExecCtxtPtr 1 static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { return(NULL); @@ -32097,7 +32792,24 @@ static int test_xmlregexp(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xmlregexp : 7 of 11 functions ...\n"); + if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n"); + test_ret += test_xmlExpCtxtNbCons(); + test_ret += test_xmlExpCtxtNbNodes(); + test_ret += test_xmlExpDump(); + test_ret += test_xmlExpExpDerive(); + test_ret += test_xmlExpGetLanguage(); + test_ret += test_xmlExpGetStart(); + test_ret += test_xmlExpIsNillable(); + test_ret += test_xmlExpMaxToken(); + test_ret += test_xmlExpNewAtom(); + test_ret += test_xmlExpNewCtxt(); + test_ret += test_xmlExpNewOr(); + test_ret += test_xmlExpNewRange(); + test_ret += test_xmlExpNewSeq(); + test_ret += test_xmlExpParse(); + test_ret += test_xmlExpRef(); + test_ret += test_xmlExpStringDerive(); + test_ret += test_xmlExpSubsume(); test_ret += test_xmlRegExecErrInfo(); test_ret += test_xmlRegExecNextValues(); test_ret += test_xmlRegExecPushString(); @@ -32809,6 +33521,16 @@ test_xmlSchemaSetValidOptions(void) { static int +test_xmlSchemaSetValidStructuredErrors(void) { + int test_ret = 0; + + + /* missing type support */ + return(test_ret); +} + + +static int test_xmlSchemaValidCtxtGetOptions(void) { int test_ret = 0; @@ -33037,7 +33759,7 @@ static int test_xmlschemas(void) { int test_ret = 0; - if (quiet == 0) printf("Testing xmlschemas : 14 of 22 functions ...\n"); + if (quiet == 0) printf("Testing xmlschemas : 14 of 23 functions ...\n"); test_ret += test_xmlSchemaDump(); test_ret += test_xmlSchemaGetParserErrors(); test_ret += test_xmlSchemaGetValidErrors(); @@ -33052,6 +33774,7 @@ test_xmlschemas(void) { test_ret += test_xmlSchemaSetParserErrors(); test_ret += test_xmlSchemaSetValidErrors(); test_ret += test_xmlSchemaSetValidOptions(); + test_ret += test_xmlSchemaSetValidStructuredErrors(); test_ret += test_xmlSchemaValidCtxtGetOptions(); test_ret += test_xmlSchemaValidateDoc(); test_ret += test_xmlSchemaValidateFile(); @@ -49988,6 +50711,7 @@ test_module(const char *module) { if (!strcmp(module, "pattern")) return(test_pattern()); if (!strcmp(module, "relaxng")) return(test_relaxng()); if (!strcmp(module, "schemasInternals")) return(test_schemasInternals()); + if (!strcmp(module, "schematron")) return(test_schematron()); if (!strcmp(module, "tree")) return(test_tree()); if (!strcmp(module, "uri")) return(test_uri()); if (!strcmp(module, "valid")) return(test_valid()); |
