summaryrefslogtreecommitdiff
path: root/TAO/tests/OBV/Truncatable/client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/OBV/Truncatable/client.cpp')
-rw-r--r--TAO/tests/OBV/Truncatable/client.cpp104
1 files changed, 29 insertions, 75 deletions
diff --git a/TAO/tests/OBV/Truncatable/client.cpp b/TAO/tests/OBV/Truncatable/client.cpp
index 4f75c2cd7c8..372e751b0e2 100644
--- a/TAO/tests/OBV/Truncatable/client.cpp
+++ b/TAO/tests/OBV/Truncatable/client.cpp
@@ -57,11 +57,10 @@ parse_args (int argc, char *argv[])
int
main (int argc, char *argv[])
{
- ACE_TRY_NEW_ENV
+ try
{
CORBA::ORB_var orb =
- CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::ORB_init (argc, argv, "");
if (parse_args (argc, argv) != 0)
return 1;
@@ -74,9 +73,7 @@ main (int argc, char *argv[])
1);
orb->register_value_factory (base_factory->tao_repository_id (),
- base_factory
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ base_factory);
base_factory->_remove_ref (); // release ownership
@@ -87,9 +84,7 @@ main (int argc, char *argv[])
1);
orb->register_value_factory (value1_factory->tao_repository_id (),
- value1_factory
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ value1_factory);
value1_factory->_remove_ref ();
@@ -100,9 +95,7 @@ main (int argc, char *argv[])
1);
orb->register_value_factory (value2_factory->tao_repository_id (),
- value2_factory
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ value2_factory);
value2_factory->_remove_ref ();
@@ -112,9 +105,7 @@ main (int argc, char *argv[])
1);
orb->register_value_factory (value3_factory->tao_repository_id (),
- value3_factory
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ value3_factory);
value3_factory->_remove_ref ();
OBV_TruncatableTest::TValue4_init *value4_factory = 0;
@@ -123,9 +114,7 @@ main (int argc, char *argv[])
1);
orb->register_value_factory (value4_factory->tao_repository_id (),
- value4_factory
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ value4_factory);
value4_factory->_remove_ref ();
OBV_TruncatableTest::TValue5_init *value5_factory = 0;
@@ -134,9 +123,7 @@ main (int argc, char *argv[])
1);
orb->register_value_factory (value5_factory->tao_repository_id (),
- value5_factory
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ value5_factory);
value5_factory->_remove_ref ();
OBV_TruncatableTest::NestedValue_init *nested_value_factory = 0;
@@ -145,19 +132,15 @@ main (int argc, char *argv[])
1);
orb->register_value_factory (nested_value_factory->tao_repository_id (),
- nested_value_factory
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ nested_value_factory);
nested_value_factory->_remove_ref ();
// Obtain reference to the object
CORBA::Object_var tmp =
- orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->string_to_object(ior);
OBV_TruncatableTest::Test_var test =
- OBV_TruncatableTest::Test::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ OBV_TruncatableTest::Test::_narrow(tmp.in ());
if (CORBA::is_nil (test.in ()))
{
@@ -181,10 +164,8 @@ main (int argc, char *argv[])
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op1 ("case1", &v1, ov1.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
+ test->op1 ("case1", &v1, ov1.out (), desc.inout ());
- ACE_TRY_CHECK;
VERIFY (! ACE_OS::strcmp (desc.in (),
"case1: A<-tB, truncate B to A"));
@@ -209,9 +190,7 @@ main (int argc, char *argv[])
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op1 ("case2", &v2, ov2.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ test->op1 ("case2", &v2, ov2.out (), desc.inout ());
VERIFY (! ACE_OS::strcmp (desc.in (),
"case2: A<-tB<-tC, truncate C to A"));
@@ -228,9 +207,7 @@ main (int argc, char *argv[])
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op2 (&v2, "case3", otv1.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ test->op2 (&v2, "case3", otv1.out (), desc.inout ());
VERIFY (! ACE_OS::strcmp (desc.in (),
"case3: A<-tB<-tC, truncate C to B"));
@@ -254,9 +231,7 @@ main (int argc, char *argv[])
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op2 (&itv1b, "case3b", otv1b.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ test->op2 (&itv1b, "case3b", otv1b.out (), desc.inout ());
VERIFY (! ACE_OS::strcmp (desc.in (),
"case3b: A<-tB, truncatable but no truncation"));
@@ -275,7 +250,7 @@ main (int argc, char *argv[])
v3.data3 (99 * 3);
bool caught_expected_exception = false;
- ACE_TRY_EX (value3)
+ try
{
OBV_TruncatableTest::BaseValue_var ov3;
desc = CORBA::string_dup
@@ -283,17 +258,14 @@ main (int argc, char *argv[])
if (verbose)
ACE_DEBUG ((LM_DEBUG,ACE_TEXT("Case 4: %s: "),
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
- test->op1 ("case4", &v3, ov3.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX (value3);
+ test->op1 ("case4", &v3, ov3.out (), desc.inout ());
}
- ACE_CATCH (CORBA::MARSHAL, v3ex)
+ catch (const CORBA::MARSHAL&)
{
if (verbose)
ACE_DEBUG ((LM_DEBUG,ACE_TEXT ("passed\n")));
caught_expected_exception = true;
}
- ACE_ENDTRY;
if ( ! caught_expected_exception)
{
@@ -324,9 +296,7 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG,ACE_TEXT("Case 5: %s: "),
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op1 ("case5", &v5, ov5.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ test->op1 ("case5", &v5, ov5.out (), desc.inout ());
VERIFY (! ACE_OS::strcmp (desc.in (),
"case5: A<-tB<-tC, B & C have nested value type, truncate C to A"));
@@ -343,9 +313,7 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG,ACE_TEXT("Case 6: %s: "),
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op3 ("case6", &v5, otv4.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ test->op3 ("case6", &v5, otv4.out (), desc.inout ());
VERIFY (! ACE_OS::strcmp (desc.in (),
"case6: A<-tB<-tC, B & C have nested value type, truncate C to B"));
@@ -368,9 +336,7 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG,ACE_TEXT("Case 7: %s: "),
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op1 ("case7", &iv, ov.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ test->op1 ("case7", &iv, ov.out (), desc.inout ());
VERIFY (! ACE_OS::strcmp (desc.in (),
"case7: A<-tB, B has no data, truncate B to A"));
@@ -412,9 +378,7 @@ main (int argc, char *argv[])
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
OBV_TruncatableTest::BaseValue_var ov
- = test->op4 ("case8", &v1, 5, &v2, &v3, &v4, desc.inout ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ = test->op4 ("case8", &v1, 5, &v2, &v3, &v4, desc.inout ());
VERIFY (! ACE_OS::strcmp (desc.in (),
"case8: multiple IN truncatable valuetype parameters"
@@ -442,10 +406,8 @@ main (int argc, char *argv[])
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op2 (&v1, "case9", ov1.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
+ test->op2 (&v1, "case9", ov1.out (), desc.inout ());
- ACE_TRY_CHECK;
VERIFY (! ACE_OS::strcmp (desc.in (),
"case9: A<-tB, truncate unknown B to A"));
@@ -472,10 +434,8 @@ main (int argc, char *argv[])
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op5 (a, "case10", ov1.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
+ test->op5 (a, "case10", ov1.out (), desc.inout ());
- ACE_TRY_CHECK;
VERIFY (! ACE_OS::strcmp (desc.in (),
"case10: A<-tB, known truncatable via Any"));
@@ -502,10 +462,8 @@ main (int argc, char *argv[])
ACE_TEXT_CHAR_TO_TCHAR(desc.in())));
pretest = fail;
- test->op5 (a, "case11", ov1.out (), desc.inout ()
- ACE_ENV_ARG_PARAMETER);
+ test->op5 (a, "case11", ov1.out (), desc.inout ());
- ACE_TRY_CHECK;
VERIFY (! ACE_OS::strcmp (desc.in (),
"case11: A<-tB, unknown truncatable via Any"));
@@ -520,11 +478,9 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG, "(%P|%t) client - shutdown orb \n"));
- test->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ test->shutdown ();
- orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->destroy ();
if (fail)
{
@@ -534,13 +490,11 @@ main (int argc, char *argv[])
else
ACE_DEBUG((LM_DEBUG, "(%P|%t) client: test passed \n"));
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Exception caught:");
+ ex._tao_print_exception ("Exception caught:");
return 1;
}
- ACE_ENDTRY;
return 0;
}