X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=example-codegen%2Fclient.cpp;h=260a60cb840c289d7f47291d64690bc6e6a5a09b;hp=f3f11763238754f22872a0ea7156dfff7ac3f6a1;hb=472456caf92ef55f7ab344e8b0087d64c8701e23;hpb=86c1c2e9dcdced7022bc2b979a4b580946802410 diff --git a/example-codegen/client.cpp b/example-codegen/client.cpp index f3f1176..260a60c 100644 --- a/example-codegen/client.cpp +++ b/example-codegen/client.cpp @@ -12,7 +12,23 @@ int main(int argc, char** argv) { libt2n::socket_client_connection sc("./socket"); - cmd_group_example_client cc(sc); + libt2n::socket_client_connection sc_other("./socket_other"); + cmd_group_default_client cc(sc); + cmd_group_other_client cc_other(sc_other); - return (cc.testfunc("hello")=="hello, testfunc() was here") ? EXIT_SUCCESS : EXIT_FAILURE; + 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_other.t3(10, 20, "hello", std::pair(10,20)) ) + && ( cc_other.t3(10) == 10 ) ) + ? EXIT_SUCCESS : EXIT_FAILURE; }