2 #include "ace/Get_Opt.h"
3 #include "ace/High_Res_Timer.h"
6 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
11 parse_args (int argc
, ACE_TCHAR
*argv
[])
13 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("xk:i:"));
16 while ((c
= get_opts ()) != -1)
24 ior
= get_opts
.opt_arg ();
28 niterations
= ACE_OS::atoi (get_opts
.opt_arg ());
33 ACE_ERROR_RETURN ((LM_ERROR
,
37 "-x (disable shutdown) "
42 // Indicates successful parsing of the command line
47 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
52 CORBA::ORB_init (argc
, argv
);
54 if (parse_args (argc
, argv
) != 0)
57 CORBA::Object_var object
=
58 orb
->string_to_object (ior
);
60 Test::Roundtrip_var roundtrip
=
61 Test::Roundtrip::_narrow (object
.in ());
63 if (CORBA::is_nil (roundtrip
.in ()))
65 ACE_ERROR_RETURN ((LM_ERROR
,
66 "Nil Test::Roundtrip reference <%s>\n",
71 for (int i
= 0; i
< niterations
; ++i
)
73 ACE_hrtime_t start
= ACE_OS::gethrtime ();
74 ACE_hrtime_t retval
= roundtrip
->test_method (start
);
76 if (TAO_debug_level
> 0)
77 ACE_DEBUG ((LM_DEBUG
, "test return value: %Q\n", retval
));
81 ACE_DEBUG ((LM_DEBUG
, "test finished\n"));
86 roundtrip
->shutdown ();
89 catch (const CORBA::Exception
& ex
)
91 ex
._tao_print_exception ("Exception caught:");