aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/ocaml/throw_exception_runme.ml
diff options
context:
space:
mode:
authorDave Beazley <dave-swig@dabeaz.com>2002-11-30 22:01:28 +0000
committerDave Beazley <dave-swig@dabeaz.com>2002-11-30 22:01:28 +0000
commit12a43edc2df8853e8e0315f742e57be88f0c4269 (patch)
treee3237f5f8c0a67c9bfa9bb5d6d095a739a49e4b2 /Examples/test-suite/ocaml/throw_exception_runme.ml
parent5fcae5eb66d377e1c3f81da7465c44a62295a72b (diff)
downloadswig-12a43edc2df8853e8e0315f742e57be88f0c4269.tar.gz
The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/ocaml/throw_exception_runme.ml')
-rw-r--r--Examples/test-suite/ocaml/throw_exception_runme.ml27
1 files changed, 27 insertions, 0 deletions
diff --git a/Examples/test-suite/ocaml/throw_exception_runme.ml b/Examples/test-suite/ocaml/throw_exception_runme.ml
new file mode 100644
index 000000000..49ce884c4
--- /dev/null
+++ b/Examples/test-suite/ocaml/throw_exception_runme.ml
@@ -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