diff options
author | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-03-16 21:40:44 +0000 |
---|---|---|
committer | bala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-03-16 21:40:44 +0000 |
commit | cd55faec95d641f16bab06852546b2fbcb6766ee (patch) | |
tree | bd74064985135efff4fd435911566384398edadc /TAO/tests/Param_Test/param_test_i.cpp | |
parent | 8c35832b7c0414a367c3050bcc5631286dd2801c (diff) | |
download | ATCD-cd55faec95d641f16bab06852546b2fbcb6766ee.tar.gz |
Made them Exception safe using the ACE_TRY macros instead of the
TAO_TRY macros
Diffstat (limited to 'TAO/tests/Param_Test/param_test_i.cpp')
-rw-r--r-- | TAO/tests/Param_Test/param_test_i.cpp | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/TAO/tests/Param_Test/param_test_i.cpp b/TAO/tests/Param_Test/param_test_i.cpp index 1817b8b6cd8..f00d9d58a7b 100644 --- a/TAO/tests/Param_Test/param_test_i.cpp +++ b/TAO/tests/Param_Test/param_test_i.cpp @@ -98,9 +98,8 @@ char * Param_Test_i::test_unbounded_string (const char *s1, char *&s2, CORBA::String_out s3, - CORBA::Environment &env) + CORBA::Environment &) { - ACE_UNUSED_ARG (env); char *retstr = CORBA::string_dup (s1); s3 = CORBA::string_dup (s1); char *tmp = CORBA::string_alloc (2*ACE_OS::strlen (s2)); @@ -133,9 +132,8 @@ Param_Test::Fixed_Struct Param_Test_i::test_fixed_struct (const Param_Test::Fixed_Struct &s1, Param_Test::Fixed_Struct &s2, Param_Test::Fixed_Struct_out s3, - CORBA::Environment &env) + CORBA::Environment &) { - ACE_UNUSED_ARG (env); s2 = s1; s3 = s1; return s1; @@ -153,7 +151,7 @@ Param_Test::Long_Seq * Param_Test_i::test_long_sequence ( Param_Test::Long_Seq *ret = new Param_Test::Long_Seq, *out = new Param_Test::Long_Seq; - + s2 = s1; *out = s1; *ret = s1; @@ -219,9 +217,8 @@ Param_Test::StrSeq * Param_Test_i::test_strseq (const Param_Test::StrSeq &s1, Param_Test::StrSeq &s2, Param_Test::StrSeq_out s3, - CORBA::Environment &env) + CORBA::Environment &) { - ACE_UNUSED_ARG (env); // we copy the "in" sequences into all the inout, out and return sequences. Param_Test::StrSeq @@ -435,9 +432,8 @@ Param_Test::AnySeq * Param_Test_i::test_anyseq (const Param_Test::AnySeq &s1, Param_Test::AnySeq &s2, Param_Test::AnySeq_out s3, - CORBA::Environment &env) + CORBA::Environment &) { - ACE_UNUSED_ARG (env); // we copy the "in" sequences into all the inout, out and return sequences. Param_Test::AnySeq @@ -459,9 +455,8 @@ Param_Test::Var_Struct * Param_Test_i::test_var_struct (const Param_Test::Var_Struct &s1, Param_Test::Var_Struct &s2, Param_Test::Var_Struct_out s3, - CORBA::Environment &env) + CORBA::Environment &) { - ACE_UNUSED_ARG (env); // we copy the "in" sequences into all the inout, out and return sequences. Param_Test::Var_Struct @@ -481,9 +476,8 @@ Param_Test::Nested_Struct * Param_Test_i::test_nested_struct (const Param_Test::Nested_Struct &s1, Param_Test::Nested_Struct &s2, Param_Test::Nested_Struct_out s3, - CORBA::Environment &env) + CORBA::Environment &) { - ACE_UNUSED_ARG (env); // we copy the "in" sequences into all the inout, out and return sequences. Param_Test::Nested_Struct @@ -502,9 +496,8 @@ Param_Test::Objref_Struct * Param_Test_i::test_objref_struct (const Param_Test::Objref_Struct &s1, Param_Test::Objref_Struct &s2, Param_Test::Objref_Struct_out s3, - CORBA::Environment &env) + CORBA::Environment &) { - ACE_UNUSED_ARG (env); // we copy the "in" sequences into all the inout, out and return sequences. Param_Test::Objref_Struct @@ -521,9 +514,9 @@ Param_Test_i::test_objref_struct (const Param_Test::Objref_Struct &s1, // make a Coffee object Coffee_ptr -Param_Test_i::make_coffee (CORBA::Environment &env) +Param_Test_i::make_coffee (CORBA::Environment &ACE_TRY_ENV) { - return this->obj_._this (env); + return this->obj_._this (ACE_TRY_ENV); } // test for object references @@ -531,19 +524,19 @@ Coffee_ptr Param_Test_i::test_objref (Coffee_ptr o1, Coffee_ptr &o2, Coffee_out o3, - CORBA::Environment &env) + CORBA::Environment &ACE_TRY_ENV) { Coffee_ptr ret = Coffee::_nil (); - TAO_TRY + ACE_TRY { - Coffee_var myobj = obj_._this (TAO_TRY_ENV); - TAO_CHECK_ENV; + Coffee_var myobj = obj_._this (ACE_TRY_ENV); + ACE_TRY_CHECK; if (!CORBA::is_nil (o2)) CORBA::release (o2); - if (myobj->_is_equivalent (o1, env)) + if (myobj->_is_equivalent (o1, ACE_TRY_ENV)) { o2 = Coffee::_duplicate (myobj.in ()); o3 = Coffee::_duplicate (myobj.in ()); @@ -555,17 +548,17 @@ Param_Test_i::test_objref (Coffee_ptr o1, o3 = Coffee::_nil (); } } - TAO_CATCH (CORBA::SystemException, sysex) + ACE_CATCH (CORBA::SystemException, sysex) { - TAO_TRY_ENV.print_exception ("System Exception"); - env.exception (TAO_TRY_ENV.exception ()); + ACE_PRINT_EXCEPTION (sysex, "System Exception"); + // env.exception (TAO_TRY_ENV.exception ()); } - TAO_CATCH (CORBA::UserException, userex) + ACE_CATCH (CORBA::UserException, userex) { - TAO_TRY_ENV.print_exception ("User Exception"); - env.exception (TAO_TRY_ENV.exception ()); + ACE_PRINT_EXCEPTION (userex, "User Exception"); + // env.exception (TAO_TRY_ENV.exception ()); } - TAO_ENDTRY; + ACE_ENDTRY; return ret; } @@ -575,7 +568,7 @@ CORBA::TypeCode_ptr Param_Test_i::test_typecode (CORBA::TypeCode_ptr t1, CORBA::TypeCode_ptr &t2, CORBA::TypeCode_out t3, - CORBA::Environment &env) + CORBA::Environment &/*env*/) { // we simply assign t1 to the others CORBA::TypeCode_ptr retval = CORBA::TypeCode::_duplicate (t1); @@ -589,7 +582,7 @@ CORBA::Any * Param_Test_i::test_any (const CORBA::Any &a1, CORBA::Any &a2, CORBA::Any_out a3, - CORBA::Environment &env) + CORBA::Environment &) { CORBA::Any *ret; CORBA::Short short_in; @@ -674,11 +667,10 @@ Param_Test::Fixed_Array_slice * Param_Test_i::test_fixed_array (const Param_Test::Fixed_Array a1, Param_Test::Fixed_Array a2, Param_Test::Fixed_Array_out a3, - CORBA::Environment &env) + CORBA::Environment &) { Param_Test::Fixed_Array_slice *ret; - ACE_UNUSED_ARG (env); - + Param_Test::Fixed_Array_copy (a2, a1); Param_Test::Fixed_Array_copy (a3, a1); ret = Param_Test::Fixed_Array_dup (a1); @@ -690,11 +682,10 @@ Param_Test::Var_Array_slice * Param_Test_i::test_var_array (const Param_Test::Var_Array a1, Param_Test::Var_Array a2, Param_Test::Var_Array_out a3, - CORBA::Environment &env) + CORBA::Environment &) { Param_Test::Var_Array_slice *ret; - ACE_UNUSED_ARG (env); - + Param_Test::Var_Array_copy (a2, a1); a3 = Param_Test::Var_Array_dup (a1); ret = Param_Test::Var_Array_dup (a1); @@ -705,7 +696,7 @@ CORBA::ULong Param_Test_i::test_exception (CORBA::ULong s1, CORBA::ULong& s2, CORBA::ULong_out s3, - CORBA::Environment &env) + CORBA::Environment &ACE_TRY_ENV) { int d = this->test_exception_count_ % 3; this->test_exception_count_++; @@ -717,11 +708,11 @@ Param_Test_i::test_exception (CORBA::ULong s1, } else if (d == 1) { - env.exception (new Param_Test::Ooops (CORBA::string_dup (" % 3 == 1"), + ACE_TRY_ENV.exception (new Param_Test::Ooops (CORBA::string_dup (" % 3 == 1"), s1)); return 0; } - env.exception (new Param_Test::BadBoy); + ACE_TRY_ENV.exception (new Param_Test::BadBoy); return 0; } @@ -729,7 +720,7 @@ Param_Test::Big_Union* Param_Test_i::test_big_union (const Param_Test::Big_Union& u1, Param_Test::Big_Union& u2, Param_Test::Big_Union_out u3, - CORBA::Environment &env) + CORBA::Environment &) { Param_Test::Big_Union_var ret (new Param_Test::Big_Union (u1)); u2 = u1; |