1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

parser: implement xmlCtxtGetOptions

In 712a31ab, the `options` struct member was deprecated. To allow
callers to check the status of options bits, introduce
xmlCtxtGetOptions.
This commit is contained in:
Mike Dalessio
2024-06-20 03:19:48 -04:00
committed by Nick Wellnhofer
parent a4517bfeaf
commit bbbbbb4649
4 changed files with 61 additions and 1 deletions

View File

@@ -11820,6 +11820,38 @@ test_xmlCreatePushParserCtxt(void) {
}
static int
test_xmlCtxtGetOptions(void) {
int test_ret = 0;
int mem_base;
int ret_val;
xmlParserCtxtPtr ctxt; /* an XML parser context */
int n_ctxt;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
ret_val = xmlCtxtGetOptions(ctxt);
desret_int(ret_val);
call_tests++;
des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlCtxtGetOptions",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
printf("\n");
}
}
function_tests++;
return(test_ret);
}
static int
test_xmlCtxtParseDocument(void) {
int test_ret = 0;
@@ -14721,13 +14753,14 @@ static int
test_parser(void) {
int test_ret = 0;
if (quiet == 0) printf("Testing parser : 71 of 83 functions ...\n");
if (quiet == 0) printf("Testing parser : 72 of 84 functions ...\n");
test_ret += test_xmlByteConsumed();
test_ret += test_xmlCleanupGlobals();
test_ret += test_xmlClearNodeInfoSeq();
test_ret += test_xmlClearParserCtxt();
test_ret += test_xmlCreateDocParserCtxt();
test_ret += test_xmlCreatePushParserCtxt();
test_ret += test_xmlCtxtGetOptions();
test_ret += test_xmlCtxtParseDocument();
test_ret += test_xmlCtxtReadDoc();
test_ret += test_xmlCtxtReadFile();