Commit graph

4,630 commits

Author SHA1 Message Date
William S Fulton
aef25cff0c Add missing default_arg_expressions.i testcase 2018-01-05 18:31:48 +00:00
William S Fulton
ef378407d0 Fix parsing of default argument expressions containing ->. 2018-01-05 07:58:25 +00:00
William S Fulton
cd9b7c3c34 std_basic_string.i fixes
- Remove python code from octave's std_basic_string.i
- Correctly return an error to fix error handling when using std::basic_string in
  overloaded methods - issue #1171.
2018-01-04 07:00:26 +00:00
William S Fulton
3c30dec661 Remove php5 generated files inadvertently checked in 2017-12-31 16:19:39 +00:00
William S Fulton
aff36823df Complete switch from pep8 to pycodestyle for Python testing 2017-12-31 16:19:39 +00:00
William S Fulton
0b0aed6842 Fix pycodestyle 'E722 do not use bare except' 2017-12-31 16:19:39 +00:00
William S Fulton
b0e29fbdf3 Add missing checks for failures in calls to PyUnicode_AsUTF8String.
Previously a seg fault could occur when passing invalid UTF8 strings (low
surrogates), eg passing u"\udcff" to the C layer (Python 3).
2017-12-04 20:14:04 +00:00
William S Fulton
069ce1f6e9 Merge branch 'java-director-exceptions'
* java-director-exceptions:
  Add recent Java director enhancements to the changes file
  Replace DirectorException::raiseJavaException with DirectorException::throwException
  Improve Java director exception customization documentation
  Add Swig::DirectorException directorthrows typemap for Java
  Cosmetic whitespace improvement in generated code from throws typemaps.
  Tidy up director_exception testcase
  Changes to use common DirectorException class
  Improved Java director exceptions documentation
  Java director exception handling improvements
2017-11-29 20:32:40 +00:00
William S Fulton
901f8357b0 Replace DirectorException::raiseJavaException with DirectorException::throwException
This is part of a plan to provide a common DirectorException api for
throwing the target language exception raised during a director method call.
2017-11-29 20:32:15 +00:00
William S Fulton
91080872a8 Tidy up director_exception testcase 2017-11-29 20:32:15 +00:00
William S Fulton
923091da13 Changes to use common DirectorException class
Add director.swg for Go as was completely absent.
This is just the start of a common exception handling approach to directors.
An exception thrown in a Java director method will be propogated back to
Java via a C++ DirectorException.
DirectorException throws typemap for Java is fully working, all other languages need work.
DirectorException throws typemap for Perl added just to fix compilation errors.
Add director_exception_catches test.
2017-11-29 20:31:55 +00:00
Joseph C Wang
4e8c515d36 add new tests and coercion files for null fix #1124 2017-11-26 03:43:39 +08:00
Joseph C Wang
5525abfea8 add support files and regression tests for #1124 2017-11-25 01:37:14 +08:00
William S Fulton
7aa28e37ec Java director exception handling improvements
When a director method throws an exception and it is caught by DirectorException
and passed back to Java using DirectorException::raiseJavaException, the Java
stack trace now contains the original source line that threw the exception.

Director exception handling code improved slightly to add some missing
ExceptionClear calls before calling JNI code.
2017-11-10 19:50:22 +00:00
William S Fulton
dafe2d6949 Add director typemaps for pointer const ref types 2017-10-24 23:47:40 +01:00
William S Fulton
ae044c1c2f Generation of director method declarations fixes
- Fixes generation of director method declarations containing C++11 ref-qualifiers.
- Fixes generation of director method declarations returning more complex types such
  as const ref pointers.
- Rewrite Swig_method_call to use more up to date code in the core.
2017-10-23 18:55:14 +01:00
William S Fulton
280090ed4b Add director shared_ptr typemaps for D 2017-10-17 22:47:16 +01:00
William S Fulton
46ea2ab0a6 Add director shared_ptr typemaps for C# 2017-10-17 21:55:31 +01:00
William S Fulton
3f8b8fe734 Enhancements for directorin typemaps
The directorin typemaps will now generate a temporary variable
(specified after the type), such as:
%typemap(directorin) MyType (MyType *temp) { ... use temp ... }

The shared_ptr director typemaps have been fixed for use in functions
that take more than one parameter.
2017-10-16 19:28:27 +01:00
William S Fulton
e8ebadcded Add director shared_ptr typemaps for Java
Correct testcase to test T*const& rather than T*& typemaps
2017-10-16 18:21:31 +01:00
William S Fulton
6470fe8c36 Director shared_ptr typemaps for scripting languages
Modify the Python and Ruby director shared_ptr typemaps to be language neutral.
Port the director modifications to other scripting languages that
have shared_ptr support - Octave, R and Scilab. Scilab shared_ptr
support is not fully working and needs work though.
2017-10-13 07:34:38 +01:00
William S Fulton
d0615d98a9 Merge branch 'radarsat1-fix-null-shared_ptr-directors'
* radarsat1-fix-null-shared_ptr-directors:
  Remove duplicate director shared_ptr pointer reference typemaps
  For shared_ptr directorin, make copy of shared_ptr in all cases.
  Add directorin typemap for Python and Ruby shared_ptr.
2017-10-11 09:03:01 +01:00
William S Fulton
d72aca991f preproc testcase warning suppression for bad macro test 2017-10-10 19:26:54 +01:00
Joseph C Wang
810fb67e4e disable failing enum tests 2017-10-10 17:48:56 +08:00
William S Fulton
08210236ef Fix newobject3 testcase
Fixes Octave problem which has a template called product.
2017-10-10 08:05:21 +01:00
William S Fulton
d6077129e4 Testcase changes to satisfy pep8 E742 and E743 checks
Closes #1110
2017-10-09 07:27:38 +01:00
Olly Betts
0ca47dd7cc CHANGES.current entry and regression test for previous commit 2017-10-09 11:09:58 +13:00
Olly Betts
5a9422d980 Remove GCJ support
GCC7 dropped GCJ.

Closes https://sourceforge.net/p/swig/bugs/823/
2017-10-09 08:32:01 +13:00
Olly Betts
59ebe27a95 Merge pull request #1111 from ojwb/empty-arglist-macros
Fix handling of macro with empty argument list
2017-10-08 15:34:37 +13:00
Olly Betts
0863eca5e7 Fix constants involved parenthesised char literals
Fixes https://sourceforge.net/p/swig/bugs/1168/
2017-10-08 13:43:02 +13:00
William S Fulton
6981abc440 Travis test gcc-7.2 and c++-17 2017-10-07 23:56:33 +01:00
Olly Betts
5d14a7d910 Add regression testcase 2017-10-08 09:02:29 +13:00
Olly Betts
f85d87a64c Fix bug with macro invocation with empty first arg
The first argument was being dropped in this case.
2017-10-08 09:02:28 +13:00
William S Fulton
dcf8730cf3 Avoid can of worms testing minimum signed int value
Specifying the minimum 32 bit signed int value is not easily portable.
Remove min_32bit_int2 method, min_32bit_int1 provides runtime coverage.

g++ 32bit resulted in:
warning: this decimal constant is unsigned only in ISO C90

and some versions of clang++ resulted in:
error: integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will have type 'long long' in C++11 onwards [-Werror,-Wc++11-compat]
2017-10-07 15:04:19 +01:00
Olly Betts
2c1a5c5919 Add regression test for old fixed SF bug 2017-10-07 15:28:10 +13:00
William S Fulton
4a7976a5d8 Fix platorm inconsistency in Python default argument handling.
32 bit and 64 bit compiled versions of SWIG generated different Python files
when default arguments were outside the range of 32 bit signed integers.
The default arguments specified in Python are now only those that are in the
range of a 32 bit signed integer, otherwise the default is obtained from C/C++ code.

Closes #1108
2017-10-06 21:57:04 +01:00
William S Fulton
ac8331648f Testcase fix for clang 2017-10-05 15:38:51 +01:00
William S Fulton
4f4147a779 Remove unused SWIG_NO_OVERLOAD macro from testcases 2017-10-04 23:49:40 +01:00
William S Fulton
f4644d7c30 Run overload_complicated testcase
Was marked as broken, seems to work now
2017-10-04 20:43:44 +01:00
William S Fulton
bb7db846cc Run virtual_derivation testcase
Should have been added in c92d8c7cf7
2017-10-04 08:51:16 +01:00
William S Fulton
1a0ce21547 Run typemap_template_typedef testcase
Should have been added in aa2932f409
2017-10-04 08:16:10 +01:00
William S Fulton
7c1b60f340 Run python_threads testcase
Should have been added in f4a2470325
2017-10-04 08:05:14 +01:00
William S Fulton
5f9376bae4 Run default_args_c testcase
Should have been added in ddd1b38fa2
2017-10-04 07:11:02 +01:00
William S Fulton
a55981b883 Fix C# std::complex pass by value typemaps 2017-10-02 19:07:24 +01:00
William S Fulton
e01cfd70c7 Add missing declaration for std::complex
Fixes missing type information for std::complex in scripting languages.
Closes #732.

Update Javascript and Octave complextest, although they don't actually
get run as they don't work
2017-10-02 19:07:24 +01:00
William S Fulton
8ee11ad71a Add missing test - template_class_reuse_name 2017-09-29 23:30:27 +01:00
William S Fulton
e27a606335 Allow an instantiated template to have the same name as the C++ template name
For example, this is now possible:
  template<typename T> struct X { ... };
  %template(X) X<int>;
Closes #1100.
2017-09-29 23:28:04 +01:00
Stephen Sinclair
bda750ee15 Add directorin typemap for Python and Ruby shared_ptr. 2017-09-27 11:22:30 -03:00
William S Fulton
8080ed1bb1 Add std::shared_ptr testcases to Octave 2017-09-25 08:40:31 +01:00
William S Fulton
ed4b84f4d3 Fix overloading of shared_ptr method overloading
Add 'equivalent' attribute to typecheck typemap.
Closes #1098.
2017-09-23 15:19:34 +01:00