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:
William S Fulton 2005-05-25 21:15:01 +00:00
commit 4ada2f88af
2 changed files with 39 additions and 0 deletions

View 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>;

View file

@ -67,6 +67,7 @@ CPP_TEST_CASES += \
abstract_typedef \
abstract_typedef2 \
abstract_virtual \
access_change \
add_link \
aggregate \
anonymous_bitfield \