3 Service::Service (void)
4 : orb_ (CORBA::ORB::_nil ()),
10 Service::dump_results (void)
12 if (this->test_count_
== 0)
15 "ERROR: no tests were completed!\n"));
20 Service::run_test (Test::Crashed_Callback_ptr callback
)
22 int pre_crash_exceptions
=
23 this->call_are_you_there (callback
);
25 pre_crash_exceptions
+=
26 this->call_test_oneway (callback
);
31 "(%P|%t) - Service, calling crash_now_please\n"));
32 callback
->crash_now_please ();
34 catch (const CORBA::Exception
&){}
36 int pos_crash_exceptions
=
37 this->call_test_oneway (callback
);
39 if (pre_crash_exceptions
!= 0)
42 "ERROR: There were %d exceptions before crash\n"));
45 if (pos_crash_exceptions
== 0)
48 "ERROR: There were no exceptions after crash\n"));
53 "Good!! %d exceptions raised after crash\n",
54 pos_crash_exceptions
));
55 orb_
->shutdown (false);
58 /// Increment the number of tests completed
63 Service::call_are_you_there (Test::Crashed_Callback_ptr callback
)
65 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) - Service, calling are_you_there\n"));
66 const int iterations
= 50;
68 int exception_count
= 0;
69 for (int i
= 0; i
!= iterations
; ++i
)
73 (void) callback
->are_you_there ();
75 catch (const CORBA::Exception
&)
80 return exception_count
;
84 Service::call_test_oneway (Test::Crashed_Callback_ptr callback
)
86 ACE_DEBUG ((LM_DEBUG
, "(%P|%t) - Service, calling test_oneway\n"));
87 const int iterations
= 50;
89 int exception_count
= 0;
90 for (int i
= 0; i
!= iterations
; ++i
)
94 (void) callback
->test_oneway ();
96 catch (const CORBA::Exception
&)
101 return exception_count
;