Skip to content

Commit

Permalink
test improved handling of unknown**
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Oct 18, 2017
1 parent b431ee1 commit 2d094d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion test/fragile.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ class D {
void overload(int, no_such_class* p = 0) {}
};


static const int dummy_location = 0xdead;

class E {
public:
E() : m_pp_no_such(0), m_pp_a(0) {}
E() : m_pp_no_such((no_such_class**)&dummy_location), m_pp_a(0) {}

virtual int check() { return (int)'E'; }
void overload(no_such_class**) {}
Expand Down
4 changes: 3 additions & 1 deletion test/test_fragile.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def test04_unsupported_arguments(self):

e = fragile.E()
raises(TypeError, e.overload, None)
raises(TypeError, getattr, e, 'm_pp_no_such')
# allowing access to e.m_pp_no_such is debatable, but it provides a raw pointer
# which may be useful ...
assert e.m_pp_no_such[0] == 0xdead

def test05_wrong_arg_addressof(self):
"""Test addressof() error reporting"""
Expand Down

0 comments on commit 2d094d7

Please sign in to comment.