adding more tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6740 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
794680d137
commit
e2e96ec64f
7 changed files with 42 additions and 11 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
%module abstract_access
|
%module abstract_access
|
||||||
|
|
||||||
|
%warnfilter(517) A;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
class A {
|
class A {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,10 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class FooBar : private Foo
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,7 @@ public:
|
||||||
%inline %{
|
%inline %{
|
||||||
namespace Space {
|
namespace Space {
|
||||||
struct WildCards {
|
struct WildCards {
|
||||||
|
virtual ~WildCards() {}
|
||||||
virtual WildCards* incy(int a) const { return 0; }
|
virtual WildCards* incy(int a) const { return 0; }
|
||||||
virtual WildCards* wincy(int a) { return 0; }
|
virtual WildCards* wincy(int a) { return 0; }
|
||||||
virtual WildCards* spider(int a) const { return 0; }
|
virtual WildCards* spider(int a) const { return 0; }
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
/* This was broken in the perl module. See bug 962115
|
/* This was broken in the perl module. See bug 962115
|
||||||
It tests basic multiple inheritance */
|
It tests basic multiple inheritance */
|
||||||
|
|
||||||
%module multiple_inheritance
|
%module(ruby_minherit="1") multiple_inheritance
|
||||||
|
|
||||||
#ifdef SWIGRUBY
|
|
||||||
#pragma SWIG nowarn=802; // Ruby doesn't support multiple inheritance
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SWIGJAVA
|
#ifdef SWIGJAVA
|
||||||
#pragma SWIG nowarn=813; // Java doesn't support multiple inheritance
|
#pragma SWIG nowarn=813; // Java doesn't support multiple inheritance
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@
|
||||||
Foo blah() {
|
Foo blah() {
|
||||||
return Foo();
|
return Foo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Bar : protected Foo
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
#pragma SWIG nowarn=350 // operator new
|
#pragma SWIG nowarn=350 // operator new
|
||||||
|
|
@ -26,6 +31,11 @@
|
||||||
protected:
|
protected:
|
||||||
void *operator new(size_t l) { return malloc(sizeof(TROOT)); }
|
void *operator new(size_t l) { return malloc(sizeof(TROOT)); }
|
||||||
|
|
||||||
|
int prot_meth()
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TROOT()
|
TROOT()
|
||||||
{
|
{
|
||||||
|
|
@ -36,7 +46,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class A : public TROOT
|
class A : protected TROOT
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -46,11 +56,11 @@
|
||||||
|
|
||||||
// This case only works in python
|
// This case only works in python
|
||||||
%inline %{
|
%inline %{
|
||||||
struct Bar : Foo
|
struct FooBar : Foo
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
Bar bar;
|
FooBar bar;
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,24 @@ namespace std {
|
||||||
|
|
||||||
%template(DoubleVector) std::vector<double>;
|
%template(DoubleVector) std::vector<double>;
|
||||||
|
|
||||||
%template(SizeVector) std::vector<size_t>;
|
specialize_std_vector(size_t,PyInt_Check,PyInt_AsLong,PyInt_FromLong);
|
||||||
|
|
||||||
|
|
||||||
|
%template(sizeVector) std::vector<size_t>;
|
||||||
|
%{
|
||||||
|
template <class T>
|
||||||
|
struct Param
|
||||||
|
{
|
||||||
|
T val;
|
||||||
|
|
||||||
|
Param(T v = 0): val(v) {
|
||||||
|
}
|
||||||
|
|
||||||
|
operator T() const { return val; }
|
||||||
|
};
|
||||||
|
%}
|
||||||
|
specialize_std_vector(Param<int>,PyInt_Check,PyInt_AsLong,PyInt_FromLong);
|
||||||
|
%template(PIntVector) std::vector<Param<int> >;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
typedef float Real;
|
typedef float Real;
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,10 @@
|
||||||
const T& meth(const T& t = T(0)) { return t; }
|
const T& meth(const T& t = T(0)) { return t; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T> class Y : private X<T> {
|
template <typename TT> class Y : private X<TT> {
|
||||||
public:
|
public:
|
||||||
// test using on templated class with default args in the method
|
// test using on templated class with default args in the method
|
||||||
using X<T>::meth;
|
using X<TT>::meth;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <int V> struct Z
|
template <int V> struct Z
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue