The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5fcae5eb66
commit
12a43edc2d
1508 changed files with 125983 additions and 44037 deletions
27
Examples/test-suite/ocaml/throw_exception_runme.ml
Normal file
27
Examples/test-suite/ocaml/throw_exception_runme.ml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
(* Throw exception test *)
|
||||
|
||||
open Throw_exception
|
||||
|
||||
let x = new_Foo C_void ;;
|
||||
let _ =
|
||||
try
|
||||
(invoke x) "test_int" C_void
|
||||
with (Failure "Exception(37): Thrown exception from C++ (int)\n") ->
|
||||
try
|
||||
(invoke x) "test_msg" C_void
|
||||
with (Failure "Exception(0): Dead\n") ->
|
||||
try
|
||||
(invoke x) "test_cls" C_void
|
||||
with (Failure "Exception(0): Thrown exception from C++ (unknown)\n") ->
|
||||
try
|
||||
(invoke x) "test_multi" (C_int 1)
|
||||
with (Failure "Exception(37): Thrown exception from C++ (int)\n") ->
|
||||
try
|
||||
(invoke x) "test_multi" (C_int 2)
|
||||
with (Failure "Exception(0): Dead\n") ->
|
||||
try
|
||||
(invoke x) "test_multi" (C_int 3)
|
||||
with (Failure "Exception(0): Thrown exception from C++ (unknown)\n") ->
|
||||
exit 0
|
||||
|
||||
let _ = exit 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue