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:
Marcelo Matus 2004-11-15 22:58:10 +00:00
commit e2e96ec64f
7 changed files with 42 additions and 11 deletions

View file

@ -1,5 +1,7 @@
%module abstract_access
%warnfilter(517) A;
%inline %{
class A {
public:

View file

@ -83,6 +83,10 @@ private:
};
class FooBar : private Foo
{
};
}

View file

@ -104,6 +104,7 @@ public:
%inline %{
namespace Space {
struct WildCards {
virtual ~WildCards() {}
virtual WildCards* incy(int a) const { return 0; }
virtual WildCards* wincy(int a) { return 0; }
virtual WildCards* spider(int a) const { return 0; }

View file

@ -1,11 +1,8 @@
/* This was broken in the perl module. See bug 962115
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
#pragma SWIG nowarn=813; // Java doesn't support multiple inheritance

View file

@ -17,6 +17,11 @@
Foo blah() {
return Foo();
}
class Bar : protected Foo
{
};
%}
#pragma SWIG nowarn=350 // operator new
@ -26,6 +31,11 @@
protected:
void *operator new(size_t l) { return malloc(sizeof(TROOT)); }
int prot_meth()
{
return 1;
}
public:
TROOT()
{
@ -36,7 +46,7 @@
}
};
class A : public TROOT
class A : protected TROOT
{
};
@ -46,11 +56,11 @@
// This case only works in python
%inline %{
struct Bar : Foo
struct FooBar : Foo
{
};
Bar bar;
FooBar bar;
%}

View file

@ -18,7 +18,24 @@ namespace std {
%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 %{
typedef float Real;

View file

@ -35,10 +35,10 @@
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:
// test using on templated class with default args in the method
using X<T>::meth;
using X<TT>::meth;
};
template <int V> struct Z