add pointer test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7725 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
ac439c16b6
commit
85f9345667
2 changed files with 25 additions and 1 deletions
|
|
@ -11,6 +11,8 @@
|
||||||
%attribute(A, int, c, get_c); /* read-only */
|
%attribute(A, int, c, get_c); /* read-only */
|
||||||
%attribute_ref(A, int, b, d); /* different attribute name 'd' */
|
%attribute_ref(A, int, b, d); /* different attribute name 'd' */
|
||||||
|
|
||||||
|
%attribute_ref(B, A*, a)
|
||||||
|
|
||||||
%inline
|
%inline
|
||||||
{
|
{
|
||||||
struct A
|
struct A
|
||||||
|
|
@ -63,7 +65,20 @@
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
C _v;
|
C _v;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct B {
|
||||||
|
B(A *a) : mA(a)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
A*& a() { return mA; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
A* mA;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%template(Param_i) Param<int>;
|
%template(Param_i) Param<int>;
|
||||||
|
|
|
||||||
|
|
@ -35,3 +35,12 @@ if pi.value != 7:
|
||||||
pi.value=3
|
pi.value=3
|
||||||
if pi.value != 3:
|
if pi.value != 3:
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
|
|
||||||
|
b = li_attribute.B(aa)
|
||||||
|
|
||||||
|
if b.a.c != 3:
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue