VirtualBox

source: vbox/trunk/src/libs/libxml2-2.9.2/python/tests/inbuf.py@ 61509

Last change on this file since 61509 was 58072, checked in by vboxsync, 9 years ago

libxml 2.9.2 unmodified

  • Property svn:eol-style set to LF
  • Property svn:executable set to *
File size: 498 bytes
Line 
1#!/usr/bin/python -u
2import sys
3import libxml2
4try:
5 import StringIO
6 str_io = StringIO.StringIO
7except:
8 import io
9 str_io = io.StringIO
10
11# Memory debug specific
12libxml2.debugMemory(1)
13
14i = 0
15while i < 5000:
16 f = str_io("foobar")
17 buf = libxml2.inputBuffer(f)
18 i = i + 1
19
20del f
21del buf
22
23# Memory debug specific
24libxml2.cleanupParser()
25if libxml2.debugMemory(1) == 0:
26 print("OK")
27else:
28 print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
29 libxml2.dumpMemory()
30
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette