VirtualBox

source: vbox/trunk/src/libs/libxml2-2.13.2/python/tests/reader8.py@ 105681

最後變更 在這個檔案從105681是 105420,由 vboxsync 提交於 7 月 前

libxml2-2.12.6: Applied and adjusted our libxml2 changes to 2.12.6. bugref:10730

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

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