version 1.1, 2012/02/21 23:38:00
|
version 1.1.1.2, 2014/06/15 19:53:34
|
Line 3
|
Line 3
|
# this tests the entities substitutions with the XmlTextReader interface |
# this tests the entities substitutions with the XmlTextReader interface |
# |
# |
import sys |
import sys |
import StringIO |
|
import libxml2 |
import libxml2 |
|
|
# Memory debug specific |
# Memory debug specific |
Line 45 while ret == 1:
|
Line 44 while ret == 1:
|
ret = reader.Read() |
ret = reader.Read() |
|
|
if ret != 0: |
if ret != 0: |
print "Error parsing the document test1" | print("Error parsing the document test1") |
sys.exit(1) |
sys.exit(1) |
|
|
if result != expect: |
if result != expect: |
print "Unexpected result for test1" | print("Unexpected result for test1") |
print result | print(result) |
sys.exit(1) |
sys.exit(1) |
|
|
doc.freeDoc() |
doc.freeDoc() |
Line 85 while ret == 1:
|
Line 84 while ret == 1:
|
ret = reader.Read() |
ret = reader.Read() |
|
|
if ret != 0: |
if ret != 0: |
print "Error parsing the document test2" | print("Error parsing the document test2") |
sys.exit(1) |
sys.exit(1) |
|
|
if result != expect: |
if result != expect: |
print "Unexpected result for test2" | print("Unexpected result for test2") |
print result | print(result) |
sys.exit(1) |
sys.exit(1) |
|
|
doc.freeDoc() |
doc.freeDoc() |
Line 123 while ret == 1:
|
Line 122 while ret == 1:
|
ret = reader.Read() |
ret = reader.Read() |
|
|
if ret != 0: |
if ret != 0: |
print "Error parsing the document test3" | print("Error parsing the document test3") |
sys.exit(1) |
sys.exit(1) |
|
|
if result != expect: |
if result != expect: |
print "Unexpected result for test3" | print("Unexpected result for test3") |
print result | print(result) |
sys.exit(1) |
sys.exit(1) |
|
|
# |
# |
Line 139 del reader
|
Line 138 del reader
|
# Memory debug specific |
# Memory debug specific |
libxml2.cleanupParser() |
libxml2.cleanupParser() |
if libxml2.debugMemory(1) == 0: |
if libxml2.debugMemory(1) == 0: |
print "OK" | print("OK") |
else: |
else: |
print "Memory leak %d bytes" % (libxml2.debugMemory(1)) | print("Memory leak %d bytes" % (libxml2.debugMemory(1))) |
libxml2.dumpMemory() |
libxml2.dumpMemory() |