From: Jens Thiele Date: Tue, 21 Nov 2006 10:34:03 +0000 (+0000) Subject: transparent exception test X-Git-Tag: v0.2~109 X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=commitdiff_plain;h=70e3d35c116c6483a8c78d2296122f2f90835349 transparent exception test --- diff --git a/example-codegen/Makefile.am b/example-codegen/Makefile.am index dac66dc..a2ddc51 100644 --- a/example-codegen/Makefile.am +++ b/example-codegen/Makefile.am @@ -14,6 +14,7 @@ noinst_PROGRAMS = client server codegen.stamp: server.hxx $(top_builddir)/codegen/codegen cp $(top_srcdir)/codegen/codegen-stubhead.hxx codegen_common.hxx +# todo use tmp file for server.xml gccxml $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) server.hxx -fxml=server.xml $(top_builddir)/codegen/codegen server.xml codegen_ touch codegen.stamp diff --git a/example-codegen/client.cpp b/example-codegen/client.cpp index 10d2e52..f7d94ea 100644 --- a/example-codegen/client.cpp +++ b/example-codegen/client.cpp @@ -14,7 +14,16 @@ int main(int argc, char** argv) libt2n::socket_client_connection sc("./socket"); cmd_group_default_client cc(sc); - return ( ( cc.testfunc("hello") == "hello, testfunc() was here" ) + bool throwok=false; + try + { + cc.testfunc("throw"); + }catch(libt2n::t2n_runtime_error &e){ + throwok=(std::string(e.what())=="throw me around"); + } + + return ( throwok + && ( cc.testfunc("hello") == "hello, testfunc() was here" ) && ( cc.testfunc_ref("hello") == "hello, testfunc() was here" ) && ( cc.t2(10) == 10 ) && ( cc.t3(10, 20, "hello", std::pair(10,20)) ) )