swig/Examples/test-suite/ocaml/primitive_ref_runme.ml
Zackery Spytz b2d93665fe [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.
2019-02-09 22:04:46 -07:00

20 lines
619 B
OCaml

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);
;;