comparison python/pydc/test/types.py @ 46:c21d1c2c84e1

- removed pydc.py wrapper overhead (which only called pydcext.so functions, directly, anyways) * implies renaming pydcext.* to pydc.* * while at it, iterate directly over args that are passed in (before we did extract fptr, sig and a tuple for the args and iterated over latter afterwards); we might have a tiny perf improvement now - added type stub as package_data
author Tassilo Philipp
date Fri, 13 Nov 2020 14:10:31 +0100
parents 0f86a5ecfe61
children 80b11152c659
comparison
equal deleted inserted replaced
45:da553362fa7c 46:c21d1c2c84e1
130 130
131 t(l, "p)Z", "const char*", "ccp_plus_one", "(const char*)", ' "xY" => "Y"', bytearray(b'xY')) # bytearray object 131 t(l, "p)Z", "const char*", "ccp_plus_one", "(const char*)", ' "xY" => "Y"', bytearray(b'xY')) # bytearray object
132 t(l, "p)p", "const char*", "ccp_plus_one", "(const char*)", ' "xY" => p+1 (~ odd addr)', bytearray(b'xY')) # bytearray object 132 t(l, "p)p", "const char*", "ccp_plus_one", "(const char*)", ' "xY" => p+1 (~ odd addr)', bytearray(b'xY')) # bytearray object
133 t(l, "p)p", "const char*", "ccp_plus_one", "(const char*)", ' 0xdeadc0de => 0xdeadc0de+1=3735929055', long_h) # handle (integer interpreted as ptr) 133 t(l, "p)p", "const char*", "ccp_plus_one", "(const char*)", ' 0xdeadc0de => 0xdeadc0de+1=3735929055', long_h) # handle (integer interpreted as ptr)
134 t(l, "p)p", "const char*", "ccp_plus_one", "(const char*)", ' 0xdeadc0de => 0xdeadc0de+1=3735929055', long_h) # handle (integer interpreted as ptr, long in Python 2) 134 t(l, "p)p", "const char*", "ccp_plus_one", "(const char*)", ' 0xdeadc0de => 0xdeadc0de+1=3735929055', long_h) # handle (integer interpreted as ptr, long in Python 2)
135 t(l, "p)p", "const char*", "ccp_plus_one", "(const char*)", ' NULL => NULL+1=1', None) # NULL, addin gone will result in 0x1 135 t(l, "p)p", "const char*", "ccp_plus_one", "(const char*)", ' NULL => NULL+1=1', None) # NULL, adding one will result in 0x1
136 136
137 # functions that change buffers 137 # functions that change buffers
138 theader('TESTS OF IMMUTABLE AND MUTABLE PYTHON BUFFERS:') 138 theader('TESTS OF IMMUTABLE AND MUTABLE PYTHON BUFFERS:')
139 t(l, "Z)v", "const char*", "cp_head_incr", "(const char*)", ' "string" => None / arg => "string" (not modified)"', 'string') # string object 139 t(l, "Z)v", "const char*", "cp_head_incr", "(const char*)", ' "string" => None / arg => "string" (not modified)"', 'string') # string object
140 t(l, "Z)v", "const char*", "cp_head_incr", "(const char*)", ' "UnIcOdE" => None / arg => "UnIcOdE" (not modified)"', u'UnIcOdE') # string object (unicode in Python 2) 140 t(l, "Z)v", "const char*", "cp_head_incr", "(const char*)", ' "UnIcOdE" => None / arg => "UnIcOdE" (not modified)"', u'UnIcOdE') # string object (unicode in Python 2)