[OCaml] Fix member var getters and setters

Add `membervariableHandler()` to the `OCAML` class in ocaml.cxx (it is
partly based on the code in python.cxx and octave.cxx).

In Lib/ocaml/class.swg, wrapped classes/structs were not being added
to `class_master_list`. This is fixed by adding a call to
`register_class_byname`.

Add a unit test in the form of struct_value_runme.ml.
This commit is contained in:
Zackery Spytz 2019-01-06 09:40:25 -07:00
commit 4a912668fc
4 changed files with 40 additions and 19 deletions

View file

@ -0,0 +1,11 @@
open Swig
open Struct_value
let b = new_Bar (C_void)
let a = (invoke b) "[a]" (C_void)
let _ = (invoke a) "[x]" (C_int 3)
let _ = assert((invoke a) "[x]" (C_void) = C_int 3)
let bb = (invoke b) "[b]" (C_void)
let _ = (invoke bb) "[x]" (C_int 3)
let _ = assert((invoke bb) "[x]" (C_void) = C_int 3)