Added test case just to check a few things with protected/private virtual methods

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5515 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-12-09 17:50:29 +00:00
commit f92e4b1c6c
3 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,29 @@
%module abstract_access
%inline %{
class A {
private:
virtual int x() = 0;
protected:
virtual int y() = 0;
public:
virtual int z() = 0;
int do_x() { return x(); }
};
class B : public A {
private:
virtual int x() { return y(); }
};
class C : public B {
protected:
virtual int y() { return z(); }
};
class D : public C {
private:
virtual int z() { return 1; }
};
%}

View file

@ -61,6 +61,7 @@ C_TEST_BROKEN +=
# C++ test cases. (Can be run individually using make testcase.cpptest.)
CPP_TEST_CASES += \
abstract_access \
abstract_inherit \
abstract_inherit_ok \
abstract_signature \

View file

@ -0,0 +1,6 @@
import abstract_access
d = abstract_access.D()
if d.do_x() != 1:
raise RuntimeError