diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-01-24 15:39:09 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-01-24 15:39:09 +0000 |
commit | c801f87e59c00f72bdeb5ce7bd0d276674665bac (patch) | |
tree | 70bff03d1cf156ecf05ee4c5c338d8ce423e64ee /TAO/tests/AMI_Buffering/client.cpp | |
parent | 98c0b37d4714ff774fc3ada8c9ee893c719af714 (diff) | |
download | ATCD-c801f87e59c00f72bdeb5ce7bd0d276674665bac.tar.gz |
Wed Jan 24 14:00:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/tests/AMI_Buffering/client.cpp')
-rw-r--r-- | TAO/tests/AMI_Buffering/client.cpp | 115 |
1 files changed, 23 insertions, 92 deletions
diff --git a/TAO/tests/AMI_Buffering/client.cpp b/TAO/tests/AMI_Buffering/client.cpp index 2e05c13f86e..83ee301c399 100644 --- a/TAO/tests/AMI_Buffering/client.cpp +++ b/TAO/tests/AMI_Buffering/client.cpp @@ -121,15 +121,12 @@ main (int argc, char *argv[]) { CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; CORBA::Object_var poa_object = orb->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, @@ -137,22 +134,18 @@ main (int argc, char *argv[]) 1); PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + root_poa->the_POAManager (); - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + poa_manager->activate (); if (parse_args (argc, argv) != 0) return 1; CORBA::Object_var tmp = orb->string_to_object(server_ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; Test::AMI_Buffering_var ami_buffering = Test::AMI_Buffering::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; if (CORBA::is_nil (ami_buffering.in ())) { @@ -164,11 +157,9 @@ main (int argc, char *argv[]) tmp = orb->string_to_object(admin_ior ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; Test::AMI_Buffering_Admin_var ami_buffering_admin = Test::AMI_Buffering_Admin::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; if (CORBA::is_nil (ami_buffering_admin.in ())) { @@ -193,7 +184,6 @@ main (int argc, char *argv[]) ami_buffering.in (), ami_buffering_admin.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; } else if (run_timeout_test) { @@ -204,7 +194,6 @@ main (int argc, char *argv[]) ami_buffering.in (), ami_buffering_admin.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; } else if (run_timeout_reactive_test) { @@ -215,7 +204,6 @@ main (int argc, char *argv[]) ami_buffering.in (), ami_buffering_admin.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; } else if (run_buffer_size_test) { @@ -226,7 +214,6 @@ main (int argc, char *argv[]) ami_buffering.in (), ami_buffering_admin.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; } else { @@ -238,14 +225,11 @@ main (int argc, char *argv[]) client_task.thr_mgr ()->wait (); - ami_buffering->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + ami_buffering->shutdown (); root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + orb->destroy (); } ACE_CATCHANY { @@ -267,11 +251,9 @@ configure_policies (CORBA::ORB_ptr orb, { CORBA::Object_var object = orb->resolve_initial_references ("PolicyCurrent" ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); CORBA::PolicyCurrent_var policy_current = CORBA::PolicyCurrent::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); if (CORBA::is_nil (policy_current.in ())) { @@ -289,21 +271,16 @@ configure_policies (CORBA::ORB_ptr orb, orb->create_policy (Messaging::SYNC_SCOPE_POLICY_TYPE, scope_as_any ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); policies[1] = orb->create_policy (TAO::BUFFERING_CONSTRAINT_POLICY_TYPE, buffering_as_any ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); policy_current->set_policy_overrides (policies, CORBA::ADD_OVERRIDE ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - policies[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - policies[1]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + policies[0]->destroy (); + policies[1]->destroy (); TAO::BufferingConstraint flush_constraint; flush_constraint.mode = TAO::BUFFER_FLUSH; @@ -317,20 +294,16 @@ configure_policies (CORBA::ORB_ptr orb, orb->create_policy (TAO::BUFFERING_CONSTRAINT_POLICY_TYPE, buffering_as_any ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); object = ami_buffering->_set_policy_overrides (policies, CORBA::ADD_OVERRIDE ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - policies[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + policies[0]->destroy (); flusher = Test::AMI_Buffering::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); return 0; } @@ -341,15 +314,12 @@ sync_server (CORBA::ORB_ptr orb, ACE_ENV_ARG_DECL) { // Get back in sync with the server... - flusher->flush (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - flusher->sync (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + flusher->flush (); + flusher->sync (); // Drain responses from the queue ACE_Time_Value tv (0, 100000); orb->run (tv ACE_ENV_ARG_PARAMETER); - ACE_CHECK; } int @@ -365,11 +335,9 @@ run_liveness_test (CORBA::ORB_ptr orb, // Get back in sync with the server... sync_server (orb, flusher ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); CORBA::ULong send_count = - ami_buffering_admin->request_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->request_count (); int liveness_test_iterations = int(send_count); ACE_DEBUG ((LM_DEBUG, " liveness_test_iterations = %d\n", @@ -386,16 +354,13 @@ run_liveness_test (CORBA::ORB_ptr orb, ami_buffering->sendc_receive_data (reply_handler, payload ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); send_count++; CORBA::ULong receive_count = - ami_buffering_admin->request_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->request_count (); ACE_Time_Value tv (0, 10 * 1000); orb->run (tv ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); // Once the system has sent enough messages we don't // expect it to fall too far behind, i.e. at least 90% of the @@ -413,13 +378,11 @@ run_liveness_test (CORBA::ORB_ptr orb, i, receive_count, expected)); sync_server (orb, flusher ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); } if (depth++ == LIVENESS_MAX_DEPTH) { sync_server (orb, flusher ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); depth = 0; } @@ -445,7 +408,6 @@ run_message_count (CORBA::ORB_ptr orb, configure_policies (orb, buffering_constraint, ami_buffering, flusher.out () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); if (test_failed != 0) return test_failed; @@ -462,18 +424,15 @@ run_message_count (CORBA::ORB_ptr orb, PortableServer::ServantBase_var owner_transfer(reply_handler_impl); Test::AMI_AMI_BufferingHandler_var reply_handler = - reply_handler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + reply_handler_impl->_this (); CORBA::ULong send_count = 0; for (int i = 0; i != iterations; ++i) { sync_server (orb, flusher.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); CORBA::ULong initial_receive_count = - ami_buffering_admin->request_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->request_count (); if (initial_receive_count != send_count) { @@ -488,16 +447,13 @@ run_message_count (CORBA::ORB_ptr orb, ami_buffering->sendc_receive_data (reply_handler.in (), payload ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); send_count++; CORBA::ULong receive_count = - ami_buffering_admin->request_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->request_count (); ACE_Time_Value tv (0, 10 * 1000); orb->run (tv ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); CORBA::ULong iteration_count = send_count - initial_receive_count; @@ -537,7 +493,6 @@ run_message_count (CORBA::ORB_ptr orb, flusher.in (), ami_buffering_admin ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); if (liveness_test_failed) test_failed = 1; @@ -562,7 +517,6 @@ run_timeout (CORBA::ORB_ptr orb, configure_policies (orb, buffering_constraint, ami_buffering, flusher.out () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); if (test_failed != 0) return test_failed; @@ -579,18 +533,15 @@ run_timeout (CORBA::ORB_ptr orb, PortableServer::ServantBase_var owner_transfer(reply_handler_impl); Test::AMI_AMI_BufferingHandler_var reply_handler = - reply_handler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + reply_handler_impl->_this (); CORBA::ULong send_count = 0; for (int i = 0; i != iterations; ++i) { sync_server (orb, flusher.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); CORBA::ULong initial_receive_count = - ami_buffering_admin->request_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->request_count (); if (initial_receive_count != send_count) { @@ -606,16 +557,13 @@ run_timeout (CORBA::ORB_ptr orb, ami_buffering->sendc_receive_data (reply_handler.in (), payload ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); send_count++; CORBA::ULong receive_count = - ami_buffering_admin->request_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->request_count (); ACE_Time_Value tv (0, 10 * 1000); orb->run (tv ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); ACE_Time_Value elapsed = ACE_OS::gettimeofday () - start; if (receive_count != initial_receive_count) @@ -655,7 +603,6 @@ run_timeout (CORBA::ORB_ptr orb, flusher.in (), ami_buffering_admin ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); if (liveness_test_failed) test_failed = 1; @@ -680,7 +627,6 @@ run_timeout_reactive (CORBA::ORB_ptr orb, configure_policies (orb, buffering_constraint, ami_buffering, flusher.out () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); if (test_failed != 0) return test_failed; @@ -697,18 +643,15 @@ run_timeout_reactive (CORBA::ORB_ptr orb, PortableServer::ServantBase_var owner_transfer(reply_handler_impl); Test::AMI_AMI_BufferingHandler_var reply_handler = - reply_handler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + reply_handler_impl->_this (); CORBA::ULong send_count = 0; for (int i = 0; i != iterations; ++i) { sync_server (orb, flusher.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); CORBA::ULong initial_receive_count = - ami_buffering_admin->request_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->request_count (); if (initial_receive_count != send_count) { @@ -723,18 +666,15 @@ run_timeout_reactive (CORBA::ORB_ptr orb, ami_buffering->sendc_receive_data (reply_handler.in (), payload ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); send_count++; } while (1) { CORBA::ULong receive_count = - ami_buffering_admin->request_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->request_count (); ACE_Time_Value tv (0, 10 * 1000); orb->run (tv ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); ACE_Time_Value elapsed = ACE_OS::gettimeofday () - start; if (receive_count != initial_receive_count) @@ -775,7 +715,6 @@ run_timeout_reactive (CORBA::ORB_ptr orb, flusher.in (), ami_buffering_admin ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); if (liveness_test_failed) test_failed = 1; @@ -802,7 +741,6 @@ run_buffer_size (CORBA::ORB_ptr orb, configure_policies (orb, buffering_constraint, ami_buffering, flusher.out () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); if (test_failed != 0) return test_failed; @@ -817,18 +755,15 @@ run_buffer_size (CORBA::ORB_ptr orb, PortableServer::ServantBase_var owner_transfer(reply_handler_impl); Test::AMI_AMI_BufferingHandler_var reply_handler = - reply_handler_impl->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + reply_handler_impl->_this (); CORBA::ULong bytes_sent = 0; for (int i = 0; i != iterations; ++i) { sync_server (orb, flusher.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); CORBA::ULong initial_bytes_received = - ami_buffering_admin->bytes_received_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->bytes_received_count (); if (initial_bytes_received != bytes_sent) { @@ -843,16 +778,13 @@ run_buffer_size (CORBA::ORB_ptr orb, ami_buffering->sendc_receive_data (reply_handler.in (), payload ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); bytes_sent += PAYLOAD_LENGTH; CORBA::ULong bytes_received = - ami_buffering_admin->bytes_received_count (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); + ami_buffering_admin->bytes_received_count (); ACE_Time_Value tv (0, 10 * 1000); orb->run (tv ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); CORBA::ULong payload_delta = bytes_sent - initial_bytes_received; @@ -897,7 +829,6 @@ run_buffer_size (CORBA::ORB_ptr orb, flusher.in (), ami_buffering_admin ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); if (liveness_test_failed) test_failed = 1; |