diff options
author | Steve Huston <shuston@riverace.com> | 2008-07-04 20:18:14 +0000 |
---|---|---|
committer | Steve Huston <shuston@riverace.com> | 2008-07-04 20:18:14 +0000 |
commit | d0bbdebde053b970a9155da6d66cf69b7620dffc (patch) | |
tree | 871e60e63454ccebc277a2cb0fa00a1756cd9801 /ACE/tests | |
parent | b3a98b89e011094f3cb262b38bac9248569f7784 (diff) | |
download | ATCD-d0bbdebde053b970a9155da6d66cf69b7620dffc.tar.gz |
ChangeLogTag:Fri Jul 4 20:11:02 UTC 2008 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/tests')
-rw-r--r-- | ACE/tests/Reference_Counted_Event_Handler_Test.cpp | 409 | ||||
-rw-r--r-- | ACE/tests/Service_Config_Test.cpp | 20 | ||||
-rw-r--r-- | ACE/tests/Thread_Pool_Reactor_Resume_Test.cpp | 8 | ||||
-rw-r--r-- | ACE/tests/Thread_Pool_Reactor_Test.cpp | 7 | ||||
-rw-r--r-- | ACE/tests/run_test.lst | 2 | ||||
-rwxr-xr-x | ACE/tests/run_test.pl | 11 |
6 files changed, 287 insertions, 170 deletions
diff --git a/ACE/tests/Reference_Counted_Event_Handler_Test.cpp b/ACE/tests/Reference_Counted_Event_Handler_Test.cpp index 4857e647be9..20fd83daafe 100644 --- a/ACE/tests/Reference_Counted_Event_Handler_Test.cpp +++ b/ACE/tests/Reference_Counted_Event_Handler_Test.cpp @@ -22,6 +22,7 @@ #include "ace/Select_Reactor.h" #include "ace/TP_Reactor.h" #include "ace/WFMO_Reactor.h" +#include "ace/Dev_Poll_Reactor.h" #include "ace/Get_Opt.h" #include "ace/ACE.h" @@ -32,6 +33,7 @@ static const int message_size = 26; static int test_select_reactor = 1; static int test_tp_reactor = 1; static int test_wfmo_reactor = 1; +static int test_dev_poll_reactor = 1; static int test_io = 1; static int test_timers = 1; static int test_find = 1; @@ -76,11 +78,8 @@ public: Reference_Counted_Event_Handler::Reference_Counted_Event_Handler (int &events) : events_ (events) { - int result = - this->pipe_.open (); - - ACE_ASSERT (result == 0); - ACE_UNUSED_ARG (result); + if (this->pipe_.open () != 0) + ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("ctor: pipe open"))); this->reference_counting_policy ().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED); @@ -115,7 +114,11 @@ Reference_Counted_Event_Handler::handle_input (ACE_HANDLE) buf, sizeof buf - 1); - ACE_ASSERT (result == message_size); + if (result != message_size) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("recv_n expected %d bytes; got %b\n"), + message_size, + result)); buf[message_size] = '\0'; @@ -140,7 +143,11 @@ Reference_Counted_Event_Handler::handle_output (ACE_HANDLE) message, message_size); - ACE_ASSERT (result == message_size); + if (result != message_size) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("send_n sent %b bytes; should be %d\n"), + result, + message_size)); // No longer interested in output. return -1; @@ -221,19 +228,23 @@ reference_counted_event_handler_test_1 (ACE_Reactor *reactor) if (test_io) { - result = - reactor->register_handler (handler->pipe_.read_handle (), - handler, - ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); - - result = - reactor->register_handler (handler->pipe_.write_handle (), - handler, - ACE_Event_Handler::WRITE_MASK); - ACE_ASSERT (result == 0); - - events += 2; + if (-1 == reactor->register_handler (handler->pipe_.read_handle (), + handler, + ACE_Event_Handler::READ_MASK)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("register pipe read"))); + else + ++events; + + if (-1 == reactor->register_handler (handler->pipe_.write_handle (), + handler, + ACE_Event_Handler::WRITE_MASK)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("register pipe write"))); + else + events++; } if (test_timers) @@ -244,29 +255,39 @@ reference_counted_event_handler_test_1 (ACE_Reactor *reactor) one_second_timeout, one_second, one_second); - ACE_ASSERT (timer_id != -1); - - result = - reactor->cancel_timer (timer_id, - 0, - 0); - ACE_ASSERT (result == 1); + if (timer_id == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("schedule_timer"))); + else + if ((result = reactor->cancel_timer (timer_id, 0, 0)) != 1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("cancel_timer returned %d; should be 1\n"), + result)); timer_id = reactor->schedule_timer (handler, one_second_timeout, one_second, one_second); - ACE_ASSERT (timer_id != -1); + if (timer_id == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("schedule_timer"))); + else + events += 2; // Wait for the scheduled and one repeating ACE_Time_Value const two_second (2); timer_id = reactor->schedule_timer (handler, two_second_timeout, two_second); - ACE_ASSERT (result != -1); - - events += 3; + if (timer_id == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("schedule_timer"))); + else + events++; } while (events > 0) @@ -294,8 +315,11 @@ reference_counted_event_handler_test_2 (ACE_Reactor *reactor) reactor->register_handler (handler->pipe_.read_handle (), handler, ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); - + if (result != 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("register pipe handler read"))); + else { ACE_Event_Handler *result_handler = 0; @@ -305,8 +329,15 @@ reference_counted_event_handler_test_2 (ACE_Reactor *reactor) &result_handler); ACE_Event_Handler_var safe_result_handler (result_handler); - ACE_ASSERT (result == 0); - ACE_ASSERT (result_handler == handler); + if (result != 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("Looking up pipe read handler"))); + else + if (result_handler != handler) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Mismatch: result_handler %@ should be %@\n"), + result_handler, handler)); } { @@ -318,14 +349,20 @@ reference_counted_event_handler_test_2 (ACE_Reactor *reactor) &result_handler); ACE_Event_Handler_var safe_result_handler (result_handler); - ACE_ASSERT (result == -1); + if (result != 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("Looking up pipe write handler"))); } { ACE_Event_Handler_var result_handler = reactor->find_handler (handler->pipe_.read_handle ()); - ACE_ASSERT (result_handler.handler () == handler); + if (result_handler.handler () != handler) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Mismatch 2: result_handler %@ should be %@\n"), + result_handler.handler (), handler)); } } @@ -336,19 +373,23 @@ reference_counted_event_handler_test_2 (ACE_Reactor *reactor) ACE_Event_Handler_var safe_handler (handler); - result = - reactor->register_handler (handler->pipe_.read_handle (), - handler, - ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); - - result = - reactor->register_handler (handler->pipe_.write_handle (), - handler, - ACE_Event_Handler::WRITE_MASK); - ACE_ASSERT (result == 0); - - events += 2; + if (-1 == reactor->register_handler (handler->pipe_.read_handle (), + handler, + ACE_Event_Handler::READ_MASK)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("register pipe read"))); + else + ++events; + + if (-1 == reactor->register_handler (handler->pipe_.write_handle (), + handler, + ACE_Event_Handler::WRITE_MASK)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("register pipe write"))); + else + events++; } if (test_timers) @@ -363,13 +404,15 @@ reference_counted_event_handler_test_2 (ACE_Reactor *reactor) one_second_timeout, one_second, one_second); - ACE_ASSERT (timer_id != -1); - - result = - reactor->cancel_timer (timer_id, - 0, - 0); - ACE_ASSERT (result == 1); + if (timer_id == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("schedule_timer"))); + else + if ((result = reactor->cancel_timer (timer_id, 0, 0)) != 1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("cancel_timer returned %d; should be 1\n"), + result)); } if (test_timers) @@ -384,16 +427,24 @@ reference_counted_event_handler_test_2 (ACE_Reactor *reactor) one_second_timeout, one_second, one_second); - ACE_ASSERT (timer_id != -1); + if (timer_id == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("schedule_timer"))); + else + events += 2; // Wait for the scheduled and one repeating ACE_Time_Value const two_second (2); timer_id = reactor->schedule_timer (handler, two_second_timeout, two_second); - ACE_ASSERT (result != -1); - - events += 3; + if (timer_id == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("schedule_timer"))); + else + events++; } while (events > 0) @@ -459,20 +510,17 @@ Simple_Event_Handler::Simple_Event_Handler (int &events, : events_ (events), close_count_ (close_count) { - int result = - this->pipe_.open (); + if (-1 == this->pipe_.open ()) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("Simple_Event_Handler pipe open"))); - ACE_ASSERT (result == 0); - ACE_UNUSED_ARG (result); - - ACE_DEBUG ((LM_DEBUG, - "Simple_Event_Handler()\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Simple_Event_Handler()\n"))); } Simple_Event_Handler::~Simple_Event_Handler (void) { - ACE_DEBUG ((LM_DEBUG, - "~Simple_Event_Handler()\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("~Simple_Event_Handler()\n"))); this->pipe_.close (); } @@ -480,8 +528,7 @@ Simple_Event_Handler::~Simple_Event_Handler (void) int Simple_Event_Handler::handle_input (ACE_HANDLE) { - ACE_DEBUG ((LM_DEBUG, - "Simple_Event_Handler::handle_input()\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Simple_Event_Handler::handle_input()\n"))); --this->events_; @@ -491,13 +538,13 @@ Simple_Event_Handler::handle_input (ACE_HANDLE) ACE::recv_n (this->pipe_.read_handle (), buf, sizeof buf - 1); - - ACE_ASSERT (result == message_size); - + if (result != message_size) + ACE_ERROR ((LM_ERROR, ACE_TEXT ("line %l recv_n got %b; should be %d\n"), + result, message_size)); buf[message_size] = '\0'; ACE_DEBUG ((LM_DEBUG, - "Message received: %C\n", + ACE_TEXT ("Message received: %C\n"), buf)); return 0; @@ -506,8 +553,7 @@ Simple_Event_Handler::handle_input (ACE_HANDLE) int Simple_Event_Handler::handle_output (ACE_HANDLE) { - ACE_DEBUG ((LM_DEBUG, - "Simple_Event_Handler::handle_output()\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Simple_Event_Handler::handle_output()\n"))); --this->events_; @@ -515,8 +561,10 @@ Simple_Event_Handler::handle_output (ACE_HANDLE) ACE::send_n (this->pipe_.write_handle (), message, message_size); - - ACE_ASSERT (result == message_size); + if (result != message_size) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l send_n sent %b; should be %d\n"), + result, message_size)); // No longer interested in output. return -1; @@ -527,7 +575,7 @@ Simple_Event_Handler::handle_timeout (const ACE_Time_Value &, const void *arg) { ACE_DEBUG ((LM_DEBUG, - "Simple_Event_Handler::handle_timeout() for arg = %C\n", + ACE_TEXT ("Simple_Event_Handler::handle_timeout() for arg = %C\n"), (const char *) arg)); --this->events_; @@ -548,7 +596,8 @@ Simple_Event_Handler::handle_close (ACE_HANDLE handle, ACE_Reactor_Mask masks) { ACE_DEBUG ((LM_DEBUG, - "Simple_Event_Handler::handle_close() called with handle = %d and masks = %d with close count = %d.\n", + ACE_TEXT ("Simple_Event_Handler::handle_close() called with ") + ACE_TEXT ("handle = %d and masks = %d with close count = %d.\n"), handle, masks, --this->close_count_)); @@ -575,8 +624,11 @@ simple_event_handler (ACE_Reactor *reactor) reactor->register_handler (handler.pipe_.read_handle (), &handler, ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); - + if (result != 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("register pipe handler read"))); + else { ACE_Event_Handler *result_handler = 0; @@ -585,9 +637,15 @@ simple_event_handler (ACE_Reactor *reactor) ACE_Event_Handler::READ_MASK, &result_handler); ACE_Event_Handler_var safe_result_handler (result_handler); - - ACE_ASSERT (result == 0); - ACE_ASSERT (result_handler == &handler); + if (result != 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("Looking up pipe read handler"))); + else + if (result_handler != &handler) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Mismatch: result_handler %@ should be %@\n"), + result_handler, &handler)); } { @@ -598,22 +656,29 @@ simple_event_handler (ACE_Reactor *reactor) ACE_Event_Handler::WRITE_MASK, &result_handler); ACE_Event_Handler_var safe_result_handler (result_handler); - - ACE_ASSERT (result == -1); + if (result == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("handler()"))); } { ACE_Event_Handler_var result_handler = reactor->find_handler (handler.pipe_.read_handle ()); - - ACE_ASSERT (result_handler.handler () == &handler); + if (result_handler.handler () != &handler) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Mismatch: line %l: result_handler.handler %@ ") + ACE_TEXT ("should be %@\n"), + result_handler.handler (), &handler)); } result = reactor->remove_handler (handler.pipe_.read_handle (), ACE_Event_Handler::ALL_EVENTS_MASK | ACE_Event_Handler::DONT_CALL); - - ACE_ASSERT (result == 0); + if (result != 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l: %p\n"), + ACE_TEXT ("remove_handler"))); } if (test_io) @@ -622,19 +687,23 @@ simple_event_handler (ACE_Reactor *reactor) new Simple_Event_Handler (events, 2); - result = - reactor->register_handler (handler->pipe_.read_handle (), - handler, - ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); - - result = - reactor->register_handler (handler->pipe_.write_handle (), - handler, - ACE_Event_Handler::WRITE_MASK); - ACE_ASSERT (result == 0); - - events += 2; + if (-1 == reactor->register_handler (handler->pipe_.read_handle (), + handler, + ACE_Event_Handler::READ_MASK)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("register pipe read"))); + else + ++events; + + if (-1 == reactor->register_handler (handler->pipe_.write_handle (), + handler, + ACE_Event_Handler::WRITE_MASK)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("register pipe write"))); + else + events++; } if (test_timers) @@ -648,13 +717,15 @@ simple_event_handler (ACE_Reactor *reactor) one_second_timeout, one_second, one_second); - ACE_ASSERT (timer_id != -1); - - result = - reactor->cancel_timer (timer_id, - 0, - 0); - ACE_ASSERT (result == 1); + if (timer_id == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("schedule_timer"))); + else + if ((result = reactor->cancel_timer (timer_id, 0, 0)) != 1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("cancel_timer returned %d; should be 1\n"), + result)); } if (test_timers) @@ -668,16 +739,24 @@ simple_event_handler (ACE_Reactor *reactor) one_second_timeout, one_second, one_second); - ACE_ASSERT (timer_id != -1); + if (timer_id == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("schedule_timer"))); + else + events += 2; // Wait for the scheduled and one repeating ACE_Time_Value const two_second (2); timer_id = reactor->schedule_timer (handler, two_second_timeout, two_second); - ACE_ASSERT (result != -1); - - events += 3; + if (timer_id == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("schedule_timer"))); + else + events++; } while (events > 0) @@ -692,8 +771,7 @@ simple (ACE_Reactor_Impl *impl) { ACE_Reactor reactor (impl, 1); - ACE_DEBUG ((LM_DEBUG, - "\nTesting Simple Event Handler....\n\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nTesting Simple Event Handler....\n\n"))); simple_event_handler (&reactor); } @@ -724,23 +802,20 @@ public: Closed_In_Upcall_Event_Handler::Closed_In_Upcall_Event_Handler (int &events) : events_ (events) { - int result = - this->pipe_.open (); - - ACE_ASSERT (result == 0); - ACE_UNUSED_ARG (result); + if (-1 == this->pipe_.open ()) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("Closed_In_Upcall_Event_Handler pipe open"))); this->reference_counting_policy ().value (ACE_Event_Handler::Reference_Counting_Policy::ENABLED); - ACE_DEBUG ((LM_DEBUG, - "Closed_In_Upcall_Event_Handler()\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Closed_In_Upcall_Event_Handler()\n"))); } Closed_In_Upcall_Event_Handler::~Closed_In_Upcall_Event_Handler (void) { - ACE_DEBUG ((LM_DEBUG, - "~Closed_In_Upcall_Event_Handler()\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("~Closed_In_Upcall_Event_Handler()\n"))); this->pipe_.close (); } @@ -749,15 +824,15 @@ int Closed_In_Upcall_Event_Handler::handle_input (ACE_HANDLE) { ACE_DEBUG ((LM_DEBUG, - "Closed_In_Upcall_Event_Handler::handle_input()\n")); + ACE_TEXT ("Closed_In_Upcall_Event_Handler::handle_input()\n"))); this->events_--; - int result = - this->reactor ()->remove_handler (this->pipe_.read_handle (), - ACE_Event_Handler::ALL_EVENTS_MASK); - ACE_ASSERT (result == 0); - ACE_UNUSED_ARG (result); + if (0 != this->reactor ()->remove_handler (this->pipe_.read_handle (), + ACE_Event_Handler::ALL_EVENTS_MASK)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("remove_handler"))); char buf[message_size + 1]; @@ -766,12 +841,14 @@ Closed_In_Upcall_Event_Handler::handle_input (ACE_HANDLE) buf, sizeof buf - 1); - ACE_ASSERT (recv_result == message_size); + if (recv_result != message_size) + ACE_ERROR ((LM_ERROR, ACE_TEXT ("line %l recv_n got %b; should be %d\n"), + recv_result, message_size)); buf[message_size] = '\0'; ACE_DEBUG ((LM_DEBUG, - "Message received: %C\n", + ACE_TEXT ("Message received: %C\n"), buf)); return 0; @@ -782,8 +859,9 @@ Closed_In_Upcall_Event_Handler::handle_close (ACE_HANDLE handle, ACE_Reactor_Mask masks) { ACE_DEBUG ((LM_DEBUG, - "Closed_In_Upcall_Event_Handler::handle_close() called with handle = %d and masks = %d. " - "Reference count is %d\n", + ACE_TEXT ("Closed_In_Upcall_Event_Handler::handle_close() ") + ACE_TEXT ("called with handle = %d and masks = %d. ") + ACE_TEXT ("Reference count is %d\n"), handle, masks, this->reference_count_.value ())); @@ -798,7 +876,7 @@ Closed_In_Upcall_Event_Handler::add_reference (void) this->ACE_Event_Handler::add_reference (); ACE_DEBUG ((LM_DEBUG, - "Reference count after add_reference() is %d\n", + ACE_TEXT ("Reference count after add_reference() is %d\n"), this->reference_count_.value ())); return reference_count; @@ -811,7 +889,7 @@ Closed_In_Upcall_Event_Handler::remove_reference (void) this->ACE_Event_Handler::remove_reference (); ACE_DEBUG ((LM_DEBUG, - "Reference count after remove_reference() is %d\n", + ACE_TEXT ("Reference count after remove_reference() is %d\n"), reference_count)); return reference_count; @@ -835,15 +913,19 @@ closed_in_upcall_event_handler (ACE_Reactor *reactor) message, message_size); - ACE_ASSERT (send_n_result == message_size); - - int register_handler_result = - reactor->register_handler (handler->pipe_.read_handle (), - handler, - ACE_Event_Handler::READ_MASK); - ACE_ASSERT (register_handler_result == 0); - - events += 1; + if (send_n_result != message_size) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l send_n sent %b; should be %d\n"), + send_n_result, message_size)); + + if (-1 == reactor->register_handler (handler->pipe_.read_handle (), + handler, + ACE_Event_Handler::READ_MASK)) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("register_handler"))); + else + events += 1; } while (events > 0) @@ -859,7 +941,7 @@ closed_in_upcall (ACE_Reactor_Impl *impl) ACE_Reactor reactor (impl, 1); ACE_DEBUG ((LM_DEBUG, - "\nTesting Closed in Upcall Event Handler....\n\n")); + ACE_TEXT ("\nTesting Closed in Upcall Event Handler....\n\n"))); closed_in_upcall_event_handler (&reactor); } @@ -906,6 +988,9 @@ parse_args (int argc, ACE_TCHAR *argv[]) case 'c': test_wfmo_reactor = ACE_OS::atoi (get_opt.opt_arg ()); break; + case 'd': + test_dev_poll_reactor = ACE_OS::atoi (get_opt.opt_arg ()); + break; case 'f': test_simple_event_handler = ACE_OS::atoi (get_opt.opt_arg ()); break; @@ -938,6 +1023,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) ACE_TEXT ("\t[-a test Select Reactor] (defaults to %d)\n") ACE_TEXT ("\t[-b test TP Reactor] (defaults to %d)\n") ACE_TEXT ("\t[-c test WFMO Reactor] (defaults to %d)\n") + ACE_TEXT ("\t[-d test Dev Poll Reactor] (defaults to %d)\n") ACE_TEXT ("\t[-f test simple event handler] (defaults to %d)\n") ACE_TEXT ("\t[-g test reference counted event handler (first test)] (defaults to %d)\n") ACE_TEXT ("\t[-h test reference counted event handler (second test)] (defaults to %d)\n") @@ -951,6 +1037,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) test_select_reactor, test_tp_reactor, test_wfmo_reactor, + test_dev_poll_reactor, test_simple_event_handler, test_reference_counted_event_handler_1, test_reference_counted_event_handler_2, @@ -979,8 +1066,7 @@ run_main (int argc, ACE_TCHAR *argv[]) if (test_select_reactor) { - ACE_DEBUG ((LM_DEBUG, - "\n\nTesting Select Reactor....\n\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n\nTesting Select Reactor....\n\n"))); test<ACE_Select_Reactor> test; ACE_UNUSED_ARG (test); @@ -988,8 +1074,7 @@ run_main (int argc, ACE_TCHAR *argv[]) if (test_tp_reactor) { - ACE_DEBUG ((LM_DEBUG, - "\n\nTesting TP Reactor....\n\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n\nTesting TP Reactor....\n\n"))); test<ACE_TP_Reactor> test; ACE_UNUSED_ARG (test); @@ -1000,8 +1085,7 @@ run_main (int argc, ACE_TCHAR *argv[]) if (test_wfmo_reactor) { - ACE_DEBUG ((LM_DEBUG, - "\n\nTesting WFMO Reactor....\n\n")); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n\nTesting WFMO Reactor....\n\n"))); test<ACE_WFMO_Reactor> test; ACE_UNUSED_ARG (test); @@ -1009,6 +1093,19 @@ run_main (int argc, ACE_TCHAR *argv[]) #endif /* ACE_WIN32 && ACE_HAS_WINSOCK2 */ +#if defined (ACE_HAS_DEV_POLL) || defined (ACE_HAS_EVENT_POLL) + + if (test_dev_poll_reactor) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("\n\nTesting ACE_Dev_Poll_Reactor....\n\n"))); + + test<ACE_Dev_Poll_Reactor> test; + ACE_UNUSED_ARG (test); + } + +#endif /* ACE_HAS_DEV_POOL || ACE_HAS_EVENT_POLL */ + ACE_END_TEST; return 0; diff --git a/ACE/tests/Service_Config_Test.cpp b/ACE/tests/Service_Config_Test.cpp index bbecdf9a41e..b20b8d35ccb 100644 --- a/ACE/tests/Service_Config_Test.cpp +++ b/ACE/tests/Service_Config_Test.cpp @@ -210,12 +210,16 @@ testLoadingServiceConfFileAndProcessNo (int argc, ACE_TCHAR *argv[]) // <ACE_Service_Config> gets called. ACE_Service_Config daemon; - ACE_ASSERT (daemon.open (new_argv.argc (), - new_argv.argv ()) != -1 || errno == ENOENT); + if (daemon.open (new_argv.argc (), new_argv.argv ()) == -1 && + errno != ENOENT) + ACE_ERROR ((LM_ERROR, ACE_TEXT ("line %l %p\n"), ACE_TEXT ("daemon.open"))); ACE_Time_Value tv (argc > 1 ? ACE_OS::atoi (argv[1]) : 2); - ACE_ASSERT (ACE_Reactor::instance()->run_reactor_event_loop (tv) == 0); + if (ACE_Reactor::instance()->run_reactor_event_loop (tv) == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("run_reactor_event_loop"))); // Wait for all threads to complete. ACE_Thread_Manager::instance ()->wait (); @@ -263,12 +267,16 @@ testLoadingServiceConfFile (int argc, ACE_TCHAR *argv[]) // <ACE_Service_Config> gets called. ACE_Service_Config daemon; - ACE_ASSERT (daemon.open (new_argv.argc (), - new_argv.argv ()) != -1 || errno == ENOENT); + if (daemon.open (new_argv.argc (), new_argv.argv ()) == -1 && + errno != ENOENT) + ACE_ERROR ((LM_ERROR, ACE_TEXT ("line %l %p\n"), ACE_TEXT ("daemon.open"))); ACE_Time_Value tv (argc > 1 ? ACE_OS::atoi (argv[1]) : 2); - ACE_ASSERT (ACE_Reactor::instance()->run_reactor_event_loop (tv) == 0); + if (ACE_Reactor::instance()->run_reactor_event_loop (tv) == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("line %l %p\n"), + ACE_TEXT ("run_reactor_event_loop"))); // Wait for all threads to complete. ACE_Thread_Manager::instance ()->wait (); diff --git a/ACE/tests/Thread_Pool_Reactor_Resume_Test.cpp b/ACE/tests/Thread_Pool_Reactor_Resume_Test.cpp index 59de935d0f7..51df91fccf0 100644 --- a/ACE/tests/Thread_Pool_Reactor_Resume_Test.cpp +++ b/ACE/tests/Thread_Pool_Reactor_Resume_Test.cpp @@ -60,10 +60,10 @@ static const ACE_TCHAR *rendezvous = ACE_TEXT ("127.0.0.1:10010"); static size_t svr_thrno = ACE_MAX_THREADS; -#if defined (CHORUS) \ - || defined (ACE_VXWORKS) // default network parameters (MAX_BINDS and system buffers) are too small for full test - // Add platforms that can't handle too many - // connection simultaneously here. +// Default network parameters (MAX_BINDS and system buffers) are too small +// for full test on some platforms; add platforms that can't handle too many +// connection simultaneously here. +#if defined (CHORUS) || defined (ACE_VXWORKS) || defined (ACE_HAS_PHARLAP) #define ACE_LOAD_FACTOR /2 #else #define ACE_LOAD_FACTOR diff --git a/ACE/tests/Thread_Pool_Reactor_Test.cpp b/ACE/tests/Thread_Pool_Reactor_Test.cpp index e60233777e7..61febd32f80 100644 --- a/ACE/tests/Thread_Pool_Reactor_Test.cpp +++ b/ACE/tests/Thread_Pool_Reactor_Test.cpp @@ -63,9 +63,10 @@ static const ACE_TCHAR *rendezvous = ACE_TEXT ("127.0.0.1:10010"); // Total number of server threads. static size_t svr_thrno = ACE_MAX_THREADS; -#if defined (ACE_VXWORKS) // default network parameters (MAX_BINDS and system buffers) are too small for full test - // Add platforms that can't handle too many - // connection simultaneously here. +// Default network parameters (MAX_BINDS and system buffers) are too small +// for full test on some platforms; add platforms that can't handle too many +// connection simultaneously here. +#if defined (ACE_VXWORKS) || defined (ACE_HAS_PHARLAP) #define ACE_LOAD_FACTOR /2 #else #define ACE_LOAD_FACTOR diff --git a/ACE/tests/run_test.lst b/ACE/tests/run_test.lst index b61ecbe70a0..5320747ca64 100644 --- a/ACE/tests/run_test.lst +++ b/ACE/tests/run_test.lst @@ -144,7 +144,7 @@ Refcounted_Auto_Ptr_Test: !ACE_FOR_TAO Reference_Counted_Event_Handler_Test Reverse_Lock_Test RW_Process_Mutex_Test: !VxWorks !ACE_FOR_TAO !PHARLAP -Sendfile_Test: !QNX !NO_NETWORK !VxWorks +Sendfile_Test: !QNX !NO_NETWORK !VxWorks !LabVIEW_RT Signal_Test: !VxWorks63 !VxWorks64 !VxWorks65 !LynxOS SOCK_Connector_Test: !NO_NETWORK SOCK_Netlink_Test: !ACE_FOR_TAO diff --git a/ACE/tests/run_test.pl b/ACE/tests/run_test.pl index 5be05fe7d01..5079472a531 100755 --- a/ACE/tests/run_test.pl +++ b/ACE/tests/run_test.pl @@ -540,6 +540,14 @@ else { my $target = PerlACE::TestTarget::create_target (1); + # Put needed files in place for targets that require them. + # + # Service_Config_Test needs service config file. + my $svc_conf_file = $target->LocalFile ("Service_Config_Test.conf"); + if ($target->PutFile ("Service_Config_Test.conf", $svc_conf_file) == -1) { + print STDERR "WARNING: Cannot send $svc_conf_file to target\n"; + } + foreach $test (@tests) { if (defined $opt_d) { print "Would run test $test now\n"; @@ -555,6 +563,9 @@ else { } $target->GetStderrLog(); } + + # Clean up specially placed test files. + $target->DeleteFile($svc_conf_file); } check_resources ($oh) if (!defined $opt_d); |