[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:
parent
0c4491eaae
commit
4a912668fc
4 changed files with 40 additions and 19 deletions
11
Examples/test-suite/ocaml/struct_value_runme.ml
Normal file
11
Examples/test-suite/ocaml/struct_value_runme.ml
Normal 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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue