Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / ImplRepo / link_poas / client.cpp
blob6e9548a87778a5d0891a9cea798f359088f333ef
1 #include "TestC.h"
2 #include <iostream>
3 #include "ace/Get_Opt.h"
4 #include "ace/OS_NS_unistd.h"
6 char target = ' ';
8 int
9 parse_args (int argc, ACE_TCHAR *argv[])
11 ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("abc"));
12 int c;
14 while ((c = get_opts ()) != -1)
15 switch (c)
17 case 'a':
18 case 'b':
19 case 'c':
20 target = c;
21 break;
22 default:
23 ACE_ERROR_RETURN ((LM_ERROR,
24 "usage: %s [-a|-b|-c]\n '%s' unknown"
25 "\n",
26 argv [0], argv[1]),
27 -1);
30 return target != ' ' ? 0 : -1;
33 int
34 ACE_TMAIN (int argc, ACE_TCHAR *argv[])
36 try {
37 // Initialize orb
38 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
40 if (parse_args (argc, argv) != 0)
41 return 1;
43 ACE_CString ior ("file://TestObject_");
44 ior += target;
45 ior += ".ior";
46 ACE_DEBUG ((LM_DEBUG, "using target = %c, iorstr %s\n", target, ior.c_str()));
47 CORBA::Object_var obj = orb->string_to_object (ior.c_str());
48 Test_var test = Test::_narrow( obj.in());
49 ACE_ASSERT (!CORBA::is_nil(test.in()));
51 CORBA::Long spid = test->server_pid ();
52 ACE_DEBUG ((LM_DEBUG, "client target %c got pid %d\n", target, spid));
54 orb->destroy ();
56 return 0;
58 catch(const CORBA::Exception& ex) {
59 ex._tao_print_exception ("client:");
62 return -1;