Fix warning and improve description of ignore_parameter test
See https://github.com/swig/swig/pull/2205#issuecomment-1052648190
This commit is contained in:
parent
136692d2b0
commit
f4e2a4feee
3 changed files with 6 additions and 0 deletions
|
|
@ -11,6 +11,10 @@
|
||||||
%typemap(argout) int bb "called_argout = 1;"
|
%typemap(argout) int bb "called_argout = 1;"
|
||||||
|
|
||||||
%ignore unignorable;
|
%ignore unignorable;
|
||||||
|
// Don't let SWIG expand this function with its default parameter: instead,
|
||||||
|
// always "require" the version of the function with a single argument, but
|
||||||
|
// then ignore it using `numinputs=0`.
|
||||||
|
%ignore audi();
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
// constant for detecting correct "argout" call
|
// constant for detecting correct "argout" call
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ check(car.astonmartin("foo", 1), 101)
|
||||||
check(car.bugatti("bar", 2), 8.8)
|
check(car.bugatti("bar", 2), 8.8)
|
||||||
check(car.lamborghini(), 101)
|
check(car.lamborghini(), 101)
|
||||||
check(car.maseratti(289), 289)
|
check(car.maseratti(289), 289)
|
||||||
|
check(car.audi(), 8.8) # Typemap overrides default argument
|
||||||
|
|
||||||
MiniCooper(200, 0)
|
MiniCooper(200, 0)
|
||||||
MorrisMinor("baz", 0)
|
MorrisMinor("baz", 0)
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ raise RuntimeError unless sc.daimler(0, 1.0) == "hello"
|
||||||
raise RuntimeError unless sc.astonmartin("foo", 1.0) == 101
|
raise RuntimeError unless sc.astonmartin("foo", 1.0) == 101
|
||||||
raise RuntimeError unless sc.bugatti("foo", 0) == 8.8
|
raise RuntimeError unless sc.bugatti("foo", 0) == 8.8
|
||||||
raise RuntimeError unless sc.lamborghini() == 101
|
raise RuntimeError unless sc.lamborghini() == 101
|
||||||
|
raise RuntimeError unless sc.audi() == 8.8
|
||||||
|
|
||||||
# Constructor tests
|
# Constructor tests
|
||||||
MiniCooper.new(0, 1.0)
|
MiniCooper.new(0, 1.0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue