File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -242,6 +242,10 @@ std::string nullsmartpointerpointertest(SwigBoost::shared_ptr<Klass>* k) {
242
242
else
243
243
return " also not null" ;
244
244
}
245
+
246
+ SwigBoost::shared_ptr<Klass>* sp_pointer_null () { return NULL ; }
247
+ SwigBoost::shared_ptr<Klass>* null_sp_pointer () { static SwigBoost::shared_ptr<Klass> static_sp; return &static_sp; }
248
+ SwigBoost::shared_ptr<Klass> sp_value_null () { return SwigBoost::shared_ptr<Klass>(); }
245
249
// $owner
246
250
Klass *pointerownertest () {
247
251
return new Klass (" pointerownertest" );
Original file line number Diff line number Diff line change @@ -168,6 +168,19 @@ def runtest(self):
168
168
except ValueError :
169
169
pass
170
170
171
+ # test null pointers emitted from C++
172
+ k = li_boost_shared_ptr .sp_pointer_null ()
173
+ if (li_boost_shared_ptr .smartpointertest (k ) != None ):
174
+ raise RuntimeError ("return was not null" )
175
+
176
+ k = li_boost_shared_ptr .null_sp_pointer ()
177
+ if (li_boost_shared_ptr .smartpointertest (k ) != None ):
178
+ raise RuntimeError ("return was not null" )
179
+
180
+ k = li_boost_shared_ptr .sp_value_null ()
181
+ if (li_boost_shared_ptr .smartpointertest (k ) != None ):
182
+ raise RuntimeError ("return was not null" )
183
+
171
184
# $owner
172
185
k = li_boost_shared_ptr .pointerownertest ()
173
186
val = k .getValue ()
You can’t perform that action at this time.
0 commit comments