mirror of https://github.com/swig/swig
Test suite warning fixes
This commit is contained in:
parent
03570f85f2
commit
eec306c228
|
@ -13,28 +13,28 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
struct XXX {
|
struct XXX {
|
||||||
XXX(int v) : value(v) {
|
XXX(int v) : value(v) {
|
||||||
if (debug) std::cout << "Default Constructor " << value << " " << this << std::endl;
|
if (debugging) std::cout << "Default Constructor " << value << " " << this << std::endl;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
XXX(const XXX &other) {
|
XXX(const XXX &other) {
|
||||||
value = other.value;
|
value = other.value;
|
||||||
if (debug) std::cout << "Copy Constructor " << value << " " << this << std::endl;
|
if (debugging) std::cout << "Copy Constructor " << value << " " << this << std::endl;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
XXX& operator=(const XXX &other) {
|
XXX& operator=(const XXX &other) {
|
||||||
value = other.value;
|
value = other.value;
|
||||||
if (debug) std::cout << "Assignment operator " << value << " " << this << std::endl;
|
if (debugging) std::cout << "Assignment operator " << value << " " << this << std::endl;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
~XXX() {
|
~XXX() {
|
||||||
if (debug) std::cout << "Destructor " << value << " " << this << std::endl;
|
if (debugging) std::cout << "Destructor " << value << " " << this << std::endl;
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
void showInfo() {
|
void showInfo() {
|
||||||
if (debug) std::cout << "Info " << value << " " << this << std::endl;
|
if (debugging) std::cout << "Info " << value << " " << this << std::endl;
|
||||||
}
|
}
|
||||||
int value;
|
int value;
|
||||||
static const bool debug = false;
|
static const bool debugging = false;
|
||||||
static int count;
|
static int count;
|
||||||
};
|
};
|
||||||
int XXX::count = 0;
|
int XXX::count = 0;
|
||||||
|
|
|
@ -49,6 +49,9 @@ struct Outer {
|
||||||
struct {
|
struct {
|
||||||
Integer b;
|
Integer b;
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
Integer a;
|
||||||
|
Integer b;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
union {
|
union {
|
||||||
|
@ -164,6 +167,9 @@ struct Outer {
|
||||||
public:
|
public:
|
||||||
Integer yy;
|
Integer yy;
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
Integer xx;
|
||||||
|
Integer yy;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
///////////////////////////////////////////
|
///////////////////////////////////////////
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace ns {
|
||||||
int data;
|
int data;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
template <class T> class Abstract;
|
template <class T> class AbstractClass;
|
||||||
class Real;
|
class Real;
|
||||||
};
|
};
|
||||||
#ifndef __clang__
|
#ifndef __clang__
|
||||||
|
@ -44,23 +44,23 @@ namespace ns {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class Class {
|
class Klass {
|
||||||
public:
|
public:
|
||||||
template <class T> class Abstract;
|
template <class T> class AbstractClass;
|
||||||
class Real;
|
class Real;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T> class Class::Abstract {
|
template <class T> class Klass::AbstractClass {
|
||||||
public:
|
public:
|
||||||
virtual void Method() = 0;
|
virtual void Method() = 0;
|
||||||
virtual ~Abstract() {}
|
virtual ~AbstractClass() {}
|
||||||
};
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%template(abstract_int) Class::Abstract <int>;
|
%template(abstract_int) Klass::AbstractClass <int>;
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
class Class::Real : public Abstract <int> {
|
class Klass::Real : public AbstractClass <int> {
|
||||||
public:
|
public:
|
||||||
virtual void Method() {}
|
virtual void Method() {}
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@ require "tests.php";
|
||||||
require "director_exception.php";
|
require "director_exception.php";
|
||||||
|
|
||||||
// No new functions
|
// No new functions
|
||||||
check::functions(array(foo_ping,foo_pong,launder,bar_ping,bar_pong,bar_pang,returnalltypes_return_int,returnalltypes_return_double,returnalltypes_return_const_char_star,returnalltypes_return_std_string,returnalltypes_return_bar));
|
check::functions(array(foo_ping,foo_pong,launder,bar_ping,bar_pong,bar_pang,returnalltypes_return_int,returnalltypes_return_double,returnalltypes_return_const_char_star,returnalltypes_return_std_string,returnalltypes_return_bar,returnalltypes_call_int,returnalltypes_call_double,returnalltypes_call_const_char_star,returnalltypes_call_std_string,returnalltypes_call_bar,is_python_builtin));
|
||||||
// No new classes
|
// No new classes
|
||||||
check::classes(array(director_exception,Foo,Exception1,Exception2,Base,Bar,ReturnAllTypes));
|
check::classes(array(director_exception,Foo,Exception1,Exception2,Base,Bar,ReturnAllTypes));
|
||||||
// now new vars
|
// now new vars
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
require "tests.php";
|
require "tests.php";
|
||||||
require "exception_order.php";
|
require "exception_order.php";
|
||||||
|
|
||||||
check::functions(array(a_foo,a_bar,a_foobar,a_barfoo));
|
check::functions(array(a_foo,a_bar,a_foobar,a_barfoo,is_python_builtin));
|
||||||
check::classes(array(A,E1,E2,E3,exception_order,ET_i,ET_d));
|
check::classes(array(A,E1,E2,E3,exception_order,ET_i,ET_d));
|
||||||
check::globals(array(efoovar,foovar,cfoovar,a_sfoovar,a_foovar,a_efoovar));
|
check::globals(array(efoovar,foovar,cfoovar,a_sfoovar,a_foovar,a_efoovar));
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require "tests.php";
|
||||||
require "import_nomodule.php";
|
require "import_nomodule.php";
|
||||||
|
|
||||||
// No new functions
|
// No new functions
|
||||||
check::functions(array(create_foo,delete_foo,test1));
|
check::functions(array(create_foo,delete_foo,test1,is_python_builtin));
|
||||||
// No new classes
|
// No new classes
|
||||||
check::classes(array(import_nomodule,Bar));
|
check::classes(array(import_nomodule,Bar));
|
||||||
// now new vars
|
// now new vars
|
||||||
|
|
|
@ -4,9 +4,9 @@ require "tests.php";
|
||||||
require "threads_exception.php";
|
require "threads_exception.php";
|
||||||
|
|
||||||
// Check functions
|
// Check functions
|
||||||
check::functions(array(test_simple,test_message,test_hosed,test_unknown,test_multi));
|
check::functions(array(test_simple,test_message,test_hosed,test_unknown,test_multi,is_python_builtin));
|
||||||
// Check classes.
|
// Check classes.
|
||||||
check::classes(array(Exc,Test));
|
check::classes(array(Exc,Test,threads_exception));
|
||||||
// Chek globals.
|
// Chek globals.
|
||||||
check::globals(array(exc_code,exc_msg));
|
check::globals(array(exc_code,exc_msg));
|
||||||
|
|
||||||
|
|
|
@ -16,15 +16,15 @@
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
|
|
||||||
class Error {
|
class CError {
|
||||||
};
|
};
|
||||||
|
|
||||||
void test_is_Error(Error *r) {}
|
void test_is_Error(CError *r) {}
|
||||||
|
|
||||||
namespace Namespace {
|
namespace Namespace {
|
||||||
typedef Error ErrorTypedef;
|
typedef CError ErrorTypedef;
|
||||||
typedef const Error& ErrorRef;
|
typedef const CError& ErrorRef;
|
||||||
typedef const Error* ErrorPtr;
|
typedef const CError* ErrorPtr;
|
||||||
typedef int IntArray[10];
|
typedef int IntArray[10];
|
||||||
enum EnumTest { enum1, enum2 };
|
enum EnumTest { enum1, enum2 };
|
||||||
}
|
}
|
||||||
|
@ -36,26 +36,26 @@ public:
|
||||||
void test_msg() throw(const char *) {
|
void test_msg() throw(const char *) {
|
||||||
throw "Dead";
|
throw "Dead";
|
||||||
}
|
}
|
||||||
void test_cls() throw(Error) {
|
void test_cls() throw(CError) {
|
||||||
throw Error();
|
throw CError();
|
||||||
}
|
}
|
||||||
void test_cls_ptr() throw(Error *) {
|
void test_cls_ptr() throw(CError *) {
|
||||||
static Error StaticError;
|
static CError StaticError;
|
||||||
throw &StaticError;
|
throw &StaticError;
|
||||||
}
|
}
|
||||||
void test_cls_ref() throw(Error &) {
|
void test_cls_ref() throw(CError &) {
|
||||||
static Error StaticError;
|
static CError StaticError;
|
||||||
throw StaticError;
|
throw StaticError;
|
||||||
}
|
}
|
||||||
void test_cls_td() throw(Namespace::ErrorTypedef) {
|
void test_cls_td() throw(Namespace::ErrorTypedef) {
|
||||||
throw Error();
|
throw CError();
|
||||||
}
|
}
|
||||||
void test_cls_ptr_td() throw(Namespace::ErrorPtr) {
|
void test_cls_ptr_td() throw(Namespace::ErrorPtr) {
|
||||||
static Error StaticError;
|
static CError StaticError;
|
||||||
throw &StaticError;
|
throw &StaticError;
|
||||||
}
|
}
|
||||||
void test_cls_ref_td() throw(Namespace::ErrorRef) {
|
void test_cls_ref_td() throw(Namespace::ErrorRef) {
|
||||||
static Error StaticError;
|
static CError StaticError;
|
||||||
throw StaticError;
|
throw StaticError;
|
||||||
}
|
}
|
||||||
void test_array() throw(Namespace::IntArray) {
|
void test_array() throw(Namespace::IntArray) {
|
||||||
|
@ -68,10 +68,10 @@ public:
|
||||||
void test_enum() throw(Namespace::EnumTest) {
|
void test_enum() throw(Namespace::EnumTest) {
|
||||||
throw Namespace::enum2;
|
throw Namespace::enum2;
|
||||||
}
|
}
|
||||||
void test_multi(int x) throw(int, const char *, Error) {
|
void test_multi(int x) throw(int, const char *, CError) {
|
||||||
if (x == 1) throw 37;
|
if (x == 1) throw 37;
|
||||||
if (x == 2) throw "Dead";
|
if (x == 2) throw "Dead";
|
||||||
if (x == 3) throw Error();
|
if (x == 3) throw CError();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue