Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / ImplRepo / oneway / client.cpp
blobe85d56a9b7ea473b77777aa6fa71ca66244ed0a6
1 #include "TestC.h"
2 #include <iostream>
3 #include "ace/Get_Opt.h"
4 #include "ace/OS_NS_unistd.h"
5 #include "tao/Stub.h"
6 #include "tao/Messaging/Messaging.h"
8 char pause_poa = ' ';
9 char resume_poa = ' ';
11 int
12 parse_args (int argc, ACE_TCHAR *argv[])
14 ACE_Get_Opt get_opts (argc, argv, ACE_TEXT(""));
15 int c;
17 while ((c = get_opts ()) != -1)
18 switch (c)
20 case '?':
21 default:
22 ACE_ERROR_RETURN ((LM_ERROR,
23 "usage: %s "
24 "\n",
25 argv [0]),
26 -1);
28 // Indicates successful parsing of the command line
29 return 0;
32 int
33 ACE_TMAIN (int argc, ACE_TCHAR *argv[])
35 try {
36 // Initialize orb
37 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
39 if (parse_args (argc, argv) != 0)
40 return 1;
42 CORBA::Object_var obj = orb->resolve_initial_references("Test");
43 if (CORBA::is_nil(obj.in()))
45 ACE_DEBUG ((LM_DEBUG, "Client could not RIR Test\n"));
46 return 1;
48 Test_var test = Test::_narrow( obj.in());
49 if (CORBA::is_nil(test.in()))
51 ACE_DEBUG ((LM_DEBUG, "Client could not narrow Test\n"));
52 return 1;
55 test->_stubobj()->reset_profiles();
57 test->foo ();
59 CORBA::Any a;
60 a <<= Messaging::SYNC_WITH_SERVER;
62 CORBA::PolicyList policy_list (1);
63 policy_list.length (1);
64 policy_list[0] =
65 orb->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE, a);
67 obj = test->_set_policy_overrides (policy_list, CORBA::ADD_OVERRIDE);
68 test = Test::_narrow ( obj.in());
70 test->_stubobj()->reset_profiles();
72 test->foo ();
74 CORBA::Short n = test->get_call_count();
75 ACE_DEBUG ((LM_DEBUG,
76 "Got call count of %d\n",
77 n));
79 return n != 1;
81 catch(const CORBA::Exception& ex) {
82 ex._tao_print_exception ("client:");
85 return -1;