File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libxml2 / python / tests / tst.py
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Sun Jun 15 19:53:34 2014 UTC (10 years, 3 months ago) by misho
Branches: libxml2, MAIN
CVS tags: v2_9_1p0, v2_9_1, HEAD
libxml2 2.9.1

    1: #!/usr/bin/python -u
    2: import sys
    3: import libxml2
    4: 
    5: # Memory debug specific
    6: libxml2.debugMemory(1)
    7: 
    8: doc = libxml2.parseFile("tst.xml")
    9: if doc.name != "tst.xml":
   10:     print("doc.name failed")
   11:     sys.exit(1)
   12: root = doc.children
   13: if root.name != "doc":
   14:     print("root.name failed")
   15:     sys.exit(1)
   16: child = root.children
   17: if child.name != "foo":
   18:     print("child.name failed")
   19:     sys.exit(1)
   20: doc.freeDoc()
   21: 
   22: # Memory debug specific
   23: libxml2.cleanupParser()
   24: if libxml2.debugMemory(1) == 0:
   25:     print("OK")
   26: else:
   27:     print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
   28:     libxml2.dumpMemory()

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>