Skip to content

Commit

Permalink
cleanup of using None as NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Oct 17, 2017
1 parent e4f7d03 commit 3ff9968
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion test/test_advancedcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ def test08_void_pointer_passing(self):
assert cppyy.addressof(ptr) == 0x4321

assert cppyy.addressof(cppyy.nullptr) == 0
assert cppyy.addressof(None) == 0
assert raises(TypeError, cppyy.addressof, None)
assert cppyy.addressof(0) == 0

def test09_opaque_pointer_passing(self):
"""Test passing around of opaque pointers"""
Expand Down
2 changes: 1 addition & 1 deletion test/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ def address_equality_test(a, b):
def null_test(null):
c.m_voidp = null
assert c.m_voidp is cppyy.nullptr
map(null_test, [0, None, cppyy.nullptr])
map(null_test, [0, cppyy.nullptr])

c.m_voidp = c2
address_equality_test(c.m_voidp, c2)
Expand Down
5 changes: 1 addition & 4 deletions test/test_fragile.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ def test05_wrong_arg_addressof(self):
cppyy.addressof(f)
raises(TypeError, cppyy.addressof, o)
raises(TypeError, cppyy.addressof, 1)
# 0, None, and nullptr allowed
assert cppyy.addressof(0) == 0
assert cppyy.addressof(None) == 0
assert cppyy.addressof(cppyy.nullptr) == 0
# see also test08_void_pointer_passing in test_advancedcpp.py

def test06_wrong_this(self):
"""Test that using an incorrect self argument raises"""
Expand Down

0 comments on commit 3ff9968

Please sign in to comment.