add pointer test

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7725 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-10-25 16:44:21 +00:00
commit 46c43c51cd
2 changed files with 25 additions and 1 deletions

View file

@ -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<int>;

View file

@ -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