swig/Examples/test-suite/ocaml/newobject2_runme.ml
Zackery Spytz 4d54d305fc [OCaml] Runtime tests for inctest, li_cpointer_cpp and some others
Add runtime tests for inctest, li_cpointer_cpp, newobject2,
special_variables, special_variable_macros, template_extend1, and
template_extend2.
2019-01-22 22:50:40 -07:00

16 lines
412 B
OCaml

open Swig
open Newobject2
let _ =
assert (_fooCount '() as int = 0);
let foo1 = _makeFoo '() in
assert (_fooCount '() as int = 1);
assert (_do_stuff '(foo1) = C_void);
let foo2 = _makeFoo '() in
assert (_fooCount '() as int = 2);
assert (_do_stuff '(foo2) = C_void);
ignore (foo1 -> "~" ());
assert (_fooCount '() as int = 1);
ignore (foo2 -> "~" ());
assert (_fooCount '() as int = 0)
;;