commit changes to build
[libt2n] / example-codegen / client.cpp
index 10d2e52..008d9e1 100644 (file)
 int main(int argc, char** argv)
 {
   libt2n::socket_client_connection sc("./socket");
+  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" )
+  bool throwok=false;
+  try
+  {
+      cc.testfunc("throw");
+  }catch(libt2n::t2n_runtime_error &e){
+      throwok=(std::string(e.what())=="throw me around");
+  }
+
+  Foo foo={10,10};
+  
+  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<int, float>(10,20)) ) )
+          && ( cc_other.t3(10, 20, "hello", std::pair<int, float>(10,20)) )
+          && ( cc_other.t3(10) == 10 ) 
+          && ( cc_other.t3(std::vector<int>(1,10)) ) 
+          && ( cc_other.t3(foo) ) )
     ? EXIT_SUCCESS : EXIT_FAILURE;
 }