-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python code generated with '-builtin -modernargs' segfaults for any m…
…ethod taking zero arguments. Also fixes: "SystemError: error return without exception set" during error checking when using just -builtin and the incorrect number of arguments is passed to a class method expecting zero arguments. Closes swig#256 Closes swig#382
- Loading branch information
Showing
4 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from template_classes import * | ||
|
||
# This test is just testing incorrect number of arguments/parameters checking | ||
|
||
point = PointInt() | ||
|
||
rectangle = RectangleInt() | ||
rectangle.setPoint(point) | ||
rectangle.getPoint() | ||
RectangleInt.static_noargs() | ||
RectangleInt.static_onearg(1) | ||
|
||
fail = True | ||
try: | ||
rectangle.setPoint() | ||
except TypeError, e: | ||
fail = False | ||
if fail: | ||
raise RuntimeError("argument count check failed") | ||
|
||
|
||
fail = True | ||
try: | ||
rectangle.getPoint(0) | ||
except TypeError, e: | ||
fail = False | ||
if fail: | ||
raise RuntimeError("argument count check failed") | ||
|
||
fail = True | ||
try: | ||
RectangleInt.static_noargs(0) | ||
except TypeError, e: | ||
fail = False | ||
if fail: | ||
raise RuntimeError("argument count check failed") | ||
|
||
fail = True | ||
try: | ||
RectangleInt.static_onearg() | ||
except TypeError, e: | ||
fail = False | ||
if fail: | ||
raise RuntimeError("argument count check failed") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters