Commit graph

4,169 commits

Author SHA1 Message Date
William S Fulton
67f38e8124 Add another interface test selecting just one base as an interface 2016-02-12 22:38:58 +00:00
William S Fulton
d0fb0ae801 Add overloading tests for interface feature 2016-02-12 20:22:37 +00:00
William S Fulton
212300c62b interfaces branch merge fixes 2016-02-11 20:21:25 +00:00
William S Fulton
abccc13a4a Merge branch 'interfaces' into interfaces2
* interfaces:
  Remove unnecessary interfaces for concrete classes
  cosmetic code formatting changes
  Correct interface name attributes that are internal
  interface macro changes to support templates
  Test non-virtual method in Derived classes
  interface tests for a most derived class inheriting the interfaces further up the chain
  Rename GetCPtr/getCPtr to SWIGInterfaceUpcast
  interface feature support for const ref pointers (used by the STL)
  Interface feature support for arrays
  More interface feature testing for return values
  interface feature support for passing by value
  interface feature support for references
  Multiple inheritance parameters as pointers testing
  Simplify multiple_inheritance_abstract Java runtime test
  Warning fixes
  Rename test functions in multiple_inheritance_abstract testcase
  Formatting fixes in generated code for interface feature
  Cosmetic spacing changes in test case
  interface feature typemap corrections to handle NULL pointers
  interface test added
  javadirectorin fix
  interface implementation visibility
  interface inheritance (2)
  interface inheritance (1)
  feature:interface ported to Java
  propagate non-abstract "interface" base methods (3)
  propagate non-abstract "interface" base methods (2)
  propagate non-abstract "interface" base methods (1)
  namespace support added GetCPtr now returns HandleRef "feature:interface:name" is now mandatory attribute
  interfaces (1)
  interfaces (1)

Conflicts:
	Source/Modules/csharp.cxx
	Source/Modules/java.cxx
2016-02-11 19:37:31 +00:00
William S Fulton
3931b5800c Remove unnecessary interfaces for concrete classes
Add Java test for checking expected base and interfaces are generated (to be expanded further)
In the example, E was previously implementing IA, IB, IC. Now it doesn't implement any.
C# virtual/override still to be fixed for this test case
2016-02-10 20:54:39 +00:00
William S Fulton
f82efac231 interface macro changes to support templates
The C++ type must be last in the argument list to support templates with
multiple arguments which are separated by commas.
Affects DECLARE_INTERFACE and DECLARE_INTERFACE_RENAME.
2016-02-09 07:02:42 +00:00
William S Fulton
b0fd270e54 Test non-virtual method in Derived classes 2016-02-08 20:56:28 +00:00
William S Fulton
8c49741eb2 interface tests for a most derived class inheriting the interfaces further up the chain 2016-02-08 20:49:57 +00:00
Karl Wette
125329466d octave: map unary functions to __...___ Python-style unary members
- Only available in Octave 3.8.0 and higher
2016-02-07 20:22:39 +01:00
Karl Wette
000ab753df octave: recognize Python __float__ numeric conversion operator 2016-02-07 20:22:39 +01:00
Karl Wette
b93b1871a9 octave: export function swig_octave_prereq() for easily testing Octave version 2016-02-07 20:22:39 +01:00
William S Fulton
e8907132cc interface feature support for const ref pointers (used by the STL)
Also interface feature return by value fixes
2016-02-07 13:58:47 +00:00
William S Fulton
5572b5f035 More interface feature testing for return values 2016-02-06 20:15:47 +00:00
William S Fulton
a1f2d60535 interface feature support for passing by value
Also add in missing $owner for governing ownership when returning pointers and references
2016-02-06 20:15:40 +00:00
William S Fulton
3eec3e2ea5 interface feature support for references 2016-02-06 20:15:29 +00:00
William S Fulton
eb15ba1638 Multiple inheritance parameters as pointers testing 2016-02-06 16:34:33 +00:00
William S Fulton
cb65828310 Simplify multiple_inheritance_abstract Java runtime test 2016-02-06 16:34:33 +00:00
William S Fulton
7379ea7848 Rename test functions in multiple_inheritance_abstract testcase
new names are just more friendly for analysing the test
2016-02-06 16:34:33 +00:00
William S Fulton
bb01ed3286 Merge branch 'ahnolds-classic_python'
* ahnolds-classic_python:
  Updating changelog and marking -classic as passing CI
  Support checking names of old-style classic classes
  Don't claim to new-style support in classic mode
  Clean up setting _object
  Removing __swig_getmethods__ for static methods
  Support python(pre|ap)pend on static methods in classic mode
  Add support for static methods in classic mode
  When possible, use PyInt rather than PyLong
2016-02-06 08:01:08 +00:00
William S Fulton
a16a818523 Cosmetic spacing changes in test case 2016-02-05 20:20:39 +00:00
Alec Cooper
17a4143dd0 Tests for Python Bytes/Unicode distinction 2016-02-04 21:07:40 -05:00
Alec Cooper
acbe04b548 Support checking names of old-style classic classes 2016-02-04 15:27:54 -05:00
Alec Cooper
b45164e098 Support python(pre|ap)pend on static methods in classic mode
Adding a test that covers this case to the python_append test-suite
Note: staticmethod function has been available since Python 2.2
2016-02-04 15:27:54 -05:00
William S Fulton
26d0b7f5b9 Disable tests broken in python 2.4 and 2.5
These tests were added in 2f8a7b82 and fc8e7654 in #572 and #573
but a change from a few months ago meant that the requested version of
Python was not actually being used during testing when these were added.
2016-02-04 08:36:58 +00:00
William S Fulton
2817e02e35 Merge branch 'ahnolds-clean_osx_go'
* ahnolds-clean_osx_go:
  Go test-suite should now work on OSX
  Don't write empty swigargs structs
  Fail if nocgo version fails
  Handle weak linking on OSX

Conflicts:
	CHANGES.current
2016-01-28 20:03:54 +00:00
Alec Cooper
14178be139 Fail if nocgo version fails 2016-01-23 16:17:33 -05:00
Alec Cooper
bec00500d6 Handle weak linking on OSX
If symbol is not defined at link time (even if it's weak/weak_import), the
linker must explicitly be told that's ok.
2016-01-23 16:16:00 -05:00
Ben Webb
2a5bbb6018 Qualify use of "__builtin__.Exception" class.
It is possible that the module we're wrapping defines an Exception
class. This will confuse code that uses an unqualified "Exception"
class (e.g. "try: ... except Exception") since it now won't match
the Python builtin Exception. Fix this by explicitly using
the class from the __builtin__ module ("builtins" in Python 3).
2016-01-11 21:43:10 -08:00
William S Fulton
575b4e58e5 Merge branch 'ahnolds-Win64_ptrdiff_t'
* ahnolds-Win64_ptrdiff_t:
  Adding required define at beginning
  Unit tests for ptrdiff_t/size_t max/min in Python
  Python2 build on x64 should no longer fail
  Don't use long long if it isn't available
  Add support for ptrdiff_t and size_t == long long
2016-01-10 17:30:57 +00:00
Alec Cooper
1875ff9002 Adding required define at beginning 2016-01-09 10:41:24 -05:00
İsmail Dönmez
b1f45053bb Fix test failure on PPC{64} where the char is unsigned by default 2016-01-08 12:00:03 +02:00
Alec Cooper
fc8e76544c Unit tests for ptrdiff_t/size_t max/min in Python 2016-01-06 17:45:21 -05:00
Alec Cooper
2f8a7b822d Adding unit tests for Python primitive type conversions
Adding unit tests for operator overloading to determine which overload was chosen
  Allow TypeError when testing overloads since it is generated instead
  of NotImplementedError when swig is run with -O or -fastdispatch
2015-12-23 19:04:27 -05:00
William S Fulton
adc773455d Merge branch 'missing-initializers'
* missing-initializers:
  Tcl fix when using -Wmissing-field-initializers warnings
  Php fix for -Wmissing-field-initializers warning
  Fixes for Octave and missing -Wmissing-field-initializers in swig_octave_member
  Fixes for Ruby and using -Wmissing-field-initializers
  R test case warning fixes
  Use -Wmissing-field-initializers warning testing all languages on Travis
2015-12-19 16:34:38 +00:00
William S Fulton
04539a930d R test case warning fixes 2015-12-19 16:21:22 +00:00
William S Fulton
01611702ec Python 2 Unicode strings can be used as inputs to char * or std::string types
Requires SWIG_PYTHON_2_UNICODE to be defined when compiling generated code.
2015-12-19 03:55:26 +00:00
William S Fulton
b15ad9349e Merge branch 'coleb-python35_dtor_exception_fix'
* coleb-python35_dtor_exception_fix:
  Add test case for Python 3.5 assertion with a pending StopIteration
  Amend python_destructor_exception runtime test
  Call PyErr_WriteUnraisable if a destructor sets a Python exception (-builtin)
  Extended zjturner's changes to encompass all function dispatch and use PyErr_WriteUnraisable to handle exceptions during __del__.
  Python - Save and restore exception state before calling destroy.
2015-12-16 12:58:01 +00:00
William S Fulton
26f52c53f4 Add test case for Python 3.5 assertion with a pending StopIteration
Testcase for issue #559 #560 #573
2015-12-16 12:57:06 +00:00
William S Fulton
dd73d81933 Amend python_destructor_exception runtime test
Suppress the message that PyErr_WriteUnraisable writes to stderr,
but check that it is called by checking some of the expected message contents.
The output varies slightly for different versions of Python and -builtin
2015-12-16 12:57:05 +00:00
Brian Cole
a863e98874 Extended zjturner's changes to encompass all function dispatch and use PyErr_WriteUnraisable to handle exceptions during __del__.
Also added test cases for the unnamed temporary destruction that is throwing assertions in Python 3.5.
2015-12-15 08:39:55 -07:00
William S Fulton
6b4e57245d Fix STL wrappers to not generate <: digraphs.
For example std::vector<::X::Y> was sometimes generated, now
corrected to std::vector< ::X::Y >.
2015-12-12 14:05:46 +00:00
William S Fulton
3bfffab9f9 Fix boost::array test for Visual Studio
Visual Studio doesn't set __cplusplus correctly when supporting c++11
2015-12-05 09:00:04 +00:00
William S Fulton
80a8a7f0d8 boost::array test fix when using C++11 2015-11-28 18:49:22 +00:00
William S Fulton
93eb7eae0b Limited Python/Ruby support for boost::array
Hack to use the std::array support for boost::array.
Is limited as it currently exposes some 'using' bugs in SWIG.
For example, the type system fails to see that pointers to std::array
and pointers to boost::array are the same.

This approach saves having to maintain separate boost::array support.
The 'using' bug ought to be fixed, otherwise separate boost_array.i
files could be easily made from the std_array.i files.
2015-11-27 19:30:22 +00:00
William S Fulton
bb2523a003 Ruby STL container setting slices fixes
Setting an STL container wrapper slice better matches the way Ruby
arrays work. The behaviour is now the same as Ruby arrays. The only
exception is the default value used when expanding a container
cannot be nil as this is not a valid type/value for C++ container
elements.
2015-11-25 10:13:30 +00:00
William S Fulton
cd33aba427 Ruby STL container ranges and slices fixes.
Access via ranges and slices now behave identically to Ruby arrays.
The fixes are mostly for out of range indices and lengths.
- Zero length slice requests return an empty container instead of nil.
- Slices which request a length greater than the size of the container
  no longer chop off the last element.
- Ranges which used to return nil now return an empty array when the
  the start element is a valid index.
2015-11-25 09:19:13 +00:00
William S Fulton
97b129de6c Add out of bounds Ruby std::vector and std::array access testing
Also fix swig_assert_equal to work with nil as an expected input
2015-11-25 09:19:13 +00:00
William S Fulton
fe09f05beb Ruby STL container negative indexing support improved
Using negative indexes to set values works the same as Ruby arrays, eg

%template(IntVector) std::vector<int>;

iv = IntVector.new([1,2,3,4])
iv[-4] = 9 # => [1,2,3,9]
iv[-5] = 9 # => IndexError
2015-11-25 09:19:13 +00:00
William S Fulton
19c24a4f60 Ruby container testing enhancement - setting slices 2015-11-25 09:19:13 +00:00
William S Fulton
b8feb85f0e Add Ruby std_array.i - std::array wrappers 2015-11-25 09:19:05 +00:00