From 2c6e7f99a6640d15e8c19720573c50986ce5f92e Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 21 Mar 2022 19:18:25 +0000 Subject: [PATCH] Test -flatstaticmethod and %extend --- .../test-suite/python/python_flatstaticmethod_runme.py | 7 +++++++ Examples/test-suite/python_flatstaticmethod.i | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/Examples/test-suite/python/python_flatstaticmethod_runme.py b/Examples/test-suite/python/python_flatstaticmethod_runme.py index f34670013..13d935f47 100644 --- a/Examples/test-suite/python/python_flatstaticmethod_runme.py +++ b/Examples/test-suite/python/python_flatstaticmethod_runme.py @@ -83,3 +83,10 @@ if A.defargs(1) != 21: if A.defargs(1, 2) != 3: raise RuntimeError + +# %extend +if A_staticextended(11) != 11: + raise RuntimeError + +if A.staticextended(11) != 11: + raise RuntimeError diff --git a/Examples/test-suite/python_flatstaticmethod.i b/Examples/test-suite/python_flatstaticmethod.i index c0de7d298..c187e9adc 100644 --- a/Examples/test-suite/python_flatstaticmethod.i +++ b/Examples/test-suite/python_flatstaticmethod.i @@ -11,6 +11,10 @@ %typemap(in) (int c, int d) "$1 = 0; $2 = 0;"; %typemap(doc,name="hello",type="Tuple") (int c, int d) "hello: int tuple[2]"; +%extend A { +static int staticextended(int i) { return i; } +} + %inline %{ struct A { static int bar(int a) {