diff options
Diffstat (limited to 'TAO/tests/DII_Collocation_Tests')
10 files changed, 176 insertions, 276 deletions
diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp index f7c3f321248..f4a02e95052 100644 --- a/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp +++ b/TAO/tests/DII_Collocation_Tests/oneway/Client_Task.cpp @@ -36,8 +36,7 @@ Client_Task::svc (void) { CORBA::Object_var obj = this->corb_->string_to_object (input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + if (CORBA::is_nil (obj.in ())) { ACE_ERROR_RETURN ((LM_DEBUG, @@ -48,8 +47,7 @@ Client_Task::svc (void) CORBA::Object_var simple_test_obj = this->corb_->string_to_object (simple_test_input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + if (CORBA::is_nil (simple_test_obj.in ())) { ACE_ERROR_RETURN ((LM_DEBUG, @@ -58,42 +56,34 @@ Client_Task::svc (void) 1); } - Test::Simple_Test_var simple_test + Test::Simple_Test_var simple_test = Test::Simple_Test::_narrow (simple_test_obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; CORBA::Request_var req (obj->_request ("test_basic_arg" ACE_ENV_ARG_PARAMETER)); - ACE_TRY_CHECK; req->add_in_arg ("basic") <<= TEST_BASIC_VALUE; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_unbounded_string_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("ub_string") <<= TEST_STR; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_bounded_string_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + ACE_CString bs (TEST_STR); bs = bs.substr (0, ::Test::BOUNDED_STRING_SIZE); - req->add_in_arg ("bd_string") + req->add_in_arg ("bd_string") <<= CORBA::Any::from_string (bs.c_str (), ::Test::BOUNDED_STRING_SIZE); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_fixed_array_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ::Test::Fixed_Array fixed_array; @@ -103,159 +93,136 @@ Client_Task::svc (void) } req->add_in_arg ("fixed_array") <<= ::Test::Fixed_Array_forany (fixed_array); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_var_array_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ::Test::Var_Array var_array; for (CORBA::ULong i = 0; i < ::Test::VAR_ARRAY_SIZE; ++i) - { + { var_array[i] = CORBA::string_dup(TEST_STR); } req->add_in_arg ("var_array") <<= var_array; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_bounded_var_size_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ACE_CString bvs (TEST_STR); bvs = bvs.substr (0, ::Test::BOUNDED_VAR_SIZE); - ::Test::Bounded_Var_Size_Arg* bd_var_size + ::Test::Bounded_Var_Size_Arg* bd_var_size = new ::Test::Bounded_Var_Size_Arg(); bd_var_size->replace (::Test::BOUNDED_VAR_SIZE, const_cast <CORBA::Char*> (bvs.c_str ())); req->add_in_arg ("bd_var_size") <<= bd_var_size; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_unbounded_var_size_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - ::Test::Unbounded_Var_Size_Arg* ub_var_size + ::Test::Unbounded_Var_Size_Arg* ub_var_size = new ::Test::Unbounded_Var_Size_Arg(); ub_var_size->replace (ub_var_size->maximum (), ACE_OS::strlen (TEST_STR), TEST_STR); req->add_in_arg ("ub_var_size") <<= ub_var_size; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_fixed_size_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ::Test::TimeOfDay t; - t.hour = TEST_HOUR; + t.hour = TEST_HOUR; t.minute = TEST_MINUTE; t.second = TEST_SECOND; req->add_in_arg ("fixed_size") <<= t; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_special_basic_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("special") <<= CORBA::Any::from_char (TEST_SPECIAL_VALUE); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_object_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("object") <<= simple_test_obj.in (); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_objref_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("objref") <<= simple_test.in (); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_args_1" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("arg1") <<= simple_test_obj.in (); req->add_in_arg ("arg2") <<= CORBA::Any::from_char (TEST_SPECIAL_VALUE); req->add_in_arg ("arg3") <<= simple_test.in (); - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_args_2" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("arg1") <<= TEST_STR; req->add_in_arg ("arg2") <<= ::Test::Fixed_Array_forany (fixed_array); req->add_in_arg ("arg3") <<= t; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("test_args_3" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - bd_var_size + bd_var_size = new ::Test::Bounded_Var_Size_Arg(); bd_var_size->replace (::Test::BOUNDED_VAR_SIZE, const_cast <CORBA::Char*> (bvs.c_str ())); - ub_var_size + ub_var_size = new ::Test::Unbounded_Var_Size_Arg(); ub_var_size->replace (ub_var_size->maximum (), ACE_OS::strlen (TEST_STR), TEST_STR); for (CORBA::ULong j = 0; j < ::Test::VAR_ARRAY_SIZE; ++j) - { + { var_array[j] = CORBA::string_dup(TEST_STR); } - req->add_in_arg ("arg1") + req->add_in_arg ("arg1") <<= CORBA::Any::from_string (bs.c_str (), ::Test::BOUNDED_STRING_SIZE); req->add_in_arg ("arg2") <<= bd_var_size; req->add_in_arg ("arg3") <<= ub_var_size; req->add_in_arg ("arg4") <<= var_array; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + req = obj->_request ("shutdown" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + } ACE_CATCHANY @@ -277,7 +244,7 @@ Client_Task::svc (void) } -CORBA::ULong +CORBA::ULong Client_Task::error_count () const { return error_count_; diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Collocated_Test.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Collocated_Test.cpp index ccf9170dc2a..13f6ba38c74 100644 --- a/TAO/tests/DII_Collocation_Tests/oneway/Collocated_Test.cpp +++ b/TAO/tests/DII_Collocation_Tests/oneway/Collocated_Test.cpp @@ -65,7 +65,6 @@ main (int argc, char *argv[]) satc.get_TCHAR_argv (), server_orb.c_str () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ACE_Manual_Event me; Server_Task server_task (output, @@ -90,7 +89,6 @@ main (int argc, char *argv[]) catc.get_TCHAR_argv (), client_orb.c_str () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; Client_Task client_task (input, simple_test_input, @@ -108,12 +106,10 @@ main (int argc, char *argv[]) ACE_Thread_Manager::instance ()->wait (); // Now that all threads have completed we can destroy the ORB - sorb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + sorb->destroy (); if (server_orb != client_orb) { - corb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + corb->destroy (); } CORBA::ULong errors = client_task.error_count () + server_task.error_count (); diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp index 77c4257f203..05d9fd122ca 100644 --- a/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp +++ b/TAO/tests/DII_Collocation_Tests/oneway/Hello.cpp @@ -52,7 +52,7 @@ Hello::Hello (CORBA::ORB_ptr orb, { } -void +void Hello::test_basic_arg ( ::CORBA::Long basic ACE_ENV_ARG_DECL @@ -65,14 +65,14 @@ Hello::test_basic_arg ( ERROR_COUNT ("Hello::test_basic_arg") } -void +void Hello::test_unbounded_string_arg(const char* message ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC((CORBA::SystemException)) { if (debug) ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_unbounded_string_arg ") - ACE_TEXT("got unbounded string: %s\n"), + ACE_TEXT("got unbounded string: %s\n"), message)); if (ACE_OS::strncmp (message, TEST_STR, strlen (TEST_STR) != 0)) { @@ -81,14 +81,14 @@ Hello::test_unbounded_string_arg(const char* message } -void +void Hello::test_bounded_string_arg(const char* message ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC((CORBA::SystemException)) { if (debug) ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_bounded_string_arg ") - ACE_TEXT("got bounded string: %s\n"), + ACE_TEXT("got bounded string: %s\n"), message)); if (ACE_OS::strncmp (message, TEST_STR, ::Test::BOUNDED_STRING_SIZE) != 0) { @@ -97,7 +97,7 @@ Hello::test_bounded_string_arg(const char* message } -void +void Hello::test_fixed_array_arg(const ::Test::Fixed_Array message ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC((CORBA::SystemException)) @@ -106,7 +106,7 @@ Hello::test_fixed_array_arg(const ::Test::Fixed_Array message { if (debug) ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_fixed_array_arg ") - ACE_TEXT("got fixed array: %d\n"), + ACE_TEXT("got fixed array: %d\n"), message[i])); if (message[i] != static_cast<CORBA::Long> (i + 999)) ERROR_COUNT ("Hello::test_fixed_array_arg") @@ -114,7 +114,7 @@ Hello::test_fixed_array_arg(const ::Test::Fixed_Array message } -void +void Hello::test_bounded_var_size_arg(const ::Test::Bounded_Var_Size_Arg& message ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC((CORBA::SystemException)) @@ -127,7 +127,7 @@ Hello::test_bounded_var_size_arg(const ::Test::Bounded_Var_Size_Arg& message } -void +void Hello::test_unbounded_var_size_arg(const ::Test::Unbounded_Var_Size_Arg& message ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC((CORBA::SystemException)) @@ -140,7 +140,7 @@ Hello::test_unbounded_var_size_arg(const ::Test::Unbounded_Var_Size_Arg& message } -void +void Hello::test_fixed_size_arg(const ::Test::TimeOfDay& t ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -150,14 +150,14 @@ Hello::test_fixed_size_arg(const ::Test::TimeOfDay& t ACE_TEXT("got timeofday: %d:%d:%d\n"), t.hour, t.minute, t.second)); - if (t.hour != TEST_HOUR - || t.minute != TEST_MINUTE + if (t.hour != TEST_HOUR + || t.minute != TEST_MINUTE || t.second != TEST_SECOND) ERROR_COUNT ("Hello::test_fixed_size_arg") } -void +void Hello::test_var_array_arg(const Test::Var_Array messages ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC((CORBA::SystemException)) @@ -173,7 +173,7 @@ Hello::test_var_array_arg(const Test::Var_Array messages } -void +void Hello::test_special_basic_arg(CORBA::Char value ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC((CORBA::SystemException)) @@ -199,14 +199,13 @@ void Hello::test_objref_arg ( if (CORBA::is_nil (test)) ERROR_COUNT ("Hello::test_objref_arg") - else + else { // Increment the error_count before calling test_method() and decrement // the error_count when the server handling the test_method() call. CORBA::ULong error_count = 0; error_count ++; test->test_method (error_count ACE_ENV_ARG_PARAMETER); - ACE_CHECK; if (error_count != 0) { ERROR_COUNT ("Hello::test_objref_arg") @@ -225,11 +224,10 @@ void Hello::test_object_arg ( if (debug) ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_object_arg \n"))); ::Test::Simple_Test_var simple_test = ::Test::Simple_Test::_narrow (o); - + CORBA::ULong error_count = 0; error_count ++; simple_test->test_method (error_count ACE_ENV_ARG_PARAMETER); - ACE_CHECK; if (error_count != 0) { ERROR_COUNT ("Hello::test_object_arg") @@ -249,14 +247,12 @@ void Hello::test_args_1 ( if (debug) ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_args_1 \n"))); ::Test::Simple_Test_var simple_test = ::Test::Simple_Test::_narrow (arg1); - + CORBA::ULong error_count = 0; error_count ++; simple_test->test_method (error_count ACE_ENV_ARG_PARAMETER); - ACE_CHECK; error_count ++; arg3->test_method (error_count ACE_ENV_ARG_PARAMETER); - ACE_CHECK; if (error_count != 0) { @@ -281,15 +277,15 @@ void Hello::test_args_2 ( ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_args_2 \n"))); if (ACE_OS::strncmp (arg1, TEST_STR, strlen (TEST_STR)) != 0 ) ERROR_COUNT ("Hello::test_args_2") - + for (unsigned i = 0; i < ::Test::FIX_ARRAY_SIZE; i++) { if (arg2[i] != static_cast<CORBA::Long> (i + 999)) ERROR_COUNT ("Hello::test_args_2") } - if (arg3.hour != TEST_HOUR - || arg3.minute != TEST_MINUTE + if (arg3.hour != TEST_HOUR + || arg3.minute != TEST_MINUTE || arg3.second != TEST_SECOND) ERROR_COUNT ("Hello::test_args_2") } @@ -321,7 +317,7 @@ void Hello::test_args_3 ( } char * -Hello::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +Hello::get_string (void) ACE_THROW_SPEC ((CORBA::SystemException)) { if (debug) @@ -359,7 +355,7 @@ Hello::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) return CORBA::string_dup ("Hello there!"); } -char * +char * Hello::test_unbounded_string ( const char * s1, char *& s2, @@ -380,7 +376,7 @@ Hello::test_unbounded_string ( } void -Hello::shutdown (ACE_ENV_SINGLE_ARG_DECL) +Hello::shutdown (void) ACE_THROW_SPEC ((CORBA::SystemException)) { // Give the client thread time to return from the collocated diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Hello.h b/TAO/tests/DII_Collocation_Tests/oneway/Hello.h index 8dde8446d54..a72caaab113 100644 --- a/TAO/tests/DII_Collocation_Tests/oneway/Hello.h +++ b/TAO/tests/DII_Collocation_Tests/oneway/Hello.h @@ -10,16 +10,16 @@ #include "ace/OS.h" -class Test_Simple_Test_i +class Test_Simple_Test_i : public virtual POA_Test::Simple_Test { public: - //Constructor + //Constructor Test_Simple_Test_i (void); - - //Destructor + + //Destructor virtual ~Test_Simple_Test_i (void); - + virtual void test_method ( ::CORBA::ULong & error_count @@ -57,7 +57,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_bounded_string_arg ( const char * message @@ -66,7 +66,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_fixed_array_arg ( const ::Test::Fixed_Array message @@ -75,7 +75,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_var_array_arg ( const ::Test::Var_Array messages @@ -84,7 +84,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_bounded_var_size_arg ( const ::Test::Bounded_Var_Size_Arg & message @@ -93,7 +93,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_unbounded_var_size_arg ( const ::Test::Unbounded_Var_Size_Arg & message @@ -102,7 +102,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_fixed_size_arg ( const ::Test::TimeOfDay & t @@ -111,7 +111,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_special_basic_arg ( ::CORBA::Char value @@ -120,7 +120,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_objref_arg ( ::Test::Simple_Test_ptr test @@ -129,7 +129,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_object_arg ( ::CORBA::Object_ptr o @@ -138,7 +138,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_args_1 ( ::CORBA::Object_ptr arg1, @@ -149,7 +149,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_args_2 ( const char * arg1, @@ -160,7 +160,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_args_3 ( const char * arg1, @@ -173,7 +173,7 @@ public: CORBA::SystemException )); - virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL) + virtual char * get_string (void) ACE_THROW_SPEC ((CORBA::SystemException)); virtual @@ -186,8 +186,8 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) + + virtual void shutdown (void) ACE_THROW_SPEC ((CORBA::SystemException)); CORBA::ULong error_count () const; diff --git a/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.cpp b/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.cpp index 15754f7aaf3..6d842101da5 100644 --- a/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.cpp +++ b/TAO/tests/DII_Collocation_Tests/oneway/Server_Task.cpp @@ -34,12 +34,10 @@ Server_Task::svc (void) CORBA::Object_var poa_object = this->sorb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; PortableServer::POA_var root_poa = PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; if (CORBA::is_nil (root_poa.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -47,8 +45,7 @@ Server_Task::svc (void) 1); PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + root_poa->the_POAManager (); Hello *hello_impl; ACE_NEW_RETURN (hello_impl, @@ -59,13 +56,11 @@ Server_Task::svc (void) PortableServer::ServantBase_var owner_transfer(hello_impl); Test::Hello_var hello = - hello_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + hello_impl->_this (); CORBA::String_var ior = this->sorb_->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // Output the IOR to the <this->output_> FILE *output_file= ACE_OS::fopen (this->output_, @@ -87,13 +82,11 @@ Server_Task::svc (void) PortableServer::ServantBase_var owner_transfer_simple(simple_impl); Test::Simple_Test_var simple_test = - simple_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + simple_impl->_this (); CORBA::String_var simple_test_ior = this->sorb_->object_to_string (simple_test.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // Output the IOR to the <this->output_> FILE *simple_test_output_file= ACE_OS::fopen (this->simple_test_output_, @@ -107,14 +100,12 @@ Server_Task::svc (void) ACE_OS::fprintf (simple_test_output_file, "%s", simple_test_ior.in ()); ACE_OS::fclose (simple_test_output_file); - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + poa_manager->activate (); // Signal the main thread before we call orb->run (); this->me_.signal (); - this->sorb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->sorb_->run (); ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n")); @@ -142,7 +133,7 @@ Server_Task::svc (void) return 0; } -CORBA::ULong +CORBA::ULong Server_Task::error_count () const { return error_count_; diff --git a/TAO/tests/DII_Collocation_Tests/twoway/Client_Task.cpp b/TAO/tests/DII_Collocation_Tests/twoway/Client_Task.cpp index f4bbfe757e4..199301ed2cf 100644 --- a/TAO/tests/DII_Collocation_Tests/twoway/Client_Task.cpp +++ b/TAO/tests/DII_Collocation_Tests/twoway/Client_Task.cpp @@ -36,8 +36,7 @@ Client_Task::svc (void) { CORBA::Object_var obj = this->corb_->string_to_object (input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + if (CORBA::is_nil (obj.in ())) { ACE_ERROR_RETURN ((LM_DEBUG, @@ -48,8 +47,7 @@ Client_Task::svc (void) CORBA::Object_var simple_test_obj = this->corb_->string_to_object (simple_test_input_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + if (CORBA::is_nil (simple_test_obj.in ())) { ACE_ERROR_RETURN ((LM_DEBUG, @@ -58,46 +56,38 @@ Client_Task::svc (void) 1); } - Test::Simple_Test_var simple_test + Test::Simple_Test_var simple_test = Test::Simple_Test::_narrow (simple_test_obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; CORBA::Long l = 200; CORBA::Request_var req (obj->_request ("test_basic_arg" ACE_ENV_ARG_PARAMETER)); - ACE_TRY_CHECK; req->add_in_arg ("basic") <<= TEST_BASIC_VALUE; - req->add_out_arg ("x") <<= l; - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + req->add_out_arg ("x") <<= l; + req->invoke (); if (req->response_received ()) { - + } req = obj->_request ("test_unbounded_string_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("ub_string") <<= TEST_STR; - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_bounded_string_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + ACE_CString bs (TEST_STR); bs = bs.substr (0, ::Test::BOUNDED_STRING_SIZE); - req->add_in_arg ("bd_string") + req->add_in_arg ("bd_string") <<= CORBA::Any::from_string (bs.c_str (), ::Test::BOUNDED_STRING_SIZE); - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_fixed_array_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ::Test::Fixed_Array fixed_array; @@ -107,159 +97,136 @@ CORBA::Long l = 200; } req->add_in_arg ("fixed_array") <<= ::Test::Fixed_Array_forany (fixed_array); - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_var_array_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ::Test::Var_Array var_array; for (CORBA::ULong i = 0; i < ::Test::VAR_ARRAY_SIZE; ++i) - { + { var_array[i] = CORBA::string_dup(TEST_STR); } req->add_in_arg ("var_array") <<= var_array; - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_bounded_var_size_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ACE_CString bvs (TEST_STR); bvs = bvs.substr (0, ::Test::BOUNDED_VAR_SIZE); - ::Test::Bounded_Var_Size_Arg* bd_var_size + ::Test::Bounded_Var_Size_Arg* bd_var_size = new ::Test::Bounded_Var_Size_Arg(); bd_var_size->replace (::Test::BOUNDED_VAR_SIZE, const_cast <CORBA::Char*> (bvs.c_str ())); req->add_in_arg ("bd_var_size") <<= bd_var_size; - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_unbounded_var_size_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - ::Test::Unbounded_Var_Size_Arg* ub_var_size + ::Test::Unbounded_Var_Size_Arg* ub_var_size = new ::Test::Unbounded_Var_Size_Arg(); ub_var_size->replace (ub_var_size->maximum (), ACE_OS::strlen (TEST_STR), TEST_STR); req->add_in_arg ("ub_var_size") <<= ub_var_size; - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_fixed_size_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ::Test::TimeOfDay t; - t.hour = TEST_HOUR; + t.hour = TEST_HOUR; t.minute = TEST_MINUTE; t.second = TEST_SECOND; req->add_in_arg ("fixed_size") <<= t; - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_special_basic_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("special") <<= CORBA::Any::from_char (TEST_SPECIAL_VALUE); - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_object_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("object") <<= simple_test_obj.in (); - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_objref_arg" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("objref") <<= simple_test.in (); - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_args_1" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("arg1") <<= simple_test_obj.in (); req->add_in_arg ("arg2") <<= CORBA::Any::from_char (TEST_SPECIAL_VALUE); req->add_in_arg ("arg3") <<= simple_test.in (); - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_args_2" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; req->add_in_arg ("arg1") <<= TEST_STR; req->add_in_arg ("arg2") <<= ::Test::Fixed_Array_forany (fixed_array); req->add_in_arg ("arg3") <<= t; - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("test_args_3" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - bd_var_size + bd_var_size = new ::Test::Bounded_Var_Size_Arg(); bd_var_size->replace (::Test::BOUNDED_VAR_SIZE, const_cast <CORBA::Char*> (bvs.c_str ())); - ub_var_size + ub_var_size = new ::Test::Unbounded_Var_Size_Arg(); ub_var_size->replace (ub_var_size->maximum (), ACE_OS::strlen (TEST_STR), TEST_STR); for (CORBA::ULong j = 0; j < ::Test::VAR_ARRAY_SIZE; ++j) - { + { var_array[j] = CORBA::string_dup(TEST_STR); } - req->add_in_arg ("arg1") + req->add_in_arg ("arg1") <<= CORBA::Any::from_string (bs.c_str (), ::Test::BOUNDED_STRING_SIZE); req->add_in_arg ("arg2") <<= bd_var_size; req->add_in_arg ("arg3") <<= ub_var_size; req->add_in_arg ("arg4") <<= var_array; - req->invoke (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->invoke (); + req = obj->_request ("shutdown" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - req->send_oneway (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + req->send_oneway (); + } ACE_CATCHANY @@ -281,7 +248,7 @@ CORBA::Long l = 200; } -CORBA::ULong +CORBA::ULong Client_Task::error_count () const { return error_count_; diff --git a/TAO/tests/DII_Collocation_Tests/twoway/Collocated_Test.cpp b/TAO/tests/DII_Collocation_Tests/twoway/Collocated_Test.cpp index 3e2bab6c3fc..4d831212bad 100644 --- a/TAO/tests/DII_Collocation_Tests/twoway/Collocated_Test.cpp +++ b/TAO/tests/DII_Collocation_Tests/twoway/Collocated_Test.cpp @@ -69,7 +69,6 @@ main (int argc, char *argv[]) satc.get_TCHAR_argv (), server_orb.c_str () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; ACE_Manual_Event me; Server_Task server_task (output, @@ -94,7 +93,6 @@ main (int argc, char *argv[]) catc.get_TCHAR_argv (), client_orb.c_str () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; Client_Task client_task (input, simple_test_input, @@ -112,12 +110,10 @@ main (int argc, char *argv[]) ACE_Thread_Manager::instance ()->wait (); // Now that all threads have completed we can destroy the ORB - sorb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + sorb->destroy (); if (server_orb != client_orb) { - corb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + corb->destroy (); } CORBA::ULong errors = client_task.error_count () + server_task.error_count (); diff --git a/TAO/tests/DII_Collocation_Tests/twoway/Hello.cpp b/TAO/tests/DII_Collocation_Tests/twoway/Hello.cpp index f11634ae374..78cdaa8e2ad 100644 --- a/TAO/tests/DII_Collocation_Tests/twoway/Hello.cpp +++ b/TAO/tests/DII_Collocation_Tests/twoway/Hello.cpp @@ -202,14 +202,13 @@ void Hello::test_objref_arg ( if (CORBA::is_nil (test)) ERROR_COUNT ("Hello::test_objref_arg") - else + else { // Increment the error_count before calling test_method() and decrement // the error_count when the server handling the test_method() call. CORBA::ULong error_count = 0; error_count ++; test->test_method (error_count ACE_ENV_ARG_PARAMETER); - ACE_CHECK; if (error_count != 0) { ERROR_COUNT ("Hello::test_objref_arg") @@ -228,11 +227,10 @@ void Hello::test_object_arg ( if (debug) ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_object_arg \n"))); ::Test::Simple_Test_var simple_test = ::Test::Simple_Test::_narrow (o); - + CORBA::ULong error_count = 0; error_count ++; simple_test->test_method (error_count ACE_ENV_ARG_PARAMETER); - ACE_CHECK; if (error_count != 0) { ERROR_COUNT ("Hello::test_object_arg") @@ -252,14 +250,12 @@ void Hello::test_args_1 ( if (debug) ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_args_1 \n"))); ::Test::Simple_Test_var simple_test = ::Test::Simple_Test::_narrow (arg1); - + CORBA::ULong error_count = 0; error_count ++; simple_test->test_method (error_count ACE_ENV_ARG_PARAMETER); - ACE_CHECK; error_count ++; arg3->test_method (error_count ACE_ENV_ARG_PARAMETER); - ACE_CHECK; if (error_count != 0) { @@ -284,15 +280,15 @@ void Hello::test_args_2 ( ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t)Hello::test_args_2 \n"))); if (ACE_OS::strncmp (arg1, TEST_STR, strlen (TEST_STR)) != 0 ) ERROR_COUNT ("Hello::test_args_2") - + for (unsigned i = 0; i < ::Test::FIX_ARRAY_SIZE; i++) { if (arg2[i] != static_cast<CORBA::Long> (i + 999)) ERROR_COUNT ("Hello::test_args_2") } - if (arg3.hour != TEST_HOUR - || arg3.minute != TEST_MINUTE + if (arg3.hour != TEST_HOUR + || arg3.minute != TEST_MINUTE || arg3.second != TEST_SECOND) ERROR_COUNT ("Hello::test_args_2") } @@ -324,7 +320,7 @@ void Hello::test_args_3 ( } char * -Hello::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +Hello::get_string (void) ACE_THROW_SPEC ((CORBA::SystemException)) { if (debug) @@ -362,7 +358,7 @@ Hello::get_string (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) return CORBA::string_dup ("Hello there!"); } -char * +char * Hello::test_unbounded_string ( const char * s1, char *& s2, @@ -383,7 +379,7 @@ Hello::test_unbounded_string ( } void -Hello::shutdown (ACE_ENV_SINGLE_ARG_DECL) +Hello::shutdown (void) ACE_THROW_SPEC ((CORBA::SystemException)) { // Give the client thread time to return from the collocated diff --git a/TAO/tests/DII_Collocation_Tests/twoway/Hello.h b/TAO/tests/DII_Collocation_Tests/twoway/Hello.h index 37271331d77..1b98b672e49 100644 --- a/TAO/tests/DII_Collocation_Tests/twoway/Hello.h +++ b/TAO/tests/DII_Collocation_Tests/twoway/Hello.h @@ -10,16 +10,16 @@ #include "ace/OS.h" -class Test_Simple_Test_i +class Test_Simple_Test_i : public virtual POA_Test::Simple_Test { public: - //Constructor + //Constructor Test_Simple_Test_i (void); - - //Destructor + + //Destructor virtual ~Test_Simple_Test_i (void); - + virtual void test_method ( ::CORBA::ULong & error_count @@ -58,7 +58,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_bounded_string_arg ( const char * message @@ -67,7 +67,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_fixed_array_arg ( const ::Test::Fixed_Array message @@ -76,7 +76,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_var_array_arg ( const ::Test::Var_Array messages @@ -85,7 +85,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_bounded_var_size_arg ( const ::Test::Bounded_Var_Size_Arg & message @@ -94,7 +94,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_unbounded_var_size_arg ( const ::Test::Unbounded_Var_Size_Arg & message @@ -103,7 +103,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_fixed_size_arg ( const ::Test::TimeOfDay & t @@ -112,7 +112,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_special_basic_arg ( ::CORBA::Char value @@ -121,7 +121,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_objref_arg ( ::Test::Simple_Test_ptr test @@ -130,7 +130,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_object_arg ( ::CORBA::Object_ptr o @@ -139,7 +139,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_args_1 ( ::CORBA::Object_ptr arg1, @@ -150,7 +150,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_args_2 ( const char * arg1, @@ -161,7 +161,7 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - + virtual void test_args_3 ( const char * arg1, @@ -174,7 +174,7 @@ public: CORBA::SystemException )); - virtual char * get_string (ACE_ENV_SINGLE_ARG_DECL) + virtual char * get_string (void) ACE_THROW_SPEC ((CORBA::SystemException)); virtual @@ -187,8 +187,8 @@ public: ACE_THROW_SPEC (( CORBA::SystemException )); - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) + + virtual void shutdown (void) ACE_THROW_SPEC ((CORBA::SystemException)); CORBA::ULong error_count () const; diff --git a/TAO/tests/DII_Collocation_Tests/twoway/Server_Task.cpp b/TAO/tests/DII_Collocation_Tests/twoway/Server_Task.cpp index 4f901730471..7fe8450cec0 100644 --- a/TAO/tests/DII_Collocation_Tests/twoway/Server_Task.cpp +++ b/TAO/tests/DII_Collocation_Tests/twoway/Server_Task.cpp @@ -32,12 +32,10 @@ Server_Task::svc (void) CORBA::Object_var poa_object = this->sorb_->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; PortableServer::POA_var root_poa = PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; if (CORBA::is_nil (root_poa.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -45,8 +43,7 @@ Server_Task::svc (void) 1); PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + root_poa->the_POAManager (); Hello *hello_impl = 0; ACE_NEW_RETURN (hello_impl, @@ -57,13 +54,11 @@ Server_Task::svc (void) PortableServer::ServantBase_var owner_transfer(hello_impl); Test::Hello_var hello = - hello_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + hello_impl->_this (); CORBA::String_var ior = this->sorb_->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // Output the IOR to the <this->output_> FILE *output_file= ACE_OS::fopen (this->output_, @@ -85,13 +80,11 @@ Server_Task::svc (void) PortableServer::ServantBase_var owner_transfer_simple(simple_impl); Test::Simple_Test_var simple_test = - simple_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + simple_impl->_this (); CORBA::String_var simple_test_ior = this->sorb_->object_to_string (simple_test.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // Output the IOR to the <this->output_> FILE *simple_test_output_file= ACE_OS::fopen (this->simple_test_output_, @@ -105,14 +98,12 @@ Server_Task::svc (void) ACE_OS::fprintf (simple_test_output_file, "%s", simple_test_ior.in ()); ACE_OS::fclose (simple_test_output_file); - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + poa_manager->activate (); // Signal the main thread before we call orb->run (); this->me_.signal (); - this->sorb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->sorb_->run (); ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n")); |