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
[])
53 CORBA::ORB_init (argc
, argv
);
55 if (parse_args (argc
, argv
) != 0)
58 CORBA::Object_var object
=
59 orb
->string_to_object (ior
);
61 Test::Roundtrip_var roundtrip
=
62 Test::Roundtrip::_narrow (object
.in ());
64 if (CORBA::is_nil (roundtrip
.in ()))
66 ACE_ERROR_RETURN ((LM_ERROR
,
67 "Nil Test::Roundtrip reference <%s>\n",
72 for (int i
= 0; i
< niterations
; ++i
)
74 ACE_hrtime_t start
= ACE_OS::gethrtime ();
75 ACE_hrtime_t retval
= roundtrip
->test_method (start
);
77 if (TAO_debug_level
> 0)
78 ACE_DEBUG ((LM_DEBUG
, "test return value: %Q\n", retval
));
82 ACE_DEBUG ((LM_DEBUG
, "test finished\n"));
87 roundtrip
->shutdown ();
90 catch (const CORBA::Exception
& ex
)
92 ex
._tao_print_exception ("Exception caught:");