File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / libxml2 / python / tests / inbuf.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, 5 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: try:
    5:     import StringIO
    6:     str_io = StringIO.StringIO
    7: except:
    8:     import io
    9:     str_io = io.StringIO
   10: 
   11: # Memory debug specific
   12: libxml2.debugMemory(1)
   13: 
   14: i = 0
   15: while i < 5000:
   16:     f = str_io("foobar")
   17:     buf = libxml2.inputBuffer(f)
   18:     i = i + 1
   19: 
   20: del f
   21: del buf
   22: 
   23: # Memory debug specific
   24: libxml2.cleanupParser()
   25: if libxml2.debugMemory(1) == 0:
   26:     print("OK")
   27: else:
   28:     print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
   29:     libxml2.dumpMemory()
   30: 

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