Skip to content

Commit

Permalink
cleaner addressof() tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Oct 17, 2017
1 parent f94b4df commit c373a99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion python/cppyy/_cpython_cppyy.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
'load_reflection_info',
'addressof',
'bind_object',
'addressof',
'nullptr',
'move',
'_backend',
Expand Down
7 changes: 5 additions & 2 deletions test/test_advancedcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,10 @@ def test08_void_pointer_passing(self):

import array
addressofo = array.array('l', [cppyy.addressof(o)])
assert addressofo.buffer_info()[0] == pp.gime_address_ptr_ptr(addressofo)
assert addressofo[0] == pp.gime_address_ptr_ptr(addressofo)

assert 0 == pp.gime_address_ptr(0)
assert 0 == pp.gime_address_ptr(None)
raises(TypeError, pp.gime_address_ptr, None)

ptr = cppyy.bind_object(0, some_concrete_class)
assert cppyy.addressof(ptr) == 0
Expand All @@ -403,6 +403,9 @@ def test08_void_pointer_passing(self):
pp.set_address_ptr_ptr(ptr)
assert cppyy.addressof(ptr) == 0x4321

assert cppyy.addressof(cppyy.nullptr) == 0
assert cppyy.addressof(None) == 0

def test09_opaque_pointer_passing(self):
"""Test passing around of opaque pointers"""

Expand Down

0 comments on commit c373a99

Please sign in to comment.