Merge branch 'master' into doxygen

Merge 3.0.12 release changes from master.
This commit is contained in:
Vadim Zeitlin 2017-02-01 02:21:35 +01:00
commit 294ab27b90
254 changed files with 4158 additions and 2457 deletions

View file

@ -227,6 +227,7 @@ CPP_TEST_CASES += \
extend_placement \
extend_special_variables \
extend_template \
extend_template_method \
extend_template_ns \
extend_typedef_class \
extern_c \
@ -335,6 +336,7 @@ CPP_TEST_CASES += \
preproc_constants \
primitive_ref \
private_assign \
proxycode \
protected_rename \
pure_virtual \
redefined \
@ -408,6 +410,7 @@ CPP_TEST_CASES += \
template_default_arg_overloaded \
template_default_arg_overloaded_extend \
template_default_arg_virtual_destructor \
template_default_cache \
template_default_class_parms \
template_default_class_parms_typedef \
template_default_inherit \

View file

@ -0,0 +1,33 @@
using System;
using proxycodeNamespace;
public class proxycode_runme {
public static void Main() {
if (new Proxy1().proxycode1(100) != 101)
throw new Exception("Fail");
if (new Proxy2().proxycode2a(100) != 102)
throw new Exception("Fail");
if (new Proxy2().proxycode2b(100) != 102)
throw new Exception("Fail");
if (new Proxy3().proxycode3(100) != 103)
throw new Exception("Fail");
if (new Proxy4().proxycode4(100) != 104)
throw new Exception("Fail");
if (new Proxy4.Proxy4Nested().proxycode4nested(100) != 144)
throw new Exception("Fail");
if (new Proxy5a().proxycode5((short)100) != (short)100)
throw new Exception("Fail");
if (new Proxy5b().proxycode5(100) != 100)
throw new Exception("Fail");
if (new Proxy5b().proxycode5(100, 100) != 255)
throw new Exception("Fail");
uint t1 = 10;
uint t2 = 100;
Proxy6 p = new Proxy6().proxyUseT(t1, t2);
p.useT(t1, t2);
}
}

View file

@ -0,0 +1,41 @@
module proxycode_runme;
import std.exception;
import proxycode.Proxy1;
import proxycode.Proxy2;
import proxycode.Proxy3;
import proxycode.Proxy4;
import proxycode.Proxy5a;
import proxycode.Proxy5b;
import proxycode.Proxy6;
void main() {
if (new Proxy1().proxycode1(100) != 101)
throw new Exception("Fail");
if (new Proxy1().proxycode1(100) != 101)
throw new Exception("Fail");
if (new Proxy2().proxycode2a(100) != 102)
throw new Exception("Fail");
if (new Proxy2().proxycode2b(100) != 102)
throw new Exception("Fail");
if (new Proxy3().proxycode3(100) != 103)
throw new Exception("Fail");
if (new Proxy4().proxycode4(100) != 104)
throw new Exception("Fail");
// if (new Proxy4.Proxy4Nested().proxycode4nested(100) != 144)
// throw new Exception("Fail");
if (new Proxy5a().proxycode5(100) != 100)
throw new Exception("Fail");
if (new Proxy5b().proxycode5(100) != 100)
throw new Exception("Fail");
if (new Proxy5b().proxycode5(100, 100) != 255)
throw new Exception("Fail");
uint t1 = 10;
uint t2 = 100;
Proxy6 p = new Proxy6().proxyUseT(t1, t2);
p.useT(t1, t2);
}

View file

@ -0,0 +1,80 @@
%module xxx
%namewarn("314:'key1' is a keyword, renaming to '_key1'", rename="_%s") "key1";
%namewarn("314:'key2' is a keyword, renaming to '_key2'", rename="_%s") "key2";
%namewarn("314:'key3' is a keyword, renaming to '_key3'", rename="_%s") "key3";
%namewarn("314:'key4' is a keyword, renaming to '_key4'", rename="_%s") "key4";
%namewarn("314:'key5' is a keyword, renaming to '_key5'", rename="_%s") "key5";
// Non-templated
%ignore KlassA::key1;
%rename(key2renamed) KlassA::key2;
%rename(key3renamed) KlassA::key3;
%rename(key4renamed) KlassA::key4;
// Templated
%ignore KlassB::key1;
%rename(key2renamed) KlassB::key2;
%rename(key3renamed) KlassB<double>::key3;
// Template specialized
%ignore KlassC::key1;
%rename(key2renamed) KlassC::key2;
%rename(key3renamed) KlassC<double>::key3;
// No warnings for these...
%inline %{
struct KlassA {
void key1() {}
void key2() {}
void key3() {}
template<typename X> void key4(X x) {}
};
template<class T> struct KlassB {
void key1() {}
void key2() {}
void key3() {}
};
template<class T> struct KlassC {};
template<> struct KlassC<double> {
void key1() {}
void key2() {}
void key3() {}
};
template<typename T> void key5(T t) {}
%}
%template(KlassBDouble) KlassB<double>;
%template(KlassCInt) KlassC<double>;
%template(key5renamed) key5<double>;
// These should create a single warning for each keyword...
%inline %{
struct ClassA {
void key1() {}
void key2() {}
void key3() {}
template<typename X> void key4(X x) {}
};
template<class T> struct ClassB {
void key1() {}
void key2() {}
void key3() {}
};
template<class T> struct ClassC {};
template<> struct ClassC<double> {
void key1() {}
void key2() {}
void key3() {}
};
%}
%template(ClassBDouble) ClassB<double>;
%template(ClassCInt) ClassC<double>;
%template(key5) key5<int>;

View file

@ -0,0 +1,10 @@
cpp_namewarn.i:58: Warning 314: 'key1' is a keyword, renaming to '_key1'
cpp_namewarn.i:59: Warning 314: 'key2' is a keyword, renaming to '_key2'
cpp_namewarn.i:60: Warning 314: 'key3' is a keyword, renaming to '_key3'
cpp_namewarn.i:65: Warning 314: 'key1' is a keyword, renaming to '_key1'
cpp_namewarn.i:66: Warning 314: 'key2' is a keyword, renaming to '_key2'
cpp_namewarn.i:67: Warning 314: 'key3' is a keyword, renaming to '_key3'
cpp_namewarn.i:72: Warning 314: 'key1' is a keyword, renaming to '_key1'
cpp_namewarn.i:73: Warning 314: 'key2' is a keyword, renaming to '_key2'
cpp_namewarn.i:74: Warning 314: 'key3' is a keyword, renaming to '_key3'
cpp_namewarn.i:80: Warning 314: 'key5' is a keyword, renaming to '_key5'

View file

@ -1,13 +0,0 @@
%module cpp_using_type_aliasing
namespace Space {
template<typename T> struct Okay {
};
struct User {
protected:
using OkayInt = Okay<int>;
};
struct Derived : User {
Okay<OkayInt> ff();
};
};

View file

@ -23,7 +23,17 @@
user's throw declarations.
*/
#if defined(SWIGUTL)
#if defined(SWIGOCTAVE)
%exception {
try {
$action
}
SWIG_RETHROW_OCTAVE_EXCEPTIONS
catch(...) {
SWIG_exception(SWIG_RuntimeError,"postcatch unknown");
}
}
#elif defined(SWIGUTL)
%exception {
try {
$action

View file

@ -0,0 +1,92 @@
%module extend_template_method
%include <std_string.i>
%inline %{
namespace Space {
class ExtendMe {
public:
ExtendMe() {}
template <typename T>
T do_stuff_impl(int a, T b, double d) {
return b;
}
};
}
%}
%extend Space::ExtendMe {
template<typename T>
T do_stuff(int a, T b) {
return $self->do_stuff_impl(a, b, 4.0);
}
template<typename T>
T do_overloaded_stuff(T b) {
return $self->do_stuff_impl(0, b, 4.0);
}
template<typename T>
static T static_method(T t) {
return t;
}
template<typename T>
ExtendMe(T x) {
Space::ExtendMe *em = new Space::ExtendMe();
return em;
}
}
%template(do_stuff_double) Space::ExtendMe::do_stuff<double>;
%template(do_stuff_string) Space::ExtendMe::do_stuff<std::string>;
%template(do_overloaded_stuff) Space::ExtendMe::do_overloaded_stuff<std::string>;
%template(do_overloaded_stuff) Space::ExtendMe::do_overloaded_stuff<double>;
%template(static_method) Space::ExtendMe::static_method<int>;
%template(ExtendMe) Space::ExtendMe::ExtendMe<int>;
%inline %{
namespace Space {
template<typename X>
class TemplateExtendMe {
public:
TemplateExtendMe() {}
template <typename T>
T template_stuff_impl(X a, T b, double d) {
return b;
}
};
}
%}
%extend Space::TemplateExtendMe {
template<typename T>
T do_template_stuff(int a, T b) {
return $self->template_stuff_impl(a, b, 4.0);
}
template<typename T>
T do_template_overloaded_stuff(T b) {
return $self->template_stuff_impl(0, b, 4.0);
}
template<typename T>
static T static_template_method(T t) {
return t;
}
template<typename T>
TemplateExtendMe(T x) {
Space::TemplateExtendMe<X> *em = new Space::TemplateExtendMe<X>();
return em;
}
%template(do_template_stuff_double) do_template_stuff<double>;
%template(do_template_stuff_string) do_template_stuff<std::string>;
%template(do_template_overloaded_stuff) do_template_overloaded_stuff<std::string>;
%template(do_template_overloaded_stuff) do_template_overloaded_stuff<double>;
%template(static_template_method) static_template_method<int>;
%template(TemplateExtendMe) Space::TemplateExtendMe::TemplateExtendMe<int>;
}
%template(TemplateExtend) Space::TemplateExtendMe<int>;

View file

@ -5,7 +5,12 @@
%warnfilter(SWIGWARN_LANG_IDENTIFIER);
#if defined(SWIGOCTAVE)
%warnfilter(SWIGWARN_IGNORE_OPERATOR_LSHIFT_MSG) operator<<;
%warnfilter(SWIGWARN_IGNORE_OPERATOR_RSHIFT_MSG) operator>>;
#endif
%inline
{

View file

@ -1,5 +1,10 @@
%module friends_template
#if defined(SWIGOCTAVE)
%warnfilter(SWIGWARN_IGNORE_OPERATOR_RSHIFT_MSG) operator>>;
#endif
%{
template <typename Type> class MyClass;

View file

@ -0,0 +1,20 @@
;; tests support for native guile pointers
;; https://www.gnu.org/software/guile/manual/html_node/Void-Pointers-and-Byte-Access.html
(dynamic-call "scm_init_argout_module" (dynamic-link "./libargout"))
(define initial-value 42)
(define some-s32-data (s32vector initial-value))
;; if we're running guile 1.8, then bytevector->pointer won't exist and this
;; test is useless
(if (>= (string->number (major-version)) 2)
(begin
(use-modules (srfi srfi-4) (system foreign))
(if (not (= (incp (bytevector->pointer some-s32-data)) initial-value))
(error "Didn't read s32 data" initial-value some-s32-data))
(if (not (= (s32vector-ref some-s32-data 0) (+ initial-value 1)))
(error "Failed to increment s32 data" some-s32-data))))
(exit 0)

View file

@ -18,4 +18,12 @@ class A {
virtual MemberEnum member_virtual_test(MemberEnum e) { return e; }
virtual GlobalEnum global_virtual_test(GlobalEnum e) { return global_test(e); }
};
/* This class overrides nothing. Inherited classes should see base functions.
*/
class A_Intermediate : public A {
public:
A_Intermediate(){}
~A_Intermediate(){}
};
#endif

View file

@ -1,6 +1,6 @@
#include "imports_a.h"
class B : public A
class B : public A_Intermediate
{
public:
B() {};

View file

@ -0,0 +1,2 @@
// %inserted code %header from file
int inserted_header4(int i) { return inserted_header3(i); }

View file

@ -27,9 +27,11 @@ int inserted_header2(int i) { return inserted_header1(i); }
int inserted_header3(int i) { return inserted_header2(i); }
%}
%header "insert_directive.h"
%wrapper %{
// %inserted code %wrapper
int inserted_wrapper(int i) { return inserted_header3(i); }
int inserted_wrapper(int i) { return inserted_header4(i); }
%}
%init %{

View file

@ -31,6 +31,7 @@ CPP_TEST_CASES = \
java_director_exception_feature \
java_director_exception_feature_nspace \
java_director_ptrclass \
java_director_typemaps \
java_enums \
java_jnitypes \
java_lib_arrays_dimensionless \

View file

@ -0,0 +1,63 @@
import extend_template_method.*;
public class extend_template_method_runme {
static {
try {
System.loadLibrary("extend_template_method");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
System.exit(1);
}
}
public static void main(String argv[]) {
{
ExtendMe em = new ExtendMe();
{
double ret_double = em.do_stuff_double(1, 1.1);
if (ret_double != 1.1)
throw new RuntimeException("double failed " + ret_double);
String ret_string = em.do_stuff_string(1, "hello there");
if (!ret_string.equals("hello there"))
throw new RuntimeException("string failed " + ret_string);
}
{
double ret_double = em.do_overloaded_stuff(1.1);
if (ret_double != 1.1)
throw new RuntimeException("double failed " + ret_double);
String ret_string = em.do_overloaded_stuff("hello there");
if (!ret_string.equals("hello there"))
throw new RuntimeException("string failed " + ret_string);
}
if (ExtendMe.static_method(123) != 123)
throw new RuntimeException("static_method failed");
ExtendMe em2 = new ExtendMe(123);
}
{
TemplateExtend em = new TemplateExtend();
{
double ret_double = em.do_template_stuff_double(1, 1.1);
if (ret_double != 1.1)
throw new RuntimeException("double failed " + ret_double);
String ret_string = em.do_template_stuff_string(1, "hello there");
if (!ret_string.equals("hello there"))
throw new RuntimeException("string failed " + ret_string);
}
{
double ret_double = em.do_template_overloaded_stuff(1.1);
if (ret_double != 1.1)
throw new RuntimeException("double failed " + ret_double);
String ret_string = em.do_template_overloaded_stuff("hello there");
if (!ret_string.equals("hello there"))
throw new RuntimeException("string failed " + ret_string);
}
if (TemplateExtend.static_template_method(123) != 123)
throw new RuntimeException("static_template_method failed");
TemplateExtend em2 = new TemplateExtend(123);
}
}
}

View file

@ -0,0 +1,151 @@
// tests for java/typemaps.i used for directors
import java_director_typemaps.*;
import java.math.BigInteger;
public class java_director_typemaps_runme {
static {
try {
System.loadLibrary("java_director_typemaps");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
System.exit(1);
}
}
public static void main(String argv[]) {
Quux quux = new java_director_typemaps_MyQuux();
quux.etest();
}
}
class java_director_typemaps_MyQuux extends Quux {
public java_director_typemaps_MyQuux() {
super();
}
public void director_method_bool_output(
boolean[] bool_arg,
byte[] signed_char_arg,
short[] unsigned_char_arg,
short[] short_arg,
int[] unsigned_short_arg,
int[] int_arg,
long[] unsigned_int_arg,
int[] long_arg,
long[] unsigned_long_arg,
long[] long_long_arg,
// BigInteger[] unsigned_long_long_arg,
float[] float_arg,
double[] double_arg)
{
bool_arg[0] = true;
signed_char_arg[0] = 1;
unsigned_char_arg[0] = 2;
short_arg[0] = 3;
unsigned_short_arg[0] = 4;
int_arg[0] = 5;
unsigned_int_arg[0] = 6;
long_arg[0] = 7;
unsigned_long_arg[0] = 8;
long_long_arg[0] = 9;
// unsigned_long_long_arg[0] = 10;
float_arg[0] = 11;
double_arg[0] = 12;
}
public void director_method_bool_inout(
boolean[] bool_arg,
byte[] signed_char_arg,
short[] unsigned_char_arg,
short[] short_arg,
int[] unsigned_short_arg,
int[] int_arg,
long[] unsigned_int_arg,
int[] long_arg,
long[] unsigned_long_arg,
long[] long_long_arg,
// BigInteger[] unsigned_long_long_arg,
float[] float_arg,
double[] double_arg)
{
if (bool_arg[0]) throw new RuntimeException("unexpected value for bool_arg");
if (signed_char_arg[0] != 101) throw new RuntimeException("unexpected value for signed_char_arg");
if (unsigned_char_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_char_arg");
if (short_arg[0] != 101) throw new RuntimeException("unexpected value for short_arg");
if (unsigned_short_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_short_arg");
if (int_arg[0] != 101) throw new RuntimeException("unexpected value for int_arg");
if (unsigned_int_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_int_arg");
if (long_arg[0] != 101) throw new RuntimeException("unexpected value for long_arg");
if (unsigned_long_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_long_arg");
if (long_long_arg[0] != 101) throw new RuntimeException("unexpected value for long_long_arg");
// if (unsigned_long_long_arg[0] != 101) throw new RuntimeException("unexpected value for unsigned_long_long_arg");
if (float_arg[0] != 101) throw new RuntimeException("unexpected value for float_arg");
if (double_arg[0] != 101) throw new RuntimeException("unexpected value for double_arg");
bool_arg[0] = false;
signed_char_arg[0] = 11;
unsigned_char_arg[0] = 12;
short_arg[0] = 13;
unsigned_short_arg[0] = 14;
int_arg[0] = 15;
unsigned_int_arg[0] = 16;
long_arg[0] = 17;
unsigned_long_arg[0] = 18;
long_long_arg[0] = 19;
// unsigned_long_long_arg[0] = 110;
float_arg[0] = 111;
double_arg[0] = 112;
}
public void director_method_bool_nameless_args(
boolean[] bool_arg,
byte[] signed_char_arg,
short[] unsigned_char_arg,
short[] short_arg,
int[] unsigned_short_arg,
int[] int_arg,
long[] unsigned_int_arg,
int[] long_arg,
long[] unsigned_long_arg,
long[] long_long_arg,
// BigInteger[] unsigned_long_long_arg,
float[] float_arg,
double[] double_arg)
{
bool_arg[0] = true;
signed_char_arg[0] = 12;
unsigned_char_arg[0] = 13;
short_arg[0] = 14;
unsigned_short_arg[0] = 15;
int_arg[0] = 16;
unsigned_int_arg[0] = 17;
long_arg[0] = 18;
unsigned_long_arg[0] = 19;
long_long_arg[0] = 20;
// unsigned_long_long_arg[0] = 111;
float_arg[0] = 112;
double_arg[0] = 113;
}
}

View file

@ -0,0 +1,42 @@
import proxycode.*;
public class proxycode_runme {
static {
try {
System.loadLibrary("proxycode");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
System.exit(1);
}
}
public static void main(String argv[]) throws Throwable
{
if (new Proxy1().proxycode1(100) != 101)
throw new RuntimeException("Fail");
if (new Proxy2().proxycode2a(100) != 102)
throw new RuntimeException("Fail");
if (new Proxy2().proxycode2b(100) != 102)
throw new RuntimeException("Fail");
if (new Proxy3().proxycode3(100) != 103)
throw new RuntimeException("Fail");
if (new Proxy4().proxycode4(100) != 104)
throw new RuntimeException("Fail");
if (new Proxy4.Proxy4Nested().proxycode4nested(100) != 144)
throw new RuntimeException("Fail");
if (new Proxy5a().proxycode5((short)100) != (short)100)
throw new RuntimeException("Fail");
if (new Proxy5b().proxycode5(100) != 100)
throw new RuntimeException("Fail");
if (new Proxy5b().proxycode5(100, 100) != 255)
throw new RuntimeException("Fail");
long t1 = 10;
long t2 = 100;
Proxy6 p = new Proxy6().proxyUseT(t1, t2);
p.useT(t1, t2);
}
}

View file

@ -0,0 +1,18 @@
import template_default_cache.*;
public class template_default_cache_runme {
static {
try {
System.loadLibrary("template_default_cache");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
System.exit(1);
}
}
public static void main(String argv[]) {
AModelPtr ap = template_default_cache.get_mp_a();
BModelPtr bp = template_default_cache.get_mp_b();
}
}

View file

@ -0,0 +1,367 @@
%module(directors="1") java_director_typemaps
%feature("director", assumeoverride=1) Quux;
%include <typemaps.i>
%apply bool& OUTPUT {bool&};
%apply signed char& OUTPUT {signed char&};
%apply unsigned char& OUTPUT {unsigned char&};
%apply short& OUTPUT {short&};
%apply unsigned short& OUTPUT {unsigned short&};
%apply int& OUTPUT {int&};
%apply unsigned int& OUTPUT {unsigned int&};
%apply long& OUTPUT {long&};
%apply unsigned long& OUTPUT {unsigned long&};
%apply long long& OUTPUT {long long&};
// %apply unsigned long long& OUTPUT {unsigned long long&};
%apply float& OUTPUT {float&};
%apply double& OUTPUT {double&};
%apply bool& OUTPUT {bool& boolarg_output};
%apply signed char& OUTPUT {signed char& signed_chararg_output};
%apply unsigned char& OUTPUT {unsigned char& unsigned_chararg_output};
%apply short& OUTPUT {short& shortarg_output};
%apply unsigned short& OUTPUT {unsigned short& unsigned_shortarg_output};
%apply int& OUTPUT {int& intarg_output};
%apply unsigned int& OUTPUT {unsigned int& unsigned_intarg_output};
%apply long& OUTPUT {long& longarg_output};
%apply unsigned long& OUTPUT {unsigned long& unsigned_longarg_output};
%apply long long& OUTPUT {long long& long_longarg_output};
// %apply unsigned long long& OUTPUT {unsigned long long& unsigned_long_longarg_output};
%apply float& OUTPUT {float& floatarg_output};
%apply double& OUTPUT {double& doublearg_output};
%apply bool& INOUT {bool& boolarg_inout};
%apply signed char& INOUT {signed char& signed_chararg_inout};
%apply unsigned char& INOUT {unsigned char& unsigned_chararg_inout};
%apply short& INOUT {short& shortarg_inout};
%apply unsigned short& INOUT {unsigned short& unsigned_shortarg_inout};
%apply int& INOUT {int& intarg_inout};
%apply unsigned int& INOUT {unsigned int& unsigned_intarg_inout};
%apply long& INOUT {long& longarg_inout};
%apply unsigned long& INOUT {unsigned long& unsigned_longarg_inout};
%apply long long& INOUT {long long& long_longarg_inout};
// %apply unsigned long long& INOUT {unsigned long long& unsigned_long_longarg_inout};
%apply float& INOUT {float& floatarg_inout};
%apply double& INOUT {double& doublearg_inout};
%{
#include <stdexcept>
#define verify(ok) if (!(ok)) throw std::runtime_error(# ok);
%}
%inline %{
class Quux {
public:
Quux() {}
virtual ~Quux() {}
virtual void director_method_bool_output(
bool& boolarg_output,
signed char& signed_chararg_output,
unsigned char& unsigned_chararg_output,
short& shortarg_output,
unsigned short& unsigned_shortarg_output,
int& intarg_output,
unsigned int& unsigned_intarg_output,
long& longarg_output,
unsigned long& unsigned_longarg_output,
long long& long_longarg_output,
// unsigned long long& unsigned_long_longarg_output,
float& floatarg_output,
double& doublearg_output)
{
boolarg_output = false;
signed_chararg_output = 50;
unsigned_chararg_output = 50;
shortarg_output = 50;
unsigned_shortarg_output = 50;
intarg_output = 50;
unsigned_intarg_output = 50;
longarg_output = 50;
unsigned_longarg_output = 50;
long_longarg_output = 50;
// unsigned_long_longarg_output = 50;
floatarg_output = 50;
doublearg_output = 50;
}
virtual void director_method_bool_inout(
bool& boolarg_inout,
signed char& signed_chararg_inout,
unsigned char& unsigned_chararg_inout,
short& shortarg_inout,
unsigned short& unsigned_shortarg_inout,
int& intarg_inout,
unsigned int& unsigned_intarg_inout,
long& longarg_inout,
unsigned long& unsigned_longarg_inout,
long long& long_longarg_inout,
// unsigned long long& unsigned_long_longarg_inout,
float& floatarg_inout,
double& doublearg_inout)
{
boolarg_inout = false;
signed_chararg_inout = 50;
unsigned_chararg_inout = 50;
shortarg_inout = 50;
unsigned_shortarg_inout = 50;
intarg_inout = 50;
unsigned_intarg_inout = 50;
longarg_inout = 50;
unsigned_longarg_inout = 50;
long_longarg_inout = 50;
// unsigned_long_longarg_inout = 50;
floatarg_inout = 50;
doublearg_inout = 50;
}
virtual void director_method_bool_nameless_args(
bool& ,
signed char& ,
unsigned char& ,
short& ,
unsigned short& ,
int& ,
unsigned int& ,
long& ,
unsigned long& ,
long long& ,
// unsigned long long& ,
float& ,
double&)
{
}
void etest() {
bool boolarg_inout = false;
signed char signed_chararg_inout = 150;
unsigned char unsigned_chararg_inout = 150;
short shortarg_inout = 150;
unsigned short unsigned_shortarg_inout = 150;
int intarg_inout = 150;
unsigned int unsigned_intarg_inout = 150;
long longarg_inout = 150;
unsigned long unsigned_longarg_inout = 150;
long long long_longarg_inout = 150;
// unsigned long long unsigned_long_longarg_inout = 150;
float floatarg_inout = 150;
double doublearg_inout = 150;
director_method_bool_output(
boolarg_inout,
signed_chararg_inout,
unsigned_chararg_inout,
shortarg_inout,
unsigned_shortarg_inout,
intarg_inout,
unsigned_intarg_inout,
longarg_inout,
unsigned_longarg_inout,
long_longarg_inout,
// unsigned_long_longarg_inout,
floatarg_inout,
doublearg_inout);
verify(boolarg_inout == true);
verify(signed_chararg_inout == 1);
verify(unsigned_chararg_inout == 2);
verify(shortarg_inout == 3);
verify(unsigned_shortarg_inout == 4);
verify(intarg_inout == 5);
verify(unsigned_intarg_inout == 6);
verify(longarg_inout == 7);
verify(unsigned_longarg_inout == 8);
verify(long_longarg_inout == 9);
// verify(unsigned_long_longarg_inout == 10);
verify(floatarg_inout == 11);
verify(doublearg_inout == 12);
boolarg_inout = false;
signed_chararg_inout = 101;
unsigned_chararg_inout = 101;
shortarg_inout = 101;
unsigned_shortarg_inout = 101;
intarg_inout = 101;
unsigned_intarg_inout = 101;
longarg_inout = 101;
unsigned_longarg_inout = 101;
long_longarg_inout = 101;
// unsigned_long_longarg_inout = 101;
floatarg_inout = 101;
doublearg_inout = 101;
director_method_bool_inout(
boolarg_inout,
signed_chararg_inout,
unsigned_chararg_inout,
shortarg_inout,
unsigned_shortarg_inout,
intarg_inout,
unsigned_intarg_inout,
longarg_inout,
unsigned_longarg_inout,
long_longarg_inout,
// unsigned_long_longarg_inout,
floatarg_inout,
doublearg_inout);
verify(boolarg_inout == false);
verify(signed_chararg_inout == 11);
verify(unsigned_chararg_inout == 12);
verify(shortarg_inout == 13);
verify(unsigned_shortarg_inout == 14);
verify(intarg_inout == 15);
verify(unsigned_intarg_inout == 16);
verify(longarg_inout == 17);
verify(unsigned_longarg_inout == 18);
verify(long_longarg_inout == 19);
// verify(unsigned_long_longarg_inout == 110);
verify(floatarg_inout == 111);
verify(doublearg_inout == 112);
director_method_bool_nameless_args(
boolarg_inout,
signed_chararg_inout,
unsigned_chararg_inout,
shortarg_inout,
unsigned_shortarg_inout,
intarg_inout,
unsigned_intarg_inout,
longarg_inout,
unsigned_longarg_inout,
long_longarg_inout,
// unsigned_long_longarg_inout,
floatarg_inout,
doublearg_inout);
verify(boolarg_inout == true);
verify(signed_chararg_inout == 12);
verify(unsigned_chararg_inout == 13);
verify(shortarg_inout == 14);
verify(unsigned_shortarg_inout == 15);
verify(intarg_inout == 16);
verify(unsigned_intarg_inout == 17);
verify(longarg_inout == 18);
verify(unsigned_longarg_inout == 19);
verify(long_longarg_inout == 20);
// verify(unsigned_long_longarg_inout == 111);
verify(floatarg_inout == 112);
verify(doublearg_inout == 113);
}
};
%}
%clear bool&;
%clear signed char&;
%clear unsigned char&;
%clear short&;
%clear unsigned short&;
%clear int&;
%clear unsigned int&;
%clear long&;
%clear unsigned long&;
%clear long long&;
// %clear unsigned long long&;
%clear float&;
%clear double&;

View file

@ -6,6 +6,7 @@
%array_functions(int,intArray);
%array_class(double, doubleArray);
%array_class(short, shortArray);
%inline %{
typedef struct {
@ -26,3 +27,13 @@ AB globalABArray[3];
%array_class(XY, XYArray)
%array_functions(AB, ABArray)
%inline %{
short sum_array(short x[5]) {
short sum = 0;
int i;
for (i=0; i<5; i++) {
sum = sum + x[i];
}
return sum;
}
%}

View file

@ -6,6 +6,7 @@
%array_functions(int,intArray);
%array_class(double, doubleArray);
%array_class(short, shortArray);
%inline %{
typedef struct {
@ -26,3 +27,13 @@ AB globalABArray[3];
%array_class(XY, XYArray)
%array_functions(AB, ABArray)
%inline %{
short sum_array(short x[5]) {
short sum = 0;
int i;
for (i=0; i<5; i++) {
sum = sum + x[i];
}
return sum;
}
%}

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
abstract_typedef2
a = A_UF();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
abstract_typedef
e = Engine();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
abstract_virtual

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
arrays_global
arrays_global.cvar.array_i = arrays_global.cvar.array_const_i;

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
class_ignore
a = class_ignore.Bar();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
complextest
a = complex(-1,2);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
constover
p = constover.test("test");

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
constructor_copy
f1 = Foo1(3);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
default_args

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
default_constructor
dc = default_constructor;

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
director_abstract
MyFoo=@() subclass(director_abstract.Foo(),@ping);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
director_classic
TargetLangPerson=@() subclass(Person(),'id',@(self) "TargetLangPerson");

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
director_extend
MyObject=@() subclass(SpObject(),'getFoo',@(self) 123);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
director_stl
MyFoo=@() subclass(director_stl.Foo(),\

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
director_string

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
director_wstring

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
dynamic_cast
f = dynamic_cast.Foo();

View file

@ -1,2 +1,7 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
empty_c

View file

@ -1,2 +1,7 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
empty

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
enum_template
if (enum_template.MakeETest() != 1)

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
exception_order
function check_lasterror(expected)

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
extend_template_ns
f = Foo_One();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
friends
a = friends.A(2);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
global_ns_arg
a = foo(1);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
grouping
x = grouping.test1(42);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
input
f = Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_attribute
aa = li_attribute.A(1,2,3);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
1;
li_boost_shared_ptr;

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_carrays_cpp
d = doubleArray(10);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_carrays
d = doubleArray(10);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_cmalloc
p = malloc_int();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_cpointer

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_cstring

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_cwstring
if (count("ab\0ab\0ab\0", 0) != 3)

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_factory
circle = Geometry_create(Geometry.CIRCLE);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_implicit
b = B();
ai = A(1);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_std_pair_extra
p = {1,2};

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_std_vector_enum
function check(a, b)

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
li_std_wstring
x="h";

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
minherit
a = minherit.Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
mod_a
mod_b

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
multi_import_a;
multi_import_b;

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
naturalvar
f = Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
null_pointer;
assert(func([]));

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
octave_cell_deref;
assert(func("hello"));

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
overload_complicated
pInt = None;

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
overload_extend_c
f = overload_extend_c.Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
overload_extend
f = overload_extend.Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
overload_simple_cast
Ai=@(x) subclass('x',x,'__int',@(self) self.x);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
overload_subtype
f = Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
preproc
if (preproc.cvar.endif != 1)

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
refcount
#
# very innocent example

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
ret_by_value
a = ret_by_value.get_test();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
smart_pointer_extend
f = Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
smart_pointer_overload
f = Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
smart_pointer_rename
f = Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
smart_pointer_simple
f = Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
smart_pointer_typedef
f = Foo();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
sneaky1
x = sneaky1.add(3,4);
y = sneaky1.subtract(3,4);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
static_const_member_2
c = Test_int();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
std_containers

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
struct_value
b = struct_value.Bar();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
swigobject
a = A();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_default_arg

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_extend1
a = template_extend1.lBaz();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_extend2
a = template_extend2.lBaz();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_inherit
a = FooInt();
b = FooDouble();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_matrix
passVector([1,2,3]);
passMatrix({[1,2],[1,2,3]});

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_ns4
d = make_Class_DD();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_opaque
v = template_opaque.OpaqueVectorType(10);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_ref_type
xr = template_ref_type.XC();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_static
Foo_bar_double(1);

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_typedef_cplx4
#

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
template_typedef_cplx2
template_typedef_import

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
typedef_class
a = typedef_class.RealA();

View file

@ -1,3 +1,8 @@
# do not dump Octave core
if exist("crash_dumps_octave_core", "builtin")
crash_dumps_octave_core(0);
endif
typedef_inherit
a = typedef_inherit.Foo();

Some files were not shown because too many files have changed in this diff Show more