Annotation of embedaddon/libxml2/python/tests/tst.py, revision 1.1.1.2

1.1       misho       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":
1.1.1.2 ! misho      10:     print("doc.name failed")
1.1       misho      11:     sys.exit(1)
                     12: root = doc.children
                     13: if root.name != "doc":
1.1.1.2 ! misho      14:     print("root.name failed")
1.1       misho      15:     sys.exit(1)
                     16: child = root.children
                     17: if child.name != "foo":
1.1.1.2 ! misho      18:     print("child.name failed")
1.1       misho      19:     sys.exit(1)
                     20: doc.freeDoc()
                     21: 
                     22: # Memory debug specific
                     23: libxml2.cleanupParser()
                     24: if libxml2.debugMemory(1) == 0:
1.1.1.2 ! misho      25:     print("OK")
1.1       misho      26: else:
1.1.1.2 ! misho      27:     print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
1.1       misho      28:     libxml2.dumpMemory()

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