[OCaml] Don't use argout typemaps by default for some reference types
The OCaml module's typemaps.i supplied argout typemaps for some reference types (e.g. int &) by default, which was unintuitive and inconsistent when compared with other modules. The argout_ref example depended on this, so add a typemap to argout_ref/example.i. Add multiple runtime tests that deal with references.
This commit is contained in:
parent
940e32477d
commit
b2d93665fe
8 changed files with 130 additions and 29 deletions
20
Examples/test-suite/ocaml/primitive_ref_runme.ml
Normal file
20
Examples/test-suite/ocaml/primitive_ref_runme.ml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
open Swig
|
||||
open Primitive_ref
|
||||
|
||||
let _ =
|
||||
assert (_ref_int '(3) as int = 3);
|
||||
assert (_ref_short '(3) as int = 3);
|
||||
assert (_ref_ushort '(3) as int = 3);
|
||||
assert (_ref_long '(3) as int = 3);
|
||||
assert (_ref_ulong '(3) as int = 3);
|
||||
assert (_ref_schar '(3) as int = 3);
|
||||
assert (_ref_uchar '(3) as int = 3);
|
||||
assert (_ref_float '(3.5) as float = 3.5);
|
||||
assert (_ref_double '(3.5) as float = 3.5);
|
||||
assert (_ref_bool '(true) as bool = true);
|
||||
let arg = C_char 'x' in
|
||||
assert (_ref_char '(arg) as char = 'x');
|
||||
assert (_ref_over '(0) as int = 0);
|
||||
let a = new_A '(12) in
|
||||
assert (_ref_over '(a) as int = 12);
|
||||
;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue