diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2004-04-18 14:58:57 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2004-04-18 14:58:57 +0000 |
commit | ee1d6926f36a4740ed4ae7f2318f5491db44c252 (patch) | |
tree | 43ccb29c584b441a17f7b9fa6b68853502fc4d90 /python | |
parent | 87640d5f14e7ce8b9844b886c765af0c56de5ca5 (diff) | |
download | android_external_libxml2-ee1d6926f36a4740ed4ae7f2318f5491db44c252.tar.gz android_external_libxml2-ee1d6926f36a4740ed4ae7f2318f5491db44c252.tar.bz2 android_external_libxml2-ee1d6926f36a4740ed4ae7f2318f5491db44c252.zip |
keep the ChangeLog compressed fix a segfault when using Close() test for
* libxml.spec.in: keep the ChangeLog compressed
* xmlreader.c: fix a segfault when using Close()
* python/tests/Makefile.am python/tests/reader8.py: test for
the Close() reader API.
Daniel
Diffstat (limited to 'python')
-rw-r--r-- | python/tests/Makefile.am | 1 | ||||
-rwxr-xr-x | python/tests/reader8.py | 37 |
2 files changed, 38 insertions, 0 deletions
diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am index a07497e1..584ddbcd 100644 --- a/python/tests/Makefile.am +++ b/python/tests/Makefile.am @@ -27,6 +27,7 @@ PYTESTS= \ reader5.py \ reader6.py \ reader7.py \ + reader8.py \ walker.py \ ctxterror.py\ readererr.py\ diff --git a/python/tests/reader8.py b/python/tests/reader8.py new file mode 100755 index 00000000..53b7f275 --- /dev/null +++ b/python/tests/reader8.py @@ -0,0 +1,37 @@ +#!/usr/bin/python -u +# +# this tests the entities substitutions with the XmlTextReader interface +# +import sys +import StringIO +import libxml2 + +# Memory debug specific +libxml2.debugMemory(1) + +# +# Parse a document testing the Close() API +# +docstr="""<foo> +<label>some text</label> +<item>100</item> +</foo>""" + +reader = libxml2.readerForDoc(docstr, "test1", None, 0) +ret = reader.Read() +ret = reader.Read() +ret = reader.Close() + +if ret != 0: + print "Error closing the document test1" + sys.exit(1) + +del reader + +# Memory debug specific +libxml2.cleanupParser() +if libxml2.debugMemory(1) == 0: + print "OK" +else: + print "Memory leak %d bytes" % (libxml2.debugMemory(1)) + libxml2.dumpMemory() |