Fix warning and improve description of ignore_parameter test

See https://github.com/swig/swig/pull/2205#issuecomment-1052648190
This commit is contained in:
Seth R Johnson 2022-02-26 19:48:54 -05:00 committed by Olly Betts
parent 136692d2b0
commit f4e2a4feee
3 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,10 @@
%typemap(argout) int bb "called_argout = 1;"
%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 %{
// constant for detecting correct "argout" call

View File

@ -16,6 +16,7 @@ check(car.astonmartin("foo", 1), 101)
check(car.bugatti("bar", 2), 8.8)
check(car.lamborghini(), 101)
check(car.maseratti(289), 289)
check(car.audi(), 8.8) # Typemap overrides default argument
MiniCooper(200, 0)
MorrisMinor("baz", 0)

View File

@ -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.bugatti("foo", 0) == 8.8
raise RuntimeError unless sc.lamborghini() == 101
raise RuntimeError unless sc.audi() == 8.8
# Constructor tests
MiniCooper.new(0, 1.0)