mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-26 10:03:34 +03:00
testapi: test_xmlSAXDefaultVersion() leaves xmlSAX2DefaultVersionValue set to 1 with LIBXML_SAX1_ENABLED
Add code to save and to restore the default value of xmlSAX2DefaultVersionValue. Fixes #554.
This commit is contained in:
parent
b236b7a588
commit
5f54bac9eb
@ -205,6 +205,10 @@ extra_pre_call = {
|
||||
""",
|
||||
"xmlParserInputBufferCreateFd":
|
||||
"if (fd >= 0) fd = -1;",
|
||||
"xmlSAXDefaultVersion": """
|
||||
{
|
||||
int original_version = xmlSAXDefaultVersion(2);
|
||||
""",
|
||||
}
|
||||
extra_post_call = {
|
||||
"xmlAddChild":
|
||||
@ -261,6 +265,10 @@ extra_post_call = {
|
||||
"xmlParseChunk": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
|
||||
"xmlParseExtParsedEnt": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
|
||||
"xmlDOMWrapAdoptNode": "if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}",
|
||||
"xmlSAXDefaultVersion": """
|
||||
(void)xmlSAXDefaultVersion(original_version);
|
||||
}
|
||||
""",
|
||||
}
|
||||
|
||||
modules = []
|
||||
|
@ -5300,7 +5300,14 @@ test_xmlSAXDefaultVersion(void) {
|
||||
mem_base = xmlMemBlocks();
|
||||
version = gen_int(n_version, 0);
|
||||
|
||||
{
|
||||
int original_version = xmlSAXDefaultVersion(2);
|
||||
|
||||
|
||||
ret_val = xmlSAXDefaultVersion(version);
|
||||
(void)xmlSAXDefaultVersion(original_version);
|
||||
}
|
||||
|
||||
desret_int(ret_val);
|
||||
call_tests++;
|
||||
des_int(n_version, version, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user