diff options
Diffstat (limited to 'TAO/tests/AMI_Buffering/client.cpp')
-rw-r--r-- | TAO/tests/AMI_Buffering/client.cpp | 72 |
1 files changed, 24 insertions, 48 deletions
diff --git a/TAO/tests/AMI_Buffering/client.cpp b/TAO/tests/AMI_Buffering/client.cpp index 809346dea0e..04238d4d082 100644 --- a/TAO/tests/AMI_Buffering/client.cpp +++ b/TAO/tests/AMI_Buffering/client.cpp @@ -25,10 +25,6 @@ const int BUFFER_SIZE = 64 * PAYLOAD_LENGTH; /// Check that no more than 10% of the messages are not sent. const double LIVENESS_TOLERANCE = 0.9; -/// Limit the depth of the liveness test, avoid blowing up the stack -/// on the server -const int LIVENESS_MAX_DEPTH = 256; - /// Factor in GIOP overhead in the buffer size test const double GIOP_OVERHEAD = 0.9; @@ -333,26 +329,8 @@ configure_policies (CORBA::ORB_ptr orb, return 0; } -void -sync_server (CORBA::ORB_ptr orb, - Test::AMI_Buffering_ptr flusher, - CORBA::Environment &ACE_TRY_ENV) -{ - // Get back in sync with the server... - flusher->flush (ACE_TRY_ENV); - ACE_CHECK; - flusher->sync (ACE_TRY_ENV); - ACE_CHECK; - - // Drain responses from the queue - ACE_Time_Value tv (0, 100000); - orb->run (tv, ACE_TRY_ENV); - ACE_CHECK; -} - int -run_liveness_test (CORBA::ORB_ptr orb, - Test::AMI_AMI_BufferingHandler_ptr reply_handler, +run_liveness_test (Test::AMI_AMI_BufferingHandler_ptr reply_handler, Test::AMI_Buffering_ptr ami_buffering, Test::AMI_Buffering_ptr flusher, Test::AMI_Buffering_Admin_ptr ami_buffering_admin, @@ -362,7 +340,9 @@ run_liveness_test (CORBA::ORB_ptr orb, int test_failed = 0; // Get back in sync with the server... - sync_server (orb, flusher, ACE_TRY_ENV); + flusher->flush (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + flusher->sync (ACE_TRY_ENV); ACE_CHECK_RETURN (-1); CORBA::ULong send_count = @@ -376,7 +356,6 @@ run_liveness_test (CORBA::ORB_ptr orb, for (int j = 0; j != PAYLOAD_LENGTH; ++j) payload[j] = CORBA::Octet(j % 256); - int depth = 0; for (int i = 0; i != liveness_test_iterations; ++i) { ami_buffering->sendc_receive_data (reply_handler, @@ -403,17 +382,6 @@ run_liveness_test (CORBA::ORB_ptr orb, "not enough messages received %u " "expected %u\n", i, receive_count, expected)); - - sync_server (orb, flusher, ACE_TRY_ENV); - ACE_CHECK_RETURN (-1); - } - - if (depth++ == LIVENESS_MAX_DEPTH) - { - sync_server (orb, flusher, ACE_TRY_ENV); - ACE_CHECK_RETURN (-1); - - depth = 0; } } @@ -460,7 +428,10 @@ run_message_count (CORBA::ORB_ptr orb, CORBA::ULong send_count = 0; for (int i = 0; i != iterations; ++i) { - sync_server (orb, flusher.in (), ACE_TRY_ENV); + // Get back in sync with the server... + flusher->flush (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + flusher->sync (ACE_TRY_ENV); ACE_CHECK_RETURN (-1); CORBA::ULong initial_receive_count = @@ -519,8 +490,7 @@ run_message_count (CORBA::ORB_ptr orb, } int liveness_test_failed = - run_liveness_test (orb, - reply_handler.in (), + run_liveness_test (reply_handler.in (), ami_buffering, flusher.in (), ami_buffering_admin, @@ -573,7 +543,10 @@ run_timeout (CORBA::ORB_ptr orb, CORBA::ULong send_count = 0; for (int i = 0; i != iterations; ++i) { - sync_server (orb, flusher.in (), ACE_TRY_ENV); + // Get back in sync with the server... + flusher->flush (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + flusher->sync (ACE_TRY_ENV); ACE_CHECK_RETURN (-1); CORBA::ULong initial_receive_count = @@ -633,8 +606,7 @@ run_timeout (CORBA::ORB_ptr orb, } int liveness_test_failed = - run_liveness_test (orb, - reply_handler.in (), + run_liveness_test (reply_handler.in (), ami_buffering, flusher.in (), ami_buffering_admin, @@ -687,7 +659,10 @@ run_timeout_reactive (CORBA::ORB_ptr orb, CORBA::ULong send_count = 0; for (int i = 0; i != iterations; ++i) { - sync_server (orb, flusher.in (), ACE_TRY_ENV); + // Get back in sync with the server... + flusher->flush (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + flusher->sync (ACE_TRY_ENV); ACE_CHECK_RETURN (-1); CORBA::ULong initial_receive_count = @@ -754,8 +729,7 @@ run_timeout_reactive (CORBA::ORB_ptr orb, #if 0 int liveness_test_failed = - run_liveness_test (orb, - reply_handler.in (), + run_liveness_test (reply_handler.in (), ami_buffering, flusher.in (), ami_buffering_admin, @@ -808,7 +782,10 @@ run_buffer_size (CORBA::ORB_ptr orb, CORBA::ULong bytes_sent = 0; for (int i = 0; i != iterations; ++i) { - sync_server (orb, flusher.in (), ACE_TRY_ENV); + // Get back in sync with the server... + flusher->flush (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + flusher->sync (ACE_TRY_ENV); ACE_CHECK_RETURN (-1); CORBA::ULong initial_bytes_received = @@ -872,8 +849,7 @@ run_buffer_size (CORBA::ORB_ptr orb, } int liveness_test_failed = - run_liveness_test (orb, - reply_handler.in (), + run_liveness_test (reply_handler.in (), ami_buffering, flusher.in (), ami_buffering_admin, |