Test suite warning fixes

This commit is contained in:
William S Fulton 2014-12-24 08:48:54 +00:00
parent 03570f85f2
commit eec306c228
8 changed files with 40 additions and 34 deletions

View File

@ -13,28 +13,28 @@
#include <iostream>
struct XXX {
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++;
}
XXX(const XXX &other) {
value = other.value;
if (debug) std::cout << "Copy Constructor " << value << " " << this << std::endl;
if (debugging) std::cout << "Copy Constructor " << value << " " << this << std::endl;
count++;
}
XXX& operator=(const XXX &other) {
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;
}
~XXX() {
if (debug) std::cout << "Destructor " << value << " " << this << std::endl;
if (debugging) std::cout << "Destructor " << value << " " << this << std::endl;
count--;
}
void showInfo() {
if (debug) std::cout << "Info " << value << " " << this << std::endl;
if (debugging) std::cout << "Info " << value << " " << this << std::endl;
}
int value;
static const bool debug = false;
static const bool debugging = false;
static int count;
};
int XXX::count = 0;

View File

@ -49,6 +49,9 @@ struct Outer {
struct {
Integer b;
};
#else
Integer a;
Integer b;
#endif
union {
@ -164,6 +167,9 @@ struct Outer {
public:
Integer yy;
};
#else
Integer xx;
Integer yy;
#endif
///////////////////////////////////////////

View File

@ -35,7 +35,7 @@ namespace ns {
int data;
};
#endif
template <class T> class Abstract;
template <class T> class AbstractClass;
class Real;
};
#ifndef __clang__
@ -44,23 +44,23 @@ namespace ns {
};
#endif
class Class {
class Klass {
public:
template <class T> class Abstract;
template <class T> class AbstractClass;
class Real;
};
template <class T> class Class::Abstract {
template <class T> class Klass::AbstractClass {
public:
virtual void Method() = 0;
virtual ~Abstract() {}
virtual ~AbstractClass() {}
};
%}
%template(abstract_int) Class::Abstract <int>;
%template(abstract_int) Klass::AbstractClass <int>;
%inline %{
class Class::Real : public Abstract <int> {
class Klass::Real : public AbstractClass <int> {
public:
virtual void Method() {}
};

View File

@ -4,7 +4,7 @@ require "tests.php";
require "director_exception.php";
// 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
check::classes(array(director_exception,Foo,Exception1,Exception2,Base,Bar,ReturnAllTypes));
// now new vars

View File

@ -2,7 +2,7 @@
require "tests.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::globals(array(efoovar,foovar,cfoovar,a_sfoovar,a_foovar,a_efoovar));

View File

@ -3,7 +3,7 @@ require "tests.php";
require "import_nomodule.php";
// 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
check::classes(array(import_nomodule,Bar));
// now new vars

View File

@ -4,9 +4,9 @@ require "tests.php";
require "threads_exception.php";
// 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(array(Exc,Test));
check::classes(array(Exc,Test,threads_exception));
// Chek globals.
check::globals(array(exc_code,exc_msg));

View File

@ -16,15 +16,15 @@
%inline %{
class Error {
class CError {
};
void test_is_Error(Error *r) {}
void test_is_Error(CError *r) {}
namespace Namespace {
typedef Error ErrorTypedef;
typedef const Error& ErrorRef;
typedef const Error* ErrorPtr;
typedef CError ErrorTypedef;
typedef const CError& ErrorRef;
typedef const CError* ErrorPtr;
typedef int IntArray[10];
enum EnumTest { enum1, enum2 };
}
@ -36,26 +36,26 @@ public:
void test_msg() throw(const char *) {
throw "Dead";
}
void test_cls() throw(Error) {
throw Error();
void test_cls() throw(CError) {
throw CError();
}
void test_cls_ptr() throw(Error *) {
static Error StaticError;
void test_cls_ptr() throw(CError *) {
static CError StaticError;
throw &StaticError;
}
void test_cls_ref() throw(Error &) {
static Error StaticError;
void test_cls_ref() throw(CError &) {
static CError StaticError;
throw StaticError;
}
void test_cls_td() throw(Namespace::ErrorTypedef) {
throw Error();
throw CError();
}
void test_cls_ptr_td() throw(Namespace::ErrorPtr) {
static Error StaticError;
static CError StaticError;
throw &StaticError;
}
void test_cls_ref_td() throw(Namespace::ErrorRef) {
static Error StaticError;
static CError StaticError;
throw StaticError;
}
void test_array() throw(Namespace::IntArray) {
@ -68,10 +68,10 @@ public:
void test_enum() throw(Namespace::EnumTest) {
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 == 2) throw "Dead";
if (x == 3) throw Error();
if (x == 3) throw CError();
}
};