[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:
Zackery Spytz 2019-02-09 22:04:46 -07:00
commit b2d93665fe
8 changed files with 130 additions and 29 deletions

View file

@ -0,0 +1,13 @@
open Swig
open Funcptr_cpp
let _ =
let fp = _ADD_BY_VALUE '() in
assert (_call1 '(fp, 10, 11) as int = 21);
let fp = _ADD_BY_POINTER '() in
assert (_call2 '(fp, 12, 13) as int = 25);
let fp = _ADD_BY_REFERENCE '() in
assert (_call3 '(fp, 14, 15) as int = 29);
let fp = _ADD_BY_VALUE_C '() in
assert (_call1 '(fp, 2, 3) as int = 5);
;;