From 46c43c51cd203255aa3401c41ecc5d310b7ec9ca Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Tue, 25 Oct 2005 16:44:21 +0000 Subject: [PATCH] add pointer test git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7725 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Examples/test-suite/li_attribute.i | 17 ++++++++++++++++- .../test-suite/python/li_attribute_runme.py | 9 +++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Examples/test-suite/li_attribute.i b/Examples/test-suite/li_attribute.i index ee3520013..c5b0eed43 100644 --- a/Examples/test-suite/li_attribute.i +++ b/Examples/test-suite/li_attribute.i @@ -11,6 +11,8 @@ %attribute(A, int, c, get_c); /* read-only */ %attribute_ref(A, int, b, d); /* different attribute name 'd' */ +%attribute_ref(B, A*, a) + %inline { struct A @@ -63,7 +65,20 @@ } private: C _v; - }; + }; + + + struct B { + B(A *a) : mA(a) + { + } + + A*& a() { return mA; } + + protected: + A* mA; + }; + } %template(Param_i) Param; diff --git a/Examples/test-suite/python/li_attribute_runme.py b/Examples/test-suite/python/li_attribute_runme.py index cce50af03..d8eff66ba 100644 --- a/Examples/test-suite/python/li_attribute_runme.py +++ b/Examples/test-suite/python/li_attribute_runme.py @@ -35,3 +35,12 @@ if pi.value != 7: pi.value=3 if pi.value != 3: raise RuntimeError + + +b = li_attribute.B(aa) + +if b.a.c != 3: + raise RuntimeError + + +