From a851e0a9ac448e21754f16c4e0978535049682da Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Fri, 11 Jan 2019 17:59:23 -0700 Subject: [PATCH] [OCaml] Re-enable the using_protected unit test Use the [member-variable] syntax in using_protected_runme.ml as required by the OCaml module's documentation and implementation. Fix the return type for vec_write() in example.h in the OCaml stl example. --- Examples/ocaml/class/runme.ml | 2 +- Examples/ocaml/stl/example.h | 2 +- Examples/test-suite/ocaml/Makefile.in | 1 - Examples/test-suite/ocaml/using_protected_runme.ml | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Examples/ocaml/class/runme.ml b/Examples/ocaml/class/runme.ml index 37993aee4..5e7b1f26c 100644 --- a/Examples/ocaml/class/runme.ml +++ b/Examples/ocaml/class/runme.ml @@ -41,7 +41,7 @@ let _ = Printf.printf " Square = (%f, %f)\n" (s -> "[x]" () as float) (s -> " let _ = print_endline "\nHere are some properties of the shapes:" -let _ = List.iter (fun o -> +let _ = List.iter (fun o -> Printf.printf " %s\n" (repr o); Printf.printf " area = %f\n" (o -> area () as float); Printf.printf " perimeter = %f\n" (o -> perimeter () as float) diff --git a/Examples/ocaml/stl/example.h b/Examples/ocaml/stl/example.h index df5762bfc..da1d50e22 100644 --- a/Examples/ocaml/stl/example.h +++ b/Examples/ocaml/stl/example.h @@ -8,7 +8,7 @@ using std::string; -double vec_write(std::vector v) { +void vec_write(std::vector v) { int n = 0; for( std::vector::iterator i = v.begin(); i != v.end(); diff --git a/Examples/test-suite/ocaml/Makefile.in b/Examples/test-suite/ocaml/Makefile.in index 661540bc4..5e4960169 100644 --- a/Examples/test-suite/ocaml/Makefile.in +++ b/Examples/test-suite/ocaml/Makefile.in @@ -39,7 +39,6 @@ nested_directors \ preproc_constants \ smart_pointer_inherit \ typedef_mptr \ -using_protected \ FAILING_C_TESTS = \ enums \ diff --git a/Examples/test-suite/ocaml/using_protected_runme.ml b/Examples/test-suite/ocaml/using_protected_runme.ml index 4dc4fe1c9..29647c288 100644 --- a/Examples/test-suite/ocaml/using_protected_runme.ml +++ b/Examples/test-suite/ocaml/using_protected_runme.ml @@ -2,7 +2,7 @@ open Swig open Using_protected let f = new_FooBar C_void -let _ = (invoke f) "x" (C_int 3) +let _ = (invoke f) "[x]" (C_int 3) let _ = if (invoke f) "blah" (C_int 4) <> (C_int 4) then raise (Failure "blah(int)")