VirtualBox

source: vbox/trunk/src/libs/libxml2-2.6.30/python/tests/tst.py@ 21909

最後變更 在這個檔案從21909是 6076,由 vboxsync 提交於 17 年 前

Merged dmik/s2 branch (r25959:26751) to the trunk.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Date Revision Author Id
檔案大小: 582 位元組
 
1#!/usr/bin/python -u
2import sys
3import libxml2
4
5# Memory debug specific
6libxml2.debugMemory(1)
7
8doc = libxml2.parseFile("tst.xml")
9if doc.name != "tst.xml":
10 print "doc.name failed"
11 sys.exit(1)
12root = doc.children
13if root.name != "doc":
14 print "root.name failed"
15 sys.exit(1)
16child = root.children
17if child.name != "foo":
18 print "child.name failed"
19 sys.exit(1)
20doc.freeDoc()
21
22# Memory debug specific
23libxml2.cleanupParser()
24if libxml2.debugMemory(1) == 0:
25 print "OK"
26else:
27 print "Memory leak %d bytes" % (libxml2.debugMemory(1))
28 libxml2.dumpMemory()
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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