test class hierarchies where the access changes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7213 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f7e511ddd4
commit
4ada2f88af
2 changed files with 39 additions and 0 deletions
38
SWIG/Examples/test-suite/access_change.i
Normal file
38
SWIG/Examples/test-suite/access_change.i
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
%module access_change
|
||||
|
||||
// test access changing from protected to public
|
||||
|
||||
%inline %{
|
||||
|
||||
template<typename T> class Base {
|
||||
public:
|
||||
virtual ~Base() {}
|
||||
protected:
|
||||
virtual int * WasProtected1() { return 0; }
|
||||
int * WasProtected2() { return 0; }
|
||||
virtual int * WasProtected3() { return 0; }
|
||||
int * WasProtected4() { return 0; }
|
||||
};
|
||||
|
||||
template<typename T> class Derived : public Base<T> {
|
||||
public:
|
||||
int * WasProtected1() { return 0; }
|
||||
int * WasProtected2() { return 0; }
|
||||
using Base<T>::WasProtected3;
|
||||
using Base<T>::WasProtected4;
|
||||
};
|
||||
|
||||
template<typename T> class Bottom : public Derived<T> {
|
||||
public:
|
||||
int * WasProtected1() { return 0; }
|
||||
int * WasProtected2() { return 0; }
|
||||
using Base<T>::WasProtected3;
|
||||
using Base<T>::WasProtected4;
|
||||
};
|
||||
%}
|
||||
|
||||
%template(BaseInt) Base<int>;
|
||||
%template(DerivedInt) Derived<int>;
|
||||
%template(BottomInt) Bottom<int>;
|
||||
|
||||
|
||||
|
|
@ -67,6 +67,7 @@ CPP_TEST_CASES += \
|
|||
abstract_typedef \
|
||||
abstract_typedef2 \
|
||||
abstract_virtual \
|
||||
access_change \
|
||||
add_link \
|
||||
aggregate \
|
||||
anonymous_bitfield \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue