swig/Examples/test-suite/python/swigobject_runme.py
Marcelo Matus 19613c8909 fix hex pointer conversion
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7022 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-03-02 17:55:13 +00:00

28 lines
357 B
Python

from swigobject import *
a = A()
a1 = a_ptr(a)
a2 = a_ptr(a)
if a1.this != a2.this:
raise RuntimeError
lthis = long(a.this)
xstr1 = "0x%x" % (lthis,)
xstr2 = pointer_str(a)
if xstr1 != xstr2:
print xstr1, xstr2
raise RuntimeError
s = str(a.this)
r = repr(a.this)
v1 = v_ptr(a)
v2 = v_ptr(a)
if long(v1) != long(v2):
raise RuntimeError