Commit graph

5,772 commits

Author SHA1 Message Date
William S Fulton
2212af3f4f rvalue reference outputs
Document rvalue reference outputs behaviour
Test rvalue reference outputs
2022-09-08 08:46:32 +01:00
William S Fulton
4588c41646 Temporarily remove rvalue reference python runtime test
Work in progress: SWIGTYPE && out typemaps need to take ownership
2022-09-03 05:53:54 +01:00
William S Fulton
c6664703f6 std::auto_ptr emulation fix in test case 2022-09-03 05:49:13 +01:00
William S Fulton
4c58bb558f Fix Racket tests using schemerunme directory
For out of source builds
2022-09-02 19:17:38 +01:00
William S Fulton
7934561874 Test/fixes to handle NULL pointer for unique_ptr/auto_ptr
Also add missing unique_ptr tests for Lua and Racket.
2022-08-31 19:42:55 +01:00
William S Fulton
ca9eebcb8d Octave - SWIG now marshalls a C/C++ NULL pointer into the null matrix, []
SWIG has always marshalled the null matrix into a NULL pointer; this remains
and now we have consistency in representing a NULL pointer.

This is a pre-requisite for a pending commit to fully support std::unique_ptr.
2022-08-31 19:40:13 +01:00
William S Fulton
2cfd77b1c0 Racket - NULL pointer handling
SWIG now converts a C/C++ NULL pointer into a null value by calling
scheme_make_null(), so that scheme's null? is true for a NULL C/C++
pointer value.

Consistency with Guile and needed for a pending commit for handling
NULL and std::unique_ptr.
2022-08-31 19:40:13 +01:00
William S Fulton
e139a36511 SWIGTYPE && input typemaps now assume object has been moved
Replicated Java implementation.

Fully implemented for:
- C#
- D
- Guile
- Javascript (UTL)
- Lua
- MzScheme
- Octave (UTL)
- Perl (UTL)
- PHP
- Python (UTL)
- Ruby (UTL)
- Tcl (UTL)

PHP std::auto_ptr std::unique_ptr minor tweaks and testcase corrections
2022-08-31 19:40:14 +01:00
William S Fulton
0634883089 SWIGTYPE && input typemaps now assume object has been moved - Java
Implementation tweak - better RAII.
SWIGTYPE && null pointer check.
2022-08-31 19:40:13 +01:00
William S Fulton
c10a84c775 Cosmetic stray semi-colon removal after %typemap using quotes 2022-08-31 19:40:13 +01:00
William S Fulton
0ba11023ac Rename debug in testcases to trace
To remove D specific keyword rename
2022-08-20 15:09:23 +01:00
William S Fulton
48c644ea6e Add Racket support for std::unique_ptr and std::auto_ptr
Equivalent to Guile implementation.

Slight tweak to proxy ownership was required by adding in
the own member to swig_mz_proxy.
2022-08-18 22:45:03 +01:00
William S Fulton
5365149ae4 Guile testing
- call gc instead of explicitly calling the destructor
- Guile li_std_auto_ptr testcase tweaks intended for use from Racket
2022-08-18 22:45:03 +01:00
William S Fulton
63143e8773 Guile testing - call gc instead of explicitly calling the destructor 2022-08-18 21:42:25 +01:00
William S Fulton
5b16e4fbd3 Guile cpp11_std_unique_ptr testcase tweaks for use from Racket 2022-08-18 21:31:20 +01:00
William S Fulton
c9f5a85e45 Add Racket test for %newobject
Uses common mzscheme test, but corrections for Racket error:

if: bad syntax (must have an "else" expression)
2022-08-17 08:16:47 +01:00
William S Fulton
748bad3db2 Add guile test for %newobject 2022-08-15 19:56:31 +01:00
William S Fulton
23ce0655a6 Add Guile support for std::unique_ptr and std::auto_ptr
Equivalent to Python/Ruby implementations.
2022-08-12 23:50:54 +01:00
William S Fulton
3a0721bfbc Remove inadvertent guile testing of auto_ptr and unique_ptr 2022-08-11 22:12:19 +01:00
William S Fulton
41fddf61ec Add Lua support for std::unique_ptr and std::auto_ptr
Equivalent to Python/Ruby implementations.
2022-08-11 21:38:21 +01:00
William S Fulton
63632f80fb Correct raw pointer handling test for virtual inheritance 2022-08-11 18:44:36 +01:00
William S Fulton
fa9c7a7197 Add PHP support for std::unique_ptr and std::auto_ptr
Equivalent to Python/Ruby implementations.
2022-08-06 18:34:26 +01:00
William S Fulton
d4b1152d4b Add raw pointer handling test for virtual inheritance
This is a test added for D in previous commit, now expanded to all target languages.

Tidy up counting object instances.
2022-08-05 22:30:23 +01:00
William S Fulton
910fd1e3cf [D] Fix occasional undefined behaviour with inheritance hierarchies
Particularly when using virtual inheritance as the pointers weren't
correctly upcast from derived class to base class when stored in the
base's proxy class.

Fixes commented out test code in cpp11_std_unique_ptr_runme
and li_std_auto_ptr_runme D tests.
2022-08-05 22:30:23 +01:00
William S Fulton
5a379d317b Add Tcl support for std::unique_ptr and std::auto_ptr
Equivalent to C#/Java implementations.
2022-08-05 22:30:23 +01:00
Olly Betts
c496bc9d7b cpp20_spaceship_operator_runme.py: Check ALIEN value 2022-08-05 04:53:15 +12:00
William S Fulton
7a3e79cfc6 JSC version display tweaks 2022-08-04 07:14:30 +01:00
William S Fulton
a741c7dbcf auto_ptr and unique_ptr test tweaks 2022-08-04 07:14:30 +01:00
William S Fulton
fe17296eb4 Add Javascript support for std::unique_ptr and std::auto_ptr
Equivalent to Ruby/Python implementations.
2022-08-04 07:14:30 +01:00
Olly Betts
336de2f745 [guile] Stop using deprecated aliases
The replacements should all work with Guile 1.8.0, which is the
oldest version we still aim to support.

Fixes #1624
2022-08-04 10:39:02 +12:00
William S Fulton
2ccc9bd060 Add Octave support for std::unique_ptr and std::auto_ptr
Equivalent to Ruby/Python implementations.
2022-08-02 00:00:54 +01:00
William S Fulton
842ae379aa GHA: Fix for pycodestyle check in examples
E275 missing whitespace after keyword
For pycodestyle 2.9.0 released on 30 July 2022.
2022-07-31 09:02:00 +01:00
William S Fulton
4e234c7604 Suppress Visual C++ deprecated warnings 2022-07-31 01:02:08 +01:00
William S Fulton
ea3570ddb1 -Wvolatile gcc warning fix for C++20 2022-07-31 01:02:08 +01:00
William S Fulton
ffbde7a132 Fixes for deprecated std::basic_string::reserve() 2022-07-31 01:02:08 +01:00
William S Fulton
675c94c575 Add in EXTRA_CFLAGS and EXTRA_CXXFLAGS for more flexible test-suite testing 2022-07-31 01:02:08 +01:00
William S Fulton
eb8346b958 Convert cpp20_spaceship_operator php test to python 2022-07-31 00:58:35 +01:00
William S Fulton
26fbf99901 Add Tcl support for std::unique_ptr and std::auto_ptr
Equivalent to Ruby/Python implementations.
2022-07-30 16:43:05 +01:00
Olly Betts
379d5b6742 Fix warning suppression in cpp20_lambda_template 2022-07-29 16:29:32 +12:00
Olly Betts
64d72483c6 Clean up Tcl version docs and handling
We require 8.4 now which simplifies things a bit.
2022-07-28 14:30:43 +12:00
Olly Betts
346ede21c3 Fix spaceship preproc tests for previous change 2022-07-27 18:17:31 +12:00
Olly Betts
100d4d5350 Only recognise spaceship operator for C++
I don't think any valid C program can contain `<=>` in a tokenisable
context, but it's more helpful to fail with a syntax error at SWIG
parse time and not potentially generate C code trying to use `<=>` in
an expression which then fails at compile time.
2022-07-27 13:46:53 +12:00
Olly Betts
6e931b0399 Revert "Fix handling of array whose size contains <<"
This reverts commit 2227dc9e53.
2022-07-27 13:45:03 +12:00
Olly Betts
2227dc9e53 Fix handling of array whose size contains <<
Fixes https://sourceforge.net/p/swig/bugs/983/
2022-07-27 10:29:33 +12:00
Olly Betts
88f227b5da Add testcase 2022-07-27 09:30:39 +12:00
Olly Betts
02b4bd8eca Fix spaceship operator bugs, document, add tests
Remove some erroneously added brackets_increment() calls.

Reject <=> in preprocessor expressions with a clear error message (it
seems it isn't supported here - clang and gcc don't at least).

The type returned by `<=>` is not `bool`.  We pretend it's
`int` for now, which should work for how it's likely to be used
in constant expressions.

Fixes #1622
2022-07-27 09:12:40 +12:00
Olly Betts
a80e748565 [php] Add missing qualification in test suite helper
This would cause an error due to failing to find the function to
call if certain testcase checks failed.

Bug introduced in eaf311a650
2022-07-27 08:47:53 +12:00
Olly Betts
8c5c14b9ad Merge branch 'cpp-testing'
Closes #2329
2022-07-27 07:55:24 +12:00
Olly Betts
06d375cdab [Tcl] Fix handling of long long on 32-bit platforms
Fixes https://sourceforge.net/p/swig/bugs/977/ reported by Vera and
Kjell Wooding.

Closes #2331
2022-07-27 07:53:45 +12:00
Olly Betts
4f44d0a1ea Attempt to fix cpp11_result_of for MSVC
MSVC fails with:

cpp11_result_of_wrap.cxx(3211): error C2672: 'test_result_impl': no matching overloaded function found
cpp11_result_of_wrap.cxx(3211): error C2893: Failed to specialize function template 'std::result_of<Fun(Arg)>::type test_result_impl(Fun,Arg)'
cpp11_result_of_wrap.cxx(3150): note: see declaration of 'test_result_impl'
cpp11_result_of_wrap.cxx(3211): note: With the following template arguments:
cpp11_result_of_wrap.cxx(3211): note: 'Fun=double (__cdecl *)(double)'
cpp11_result_of_wrap.cxx(3211): note: 'Arg=int'

Try making the second parameter double to match the template.
2022-07-26 15:28:52 +12:00