Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / tests / CallbackTest / Service.cpp
blob4d8f0922237e04afff5cc51118efd46c948ec90d
1 #include "Service.h"
3 Service::Service (CORBA::ORB_ptr orb)
4 : test_count_ (0),
5 orb_ (CORBA::ORB::_duplicate (orb))
9 void
10 Service::dump_results ()
12 if (this->test_count_ == 0)
14 ACE_DEBUG ((LM_DEBUG,
15 "ERROR: no tests were completed!\n"));
19 void
20 Service::run_test (Test::Callback_ptr callback)
22 int exceptions =
23 this->call_are_you_there (callback);
25 exceptions +=
26 this->call_test_oneway (callback);
28 if (exceptions != 0)
30 ACE_ERROR ((LM_ERROR,
31 "ERROR: There were %d exceptions\n"));
34 /// Increment the number of tests completed
35 this->test_count_++;
37 try
39 callback->shutdown ();
41 catch (const CORBA::Exception&)
43 ACE_DEBUG ((LM_ERROR, "(%P|%t) - Service, client shutdown FAILED\n"));
46 // shutdown ourselves
47 this->orb_->shutdown (false);
51 int
52 Service::call_are_you_there (Test::Callback_ptr callback)
54 ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Service, calling are_you_there\n"));
55 const int iterations = 10;
57 int exception_count = 0;
58 for (int i = 0; i != iterations; ++i)
60 CORBA::String_var outstr;
61 CORBA::String_out out_str (outstr.out ());
62 try
64 (void) callback->are_you_there (out_str);
66 catch (const CORBA::Exception&)
68 exception_count++;
71 ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Service, answer = %C\n", outstr.in ()));
73 return exception_count;
76 int
77 Service::call_test_oneway (Test::Callback_ptr callback)
79 ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Service, calling test_oneway\n"));
80 const int iterations = 10;
82 int exception_count = 0;
83 for (int i = 0; i != iterations; ++i)
85 try
87 (void) callback->test_oneway ();
89 catch (const CORBA::Exception&)
91 exception_count++;
94 return exception_count;