diff options
Diffstat (limited to 'TAO/tests/POA/Bug_1592_Regression/client.cpp')
-rw-r--r-- | TAO/tests/POA/Bug_1592_Regression/client.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/TAO/tests/POA/Bug_1592_Regression/client.cpp b/TAO/tests/POA/Bug_1592_Regression/client.cpp new file mode 100644 index 00000000000..76e7f34222f --- /dev/null +++ b/TAO/tests/POA/Bug_1592_Regression/client.cpp @@ -0,0 +1,77 @@ +#include "ace/Get_Opt.h" + +#include "testC.h" + + +ACE_RCSID (ServantLocator, + client, + "$Id$") + + +const char * ior = 0; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.opt_arg (); + break; + + default: + ACE_ERROR_RETURN ((LM_ERROR, + "Usage: %s " + "-k IOR\n", + argv[0]), + -1); + } + + return 0; +} + +int +main (int argc, char *argv[]) +{ + int status = 0; + + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, + "Client ORB"); + + if (::parse_args (argc, argv) != 0) + return -1; + + // Start out with the first IOR. Interaction with the second + // IOR occurs during the various interceptions executed during + // this test. + CORBA::Object_var object = orb->string_to_object (ior); + + test_var server = test::_narrow (object.in ()); + + if (CORBA::is_nil (server.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Object reference <%s> is nil\n", + ior), + 1); + } + + server->op (); + + server->shutdown (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Caught exception:"); + return -1; + } + + return status; +} |