aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-09-25 22:25:35 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-09-25 22:25:35 +0000
commitbd9afb529069415baf1f32d907f035de19dae788 (patch)
tree1fa287dac150ed4b13bed4d8c269a4f81746a8ac /python/tests
parent30c7054c5bc9578b8250f4c7d219dc45aefc39b8 (diff)
downloadandroid_external_libxml2-bd9afb529069415baf1f32d907f035de19dae788.tar.gz
android_external_libxml2-bd9afb529069415baf1f32d907f035de19dae788.tar.bz2
android_external_libxml2-bd9afb529069415baf1f32d907f035de19dae788.zip
improving some documentation comments found and fixed a mem leak with
* tree.c: improving some documentation comments * xmlregexp.c: found and fixed a mem leak with python regression tests * doc/*: rebuilt the doc and the API XML file including the xmlregexp.h xmlautomata.h and xmlunicode.h headers * python/generator.py python/libxml2class.txt python/libxml_wrap.h python/types.c: added access to the XML Schemas regexps from python * python/tests/Makefile.am python/tests/regexp.py: added a simple regexp bindings test Daniel
Diffstat (limited to 'python/tests')
-rw-r--r--python/tests/Makefile.am3
-rw-r--r--python/tests/regexp.py32
2 files changed, 34 insertions, 1 deletions
diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am
index 435b5acb..adb4be33 100644
--- a/python/tests/Makefile.am
+++ b/python/tests/Makefile.am
@@ -18,7 +18,8 @@ PYTESTS= \
xpath.py \
outbuf.py \
inbuf.py \
- resolver.py
+ resolver.py \
+ regexp.py
XMLS= \
tst.xml \
diff --git a/python/tests/regexp.py b/python/tests/regexp.py
new file mode 100644
index 00000000..4c05502b
--- /dev/null
+++ b/python/tests/regexp.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python -u
+import libxml2
+
+# Memory debug specific
+libxml2.debugMemory(1)
+
+re = libxml2.regexpCompile("a|b")
+if re.regexpExec("a") != 1:
+ print "error checking 'a'"
+ sys.exit(1)
+if re.regexpExec("b") != 1:
+ print "error checking 'b'"
+ sys.exit(1)
+if re.regexpExec("ab") != 0:
+ print "error checking 'ab'"
+ sys.exit(1)
+if re.regexpExec("") != 0:
+ print "error checking 'ab'"
+ sys.exit(1)
+if re.regexpIsDeterminist() != 1:
+ print "error checking determinism"
+ sys.exit(1)
+del re
+
+
+# Memory debug specific
+libxml2.cleanupParser()
+if libxml2.debugMemory(1) == 0:
+ print "OK"
+else:
+ print "Memory leak %d bytes" % (libxml2.debugMemory(1))
+ libxml2.dumpMemory()