[OCaml] Fix director_pass_by_value
Add a directorin typemap for SWIGTYPE. Add director_frob_runme.ml, director_pass_by_value_runme.ml, and director_unroll_runme.ml. This commit fixes most of the director-related warnings in the OCaml test suite. Of the director tests that are currently included in the OCaml test suite, director_basic and director_property are the only ones which give warnings (due to issues with typecheck typemaps).
This commit is contained in:
parent
5a28593818
commit
9942e6a582
5 changed files with 59 additions and 1 deletions
24
Examples/test-suite/ocaml/director_pass_by_value_runme.ml
Normal file
24
Examples/test-suite/ocaml/director_pass_by_value_runme.ml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
open Swig
|
||||
open Director_pass_by_value
|
||||
|
||||
let passByVal = ref [| |]
|
||||
|
||||
let director_pass_by_value_Derived ob meth args =
|
||||
match meth with
|
||||
| "virtualMethod" -> passByVal := Array.append !passByVal [|args|]; C_void
|
||||
| _ -> (invoke ob) meth args
|
||||
|
||||
let d =
|
||||
new_derived_object
|
||||
new_DirectorPassByValueAbstractBase
|
||||
(director_pass_by_value_Derived)
|
||||
'()
|
||||
|
||||
let _ =
|
||||
let caller = new_Caller '() in
|
||||
assert (caller -> call_virtualMethod (d) = C_void);
|
||||
assert (Array.length !passByVal = 1);
|
||||
let a = List.hd (fnhelper (!passByVal.(0))) in
|
||||
assert (a -> getVal () as int = 0x12345678);
|
||||
assert (a -> "~" () = C_void);
|
||||
;;
|
||||
Loading…
Add table
Add a link
Reference in a new issue