[OCaml] Fix the wrapmacro test

Add a typecheck typemap for size_t and const size_t &.

Add the const qualifier to the typemaps for primitive reference
types.

Add multiple runtime tests.
This commit is contained in:
Zackery Spytz 2019-02-17 01:41:59 -07:00
commit 10d62aecd5
10 changed files with 58 additions and 10 deletions

View file

@ -0,0 +1,10 @@
open Swig
open Wrapmacro
let _ =
let args = C_list [ C_int64 2L ; C_int64 1L ] in
assert (_maximum '(args) as int = 2);
let args = C_list [ C_double (2. /. 7.) ; C_double 256. ] in
assert (_maximum '(args) as float = 256.);
assert (_GUINT16_SWAP_LE_BE_CONSTANT '(0x1234) as int = 0x3412);
;;