本文整理汇总了C++中Simple_Server_var::test_val方法的典型用法代码示例。如果您正苦于以下问题:C++ Simple_Server_var::test_val方法的具体用法?C++ Simple_Server_var::test_val怎么用?C++ Simple_Server_var::test_val使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simple_Server_var
的用法示例。
在下文中一共展示了Simple_Server_var::test_val方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
try
{
CORBA::ORB_var orb =
CORBA::ORB_init (argc, argv);
if (parse_args (argc, argv) != 0)
{
return 1;
}
CORBA::Object_var object =
orb->string_to_object (ior);
Simple_Server_var server =
Simple_Server::_narrow (object.in ());
if (CORBA::is_nil (server.in ()))
{
ACE_ERROR_RETURN ((LM_ERROR,
"Object reference <%s> is nil.\n",
ior),
1);
}
Structure the_in_structure;
the_in_structure.seq.length (10);
if (test_user_exception == 1)
{
server->raise_user_exception ();
}
else if (test_system_exception == 1)
{
server->raise_system_exception ();
}
else
{
for (int i = 0; i != niterations; ++i)
{
CORBA::Long const tv = i + 100;
server->test_val(tv);
CORBA::Long const rtv = server->test_val ();
if (TAO_debug_level > 0)
{
ACE_DEBUG ((LM_DEBUG,
"DSI_Simpler_Server ==== Expected result = %d for %d\n",
rtv, tv));
}
if (rtv != tv)
{
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR: unexpected result = %d for %d\n",
rtv, tv));
}
the_in_structure.i = i;
CORBA::String_var name = CORBA::string_dup ("the name");
Structure_var the_out_structure;
CORBA::Long const r =
server->test_method (i,
the_in_structure,
the_out_structure.out (),
name.inout ());
if (TAO_debug_level > 0)
{
ACE_DEBUG ((LM_DEBUG,
"DSI_Simpler_Server ====\n"
" x = %d\n"
" i = %d\n"
" length = %d\n"
" name = <%C>\n",
r,
the_out_structure->i,
the_out_structure->seq.length (),
name.in ()));
}
if (r != i)
{
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR: unexpected result = %d for %d",
r, i));
}
}
}
if (do_shutdown)
{
server->shutdown ();
}
}
catch (const test_exception& ex)
//.........这里部分代码省略.........