summaryrefslogtreecommitdiff
path: root/TAO/tests/Param_Test/objref.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/Param_Test/objref.cpp')
-rw-r--r--TAO/tests/Param_Test/objref.cpp97
1 files changed, 34 insertions, 63 deletions
diff --git a/TAO/tests/Param_Test/objref.cpp b/TAO/tests/Param_Test/objref.cpp
index 4b0986404b4..3bdde5b4cb5 100644
--- a/TAO/tests/Param_Test/objref.cpp
+++ b/TAO/tests/Param_Test/objref.cpp
@@ -20,7 +20,7 @@
#include "objref.h"
ACE_RCSID (Param_Test,
- objref,
+ objref,
"$Id$")
// ************************************************************************
@@ -45,8 +45,7 @@ Test_ObjRef::opname (void) const
}
void
-Test_ObjRef::dii_req_invoke (CORBA::Request *req
- ACE_ENV_ARG_DECL)
+Test_ObjRef::dii_req_invoke (CORBA::Request *req)
{
req->add_in_arg ("s1") <<= this->in_.in ();
req->add_inout_arg ("s2") <<= this->inout_.in ();
@@ -54,22 +53,19 @@ Test_ObjRef::dii_req_invoke (CORBA::Request *req
req->set_return_type (_tc_Coffee);
- req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ req->invoke ();
Coffee_ptr tmp;
req->return_value () >>= tmp;
this->ret_ = Coffee::_duplicate (tmp);
CORBA::NamedValue_ptr o2 =
- req->arguments ()->item (1 ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ req->arguments ()->item (1);
*o2->value () >>= tmp;
this->inout_ = Coffee::_duplicate (tmp);
CORBA::NamedValue_ptr o3 =
- req->arguments ()->item (2 ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ req->arguments ()->item (2);
*o3->value () >>= tmp;
this->out_ = Coffee::_duplicate (tmp);
}
@@ -84,21 +80,19 @@ static const char *Coffee_Flavor [] = {
};
int
-Test_ObjRef::init_parameters (Param_Test_ptr objref
- ACE_ENV_ARG_DECL)
+Test_ObjRef::init_parameters (Param_Test_ptr objref)
{
Coffee::Desc desc;
Generator *gen = GENERATOR::instance (); // value generator
char msg_str[256] = "";
- ACE_TRY
+ try
{
ACE_OS::strcpy (msg_str, "make_cofee");
// first get a Coffee object
- this->in_ = objref->make_coffee (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->in_ = objref->make_coffee ();
// Get some index into Coffee_Flavor [].
CORBA::ULong index = (CORBA::ULong) (gen->gen_long () % 6);
@@ -106,8 +100,7 @@ Test_ObjRef::init_parameters (Param_Test_ptr objref
// set the attribute of the object
ACE_OS::strcpy (msg_str, "set coffee attribute");
- this->in_->description (desc ACE_ENV_ARG_PARAMETER); // set the attribute for the in object
- ACE_TRY_CHECK;
+ this->in_->description (desc); // set the attribute for the in object
this->inout_ = Coffee::_nil ();
this->out_ = Coffee::_nil ();
@@ -115,11 +108,10 @@ Test_ObjRef::init_parameters (Param_Test_ptr objref
return 0;
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, msg_str);
+ ex._tao_print_exception (msg_str);
}
- ACE_ENDTRY;
return -1;
}
@@ -127,7 +119,6 @@ int
Test_ObjRef::reset_parameters (void)
{
// Environemnt variable
- ACE_DECLARE_NEW_CORBA_ENV;
Coffee::Desc desc;
Generator *gen = GENERATOR::instance (); // value generator
@@ -135,18 +126,16 @@ Test_ObjRef::reset_parameters (void)
CORBA::ULong index = (CORBA::ULong) (gen->gen_long () % 6);
desc.name = Coffee_Flavor [index];
- ACE_TRY
+ try
{
// set the attribute of the object
- this->in_->description (desc ACE_ENV_ARG_PARAMETER); // set the attribute for the in object
- ACE_TRY_CHECK;
+ this->in_->description (desc); // set the attribute for the in object
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "set coffee attribute");
+ ex._tao_print_exception ("set coffee attribute");
return -1;
}
- ACE_ENDTRY;
this->inout_ = Coffee::_nil ();
this->out_ = Coffee::_nil ();
@@ -156,27 +145,22 @@ Test_ObjRef::reset_parameters (void)
}
int
-Test_ObjRef::run_sii_test (Param_Test_ptr objref
- ACE_ENV_ARG_DECL)
+Test_ObjRef::run_sii_test (Param_Test_ptr objref)
{
- ACE_TRY
+ try
{
this->ret_ =
objref->test_objref (this->in_.in (),
this->inout_.inout (),
- this->out_.out ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->out_.out ());
return 0;
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Test_ObjRef::run_sii_test\n");
+ ex._tao_print_exception ("Test_ObjRef::run_sii_test\n");
}
- ACE_ENDTRY;
return -1;
}
@@ -184,9 +168,8 @@ CORBA::Boolean
Test_ObjRef::check_validity (void)
{
// Environemnt variable
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
if (CORBA::is_nil (this->in_.in ())
|| CORBA::is_nil (this->inout_.in ())
@@ -197,25 +180,21 @@ Test_ObjRef::check_validity (void)
return 0;
}
Coffee::Desc_var in_desc =
- this->in_->description (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->in_->description ();
const char *in = in_desc->name.in ();
Coffee::Desc_var inout_desc =
- this->inout_->description (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->inout_->description ();
const char *inout = inout_desc->name.in ();
Coffee::Desc_var out_desc =
- this->out_->description (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->out_->description ();
const char *out = out_desc->name.in ();
- Coffee::Desc_var ret_desc = this->out_->description (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ Coffee::Desc_var ret_desc = this->out_->description ();
const char* ret = ret_desc->name.in ();
@@ -225,12 +204,11 @@ Test_ObjRef::check_validity (void)
!ACE_OS::strcmp (in, ret))
return 1; // success
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Retrieving description");
+ ex._tao_print_exception ("Retrieving description");
return 0;
}
- ACE_ENDTRY;
return 1;
}
@@ -245,7 +223,6 @@ void
Test_ObjRef::print_values (void)
{
// Env. variable
- ACE_DECLARE_NEW_CORBA_ENV;
Coffee::Desc_var in_desc;
Coffee::Desc_var inout_desc;
@@ -255,47 +232,41 @@ Test_ObjRef::print_values (void)
const char *out = 0;
const char *inout = 0;
const char *ret = 0;
- ACE_TRY
+ try
{
if (!CORBA::is_nil (this->in_.in ()))
{
in_desc =
- this->in_->description (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->in_->description ();
in = in_desc->name.in ();
}
if (!CORBA::is_nil (this->inout_.in ()))
{
inout_desc =
- this->inout_->description (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->inout_->description ();
inout = inout_desc->name.in ();
}
if (!CORBA::is_nil (this->out_.in ()))
{
out_desc =
- this->out_->description (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->out_->description ();
out = out_desc->name.in ();
}
if (!CORBA::is_nil (this->ret_.in ()))
{
ret_desc =
- this->ret_->description (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->ret_->description ();
ret = ret_desc->name.in ();
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Retrieving Description");
+ ex._tao_print_exception ("Retrieving Description");
return;
}
- ACE_ENDTRY;
- ACE_CHECK;