mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-23 01:52:48 +03:00
parser: Fix in-parameter-entity and in-external-dtd checks
Use in ctxt->input->entity instead of ctxt->inputNr to determine whether we are inside a parameter entity. Stop using ctxt->external to check whether we're in an external DTD. This is signaled by ctxt->inSubset == 2.
This commit is contained in:
@@ -96,7 +96,7 @@ def callback(ctx, str):
|
||||
err = err + "%s" % (str)
|
||||
libxml2.registerErrorHandler(callback, "")
|
||||
|
||||
parsing_error_files = ["766956", "cond_sect2", "t8", "t8a"]
|
||||
parsing_error_files = ["766956", "cond_sect2", "t8", "t8a", "pe-in-text-decl"]
|
||||
expect_parsing_error = [os.path.join(dir_prefix, f + ".xml") for f in parsing_error_files]
|
||||
|
||||
valid_files = glob.glob(os.path.join(dir_prefix, "*.x*"))
|
||||
@@ -114,12 +114,11 @@ for file in valid_files:
|
||||
if ret != 0 and file not in expect_parsing_error:
|
||||
print("Error parsing and validating %s" % (file))
|
||||
#sys.exit(1)
|
||||
if (err):
|
||||
if not(file in expect and err == expect[file]):
|
||||
failures += 1
|
||||
print("Error: ", err)
|
||||
if file in expect:
|
||||
print("Expected: ", expect[file])
|
||||
if file in expect and err != expect[file]:
|
||||
failures += 1
|
||||
print("Error: ", err)
|
||||
if file in expect:
|
||||
print("Expected: ", expect[file])
|
||||
|
||||
if failures:
|
||||
print("Failed %d tests" % failures)
|
||||
|
Reference in New Issue
Block a user