VirtualBox

source: vbox/trunk/src/libs/libxml2-2.9.2/python/tests/reader8.py@ 64246

最後變更 在這個檔案從64246是 58072,由 vboxsync 提交於 9 年 前

libxml 2.9.2 unmodified

  • 屬性 svn:eol-style 設為 LF
  • 屬性 svn:executable 設為 *
檔案大小: 683 位元組
 
1#!/usr/bin/python -u
2#
3# this tests the entities substitutions with the XmlTextReader interface
4#
5import sys
6import libxml2
7
8# Memory debug specific
9libxml2.debugMemory(1)
10
11#
12# Parse a document testing the Close() API
13#
14docstr="""<foo>
15<label>some text</label>
16<item>100</item>
17</foo>"""
18
19reader = libxml2.readerForDoc(docstr, "test1", None, 0)
20ret = reader.Read()
21ret = reader.Read()
22ret = reader.Close()
23
24if ret != 0:
25 print("Error closing the document test1")
26 sys.exit(1)
27
28del reader
29
30# Memory debug specific
31libxml2.cleanupParser()
32if libxml2.debugMemory(1) == 0:
33 print("OK")
34else:
35 print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
36 libxml2.dumpMemory()
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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