summaryrefslogtreecommitdiff
path: root/Examples
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2014-12-24 08:48:54 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2014-12-28 10:38:12 +0000
commiteec306c228107478165b99954f353ab0587a451b (patch)
tree5f89b7c5123385a5c00766fb676aafc8beb38503 /Examples
parent03570f85f25f4387dbcb82daacd972c4032c9e78 (diff)
downloadswig-eec306c228107478165b99954f353ab0587a451b.tar.gz
Test suite warning fixes
Diffstat (limited to 'Examples')
-rw-r--r--Examples/test-suite/li_swigtype_inout.i12
-rw-r--r--Examples/test-suite/nested_class.i6
-rw-r--r--Examples/test-suite/nested_scope.i14
-rw-r--r--Examples/test-suite/php/director_exception_runme.php2
-rw-r--r--Examples/test-suite/php/exception_order_runme.php2
-rw-r--r--Examples/test-suite/php/import_nomodule_runme.php2
-rw-r--r--Examples/test-suite/php/threads_exception_runme.php4
-rw-r--r--Examples/test-suite/throw_exception.i32
8 files changed, 40 insertions, 34 deletions
diff --git a/Examples/test-suite/li_swigtype_inout.i b/Examples/test-suite/li_swigtype_inout.i
index 9d7e9a4c6..136c9fa9e 100644
--- a/Examples/test-suite/li_swigtype_inout.i
+++ b/Examples/test-suite/li_swigtype_inout.i
@@ -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;
diff --git a/Examples/test-suite/nested_class.i b/Examples/test-suite/nested_class.i
index ccb7ecac1..fe405479c 100644
--- a/Examples/test-suite/nested_class.i
+++ b/Examples/test-suite/nested_class.i
@@ -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
///////////////////////////////////////////
diff --git a/Examples/test-suite/nested_scope.i b/Examples/test-suite/nested_scope.i
index d89ba6ab7..bd66eec73 100644
--- a/Examples/test-suite/nested_scope.i
+++ b/Examples/test-suite/nested_scope.i
@@ -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() {}
};
diff --git a/Examples/test-suite/php/director_exception_runme.php b/Examples/test-suite/php/director_exception_runme.php
index cb823214b..8b852c2ce 100644
--- a/Examples/test-suite/php/director_exception_runme.php
+++ b/Examples/test-suite/php/director_exception_runme.php
@@ -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
diff --git a/Examples/test-suite/php/exception_order_runme.php b/Examples/test-suite/php/exception_order_runme.php
index a83598170..acb83561a 100644
--- a/Examples/test-suite/php/exception_order_runme.php
+++ b/Examples/test-suite/php/exception_order_runme.php
@@ -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));
diff --git a/Examples/test-suite/php/import_nomodule_runme.php b/Examples/test-suite/php/import_nomodule_runme.php
index 84191fba9..41836ba0f 100644
--- a/Examples/test-suite/php/import_nomodule_runme.php
+++ b/Examples/test-suite/php/import_nomodule_runme.php
@@ -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
diff --git a/Examples/test-suite/php/threads_exception_runme.php b/Examples/test-suite/php/threads_exception_runme.php
index 31148a1e1..9e4d04e10 100644
--- a/Examples/test-suite/php/threads_exception_runme.php
+++ b/Examples/test-suite/php/threads_exception_runme.php
@@ -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));
diff --git a/Examples/test-suite/throw_exception.i b/Examples/test-suite/throw_exception.i
index c1ad945fb..396c633a6 100644
--- a/Examples/test-suite/throw_exception.i
+++ b/Examples/test-suite/throw_exception.i
@@ -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();
}
};