diff options
Diffstat (limited to 'ACE/tests')
67 files changed, 2588 insertions, 1466 deletions
diff --git a/ACE/tests/.cvsignore b/ACE/tests/.cvsignore new file mode 100755 index 00000000000..052901de3e2 --- /dev/null +++ b/ACE/tests/.cvsignore @@ -0,0 +1,306 @@ +ACE_Init_Test +ACE_Init_Test +ACE_Test +ACE_Test +ARGV_Test +ARGV_Test +Aio_Platform_Test +Aio_Platform_Test +Arg_Shifter_Test +Arg_Shifter_Test +Atomic_Op_Test +Atomic_Op_Test +Auto_IncDec_Test +Auto_IncDec_Test +Barrier_Test +Barrier_Test +Basic_Types_Test +Basic_Types_Test +Bound_Ptr_Test +Bound_Ptr_Test +Buffer_Stream_Test +Buffer_Stream_Test +Bug_1576_Regression_Test +Bug_1576_Regression_Test +CDR_Array_Test +CDR_Array_Test +CDR_File_Test +CDR_File_Test +CDR_Test +CDR_Test +Cache_Map_Manager_Test +Cache_Map_Manager_Test +Cached_Accept_Conn_Test +Cached_Accept_Conn_Test +Cached_Allocator_Test +Cached_Allocator_Test +Cached_Conn_Test +Cached_Conn_Test +Capabilities_Test +Capabilities_Test +Codecs_Test +Codecs_Test +Collection_Test +Collection_Test +Config_Test +Config_Test +Conn_Test +Conn_Test +DLL_Test +DLL_Test +DLList_Test +DLList_Test +Date_Time_Test +Date_Time_Test +Dev_Poll_Reactor_Test +Dev_Poll_Reactor_Test +Dirent_Test +Dirent_Test +Dynamic_Priority_Test +Dynamic_Priority_Test +Enum_Interfaces_Test +Enum_Interfaces_Test +Env_Value_Test +Env_Value_Test +FIFO_Test +FIFO_Test +FlReactor_Test +FlReactor_Test +Framework_Component_Test +Framework_Component_Test +Future_Set_Test +Future_Set_Test +Future_Test +Future_Test +Get_Opt_Test +Get_Opt_Test +Handle_Set_Test +Handle_Set_Test +Hash_Map_Bucket_Iterator_Test +Hash_Map_Bucket_Iterator_Test +Hash_Map_Manager_Test +Hash_Map_Manager_Test +High_Res_Timer_Test +High_Res_Timer_Test +INET_Addr_Test +INET_Addr_Test +INET_Addr_Test_IPV6 +INET_Addr_Test_IPV6 +IOStream_Test +IOStream_Test +Lazy_Map_Manager_Test +Lazy_Map_Manager_Test +Log_Msg_Test +Log_Msg_Test +Logging_Strategy_Test +Logging_Strategy_Test +MEM_Stream_Test +MEM_Stream_Test +MM_Shared_Memory_Test +MM_Shared_Memory_Test +MT_Reactor_Timer_Test +MT_Reactor_Timer_Test +MT_Reactor_Upcall_Test +MT_Reactor_Upcall_Test +MT_Reference_Counted_Event_Handler_Test +MT_Reference_Counted_Event_Handler_Test +MT_Reference_Counted_Notify_Test +MT_Reference_Counted_Notify_Test +MT_SOCK_Test +MT_SOCK_Test +Malloc_Test +Malloc_Test +Map_Manager_Test +Map_Manager_Test +Map_Test +Map_Test +Max_Default_Port_Test +Max_Default_Port_Test +Max_Default_Port_Test_IPV6 +Max_Default_Port_Test_IPV6 +Memcpy_Test +Mem_Map_Test +Mem_Map_Test +Message_Block_Test +Message_Block_Test +Message_Queue_Notifications_Test +Message_Queue_Notifications_Test +Message_Queue_Test +Message_Queue_Test +Message_Queue_Test_Ex +Message_Queue_Test_Ex +Multicast_Test +Multicast_Test +Multicast_Test_IPV6 +Multicast_Test_IPV6 +Multihomed_INET_Addr_Test +Multihomed_INET_Addr_Test +Multihomed_INET_Addr_Test_IPV6 +Multihomed_INET_Addr_Test_IPV6 +Naming_Test +Naming_Test +Network_Adapters_Test +Network_Adapters_Test +New_Fail_Test +New_Fail_Test +NonBlocking_Conn_Test +NonBlocking_Conn_Test +Notify_Performance_Test +Notify_Performance_Test +OS_Test +OS_Test +Object_Manager_Test +Object_Manager_Test +Obstack_Test +Obstack_Test +OrdMultiSet_Test +OrdMultiSet_Test +Pipe_Test +Pipe_Test +Priority_Buffer_Test +Priority_Buffer_Test +Priority_Reactor_Test +Priority_Reactor_Test +Priority_Task_Test +Priority_Task_Test +Proactor_Scatter_Gather_Test +Proactor_Scatter_Gather_Test +Proactor_Test +Proactor_Test +Proactor_Test_IPV6 +Proactor_Test_IPV6 +Proactor_Timer_Test +Proactor_Timer_Test +Process_Manager_Test +Process_Manager_Test +Process_Mutex_Test +Process_Mutex_Test +Process_Strategy_Test +Process_Strategy_Test +QtReactor_Test +QtReactor_Test +QtReactor_Test_moc.cpp +QtReactor_Test_moc.cpp +RB_Tree_Test +RB_Tree_Test +Reactor_Dispatch_Order_Test +Reactor_Dispatch_Order_Test +Reactor_Exceptions_Test +Reactor_Exceptions_Test +Reactor_Notification_Queue_Test +Reactor_Notification_Queue_Test +Reactor_Notify_Test +Reactor_Notify_Test +Reactor_Performance_Test +Reactor_Performance_Test +Reactor_Registration_Test +Reactor_Registration_Test +Reactor_Timer_Test +Reactor_Timer_Test +Reactors_Test +Reactors_Test +Reader_Writer_Test +Reader_Writer_Test +Recursive_Condition_Bug_Test +Recursive_Condition_Bug_Test +Recursive_Condition_Test +Recursive_Condition_Test +Recursive_Mutex_Test +Recursive_Mutex_Test +Refcounted_Auto_Ptr_Test +Refcounted_Auto_Ptr_Test +Reference_Counted_Event_Handler_Test +Reference_Counted_Event_Handler_Test +Reverse_Lock_Test +Reverse_Lock_Test +SOCK_Connector_Test +SOCK_Connector_Test +SOCK_Dgram_Bcast_Test +SOCK_Dgram_Bcast_Test +SOCK_Dgram_Test +SOCK_Dgram_Test +SOCK_SEQPACK_SCTP_Test +SOCK_SEQPACK_SCTP_Test +SOCK_Send_Recv_Test +SOCK_Send_Recv_Test +SOCK_Send_Recv_Test_IPV6 +SOCK_Send_Recv_Test_IPV6 +SOCK_Test +SOCK_Test +SOCK_Test_IPv6 +SOCK_Test_IPv6 +SPIPE_Test +SPIPE_Test +SString_Test +SString_Test +SV_Shared_Memory_Test +SV_Shared_Memory_Test +Semaphore_Test +Semaphore_Test +Service_Config_Test +Service_Config_Test +Signal_Test +Signal_Test +Sigset_Ops_Test +Sigset_Ops_Test +Simple_Message_Block_Test +Simple_Message_Block_Test +Svc_Handler_Test +Svc_Handler_Test +TP_Reactor_Test +TP_Reactor_Test +TSS_Static_Test +TSS_Static_Test +TSS_Test +TSS_Test +Task_Ex_Test +Task_Ex_Test +Task_Test +Task_Test +Thread_Manager_Test +Thread_Manager_Test +Thread_Mutex_Test +Thread_Mutex_Test +Thread_Pool_Reactor_Resume_Test +Thread_Pool_Reactor_Resume_Test +Thread_Pool_Reactor_Test +Thread_Pool_Reactor_Test +Thread_Pool_Test +Thread_Pool_Test +Time_Service_Test +Time_Service_Test +Time_Value_Test +Time_Value_Test +Timeprobe_Test +Timeprobe_Test +Timer_Cancellation_Test +Timer_Cancellation_Test +Timer_Queue_Reference_Counting_Test +Timer_Queue_Reference_Counting_Test +Timer_Queue_Test +Timer_Queue_Test +TkReactor_Test +TkReactor_Test +Token_Strategy_Test +Token_Strategy_Test +Tokens_Test +Tokens_Test +UPIPE_SAP_Test +UPIPE_SAP_Test +UUIDTest +UUIDTest +Unbounded_Set_Test +Unbounded_Set_Test_Ex +Unbounded_Set_Test_Ex +Upgradable_RW_Test +Upgradable_RW_Test +Vector_Test +Vector_Test +WFMO_Reactor_Test +WFMO_Reactor_Test +XtAthenaReactor_Test +XtAthenaReactor_Test +XtMotifReactor_Test +XtMotifReactor_Test +XtReactor_Test +test.reg diff --git a/ACE/tests/ARGV_Test.cpp b/ACE/tests/ARGV_Test.cpp index 0e7e18f52d8..bb06c6b8d31 100644 --- a/ACE/tests/ARGV_Test.cpp +++ b/ACE/tests/ARGV_Test.cpp @@ -21,51 +21,21 @@ #include "ace/Argv_Type_Converter.h" #include "test_config.h" -ACE_RCSID (tests, ARGV_Test, "$Id$") +ACE_RCSID(tests, ARGV_Test, "$Id$") static void -consume_arg (int argc, ACE_TCHAR *argv[]) +consume_arg (int &argc, ACE_TCHAR *argv[]) { ACE_Arg_Shifter arg_shifter (argc, argv); - if (arg_shifter.is_anything_left ()) + if (arg_shifter.is_anything_left ()) arg_shifter.consume_arg (1); // Once we initialize an arg_shifter, we must iterate through it all! - while ((arg_shifter.is_anything_left ())) + while ((arg_shifter.is_anything_left ())) arg_shifter.ignore_arg (1); } static int -test_simple_argv (ACE_TCHAR *argv[]) -{ - // From command line. - ACE_ARGV cl (argv); - - // My own stuff. - ACE_ARGV my; - - // Add to my stuff. - my.add (ACE_TEXT ("-ORBEndpoint iiop://localhost:12345")); - - // Combine the two (see the ace/ARGV.h constructors documentation). - ACE_ARGV a (cl.argv (), - my.argv ()); - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("argc = %d\n"), - a.argc ())); - - // Print the contents of the combined <ACE_ARGV>. - for (int i = 0; i < a.argc (); i++) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (" (%d) %s\n"), - i, - a.argv ()[i])); - - return 0; -} - -static int test_argv_type_converter (void) { char *argv[20]; @@ -95,7 +65,7 @@ test_argv_type_converter (void) consume_arg ( ct3.get_argc (), ct3.get_TCHAR_argv ()); } - { + { for (size_t i = 0; i < 4; i++) ACE_DEBUG ((LM_DEBUG, ACE_TEXT (" (%d) %s\n"), @@ -103,7 +73,7 @@ test_argv_type_converter (void) ACE_TEXT_CHAR_TO_TCHAR (argv[i]))); } - for (size_t i = 0; save_argv[i]; ++i) + for (size_t i = 0; save_argv[i]; ++i) ACE_OS_Memory::free (save_argv[i]); return 0; @@ -130,146 +100,53 @@ test_argv_type_converter2 (void) consume_arg ( ct.get_argc (), ct.get_TCHAR_argv ()); } - consume_arg (argc, argv); + consume_arg ( argc, argv); { for (size_t i = 0; i < 4; i++) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT (" (%d) %s\n"), + ACE_TEXT (" (%d) %s\n"), i, argv[i])); } - for (size_t i = 0; save_argv[i]; ++i) + for (size_t i = 0; save_argv[i]; ++i) ACE_OS_Memory::free (save_argv[i]); return 0; } -static int -test_argv_buf (void) -{ - pid_t parent_pid = ACE_OS::getpid (); - - ACE_TCHAR *l_argv[3]; - ACE_TCHAR pid_str[100]; - // Store the parent's process id so we can pass it to the child - // portably. Also, pass the test number, as well. - ACE_OS::sprintf (pid_str, - ACE_TEXT ("-p %ld -t %d"), - static_cast <long> (parent_pid), - 1); - - // We're going to create a new process that runs this program again, - // so we need to indicate that it's the child. - const ACE_TCHAR *t = ACE_TEXT (".") - ACE_DIRECTORY_SEPARATOR_STR - ACE_TEXT ("Signal_Test") - ACE_PLATFORM_EXE_SUFFIX - ACE_TEXT (" -c"); - l_argv[0] = const_cast <ACE_TCHAR *> (t); - l_argv[1] = pid_str; - l_argv[2] = 0; - - ACE_ARGV my_argv (l_argv); - - // This shouldn't have any quotes in it. - ACE_DEBUG ((LM_DEBUG, "%s\n", my_argv.buf ())); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("argc: %d\n"), my_argv.argc ())); - return 0; -} - -static int -test_argv_quotes (void) +int +run_main (int, ACE_TCHAR *argv[]) { - const ACE_TCHAR *argv[] = { ACE_TEXT ("first without quotes"), - ACE_TEXT ("'second in single quotes'"), - ACE_TEXT ("\"third in double quotes\""), - 0 - }; - int argc = 3; - - // (argc, argv) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n*** argv ***\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("argc: %d\n"), argc)); - - for (int i = 0; i < argc; ++i) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("argv[%02d] = %s\n"), i, argv[i])); - - // args - ACE_ARGV args; - for (int i = 0; i < argc; ++i) - args.add (argv[i]); - args.add (ACE_TEXT ("'fourth in single quotes'")); - args.add (ACE_TEXT ("\"fifth in double quotes\"")); - args.add (ACE_TEXT ("sixth without any quotes")); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n*** args-1 ***\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args.argc ())); - - for (int i = 0; i < args.argc (); ++i) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args[%02d]: %s\n"), i, args[i])); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args.argc ())); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n*** args-2 ***\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args.argc ())); - - for (int i = 0; i < args.argc (); ++i) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argv ()[%02d]: %s\n"), - i, args.argv ()[i])); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args.argc ())); - - // args2 - ACE_ARGV args2; - for (int i = 0; i < argc; ++i) - args2.add (argv[i], true); - args2.add (ACE_TEXT ("'fourth in single quotes'"), true); - args2.add (ACE_TEXT ("\"fifth in double quotes\""), true); - args2.add (ACE_TEXT ("sixth without any quotes"), true); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n*** args-3 ***\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args2.argc ())); - - for (int i = 0; i < args2.argc (); ++i) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args[%02d]: %s\n"), i, args2[i])); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args2.argc ())); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n*** args-4 ***\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args2.argc ())); - - for (int i = 0; i < args2.argc (); ++i) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argv ()[%02d]: %s\n"), - i, args2.argv ()[i])); - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args2.argc ())); + ACE_START_TEST (ACE_TEXT ("ARGV_Test")); - // args3 - ACE_ARGV args3(argv); + // From command line. + ACE_ARGV cl (argv); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n*** args-5 ***\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args3.argc ())); + // My own stuff. + ACE_ARGV my; - for (int i = 0; i < args3.argc (); ++i) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args[%02d]: %s\n"), i, args3[i])); + // Add to my stuff. + my.add (ACE_TEXT ("-ORBEndpoint iiop://localhost:12345")); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("args.argc (): %d\n"), args3.argc ())); + // Combine the two (see the ace/ARGV.h constructors documentation). + ACE_ARGV a (cl.argv (), + my.argv ()); - return 0; -} + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("argc = %d\n"), + a.argc ())); -int -run_main (int, ACE_TCHAR *argv[]) -{ - ACE_START_TEST (ACE_TEXT ("ARGV_Test")); + // Print the contents of the combined <ACE_ARGV>. + for (int i = 0; i < a.argc (); i++) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT (" (%d) %s\n"), + i, + a.argv ()[i])); - test_simple_argv (argv); test_argv_type_converter2 (); test_argv_type_converter (); - test_argv_quotes (); - test_argv_buf (); ACE_END_TEST; return 0; diff --git a/ACE/tests/Bug_1890_Regression_Test.cpp b/ACE/tests/Bug_1890_Regression_Test.cpp index 8a8cade4d90..a28c8302b77 100644 --- a/ACE/tests/Bug_1890_Regression_Test.cpp +++ b/ACE/tests/Bug_1890_Regression_Test.cpp @@ -14,7 +14,7 @@ #include "ace/Pipe.h" #include "ace/Event_Handler.h" -#include "ace/Select_Reactor.h" +#include "ace/Reactor.h" ACE_RCSID (tests, Bug_1890_Regression_Test, @@ -95,19 +95,18 @@ run_main (int, ACE_TCHAR *[]) { ACE_START_TEST (ACE_TEXT ("Bug_1890_Regression_Test")); - ACE_Select_Reactor select_reactor; - ACE_Reactor reactor (&select_reactor); + ACE_Reactor * reactor = ACE_Reactor::instance(); // Create the timer, this is the main driver for the test Timer * timer = new Timer; // Initialize the timer and register with the reactor - if (-1 == timer->open(&reactor)) + if (-1 == timer->open(reactor)) { ACE_ERROR_RETURN ((LM_ERROR, "Cannot initialize timer\n"), -1); } - reactor.run_reactor_event_loop(); + reactor->run_reactor_event_loop(); // Verify that the results are what we expect if (!timer->check_expected_results()) @@ -117,7 +116,6 @@ run_main (int, ACE_TCHAR *[]) // Cleanup timer->close(); - delete timer; ACE_END_TEST; @@ -246,7 +244,7 @@ int Timer::handle_timeout(ACE_Time_Value const &, void const *) return 0; } - reactor()->end_reactor_event_loop(); + reactor()->end_event_loop(); return 0; } diff --git a/ACE/tests/Bug_2368_Regression_Test.cpp b/ACE/tests/Bug_2368_Regression_Test.cpp index 94e11107e7d..8441abe346f 100644 --- a/ACE/tests/Bug_2368_Regression_Test.cpp +++ b/ACE/tests/Bug_2368_Regression_Test.cpp @@ -111,13 +111,11 @@ run_main (int, ACE_TCHAR *[]) if (!handleA_close_called) ACE_ERROR ((LM_ERROR, - "Handle close hasn't been called for A. " - "This test failure caused by the unresolved bug is EXPECTED!\n")); + "Handle close hasn't been called for A\n")); if (!handleB_close_called) ACE_ERROR ((LM_ERROR, - "Handle close hasn't been called for B. " - "This test failure caused by the unresolved bug is EXPECTED!\n")); + "Handle close hasn't been called for B\n")); ACE_END_TEST; diff --git a/ACE/tests/Bug_2653_Regression_Test.cpp b/ACE/tests/Bug_2653_Regression_Test.cpp index 74b87288894..6735eab20e5 100644 --- a/ACE/tests/Bug_2653_Regression_Test.cpp +++ b/ACE/tests/Bug_2653_Regression_Test.cpp @@ -211,7 +211,6 @@ run_main (int, ACE_TCHAR *[]) wd.activate (THR_DETACHED); test_for_spin(tp_reactor); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing for spin\n"))); - wd.wait (); ACE_END_TEST; return 0; diff --git a/ACE/tests/Bug_2659_Regression_Test.cpp b/ACE/tests/Bug_2659_Regression_Test.cpp deleted file mode 100644 index 2dd48ea3bce..00000000000 --- a/ACE/tests/Bug_2659_Regression_Test.cpp +++ /dev/null @@ -1,178 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Bug_2659_Regression_Test.cpp -// -// = DESCRIPTION -// Reproduces the problems reported in bug 2659: -// http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=2659 -// -// = AUTHOR -// Ciju John <johnc at ociweb> -// -// ============================================================================ - -#include "test_config.h" - -#include "ace/Log_Msg.h" -#include "ace/Task.h" -#include "ace/OS_NS_unistd.h" -#include "ace/Thread_Manager.h" -#include "ace/TP_Reactor.h" - -#if !defined (ACE_LACKS_UNIX_SIGNALS) - -bool reactor_task_ready = false; - - -//#define RUN_DEBUG 1 - -#if defined RUN_DEBUG - -#define EE_DEBUG(CNAME,MNAME,LOC) \ -EntryExit ee (CNAME,MNAME,LOC) - -class EntryExit -{ -public: - EntryExit (const ACE_TCHAR* class_name, const ACE_TCHAR *method_name - , void *location = 0) - { - class_name_ [20] = method_name_[20] = 0; - - ACE_OS::strncpy (class_name_, class_name, 20); - ACE_OS::strncpy (method_name_, method_name, 20); - location_ = location; - - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Entry %@ %s::%s\n") - , location, class_name, method_name)); - }; - - ~EntryExit () - { - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Exit %@ %s::%s\n") - , location_, class_name_, method_name_)); - }; - -private: - ACE_TCHAR class_name_[21]; - ACE_TCHAR method_name_[21]; - void *location_; -}; - -#else - -#define EE_DEBUG(CNAME,MNAME,LOC) - -#endif // if defined RUN_DEBUG - - - -static void -handle_signal (int ) -{ - EE_DEBUG ("", "handle_signal", 0); - - // Dummy signal handler -} - -class ReactorTask : public ACE_Task_Base -{ -public: - - virtual ~ReactorTask () - { - EE_DEBUG ("ReactorTask", "~ReactorTask", this); - }; - - virtual int svc (void ) - { - EE_DEBUG ("ReactorTask", "svc", this); - - // Register a valid signal handler - // so process doesn't die upon receiving signal - ACE_Sig_Action sa ((ACE_SignalHandler) &::handle_signal, SIGUSR1); - ACE_UNUSED_ARG (sa); - - if (simulate_perform_work () == -1) { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%P|%t) ERROR: simulated_perform_work failed.\n")) - , -1); - } - - return 0; - }; - -private: - int simulate_perform_work () - { - EE_DEBUG ("ReactorTask", "simulate_perform_work", this); - - // Create a reactor which doesn't automatically restart - // upon interruption - ACE_TP_Reactor tp_reactor (ACE_TP_Reactor::DEFAULT_SIZE - , 0); - - reactor_task_ready = true; - - // This will return upon signal interruption - return tp_reactor.handle_events (); - } -}; - -int -run_main (int, ACE_TCHAR *[]) -{ - ACE_START_TEST (ACE_TEXT ("Bug_2659_Regression_Test")); - EE_DEBUG ("", "run_main", 0); - - ReactorTask reactor_task; - - if (reactor_task.activate () == -1) { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%P|%t) Task activation failed.\n")) - , -1); - } - - ACE_Thread_Manager *thread_manager = reactor_task.thr_mgr (); - if (thread_manager == 0) { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("(%P|%t) No Thread Manager found.\n")) - , -1); - } - - while (!reactor_task_ready) { - ACE_OS:: sleep (1); - } - - if (thread_manager->kill_all (SIGUSR1) == -1) { - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) Task signalling failed.\n")) - , -1); - } - - if (reactor_task.wait () == -1) { - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) Task wait failed.\n")) - , -1); - } - - ACE_END_TEST; - - return 0; -} - -#else -int -run_main (int, ACE_TCHAR *[]) -{ - ACE_START_TEST (ACE_TEXT ("Bug_2659_Regression_Test")); - ACE_ERROR ((LM_INFO, - ACE_TEXT ("The Unix Signals capability is not supported on this platform\n"))); - ACE_END_TEST; - return 0; -} -#endif /* !defined (ACE_LACKS_UNIX_SIGNALS) */ diff --git a/ACE/tests/CDR_File_Test.cpp b/ACE/tests/CDR_File_Test.cpp index 92f92631073..ec837123c5d 100644 --- a/ACE/tests/CDR_File_Test.cpp +++ b/ACE/tests/CDR_File_Test.cpp @@ -406,7 +406,9 @@ run_main (int argc, ACE_TCHAR *argv[]) filename.get_path_name ()), 1); -#if !defined (VXWORKS) +#if (!defined (ACE_WIN32) \ + || (defined (ACE_HAS_WINNT4) && ACE_HAS_WINNT4 == 1)) && \ + !defined (VXWORKS) # define TEST_CAN_UNLINK_IN_ADVANCE #endif diff --git a/ACE/tests/CDR_Test.cpp b/ACE/tests/CDR_Test.cpp index b4f2c206f72..ca61076c4ed 100644 --- a/ACE/tests/CDR_Test.cpp +++ b/ACE/tests/CDR_Test.cpp @@ -560,44 +560,7 @@ run_main (int argc, ACE_TCHAR *argv[]) } ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Long stream[2] - no errors\n\n") - ACE_TEXT ("Testing consolidation\n\n"))); - - ACE_OutputCDR output (30); - CDR_Test_Types test_types; - - if (test_types.test_put (output) != 0) - return 1; - - if (output.begin () == output.end ()) - ACE_DEBUG ((LM_WARNING, - ACE_TEXT ("Only one block needed; test no effective.\n"))); - else - { - if (output.consolidate () != 0) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("consolidate"))); - } - - ACE_InputCDR input (output); - if (debug > 0) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Output CDR: \n"))); - ACE_HEX_DUMP ((LM_DEBUG, - input.rd_ptr(), - 64)); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Input CDR: \n"))); - ACE_HEX_DUMP ((LM_DEBUG, - input.rd_ptr(), - 64)); - } - - if (test_types.test_get (input) != 0) - return 1; - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Consolidation - no errors\n\n"))); + ACE_TEXT ("Long stream[2] - no errors\n\n"))); ACE_END_TEST; return 0; diff --git a/ACE/tests/FlReactor_Test.cpp b/ACE/tests/FlReactor_Test.cpp index 7e476287853..0b34751da3c 100644 --- a/ACE/tests/FlReactor_Test.cpp +++ b/ACE/tests/FlReactor_Test.cpp @@ -27,7 +27,7 @@ ACE_RCSID(tests, FlReactor_Test, "$Id$") -#include "ace/FlReactor/FlReactor.h" +#include "ace/FlReactor.h" #include "ace/Event_Handler.h" #include "ace/Acceptor.h" #include "ace/SOCK_Acceptor.h" diff --git a/ACE/tests/HTBP/HTBP_Config.conf b/ACE/tests/HTBP/HTBP_Config.conf new file mode 100644 index 00000000000..49dfd238ec3 --- /dev/null +++ b/ACE/tests/HTBP/HTBP_Config.conf @@ -0,0 +1,4 @@ +[htbp] +proxy_port=3128 +proxy_host=rtai.ociweb.com +htid_url=http://rtai.ociweb.com/cgi-bin/HTIOP_ID_Generator.cgi diff --git a/ACE/tests/HTBP/Makefile.am b/ACE/tests/HTBP/Makefile.am new file mode 100644 index 00000000000..7fd964b7c84 --- /dev/null +++ b/ACE/tests/HTBP/Makefile.am @@ -0,0 +1,16 @@ +## Process this file with automake to create Makefile.in +## +## $Id$ +## +## This file was generated by MPC. Any changes made directly to +## this file will be lost the next time it is generated. +## +## MPC Command: +## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu + +SUBDIRS = \ + Reactor_Tests \ + Send_Large_Msg \ + Send_Recv_Tests \ + ping + diff --git a/ACE/tests/HTBP/README b/ACE/tests/HTBP/README new file mode 100644 index 00000000000..65a2bde0320 --- /dev/null +++ b/ACE/tests/HTBP/README @@ -0,0 +1,16 @@ +$Id$ + +Test cases for the HTTP Tunneling Bidirectional Protocol. For more +information on the protocol itself, refer to ace/HTBP/README. These +tests are adaptations of essential ACE SOCK tests, with the minimal +changes to support using HTBP rather than SOCK. + +Contained in this directory: + +HTBP_Config.conf A sample configuration file. This file is site + specific, and must be editted before use. +ping This test is shows the most basic connection + establishment with one request and reply. +Reactor_Tests A test to show use through the reactor. +Send_Large_Msg A test for sending large messages +Send_Recv_Tests A test for a variety of message sending methods. diff --git a/ACE/tests/HTBP/Reactor_Tests/.cvsignore b/ACE/tests/HTBP/Reactor_Tests/.cvsignore new file mode 100644 index 00000000000..955ffdc75d5 --- /dev/null +++ b/ACE/tests/HTBP/Reactor_Tests/.cvsignore @@ -0,0 +1,4 @@ +client +client +server +server diff --git a/ACE/tests/HTBP/Reactor_Tests/Makefile.am b/ACE/tests/HTBP/Reactor_Tests/Makefile.am new file mode 100644 index 00000000000..813229103d5 --- /dev/null +++ b/ACE/tests/HTBP/Reactor_Tests/Makefile.am @@ -0,0 +1,64 @@ +## Process this file with automake to create Makefile.in +## +## $Id$ +## +## This file was generated by MPC. Any changes made directly to +## this file will be lost the next time it is generated. +## +## MPC Command: +## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu + +ACE_BUILDDIR = $(top_builddir) +ACE_ROOT = $(top_srcdir) + +noinst_PROGRAMS = + +## Makefile.Reactor_Tests_Client.am + +if !BUILD_ACE_FOR_TAO + +noinst_PROGRAMS += client + +client_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -I$(ACE_ROOT)/protocols + +client_SOURCES = \ + client.cpp \ + test_config.h + +client_LDADD = \ + $(ACE_BUILDDIR)/protocols/ace/HTBP/libACE_HTBP.la \ + $(ACE_BUILDDIR)/ace/libACE.la + +endif !BUILD_ACE_FOR_TAO + +## Makefile.Reactor_Tests_Server.am + +if !BUILD_ACE_FOR_TAO + +noinst_PROGRAMS += server + +server_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -I$(ACE_ROOT)/protocols + +server_SOURCES = \ + server.cpp \ + test_config.h + +server_LDADD = \ + $(ACE_BUILDDIR)/protocols/ace/HTBP/libACE_HTBP.la \ + $(ACE_BUILDDIR)/ace/libACE.la + +endif !BUILD_ACE_FOR_TAO + +## Clean up template repositories, etc. +clean-local: + -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* + -rm -f gcctemp.c gcctemp so_locations *.ics + -rm -rf cxx_repository ptrepository ti_files + -rm -rf templateregistry ir.out + -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/ACE/tests/HTBP/Reactor_Tests/Reactor_Tests.mpc b/ACE/tests/HTBP/Reactor_Tests/Reactor_Tests.mpc new file mode 100755 index 00000000000..61e59146a93 --- /dev/null +++ b/ACE/tests/HTBP/Reactor_Tests/Reactor_Tests.mpc @@ -0,0 +1,19 @@ +// -*- MPC -*- +// +// $Id$ + +project(*Server): aceexe, htbp { + exename = server + + Source_Files { + server.cpp + } +} + +project(*Client): aceexe, htbp { + exename = client + + Source_Files { + client.cpp + } +} diff --git a/ACE/tests/HTBP/Reactor_Tests/client.cpp b/ACE/tests/HTBP/Reactor_Tests/client.cpp new file mode 100644 index 00000000000..2813d9116f3 --- /dev/null +++ b/ACE/tests/HTBP/Reactor_Tests/client.cpp @@ -0,0 +1,136 @@ +/** + * client for a reactor based connection establishment test using HTBP + * + * $Id$ + */ + +#include "ace/Log_Msg.h" + +#include "ace/HTBP/HTBP_Session.h" +#include "ace/HTBP/HTBP_Stream.h" +#include "ace/HTBP/HTBP_Addr.h" +#include "ace/HTBP/HTBP_ID_Requestor.h" +#include "ace/HTBP/HTBP_Environment.h" + +int +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + + ACE_OS::socket_init (ACE_WSOCK_VERSION); + + if (argc < 2) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT("Usage: client <remote host>\n")), + 0); + + ACE::HTBP::Environment env (0,0,ACE_TEXT("inside.env")); +#if 0 // this should be a taken from a command line argument. + env.import_config ("inside.conf"); +#endif /* 0 */ + + ACE::HTBP::ID_Requestor req (&env); + ACE::HTBP::Addr local = ACE_TEXT_ALWAYS_CHAR(req.get_HTID()); + + unsigned remote_port = 8088; + const ACE_TCHAR * remote_host = argv[1]; + + unsigned proxy_port = 0; + ACE_TString proxy_host; + + if (env.get_proxy_port(proxy_port) != 0 || + env.get_proxy_host(proxy_host) != 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("no proxy address in ") + ACE_TEXT("config, using direct connect\n"))); + proxy_port = remote_port; + proxy_host = remote_host; + } + + ACE_INET_Addr proxy(proxy_port,proxy_host.c_str()); + ACE::HTBP::Addr remote (remote_port,ACE_TEXT_ALWAYS_CHAR(remote_host)); + + ACE::HTBP::Session session(remote,local,ACE::HTBP::Session::next_session_id(),&proxy); + ACE::HTBP::Stream stream (&session); + + char buffer[1000]; + ssize_t n = 0; + int retrycount = 10; + for (int i = 0; i < 3; i++) + { + ACE::HTBP::Channel *ch = session.outbound(); + ACE_OS::sprintf (buffer,"Do you hear me? %d",i); + n = stream.send (buffer,ACE_OS::strlen(buffer)+1); + if (n == -1) + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("%p\n"), + ACE_TEXT("stream send")),-1); + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("send returned %d\n"),n)); + + retrycount = 10; + while ((n = ch->recv_ack()) == -1 + && (errno == EWOULDBLOCK || errno == ETIME) + && retrycount > 0) + { + retrycount--; + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("waiting for ack, %d tries left\n"), + retrycount)); + ACE_OS::sleep (1); + } + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("After wait for ack, n = %d, retry = %d\n"), + n,retrycount,errno)); + + retrycount = 10; + while ((n = stream.recv(buffer,1000)) == -1 + && (errno == EWOULDBLOCK || errno == ETIME) + && retrycount > 0) + { + retrycount--; + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("waiting for inbound data, %d tries left\n"), + retrycount)); + ACE_OS::sleep(1); + } + if (retrycount == 0 || n < 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("bailing after wait, %p\n"), + ACE_TEXT("recv"))); + break; + } + + buffer[n] = 0; + + ACE_DEBUG ((LM_DEBUG,"Got: \"%s\"\n",buffer)); + } + ACE::HTBP::Channel *ch = session.outbound(); + if (ch == 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT("session's outbound channel is null!\n")),1); + n = stream.send ("goodbye",7); + if (n == -1) + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("%p\n"), + ACE_TEXT("stream send")),-1); + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("send returned %d\n"),n)); + + retrycount = 10; + while (ch && + (n = ch->recv_ack()) == -1 + && (errno == EWOULDBLOCK || errno == ETIME) + && retrycount > 0) + { + retrycount--; + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("waiting for ack, %d tries left\n"), + retrycount)); + ACE_OS::sleep (1); + } + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("After wait for ack, n = %d, retry = %d\n"), + n,retrycount,errno)); + + return 0; +} diff --git a/ACE/tests/HTBP/Reactor_Tests/inside.conf b/ACE/tests/HTBP/Reactor_Tests/inside.conf new file mode 100644 index 00000000000..a5bcbc14420 --- /dev/null +++ b/ACE/tests/HTBP/Reactor_Tests/inside.conf @@ -0,0 +1,5 @@ +[root] +[htbp] +proxy_port=3128 +proxy_host=rtai.ociweb.com +htid_url=http://rtai.ociweb.com/cgi-bin/HTIOP_ID_Generator.cgi diff --git a/ACE/tests/HTBP/Reactor_Tests/run_test.pl b/ACE/tests/HTBP/Reactor_Tests/run_test.pl new file mode 100755 index 00000000000..ae4c56c7fb2 --- /dev/null +++ b/ACE/tests/HTBP/Reactor_Tests/run_test.pl @@ -0,0 +1,39 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; +use Sys::Hostname; + +$status = 0; + +$SV = new PerlACE::Process ("server"); + +$host = hostname(); + +# The client code should later be modified to get the hostname +# using ACE_OS::hostname so the same script can be run on all +# hosts without havng to reset the host where it has to be run. +$CL = new PerlACE::Process ("client", $host); + +$SV->Spawn (); + +$client = $CL->SpawnWaitKill (300); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +$server = $SV->WaitKill (10); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} + +exit $status; diff --git a/ACE/tests/HTBP/Reactor_Tests/server.cpp b/ACE/tests/HTBP/Reactor_Tests/server.cpp new file mode 100644 index 00000000000..87a914163c2 --- /dev/null +++ b/ACE/tests/HTBP/Reactor_Tests/server.cpp @@ -0,0 +1,180 @@ +/** + * server for a reactor based connection establishment test using HTBP + * + * $Id$ + */ + +#include "ace/Log_Msg.h" + +#include "ace/HTBP/HTBP_Session.h" +#include "ace/HTBP/HTBP_Stream.h" +#include "ace/HTBP/HTBP_Addr.h" + +#include "ace/SOCK_Acceptor.h" +#include "ace/SOCK_Stream.h" +#include "ace/Event_Handler.h" +#include "ace/Reactor.h" + +class Accept_Handler : public ACE_Event_Handler +{ +public: + Accept_Handler (ACE_SOCK_Acceptor& a); + virtual ~Accept_Handler (void); + virtual int handle_input (ACE_HANDLE ); +private: + ACE_SOCK_Acceptor& acceptor_; + ACE::HTBP::Channel *channels_[2]; +}; + +class Stream_Handler : public ACE_Event_Handler +{ +public: + Stream_Handler (ACE::HTBP::Stream &s); + virtual ~Stream_Handler (); + virtual int handle_input (ACE_HANDLE ); +private: + ACE::HTBP::Stream &stream_; +}; + + +Accept_Handler::Accept_Handler(ACE_SOCK_Acceptor &a) + :ACE_Event_Handler(), + acceptor_(a) +{ + this->channels_[0] = this->channels_[1] = 0; + if (this->reactor() == 0) + this->reactor(ACE_Reactor::instance()); + this->reactor()->register_handler (acceptor_.get_handle(), + this, + ACE_Event_Handler::ACCEPT_MASK); +} + +Accept_Handler::~Accept_Handler() +{ + this->reactor()->remove_handler (acceptor_.get_handle(), + ACE_Event_Handler::ACCEPT_MASK| + ACE_Event_Handler::DONT_CALL); + acceptor_.close(); +} + +int +Accept_Handler::handle_input (ACE_HANDLE h) +{ + ACE::HTBP::Channel **ch = 0; + if (h == acceptor_.get_handle()) + { + ACE_SOCK_Stream *sock = new ACE_SOCK_Stream; + acceptor_.accept(*sock); + ch = channels_[0] == 0 ? &channels_[0] :& channels_[1]; + *ch = new ACE::HTBP::Channel(*sock); + this->reactor()->register_handler (sock->get_handle(), + this, + ACE_Event_Handler::READ_MASK); + return 0; + } + for (int i = 0; i < 2; i++) + if (channels_[i] && channels_[i]->get_handle() == h) + { + ch = &channels_[i]; + break; + } + if (ch == 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Accept_Handler::handle_input, ") + ACE_TEXT ("unknown handle %d\n") ,h), + -1); + int result = (*ch)->pre_recv(); + if (result == 0) + { + this->reactor()->remove_handler (h, + ACE_Event_Handler::READ_MASK | + ACE_Event_Handler::DONT_CALL); + + (*ch)->register_notifier(this->reactor()); + ACE::HTBP::Session *session = (*ch)->session(); + + ACE::HTBP::Stream *stream = new ACE::HTBP::Stream(session); + ACE_Event_Handler *handler = session->handler(); + + if (handler == 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Creating new stream handler for %d\n"), + stream->get_handle())); + Stream_Handler *sh = new Stream_Handler(*stream); + session->handler (sh); + } + else + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("There is already a handler for %d\n"), + stream->get_handle())); + + if ((*ch)->state() == ACE::HTBP::Channel::Data_Queued) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Issuing notification on handler\n"))); + this->reactor()->notify (session->handler(), + ACE_Event_Handler::READ_MASK); + } + + *ch = 0; + } + return 0; +} + +Stream_Handler::Stream_Handler (ACE::HTBP::Stream &s) + :stream_(s) +{} +Stream_Handler::~Stream_Handler () +{ +} + +int +Stream_Handler::handle_input (ACE_HANDLE h) +{ + char buffer[1000]; + ssize_t n = this->stream_.recv (buffer,1000); + if (n == -1) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("Stream_Handler::handle_input %p\n"), + ACE_TEXT ("recv")), + 0); + buffer[n] = 0; + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Stream_Handler::handle_input (%d) read %d:\n%C\n"), + h, n, buffer)); + + const char *tok_loc = ACE_OS::strstr (buffer, "goodbye"); + if (tok_loc != 0) + this->reactor()->end_event_loop(); + else + { + ACE::HTBP::Channel *ch = stream_.session()->outbound(); + if (ch != 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Sending reply on %d\n"), + ch->ace_stream().get_handle())); + else + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Can't send reply on nul channel\n"))); + this->stream_.send ("Back atcha!",11); + } + return 0; +} + +int +ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("At start of main\n"))); + ACE_OS::socket_init (ACE_WSOCK_VERSION); + + ACE_INET_Addr local(8088); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("got address\n"))); + ACE_SOCK_Acceptor acc(local,1); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("opened listener\n"))); + + Accept_Handler handler (acc); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("server is ready\n"))); + + ACE_Reactor::instance()->run_reactor_event_loop(); + return 0; +} diff --git a/ACE/tests/HTBP/Reactor_Tests/test_config.h b/ACE/tests/HTBP/Reactor_Tests/test_config.h new file mode 100644 index 00000000000..efd4eb7bcc6 --- /dev/null +++ b/ACE/tests/HTBP/Reactor_Tests/test_config.h @@ -0,0 +1,319 @@ +// -*- C++ -*- + + +// ============================================================================ +/** + * @file test_config.h + * + * $Id$ + * + * This file factors out common macros and other utilities used by the + * ACE automated regression tests. + * + * @author Prashant Jain <pjain@cs.wustl.edu> + * @author Tim Harrison <harrison@cs.wustl.edu> + * @author David Levine <levine@cs.wustl.edu> + */ +// ============================================================================ + +#ifndef ACE_TEST_CONFIG_H +#define ACE_TEST_CONFIG_H + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (ACE_NLOGGING) +// ACE_NLOGGING must not be set if the tests are to produce any output. +#undef ACE_NLOGGING +#endif /* ACE_NLOGGING */ + +// This first #undef protects against command-line definitions. +#undef ACE_NDEBUG +#include "ace/OS.h" +#include "ace/streams.h" +#include "ace/Singleton.h" +#include "ace/Synch.h" +#include "ace/Log_Msg.h" +#include "ace/ACE.h" + +// The second #undef protects against being reset in a config.h file. +#undef ACE_NDEBUG + +#undef ACE_TEXT +#define ACE_TEXT ACE_LIB_TEXT + +#if defined (ACE_HAS_WINCE) +// Note that Pocket PC 2002 will NOT create a directory if it does not start with a leading '\'. +// PPC 2002 only accepts '\log' as a valid directory name, while 'log\' works under WinCE 3.0. +# define ACE_LOG_DIRECTORY_FOR_MKDIR ACE_TEXT ("\\log") +# define ACE_LOG_DIRECTORY ACE_TEXT ("\\log\\") +# define MAKE_PIPE_NAME(X) ACE_TEXT ("\\\\.\\pipe\\"#X) +#elif defined (ACE_WIN32) +# define ACE_LOG_DIRECTORY ACE_TEXT ("log\\") +# define MAKE_PIPE_NAME(X) ACE_TEXT ("\\\\.\\pipe\\"#X) +#else +# define ACE_LOG_DIRECTORY ACE_TEXT ("log/") +# define MAKE_PIPE_NAME(X) ACE_TEXT (X) +#endif /* ACE_WIN32 */ + +#if defined (ACE_HAS_WINCE) +#define ACE_LOG_FILE_EXT_NAME ACE_TEXT (".txt") +#else +#define ACE_LOG_FILE_EXT_NAME ACE_TEXT (".log") +#endif /* ACE_HAS_WINCE */ + +#if defined (ACE_HAS_WINCE) || defined (ACE_HAS_PHARLAP) +const size_t ACE_MAX_CLIENTS = 4; +#else +const size_t ACE_MAX_CLIENTS = 30; +#endif /* ACE_HAS_WINCE */ + +const size_t ACE_NS_MAX_ENTRIES = 1000; +const size_t ACE_DEFAULT_USECS = 1000; +const size_t ACE_MAX_TIMERS = 4; +const size_t ACE_MAX_DELAY = 10; +const size_t ACE_MAX_INTERVAL = 0; +const size_t ACE_MAX_ITERATIONS = 10; +const size_t ACE_MAX_PROCESSES = 10; +const size_t ACE_MAX_THREADS = 4; + +#define ACE_START_TEST(NAME) \ + const ACE_TCHAR *program = NAME; \ + ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE); \ + if (ace_file_stream::instance()->set_output (program) != 0) \ + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %D\n"), program)) + +#define ACE_END_TEST \ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Ending %s test at %D\n"), program)); \ + ace_file_stream::instance()->close () + +#define ACE_CLOSE_TEST_LOG ace_file_stream::instance()->close () + +#if !defined (ACE_WIN32) +#define ACE_APPEND_LOG(NAME) \ + const ACE_TCHAR *program = NAME; \ + ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE); \ + ace_file_stream::instance()->close (); \ + if (ace_file_stream::instance()->set_output (program, 1) != 0) \ + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %D\n"), program)); +#else /* ACE_WIN32 */ +#define ACE_APPEND_LOG(NAME) \ + const ACE_TCHAR *program = NAME; \ + ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE); \ + if (ace_file_stream::instance()->set_output (program, 1) != 0) \ + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %D\n"), program)); +#endif /* ACE_WIN32 */ + +#define ACE_END_LOG \ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Ending %s test at %D\n\n"), program)); \ + ACE_LOG_MSG->set_flags(ACE_Log_Msg::SILENT); \ + ace_file_stream::instance()->close (); + +#if defined (VXWORKS) +// This is the only way I could figure out to avoid an error +// about attempting to unlink a non-existant file. +#define ACE_INIT_LOG(NAME) \ + ACE_TCHAR temp[MAXPATHLEN]; \ + ACE_OS::sprintf (temp, ACE_TEXT ("%s%s%s"), \ + ACE_LOG_DIRECTORY, \ + ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \ + ACE_LOG_FILE_EXT_NAME); \ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Deleting old log file %s (if any)\n\n"), temp)); \ + int fd_init_log; \ + if ((fd_init_log = ACE_OS::open (temp, \ + O_WRONLY|O_CREAT, \ + S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) != ERROR) \ + { \ + ACE_OS::close (fd_init_log); \ + ACE_OS::unlink (temp); \ + } + +#if defined (ghs) +# // Rename main to ace_main for compatibility with run_tests.vxworks. +# undef ACE_MAIN +# define ACE_MAIN ace_main +#endif /* ghs */ +#else /* ! VXWORKS */ +#define ACE_INIT_LOG(NAME) \ + ACE_TCHAR temp[MAXPATHLEN]; \ + ACE_OS::sprintf (temp, ACE_TEXT ("%s%s%s"), \ + ACE_LOG_DIRECTORY, \ + ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR), \ + ACE_LOG_FILE_EXT_NAME); \ + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Deleting old log file %s (if any)\n\n"), temp)); \ + ACE_OS::unlink (temp); +#endif /* ! VXWORKS */ + +#if defined (ACE_LACKS_IOSTREAM_TOTALLY) +#define OFSTREAM FILE +#else +#define OFSTREAM ofstream +#endif /* ACE_LACKS_IOSTREAM_TOTALLY */ + +class ACE_Test_Output +{ +public: + ACE_Test_Output (void); + ~ACE_Test_Output (void); + int set_output (const ACE_TCHAR *filename, int append = 0); + OFSTREAM *output_file (void); + void close (void); + +private: + OFSTREAM *output_file_; +}; + +inline ACE_Test_Output::ACE_Test_Output (void) + : output_file_ (0) +{ +#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) + this->output_file_ = new OFSTREAM; +#endif /* ACE_LACKS_IOSTREAM_TOTALLY */ +} + +inline ACE_Test_Output::~ACE_Test_Output (void) +{ +#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_PSOS) + ACE_LOG_MSG->msg_ostream (&cerr); +#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY && ! ACE_PSOS */ + + ACE_LOG_MSG->clr_flags (ACE_Log_Msg::OSTREAM); + ACE_LOG_MSG->set_flags (ACE_Log_Msg::STDERR); + +#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) && !defined (ACE_HAS_PHARLAP) + delete this->output_file_; +#endif /* ! ACE_LACKS_IOSTREAM_TOTALLY */ +} + +inline OFSTREAM * +ACE_Test_Output::output_file (void) +{ + return this->output_file_; +} + +inline int +ACE_Test_Output::set_output (const ACE_TCHAR *filename, int append) +{ +#if defined (ACE_HAS_PHARLAP) + // For PharLap, just send it all to the host console for now - redirect + // to a file there for saving/analysis. + EtsSelectConsole(ETS_CO_HOST); + ACE_LOG_MSG->msg_ostream (&cout); + +#else + ACE_TCHAR temp[MAXPATHLEN]; + // Ignore the error value since the directory may already exist. + const ACE_TCHAR *test_dir; + +#if !defined (ACE_HAS_WINCE) + test_dir = ACE_OS::getenv (ACE_TEXT ("ACE_TEST_DIR")); + + if (test_dir == 0) +#endif /* ACE_HAS_WINCE */ + test_dir = ACE_TEXT (""); + + ACE_OS::sprintf (temp, + ACE_TEXT ("%s%s%s%s"), + test_dir, + ACE_LOG_DIRECTORY, + ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR), + ACE_LOG_FILE_EXT_NAME); + +#if defined (VXWORKS) + // This is the only way I could figure out to avoid a console + // warning about opening an existing file (w/o O_CREAT), or + // attempting to unlink a non-existant one. + ACE_HANDLE fd = ACE_OS::open (temp, + O_WRONLY|O_CREAT, + S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH); + if (fd != ERROR) + { + ACE_OS::close (fd); + ACE_OS::unlink (temp); + } +# else /* ! VXWORKS */ + // This doesn't seem to work on VxWorks if the directory doesn't + // exist: it creates a plain file instead of a directory. If the + // directory does exist, it causes a wierd console error message + // about "cat: input error on standard input: Is a directory". So, + // VxWorks users must create the directory manually. +# if defined (ACE_HAS_WINCE) + ACE_OS::mkdir (ACE_LOG_DIRECTORY_FOR_MKDIR); +# else + ACE_OS::mkdir (ACE_LOG_DIRECTORY); +# endif // ACE_HAS_WINCE +# endif /* ! VXWORKS */ + +# if !defined (ACE_LACKS_IOSTREAM_TOTALLY) + this->output_file_->open (ACE_TEXT_ALWAYS_CHAR (temp), + ios::out | (append ? ios::app : ios::trunc)); + if (this->output_file_->bad ()) + return -1; +#else /* when ACE_LACKS_IOSTREAM_TOTALLY */ + ACE_TCHAR *fmode = 0; + if (append) + fmode = ACE_TEXT ("a"); + else + fmode = ACE_TEXT ("w"); + this->output_file_ = ACE_OS::fopen (temp, fmode); +# endif /* ACE_LACKS_IOSTREAM_TOTALLY */ + + ACE_LOG_MSG->msg_ostream (this->output_file ()); +#endif /* ACE_HAS_PHARLAP */ + + ACE_LOG_MSG->clr_flags (ACE_Log_Msg::STDERR | ACE_Log_Msg::LOGGER ); + ACE_LOG_MSG->set_flags (ACE_Log_Msg::OSTREAM); + + return 0; +} + +inline void +ACE_Test_Output::close (void) +{ +#if !defined (ACE_LACKS_IOSTREAM_TOTALLY) + this->output_file_->flush (); + this->output_file_->close (); +#else + ACE_OS::fflush (this->output_file_); + ACE_OS::fclose (this->output_file_); +#endif /* !ACE_LACKS_IOSTREAM_TOTALLY */ + ACE_LOG_MSG->msg_ostream (0); +} + +inline void +randomize (int array[], size_t size) +{ + size_t i; + + for (i = 0; i < size; i++) + array [i] = static_cast<int> (i); + + // See with a fixed number so that we can produce "repeatable" + // random numbers. + ACE_OS::srand (0); + + // Generate an array of random numbers from 0 .. size - 1. + + for (i = 0; i < size; i++) + { + size_t index = ACE_OS::rand() % size--; + int temp = array [index]; + array [index] = array [size]; + array [size] = temp; + } +} + +typedef ACE_Singleton<ACE_Test_Output, ACE_Null_Mutex> ace_file_stream; + +#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) +template ACE_Singleton<ACE_Test_Output, ACE_Null_Mutex> * +ACE_Singleton<ACE_Test_Output, ACE_Null_Mutex>::singleton_; +#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ + +#endif /* ACE_TEST_CONFIG_H */ diff --git a/ACE/tests/HTBP/Send_Large_Msg/.cvsignore b/ACE/tests/HTBP/Send_Large_Msg/.cvsignore new file mode 100644 index 00000000000..955ffdc75d5 --- /dev/null +++ b/ACE/tests/HTBP/Send_Large_Msg/.cvsignore @@ -0,0 +1,4 @@ +client +client +server +server diff --git a/ACE/tests/HTBP/Send_Large_Msg/Makefile.am b/ACE/tests/HTBP/Send_Large_Msg/Makefile.am new file mode 100644 index 00000000000..2773356439b --- /dev/null +++ b/ACE/tests/HTBP/Send_Large_Msg/Makefile.am @@ -0,0 +1,64 @@ +## Process this file with automake to create Makefile.in +## +## $Id$ +## +## This file was generated by MPC. Any changes made directly to +## this file will be lost the next time it is generated. +## +## MPC Command: +## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu + +ACE_BUILDDIR = $(top_builddir) +ACE_ROOT = $(top_srcdir) + +noinst_PROGRAMS = + +## Makefile.Send_Large_Msg_Client.am + +if !BUILD_ACE_FOR_TAO + +noinst_PROGRAMS += client + +client_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -I$(ACE_ROOT)/protocols + +client_SOURCES = \ + client.cpp + +client_LDADD = \ + $(top_builddir)/tests/libTest_Output.la \ + $(ACE_BUILDDIR)/protocols/ace/HTBP/libACE_HTBP.la \ + $(ACE_BUILDDIR)/ace/libACE.la + +endif !BUILD_ACE_FOR_TAO + +## Makefile.Send_Large_Msg_Server.am + +if !BUILD_ACE_FOR_TAO + +noinst_PROGRAMS += server + +server_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -I$(ACE_ROOT)/protocols + +server_SOURCES = \ + server.cpp + +server_LDADD = \ + $(top_builddir)/tests/libTest_Output.la \ + $(ACE_BUILDDIR)/protocols/ace/HTBP/libACE_HTBP.la \ + $(ACE_BUILDDIR)/ace/libACE.la + +endif !BUILD_ACE_FOR_TAO + +## Clean up template repositories, etc. +clean-local: + -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* + -rm -f gcctemp.c gcctemp so_locations *.ics + -rm -rf cxx_repository ptrepository ti_files + -rm -rf templateregistry ir.out + -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/ACE/tests/HTBP/Send_Large_Msg/Send_Large_Msg.mpc b/ACE/tests/HTBP/Send_Large_Msg/Send_Large_Msg.mpc new file mode 100644 index 00000000000..d973b59748f --- /dev/null +++ b/ACE/tests/HTBP/Send_Large_Msg/Send_Large_Msg.mpc @@ -0,0 +1,23 @@ +// -*- MPC -*- +// +// $Id$ + +project(*Server): aceexe, htbp { + exename = server + after += Test_Output + libs += Test_Output + + Source_Files { + server.cpp + } +} + +project(*Client): aceexe, htbp { + exename = client + after += Test_Output + libs += Test_Output + + Source_Files { + client.cpp + } +} diff --git a/ACE/tests/HTBP/Send_Large_Msg/client.cpp b/ACE/tests/HTBP/Send_Large_Msg/client.cpp new file mode 100644 index 00000000000..62cd9140da8 --- /dev/null +++ b/ACE/tests/HTBP/Send_Large_Msg/client.cpp @@ -0,0 +1,98 @@ +// $Id$ + +#include "tests/test_config.h" + +#include "ace/HTBP/HTBP_Session.h" +#include "ace/HTBP/HTBP_Stream.h" +#include "ace/HTBP/HTBP_Addr.h" +#include "ace/HTBP/HTBP_ID_Requestor.h" +#include "ace/HTBP/HTBP_Environment.h" + +#include "ace/Log_Msg.h" + +const ssize_t Send_Size = 4*1024; +const size_t Loops = 10; +const size_t Total_Size = Send_Size * Loops; + +int +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + ACE_START_TEST (ACE_TEXT ("HTBP_Send_Large_Msg_client")); + + ACE_OS::socket_init (ACE_WSOCK_VERSION); + + if (argc < 2) + ACE_ERROR_RETURN ((LM_ERROR, + "Usage: client <remote host>\n"), + 0); + ACE::HTBP::Environment env; +#if 0 // this should be a taken from a command line argument + env.import_config (ACE_TEXT("../HTBP_Config.conf")); +#endif /* 0 */ + + + ACE::HTBP::ID_Requestor req (&env); + ACE::HTBP::Addr local(ACE_TEXT_ALWAYS_CHAR(req.get_HTID())); + + unsigned remote_port = 8088; + const ACE_TCHAR * remote_host = argv[1]; + + unsigned proxy_port = 0; + ACE_TString proxy_host; + + if (env.get_proxy_port(proxy_port) != 0 || + env.get_proxy_host(proxy_host) != 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("no proxy address in ") + ACE_TEXT("config, using direct connect\n"))); + proxy_port = remote_port; + proxy_host = remote_host; + } + + ACE_INET_Addr proxy(proxy_port,proxy_host.c_str()); + ACE::HTBP::Addr remote (remote_port,ACE_TEXT_ALWAYS_CHAR(remote_host)); + + ACE::HTBP::Session session(remote, + local, + ACE::HTBP::Session::next_session_id(), + &proxy); + + ACE::HTBP::Stream *stream = new ACE::HTBP::Stream(&session); + ACE_DEBUG ((LM_DEBUG,ACE_TEXT("Sending message\n"))); + char buffer[Send_Size]; + ACE_OS::memset (buffer,'a',Send_Size); + ssize_t n = 0; + for (size_t i = 0; i < Loops ; ++i) + { + errno = 0; + while (n < Send_Size) + { + n += stream->send (buffer+n,Send_Size); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("Sending %d of %d\n"), n, Send_Size)); + } + if (n == -1 && errno != 0) + { + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("%p\n %d"), + ACE_TEXT("stream send"), errno), -1); + } + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("In round %d, send returned %d\n"), i, n)); + } + + buffer[0] = 0; + n = stream->recv (buffer,1000); + while (n == -1) + { + if (errno == EWOULDBLOCK) + n = stream->recv (buffer,1000); + else + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT("%p\n"), + ACE_TEXT("stream.recv")),-1); + } + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT("received %d, %s\n"),n,buffer)); + + ACE_END_TEST; + return 0; +} diff --git a/ACE/tests/HTBP/Send_Large_Msg/run_test.pl b/ACE/tests/HTBP/Send_Large_Msg/run_test.pl new file mode 100755 index 00000000000..6b295afbf17 --- /dev/null +++ b/ACE/tests/HTBP/Send_Large_Msg/run_test.pl @@ -0,0 +1,43 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; +use Sys::Hostname; + +$iorfile = PerlACE::LocalFile ("server.ior"); + +unlink $iorfile; +$status = 0; + +$SV = new PerlACE::Process ("server"); +$host = hostname(); + +# The client code should later be modified to get the hostname +# using ACE_OS::hostname so the same script can be run on all +# hosts without havng to reset the host where it has to be run. +$CL = new PerlACE::Process ("client", $host); + +$SV->Spawn (); + +$client = $CL->SpawnWaitKill (300); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +$server = $SV->WaitKill (10); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} + +unlink $iorfile; + +exit $status; diff --git a/ACE/tests/HTBP/Send_Large_Msg/server.cpp b/ACE/tests/HTBP/Send_Large_Msg/server.cpp new file mode 100644 index 00000000000..7b7f51cf1b9 --- /dev/null +++ b/ACE/tests/HTBP/Send_Large_Msg/server.cpp @@ -0,0 +1,103 @@ +// $Id$ + +#include "tests/test_config.h" + +#include "ace/Log_Msg.h" + +#include "ace/HTBP/HTBP_Session.h" +#include "ace/HTBP/HTBP_Stream.h" +#include "ace/HTBP/HTBP_Addr.h" + +#include "ace/SOCK_Acceptor.h" +#include "ace/SOCK_Stream.h" + +const size_t Send_Size = 4*1024; +const size_t Loops = 10; +const size_t Total_Size = Send_Size * Loops; + +int +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +{ + + ACE_UNUSED_ARG (argc); + ACE_UNUSED_ARG (argv); + + char buffer[1000]; + + ACE_OS::socket_init (ACE_WSOCK_VERSION); + + ACE_INET_Addr local(8088); + ACE_SOCK_Stream sock[2]; + ACE_SOCK_Acceptor acc(local,1); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("server is ready\n"))); + + acc.accept(sock[0]); + ACE::HTBP::Channel channel1(sock[0]); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("Got sock[0], handle = %d\n"), + sock[0].get_handle())); + acc.accept(sock[1]); + ACE::HTBP::Channel channel2(sock[1]); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("Got sock[1], handle = %d\n"), + sock[1].get_handle())); + int res = 0; + while ((res =channel1.pre_recv()) != 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("res = %d. waiting 1 sec. %p\n"), + res, + ACE_TEXT("stream.pre_recv()"))); + ACE_OS::sleep (1); + } + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("Read from channel2\n"))); + while ((res = channel2.pre_recv()) != 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("res = %d, waiting 1 sec. %p\n"), + res, + ACE_TEXT("stream2.pre_recv()"))); + ACE_OS::sleep (1); + } + + ACE::HTBP::Session *session = channel1.session(); + ACE::HTBP::Stream stream (session); + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("using streams %d, %d. Got sesssion = %x\n"), + sock[0].get_handle(),sock[1].get_handle(),session)); + + ssize_t got = 1; + ssize_t total_recv = 0; + + while (got != 0) + { + errno = 0; + got = stream.recv (buffer, sizeof (buffer)); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("got : %s %d "), buffer, got)); + + if (got < 0) + break; + total_recv += got; + } + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("received %d, %s\n"),total_recv,buffer)); + + + ACE_OS::strcpy (buffer,"I hear you !"); + ssize_t n = stream.send (buffer,ACE_OS::strlen(buffer)+1); + if (n == -1) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT("%p\n"), + ACE_TEXT("stream.send")),-1); + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("send returned %d\n"),n)); + return 0; + +} diff --git a/ACE/tests/HTBP/Send_Recv_Tests/.cvsignore b/ACE/tests/HTBP/Send_Recv_Tests/.cvsignore new file mode 100644 index 00000000000..b82dc859445 --- /dev/null +++ b/ACE/tests/HTBP/Send_Recv_Tests/.cvsignore @@ -0,0 +1,2 @@ +SendRecv_Test +SendRecv_Test diff --git a/ACE/tests/HTBP/Send_Recv_Tests/Makefile.am b/ACE/tests/HTBP/Send_Recv_Tests/Makefile.am new file mode 100644 index 00000000000..03775f077a4 --- /dev/null +++ b/ACE/tests/HTBP/Send_Recv_Tests/Makefile.am @@ -0,0 +1,42 @@ +## Process this file with automake to create Makefile.in +## +## $Id$ +## +## This file was generated by MPC. Any changes made directly to +## this file will be lost the next time it is generated. +## +## MPC Command: +## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu + +ACE_BUILDDIR = $(top_builddir) +ACE_ROOT = $(top_srcdir) + + +## Makefile.SendRecv_Test.am + +if !BUILD_ACE_FOR_TAO + +noinst_PROGRAMS = SendRecv_Test + +SendRecv_Test_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -I$(ACE_ROOT)/protocols + +SendRecv_Test_SOURCES = \ + SendRecv_Test.cpp + +SendRecv_Test_LDADD = \ + $(top_builddir)/tests/libTest_Output.la \ + $(ACE_BUILDDIR)/protocols/ace/HTBP/libACE_HTBP.la \ + $(ACE_BUILDDIR)/ace/libACE.la + +endif !BUILD_ACE_FOR_TAO + +## Clean up template repositories, etc. +clean-local: + -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* + -rm -f gcctemp.c gcctemp so_locations *.ics + -rm -rf cxx_repository ptrepository ti_files + -rm -rf templateregistry ir.out + -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/ACE/tests/HTBP/Send_Recv_Tests/SendRecv_Test.cpp b/ACE/tests/HTBP/Send_Recv_Tests/SendRecv_Test.cpp new file mode 100644 index 00000000000..d462a11c3d3 --- /dev/null +++ b/ACE/tests/HTBP/Send_Recv_Tests/SendRecv_Test.cpp @@ -0,0 +1,388 @@ +// $Id$ + +// =========================================================================== +// +// = LIBRARY +// tests +// +// = FILENAME +// Send_Recv_Test.cpp +// +// = DESCRIPTION This is a test of the <ACE_SOCK>'s various send and +// receive methods, over HTBP. The test forks two processes or spawns +// two threads (depending upon the platform) and then executes client +// and server allowing them to connect and exchange data in ways +// designed to exercise the send and recv functions. +// +// Right now, it primarily tests the iov-like send and recv +// functions, but others should be added to completely cover the +// possible scenarios. +// +// = AUTHOR +// Steve Huston <shuston@riverace.com> +// +// ============================================================================ + +#include "tests/test_config.h" + +#include "ace/HTBP/HTBP_Stream.h" +#include "ace/HTBP/HTBP_Session.h" +#include "ace/HTBP/HTBP_ID_Requestor.h" +#include "ace/HTBP/HTBP_Environment.h" + +#include "ace/OS.h" +#include "ace/Thread.h" +#include "ace/Thread_Manager.h" +#include "ace/SOCK_Connector.h" +#include "ace/SOCK_Acceptor.h" +#include "ace/SOCK_Stream.h" + +ACE_RCSID(tests, + SOCK_Send_Recv_Test, + "$Id$") + +// Change to non-zero if test fails +static int Test_Result = 0; + +#if !defined (ACE_LACKS_FORK) || defined (ACE_HAS_THREADS) + +// In test 3, a large amount of data is sent. The purpose is to overflow the +// TCP send window, causing the sender to block (it's a send_n). This value +// is the amount to send. The assumption is that no implementation has a +// receive window larger than 128K bytes. If one is found, this is the place +// to change it. +// For some odd reason, NT will try to send a single large buffer, but not +// multiple smaller ones that add up to the large size. +const size_t Test3_Send_Size = 4*1024; +const size_t Test3_Loops = 10; +const size_t Test3_Total_Size = Test3_Send_Size * Test3_Loops; + + +static void * +client (void *arg) +{ + ACE_OS::socket_init (ACE_WSOCK_VERSION); + ACE::HTBP::Environment ht_env; + +#if 0 // this needs to take the config file name as an argument. + ht_env.import_config ("../HTBP_Config.conf"); +#endif /* 0 */ + + ACE::HTBP::ID_Requestor req (&ht_env); + ACE::HTBP::Addr local(ACE_TEXT_ALWAYS_CHAR(req.get_HTID())); + + char hostname [128]; + + if (ACE_OS::hostname (hostname,128) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "Could not get the host name\n"),0); + + ACE_INET_Addr *remote_addr = reinterpret_cast<ACE_INET_Addr *> (arg); + ACE::HTBP::Addr remote (remote_addr->get_port_number (),hostname); + + unsigned pport; + ACE_TString phost; + ht_env.get_proxy_port(pport); + ht_env.get_proxy_host(phost); + + ACE_INET_Addr proxy(pport,phost.c_str()); + ACE::HTBP::Session session(remote,local,ACE::HTBP::Session::next_session_id(),&proxy); + ACE::HTBP::Stream stream(&session); + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) Connecting to port %d\n"), + remote.get_port_number())); + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) connected to %s\n"), + ACE_TEXT_CHAR_TO_TCHAR(remote.get_host_name ()))); + + //******************* TEST 1 ****************************** + // + // Do a iovec sendv - send the 255 byte buffer in 5 chunks. The + // server will verify that the correct data is sent, and that there + // is no more and no less. + + u_char buffer[255]; + size_t i; + ssize_t len; + + // The server will verify that this data pattern gets there intact. + + for (i = 0; i < sizeof buffer; ++i) + buffer[i] = static_cast<u_char> (i); + + iovec iov[5]; + + iov[0].iov_base = reinterpret_cast<char *> (&buffer[0]); + iov[0].iov_len = 50; + + iov[1].iov_base = reinterpret_cast<char *> (&buffer[50]); + iov[1].iov_len = 25; + + iov[2].iov_base = reinterpret_cast<char *> (&buffer[75]); + iov[2].iov_len = 150; + + iov[3].iov_base = reinterpret_cast<char *> (&buffer[225]); + iov[3].iov_len = 29; + + iov[4].iov_base = reinterpret_cast<char *> (&buffer[254]); + iov[4].iov_len = 1; + + len = stream.sendv (iov, 5); + if (len == -1) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("Test 1, sendv failed"))); + Test_Result = 1; + } + else + ACE_ASSERT (len == 255); + + + ACE_DEBUG ((LM_DEBUG, "***** client TEST 2 ***** \n")); + + //******************* TEST 2 ****************************** + // + // The same data is coming back - receive it using recv (size_t n, + // ...) and compare it to the original data. + + u_char buffer2[255]; + // Give it a chance to get here + ACE_OS::sleep (2); + + len = stream.recv_n (buffer2, + 155); + + + len = stream.recv_n (buffer2, + 105); + + for (i = 0; i < 255; i++) + if (buffer2[i] != buffer[i]) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) Test 2, rcvd byte %d is %d, not %d\n"), + i, buffer2[i], buffer[i])); + Test_Result = 1; + } + + + stream.close (); + + return 0; +} + +static void * +server (void *arg) +{ + + ACE_OS::socket_init (ACE_WSOCK_VERSION); + ACE_SOCK_Acceptor *peer_acceptor = (ACE_SOCK_Acceptor *) arg; + ACE_INET_Addr cli_addr; + + ACE_Time_Value timeout (ACE_DEFAULT_TIMEOUT); + + ACE_SOCK_Stream sock[2]; + ACE_DEBUG ((LM_DEBUG,"server is ready\n")); + + if (peer_acceptor->accept(sock[0],&cli_addr,&timeout) == -1) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("accept"))); + Test_Result = 1; + return 0; + } + + ACE::HTBP::Channel channel1(sock[0]); + ACE_DEBUG ((LM_DEBUG,"Got sock[0], handle = %d\n",sock[0].get_handle())); + + if (peer_acceptor->accept(sock[0],&cli_addr,&timeout) == -1) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("accept"))); + Test_Result = 1; + return 0; + } + + ACE::HTBP::Channel channel2(sock[1]); + ACE_DEBUG ((LM_DEBUG,"Got sock[1], handle = %d\n",sock[1].get_handle())); + int res = 0; + while ((res = channel1.pre_recv()) != 0) + { + ACE_DEBUG ((LM_DEBUG,"res = %d. waiting 1 sec. %p\n",res, + "stream.pre_recv()")); + ACE_OS::sleep (1); + } + + ACE_DEBUG ((LM_DEBUG,"Read from channel2\n")); + while ((res = channel2.pre_recv()) != 0) + { + ACE_DEBUG ((LM_DEBUG,"res = %d, waiting 1 sec. %p\n",res, + "stream2.pre_recv()")); + ACE_OS::sleep (1); + } + + ACE::HTBP::Session *session = channel1.session(); + ACE::HTBP::Stream stream (session); + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) client %s connected from %d\n"), + ACE_TEXT_CHAR_TO_TCHAR(cli_addr.get_host_name ()), + cli_addr.get_port_number ())); + + //******************* TEST 1 ****************************** + // + // Do a iovec recvv - the client should send 255 bytes, which we + // will be detected and read into a ACE-allocated buffer. Use a 5 + // second timeout to give the client a chance to send it all. + + ACE_OS::sleep (5); + + u_char buffer[255]; + + iovec iov[3]; + + ssize_t len; + int i; + + iov[0].iov_base = reinterpret_cast<char *> (&buffer[0]); + iov[0].iov_len = 75; + + iov[1].iov_base = reinterpret_cast<char *> (&buffer[75]); + iov[1].iov_len = 100; + + iov[2].iov_base = reinterpret_cast<char *> (&buffer[175]); + iov[2].iov_len = 80; + + len = stream.recvv (iov, 3); + if (len == -1) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("Test 1, recvv failed"))); + Test_Result = 1; + } + + for (i = 0; i < 255; i++) + if (buffer[i] != i) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) Test 1, rcvd byte %d is %d, not %d\n"), + i, + buffer[i], + i)); + Test_Result = 1; + } + + ACE_DEBUG ((LM_DEBUG, "***** TEST 2 ***** \n")); + + //******************* TEST 2 ****************************** + // + // Send the buffer back, using send (size_t n, ...) in 3 pieces. + + len = stream.send (buffer, 6); + len += stream.send (buffer,42); + len += stream.send (buffer,189); + len += stream.send_n (buffer,18); + ACE_ASSERT (len == 255); + sock[0].close(); + sock[1].close(); + stream.close (); + return 0; +} + +#endif /* !ACE_LACKS_FORK || ACE_HAS_THREADS */ + +static void +spawn (void) +{ + // Acceptor + ACE_SOCK_Acceptor peer_acceptor; + + // Create a server address. + ACE_INET_Addr server_addr; + + char hostname[BUFSIZ]; + + if (ACE_OS::hostname (hostname, BUFSIZ) != 0) + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Could not get the hostname\n"))); + } + + ACE::HTBP::Addr addr (8088, hostname); + + // Bind listener to any port and then find out what the port was. + if (peer_acceptor.open (addr) == -1 + || peer_acceptor.get_local_addr (server_addr) == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("open"))); + else + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) starting server at port %d\n"), + server_addr.get_port_number ())); + +#if !defined (ACE_LACKS_FORK) + switch (ACE_OS::fork (ACE_TEXT("child"))) + { + case -1: + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n%a"), + ACE_TEXT ("fork failed"), + 1)); + /* NOTREACHED */ + case 0: + client (&server_addr); + ACE_OS::exit (0); + /* NOTREACHED */ + default: + server (reinterpret_cast<void *> (&peer_acceptor)); + ACE_OS::wait (); + } +#elif defined (ACE_HAS_THREADS) + if (ACE_Thread_Manager::instance ()->spawn + (ACE_THR_FUNC (server), + reinterpret_cast<void *> (&peer_acceptor), + THR_NEW_LWP | THR_DETACHED) == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n%a"), + ACE_TEXT ("thread create failed"), + 1)); + + if (ACE_Thread_Manager::instance ()->spawn + (ACE_THR_FUNC (client), + reinterpret_cast<void *> (&server_addr), + THR_NEW_LWP | THR_DETACHED) == -1) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) %p\n%a"), + ACE_TEXT ("thread create failed"), + 1)); + + // Wait for the threads to exit. + ACE_Thread_Manager::instance ()->wait (); +#else + ACE_ERROR ((LM_INFO, + ACE_TEXT ("(%P|%t) ") + ACE_TEXT ("only one thread may be run ") + ACE_TEXT ("in a process on this platform\n"))); +#endif /* ACE_HAS_THREADS */ + + peer_acceptor.close (); + } +} + +int +ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_START_TEST (ACE_TEXT ("SOCK_Send_Recv_Test")); + + spawn (); + + ACE_END_TEST; + return Test_Result; +} diff --git a/ACE/tests/HTBP/Send_Recv_Tests/SendRecv_Test.mpc b/ACE/tests/HTBP/Send_Recv_Tests/SendRecv_Test.mpc new file mode 100644 index 00000000000..64a40f688d1 --- /dev/null +++ b/ACE/tests/HTBP/Send_Recv_Tests/SendRecv_Test.mpc @@ -0,0 +1,14 @@ +// -*- MPC -*- +// +// $Id$ +// + +project: aceexe, htbp { + exename = SendRecv_Test + after += Test_Output + libs += Test_Output + + Source_Files { + SendRecv_Test.cpp + } +} diff --git a/ACE/tests/HTBP/htbptest.mpb b/ACE/tests/HTBP/htbptest.mpb new file mode 100644 index 00000000000..c12f33ef7ba --- /dev/null +++ b/ACE/tests/HTBP/htbptest.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// +// $Id$ +project : aceexe, htbp { + libs += Test_Output +} diff --git a/ACE/tests/HTBP/ping/.cvsignore b/ACE/tests/HTBP/ping/.cvsignore new file mode 100644 index 00000000000..955ffdc75d5 --- /dev/null +++ b/ACE/tests/HTBP/ping/.cvsignore @@ -0,0 +1,4 @@ +client +client +server +server diff --git a/ACE/tests/HTBP/ping/Makefile.am b/ACE/tests/HTBP/ping/Makefile.am new file mode 100644 index 00000000000..279d82a03c0 --- /dev/null +++ b/ACE/tests/HTBP/ping/Makefile.am @@ -0,0 +1,62 @@ +## Process this file with automake to create Makefile.in +## +## $Id$ +## +## This file was generated by MPC. Any changes made directly to +## this file will be lost the next time it is generated. +## +## MPC Command: +## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu + +ACE_BUILDDIR = $(top_builddir) +ACE_ROOT = $(top_srcdir) + +noinst_PROGRAMS = + +## Makefile.Ping_Client.am + +if !BUILD_ACE_FOR_TAO + +noinst_PROGRAMS += client + +client_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -I$(ACE_ROOT)/protocols + +client_SOURCES = \ + client.cpp + +client_LDADD = \ + $(ACE_BUILDDIR)/protocols/ace/HTBP/libACE_HTBP.la \ + $(ACE_BUILDDIR)/ace/libACE.la + +endif !BUILD_ACE_FOR_TAO + +## Makefile.Ping_Server.am + +if !BUILD_ACE_FOR_TAO + +noinst_PROGRAMS += server + +server_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) \ + -I$(ACE_ROOT)/protocols + +server_SOURCES = \ + server.cpp + +server_LDADD = \ + $(ACE_BUILDDIR)/protocols/ace/HTBP/libACE_HTBP.la \ + $(ACE_BUILDDIR)/ace/libACE.la + +endif !BUILD_ACE_FOR_TAO + +## Clean up template repositories, etc. +clean-local: + -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* + -rm -f gcctemp.c gcctemp so_locations *.ics + -rm -rf cxx_repository ptrepository ti_files + -rm -rf templateregistry ir.out + -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/ACE/tests/HTBP/ping/client.cpp b/ACE/tests/HTBP/ping/client.cpp new file mode 100644 index 00000000000..e7753faab6d --- /dev/null +++ b/ACE/tests/HTBP/ping/client.cpp @@ -0,0 +1,130 @@ +/** + * client for a basic connection establishment test using HTBP + * + * $Id$ + */ + + +#include "ace/Log_Msg.h" + +#include "ace/HTBP/HTBP_Session.h" +#include "ace/HTBP/HTBP_Stream.h" +#include "ace/HTBP/HTBP_Addr.h" +#include "ace/HTBP/HTBP_ID_Requestor.h" +#include "ace/HTBP/HTBP_Environment.h" + +int +ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +{ + + ACE_OS::socket_init (ACE_WSOCK_VERSION); + + if (argc < 2) + ACE_ERROR_RETURN ((LM_ERROR, + "Usage: client <remote host>\n"), + 0); + ACE::HTBP::Environment env; +#if 0 // this should be a taken from a command line argument + env.import_config (ACE_TEXT("../HTBP_Config.conf")); +#endif /* 0 */ + + + ACE::HTBP::ID_Requestor req (&env); + ACE::HTBP::Addr local(ACE_TEXT_ALWAYS_CHAR(req.get_HTID())); + + unsigned remote_port = 8088; + const ACE_TCHAR * remote_host = argv[1]; + + unsigned proxy_port = 0; + ACE_TString proxy_host; + + if (env.get_proxy_port(proxy_port) != 0 || + env.get_proxy_host(proxy_host) != 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("no proxy address in ") + ACE_TEXT("config, using direct connect\n"))); + proxy_port = remote_port; + proxy_host = remote_host; + } + + ACE_INET_Addr proxy(proxy_port,proxy_host.c_str()); + ACE::HTBP::Addr remote (remote_port,ACE_TEXT_ALWAYS_CHAR(remote_host)); + + ACE::HTBP::Session session(remote, + local, + ACE::HTBP::Session::next_session_id(), + &proxy); + ACE::HTBP::Stream stream (&session); + + char buffer[1000]; + ssize_t n = 0; + int retrycount = 10; + for (int i = 0; i < 3; i++) + { + ACE_OS::sprintf (buffer,"Do you hear me? %d",i); + ACE::HTBP::Channel *ob = session.outbound(); + n = stream.send (buffer,ACE_OS::strlen(buffer)+1); + if (n == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n","stream send"),-1); + + ACE_DEBUG ((LM_DEBUG, "send returned %d\n",n)); + + retrycount = 10; + ACE_DEBUG ((LM_DEBUG,"after send, outbound = %x, ob = %x\n", + session.outbound(), ob)); + while ((n = ob->recv_ack()) == -1 + && (errno == EWOULDBLOCK || errno == ETIME) + && retrycount > 0) + { + retrycount--; + ACE_DEBUG ((LM_DEBUG,"waiting for ack, %d tries left\n", + retrycount)); + ACE_OS::sleep (1); + } + ACE_DEBUG ((LM_DEBUG,"After wait for ack, n = %d, retry = %d\n", + n,retrycount,errno)); + + retrycount = 10; + while ((n = stream.recv(buffer,1000)) == -1 + && (errno == EWOULDBLOCK || errno == ETIME) + && retrycount > 0) + { + retrycount--; + ACE_DEBUG ((LM_DEBUG,"waiting for inbound data, %d tries left\n", + retrycount)); + ACE_OS::sleep(1); + } + if (retrycount == 0 || n < 0) + { + ACE_DEBUG ((LM_DEBUG,"bailing after wait, %p\n","recv")); + break; + } + + buffer[n] = 0; + + ACE_DEBUG ((LM_DEBUG,"Got: \"%s\"\n",buffer)); + } + + ACE::HTBP::Channel *ob = session.outbound(); + n = stream.send ("goodbye",7); + if (n == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n","stream send"),-1); + + ACE_DEBUG ((LM_DEBUG, "send returned %d\n",n)); + + retrycount = 10; + while ((n = ob->recv_ack()) == -1 + && (errno == EWOULDBLOCK || errno == ETIME) + && retrycount > 0) + { + retrycount--; + ACE_DEBUG ((LM_DEBUG,"waiting for ack, %d tries left\n", + retrycount)); + ACE_OS::sleep (1); + } + ACE_DEBUG ((LM_DEBUG,"After wait for ack, n = %d, retry = %d\n", + n,retrycount,errno)); + + return 0; +} diff --git a/ACE/tests/HTBP/ping/ping.mpc b/ACE/tests/HTBP/ping/ping.mpc new file mode 100755 index 00000000000..61e59146a93 --- /dev/null +++ b/ACE/tests/HTBP/ping/ping.mpc @@ -0,0 +1,19 @@ +// -*- MPC -*- +// +// $Id$ + +project(*Server): aceexe, htbp { + exename = server + + Source_Files { + server.cpp + } +} + +project(*Client): aceexe, htbp { + exename = client + + Source_Files { + client.cpp + } +} diff --git a/ACE/tests/HTBP/ping/run_test.pl b/ACE/tests/HTBP/ping/run_test.pl new file mode 100755 index 00000000000..ae4c56c7fb2 --- /dev/null +++ b/ACE/tests/HTBP/ping/run_test.pl @@ -0,0 +1,39 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::Run_Test; +use Sys::Hostname; + +$status = 0; + +$SV = new PerlACE::Process ("server"); + +$host = hostname(); + +# The client code should later be modified to get the hostname +# using ACE_OS::hostname so the same script can be run on all +# hosts without havng to reset the host where it has to be run. +$CL = new PerlACE::Process ("client", $host); + +$SV->Spawn (); + +$client = $CL->SpawnWaitKill (300); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +$server = $SV->WaitKill (10); + +if ($server != 0) { + print STDERR "ERROR: server returned $server\n"; + $status = 1; +} + +exit $status; diff --git a/ACE/tests/HTBP/ping/server.cpp b/ACE/tests/HTBP/ping/server.cpp new file mode 100644 index 00000000000..d20d46b8b09 --- /dev/null +++ b/ACE/tests/HTBP/ping/server.cpp @@ -0,0 +1,124 @@ +/** + * server for a basic connection establishment test using HTBP + * + * $Id$ + */ + +#include "ace/Log_Msg.h" + +#include "ace/HTBP/HTBP_Session.h" +#include "ace/HTBP/HTBP_Stream.h" +#include "ace/HTBP/HTBP_Addr.h" + +#include "ace/SOCK_Acceptor.h" +#include "ace/SOCK_Stream.h" + +int +ACE_TMAIN (int, ACE_TCHAR *[]) +{ + char buffer[1000]; + ssize_t n = 0; + + ACE_OS::socket_init (ACE_WSOCK_VERSION); + + ACE_INET_Addr local(8088); + ACE_SOCK_Stream sock[2]; + ACE_SOCK_Acceptor acc(local,1); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("server is ready\n"))); + + acc.accept (sock[0]); + ACE::HTBP::Channel channel1(sock[0]); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Got sock[0], handle = %d\n"), + sock[0].get_handle())); + acc.accept (sock[1]); + ACE::HTBP::Channel channel2 (sock[1]); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Got sock[1], handle = %d\n"), + sock[1].get_handle())); + int res = 0; + while ((res = channel1.pre_recv ()) != 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("res = %d. waiting 1 sec. %p\n"), + res, + ACE_TEXT ("stream.pre_recv()"))); + ACE_OS::sleep (1); + } + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Read from channel2\n"))); + while ((res = channel2.pre_recv()) != 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("res = %d, waiting 1 sec. %p\n"), + res, + ACE_TEXT ("stream2.pre_recv()"))); + ACE_OS::sleep (1); + } + + ACE::HTBP::Session *session = channel1.session(); + ACE::HTBP::Stream stream (session); + + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("using streams %d, %d. Got sesssion = %@\n"), + sock[0].get_handle(), + sock[1].get_handle(), + session)); + + for (int i = 0; i >= 0; i++) + { + int retrycount = 10; + while ((n = stream.recv(buffer,1000)) == -1 + && (errno == EWOULDBLOCK || errno == ETIME) + && retrycount > 0) + { + retrycount--; + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("waiting for inbound data, %d tries left\n"), + retrycount)); + ACE_OS::sleep(1); + } + if (retrycount == 0 || n < 0) + break; + + buffer[n] = 0; + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Got: \"%C\"\n"), buffer)); + + if (ACE_OS::strstr (buffer,"goodbye") != 0) + break; + + ACE_OS::sprintf (buffer,"I hear you %d",i); + n = stream.send (buffer,ACE_OS::strlen(buffer)+1); + if (n == -1) + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), + ACE_TEXT ("stream.send")), + -1); + + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Send returned %d\n"), n)); + + int got[2] = {-1,-1}; + while (got[0] == -1 || got[1] == -1) + { + if (got[0] == -1) + { + if ((got[0] = (res =channel1.pre_recv())) == -1) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("res = %d, waiting 1 sec. %p\n"), + got[0], + ACE_TEXT ("channel1.pre_recv()"))); + } + if (got[1] == -1) + { + if ((got[1] = (res =channel2.pre_recv())) == -1) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("res = %d, waiting 1 sec. %p\n"), + got[1], + ACE_TEXT ("channel2.pre_recv()"))); + } + if (got[0] == -1 || got[1] == -1) + ACE_OS::sleep (1); + } + } + return 0; +} diff --git a/ACE/tests/Integer_Truncate_Test.cpp b/ACE/tests/Integer_Truncate_Test.cpp index f9c60764bca..f9c60764bca 100644..100755 --- a/ACE/tests/Integer_Truncate_Test.cpp +++ b/ACE/tests/Integer_Truncate_Test.cpp diff --git a/ACE/tests/Log_Msg_Test.cpp b/ACE/tests/Log_Msg_Test.cpp index 71645e2ca0b..4436a90b26c 100644 --- a/ACE/tests/Log_Msg_Test.cpp +++ b/ACE/tests/Log_Msg_Test.cpp @@ -231,7 +231,7 @@ test_log_msg_features (const ACE_TCHAR *program) cleanup)); // Don't try this on VxWorks, it will result in an overflow and end the test. -// Platforms that define ACE_LACKS_VSNPRINTF are candidates to fail here. +// Platforms that don't define ACE_HAS_SNPRINTF are candidates to fail here. // This then proves that logging to big messages is problematic but on VxWorks // we know this and we want to rest of the test to continue #if !defined (VXWORKS) @@ -503,14 +503,14 @@ Log_Spec_Verify::log (ACE_Log_Record &log_record) ACE_ERROR ((LM_ERROR, ACE_TEXT ("Log_Spec_Verify, unrecognized test: %s\n"), b)); - ++this->fail_; + this->fail_++; } if (b != log_record.msg_data () && ACE_OS::strcmp (b, expect) != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("Test %s failed; expected %s\n"), log_record.msg_data (), expect)); - ++this->fail_; + this->fail_++; } return; @@ -557,9 +557,6 @@ test_format_specs (void) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%}%ITWO\n"))); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%}%IONE\n"))); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%}%IENDINDENTING\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%W\n"), ACE_TEXT_WIDE ("My string test\n"))); - ACE_TCHAR* nill_string = 0; - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%W\n"), nill_string)); errno = ENOENT; ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%m %p\n"), ACE_TEXT("perror"))); return 0; diff --git a/ACE/tests/Makefile.am b/ACE/tests/Makefile.am index 72f1f504760..0de38407ea0 100644 --- a/ACE/tests/Makefile.am +++ b/ACE/tests/Makefile.am @@ -6,24 +6,25 @@ ## this file will be lost the next time it is generated. ## ## MPC Command: -## ./bin/mwc.pl -type automake -noreldefs ACE.mwc +## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu ACE_BUILDDIR = $(top_builddir) ACE_ROOT = $(top_srcdir) SUBDIRS = \ . \ + HTBP \ SSL ## Makefile.Test_Output.am noinst_SCRIPTS = run_test.pl run_test.lst + dist_check_SCRIPTS = run_test.pl run_test.lst TESTS = $(noinst_PROGRAMS) TESTS_ENVIRONMENT = $(srcdir)/run_test.pl -t - noinst_LTLIBRARIES = libTest_Output.la libTest_Output_la_CPPFLAGS = \ @@ -39,7 +40,6 @@ noinst_HEADERS = \ test_config.h ## Makefile.ACE_Init_Test.am - noinst_PROGRAMS = ACE_Init_Test ACE_Init_Test_CPPFLAGS = \ @@ -60,7 +60,6 @@ EXTRA_DIST = \ ## Makefile.ACE_Test.am - noinst_PROGRAMS += ACE_Test ACE_Test_CPPFLAGS = \ @@ -76,7 +75,6 @@ ACE_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.ARGV_Test.am - noinst_PROGRAMS += ARGV_Test ARGV_Test_CPPFLAGS = \ @@ -92,7 +90,6 @@ ARGV_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Aio_Platform_Test.am - noinst_PROGRAMS += Aio_Platform_Test Aio_Platform_Test_CPPFLAGS = \ @@ -108,7 +105,6 @@ Aio_Platform_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Arg_Shifter_Test.am - noinst_PROGRAMS += Arg_Shifter_Test Arg_Shifter_Test_CPPFLAGS = \ @@ -124,7 +120,6 @@ Arg_Shifter_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Array_Map_Test.am - noinst_PROGRAMS += Array_Map_Test Array_Map_Test_CPPFLAGS = \ @@ -140,7 +135,6 @@ Array_Map_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Atomic_Op_Test.am - noinst_PROGRAMS += Atomic_Op_Test Atomic_Op_Test_CPPFLAGS = \ @@ -156,7 +150,6 @@ Atomic_Op_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Auto_Event_Test.am - noinst_PROGRAMS += Auto_Event_Test Auto_Event_Test_CPPFLAGS = \ @@ -172,7 +165,6 @@ Auto_Event_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Auto_IncDec_Test.am - noinst_PROGRAMS += Auto_IncDec_Test Auto_IncDec_Test_CPPFLAGS = \ @@ -188,7 +180,6 @@ Auto_IncDec_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Barrier_Test.am - noinst_PROGRAMS += Barrier_Test Barrier_Test_CPPFLAGS = \ @@ -268,7 +259,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Based_Pointer_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Based_Pointer_Test Based_Pointer_Test_CPPFLAGS = \ @@ -286,7 +276,6 @@ Based_Pointer_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Basic_Types_Test.am - noinst_PROGRAMS += Basic_Types_Test Basic_Types_Test_CPPFLAGS = \ @@ -304,7 +293,6 @@ Basic_Types_Test_LDADD = \ ## Makefile.Bound_Ptr_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Bound_Ptr_Test Bound_Ptr_Test_CPPFLAGS = \ @@ -323,7 +311,6 @@ Bound_Ptr_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Buffer_Stream_Test.am - noinst_PROGRAMS += Buffer_Stream_Test Buffer_Stream_Test_CPPFLAGS = \ @@ -339,7 +326,6 @@ Buffer_Stream_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Bug_1576_Regression_Test.am - noinst_PROGRAMS += Bug_1576_Regression_Test Bug_1576_Regression_Test_CPPFLAGS = \ @@ -354,24 +340,7 @@ Bug_1576_Regression_Test_LDADD = \ libTest_Output.la \ $(ACE_BUILDDIR)/ace/libACE.la -## Makefile.Bug_1890_Regression_Test.am - -noinst_PROGRAMS += Bug_1890_Regression_Test - -Bug_1890_Regression_Test_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -Bug_1890_Regression_Test_SOURCES = \ - $(ACE_ROOT)/tests/Main.cpp \ - Bug_1890_Regression_Test.cpp - -Bug_1890_Regression_Test_LDADD = \ - libTest_Output.la \ - $(ACE_BUILDDIR)/ace/libACE.la - ## Makefile.Bug_2368_Regression_Test.am - noinst_PROGRAMS += Bug_2368_Regression_Test Bug_2368_Regression_Test_CPPFLAGS = \ @@ -387,7 +356,6 @@ Bug_2368_Regression_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Bug_2497_Regression_Test.am - noinst_PROGRAMS += Bug_2497_Regression_Test Bug_2497_Regression_Test_CPPFLAGS = \ @@ -402,58 +370,9 @@ Bug_2497_Regression_Test_LDADD = \ libTest_Output.la \ $(ACE_BUILDDIR)/ace/libACE.la -## Makefile.Bug_2540_Regression_Test.am - -noinst_PROGRAMS += Bug_2540_Regression_Test - -Bug_2540_Regression_Test_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -Bug_2540_Regression_Test_SOURCES = \ - $(ACE_ROOT)/tests/Main.cpp \ - Bug_2540_Regression_Test.cpp - -Bug_2540_Regression_Test_LDADD = \ - libTest_Output.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Makefile.Bug_2653_Regression_Test.am - -noinst_PROGRAMS += Bug_2653_Regression_Test - -Bug_2653_Regression_Test_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -Bug_2653_Regression_Test_SOURCES = \ - $(ACE_ROOT)/tests/Main.cpp \ - Bug_2653_Regression_Test.cpp - -Bug_2653_Regression_Test_LDADD = \ - libTest_Output.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Makefile.Bug_2659_Regression_Test.am - -noinst_PROGRAMS += Bug_2659_Regression_Test - -Bug_2659_Regression_Test_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -Bug_2659_Regression_Test_SOURCES = \ - $(ACE_ROOT)/tests/Main.cpp \ - Bug_2659_Regression_Test.cpp - -Bug_2659_Regression_Test_LDADD = \ - libTest_Output.la \ - $(ACE_BUILDDIR)/ace/libACE.la - ## Makefile.CDR_Array_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += CDR_Array_Test CDR_Array_Test_CPPFLAGS = \ @@ -473,7 +392,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.CDR_File_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += CDR_File_Test CDR_File_Test_CPPFLAGS = \ @@ -493,7 +411,6 @@ CDR_File_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.CDR_Test.am - noinst_PROGRAMS += CDR_Test CDR_Test_CPPFLAGS = \ @@ -509,7 +426,6 @@ CDR_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Cache_Map_Manager_Test.am - noinst_PROGRAMS += Cache_Map_Manager_Test Cache_Map_Manager_Test_CPPFLAGS = \ @@ -528,7 +444,6 @@ Cache_Map_Manager_Test_LDADD = \ ## Makefile.Cached_Accept_Conn_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Cached_Accept_Conn_Test Cached_Accept_Conn_Test_CPPFLAGS = \ @@ -549,7 +464,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Cached_Allocator_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Cached_Allocator_Test Cached_Allocator_Test_CPPFLAGS = \ @@ -569,7 +483,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Cached_Conn_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Cached_Conn_Test Cached_Conn_Test_CPPFLAGS = \ @@ -590,7 +503,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Capabilities_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Capabilities_Test Capabilities_Test_CPPFLAGS = \ @@ -611,7 +523,6 @@ endif !BUILD_ACE_FOR_TAO if BUILD_ACE_CODECS if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Codecs_Test Codecs_Test_CPPFLAGS = \ @@ -630,7 +541,6 @@ endif !BUILD_ACE_FOR_TAO endif BUILD_ACE_CODECS ## Makefile.Collection_Test.am - noinst_PROGRAMS += Collection_Test Collection_Test_CPPFLAGS = \ @@ -649,7 +559,6 @@ Collection_Test_LDADD = \ ## Makefile.Config_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Config_Test Config_Test_CPPFLAGS = \ @@ -670,7 +579,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Conn_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Conn_Test Conn_Test_CPPFLAGS = \ @@ -722,7 +630,6 @@ noinst_HEADERS += \ test_config.h ## Makefile.DLL_Test.am - noinst_PROGRAMS += DLL_Test DLL_Test_CPPFLAGS = \ @@ -743,7 +650,6 @@ DLL_Test_LDADD = \ ## Makefile.DLList_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += DLList_Test DLList_Test_CPPFLAGS = \ @@ -763,7 +669,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Date_Time_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Date_Time_Test Date_Time_Test_CPPFLAGS = \ @@ -781,7 +686,6 @@ Date_Time_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Dev_Poll_Reactor_Test.am - noinst_PROGRAMS += Dev_Poll_Reactor_Test Dev_Poll_Reactor_Test_CPPFLAGS = \ @@ -797,7 +701,6 @@ Dev_Poll_Reactor_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Dirent_Test.am - noinst_PROGRAMS += Dirent_Test Dirent_Test_CPPFLAGS = \ @@ -813,7 +716,6 @@ Dirent_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Dynamic_Priority_Test.am - noinst_PROGRAMS += Dynamic_Priority_Test Dynamic_Priority_Test_CPPFLAGS = \ @@ -829,7 +731,6 @@ Dynamic_Priority_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Enum_Interfaces_Test.am - noinst_PROGRAMS += Enum_Interfaces_Test Enum_Interfaces_Test_CPPFLAGS = \ @@ -845,7 +746,6 @@ Enum_Interfaces_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Env_Value_Test.am - noinst_PROGRAMS += Env_Value_Test Env_Value_Test_CPPFLAGS = \ @@ -863,7 +763,6 @@ Env_Value_Test_LDADD = \ ## Makefile.FIFO_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += FIFO_Test FIFO_Test_CPPFLAGS = \ @@ -929,7 +828,6 @@ noinst_HEADERS += \ Framework_Component_DLL_Export.h ## Makefile.Framework_Component_Test.am - noinst_PROGRAMS += Framework_Component_Test Framework_Component_Test_CPPFLAGS = \ @@ -948,7 +846,6 @@ Framework_Component_Test_LDADD = \ ## Makefile.Future_Set_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Future_Set_Test Future_Set_Test_CPPFLAGS = \ @@ -968,7 +865,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Future_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Future_Test Future_Test_CPPFLAGS = \ @@ -986,7 +882,6 @@ Future_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Get_Opt_Test.am - noinst_PROGRAMS += Get_Opt_Test Get_Opt_Test_CPPFLAGS = \ @@ -1004,7 +899,6 @@ Get_Opt_Test_LDADD = \ ## Makefile.Handle_Set_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Handle_Set_Test Handle_Set_Test_CPPFLAGS = \ @@ -1022,7 +916,6 @@ Handle_Set_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Hash_Map_Bucket_Iterator_Test.am - noinst_PROGRAMS += Hash_Map_Bucket_Iterator_Test Hash_Map_Bucket_Iterator_Test_CPPFLAGS = \ @@ -1038,7 +931,6 @@ Hash_Map_Bucket_Iterator_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Hash_Map_Manager_Test.am - noinst_PROGRAMS += Hash_Map_Manager_Test Hash_Map_Manager_Test_CPPFLAGS = \ @@ -1054,7 +946,6 @@ Hash_Map_Manager_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Hash_Multi_Map_Manager_Test.am - noinst_PROGRAMS += Hash_Multi_Map_Manager_Test Hash_Multi_Map_Manager_Test_CPPFLAGS = \ @@ -1072,7 +963,6 @@ Hash_Multi_Map_Manager_Test_LDADD = \ ## Makefile.High_Res_Timer_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += High_Res_Timer_Test High_Res_Timer_Test_CPPFLAGS = \ @@ -1090,7 +980,6 @@ High_Res_Timer_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.INET_Addr_Test.am - noinst_PROGRAMS += INET_Addr_Test INET_Addr_Test_CPPFLAGS = \ @@ -1106,7 +995,6 @@ INET_Addr_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.INET_Addr_Test_IPV6.am - noinst_PROGRAMS += INET_Addr_Test_IPV6 INET_Addr_Test_IPV6_CPPFLAGS = \ @@ -1122,7 +1010,6 @@ INET_Addr_Test_IPV6_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.IOStream_Test.am - noinst_PROGRAMS += IOStream_Test IOStream_Test_CPPFLAGS = \ @@ -1137,24 +1024,7 @@ IOStream_Test_LDADD = \ libTest_Output.la \ $(ACE_BUILDDIR)/ace/libACE.la -## Makefile.Integer_Truncate_Test.am - -noinst_PROGRAMS += Integer_Truncate_Test - -Integer_Truncate_Test_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -Integer_Truncate_Test_SOURCES = \ - $(ACE_ROOT)/tests/Main.cpp \ - Integer_Truncate_Test.cpp - -Integer_Truncate_Test_LDADD = \ - libTest_Output.la \ - $(ACE_BUILDDIR)/ace/libACE.la - ## Makefile.Lazy_Map_Manager_Test.am - noinst_PROGRAMS += Lazy_Map_Manager_Test Lazy_Map_Manager_Test_CPPFLAGS = \ @@ -1170,9 +1040,6 @@ Lazy_Map_Manager_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Library_Unload.am - -if !BUILD_WINCE - noinst_PROGRAMS += UnloadLibACE UnloadLibACE_SOURCES = \ @@ -1222,12 +1089,9 @@ UnloadLibACE_SOURCES = \ Upgradable_RW_Test.h \ test_config.h -endif !BUILD_WINCE - ## Makefile.Log_Msg_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Log_Msg_Test Log_Msg_Test_CPPFLAGS = \ @@ -1245,7 +1109,6 @@ Log_Msg_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Logging_Strategy_Test.am - noinst_PROGRAMS += Logging_Strategy_Test Logging_Strategy_Test_CPPFLAGS = \ @@ -1263,7 +1126,6 @@ Logging_Strategy_Test_LDADD = \ ## Makefile.MEM_Stream_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += MEM_Stream_Test MEM_Stream_Test_CPPFLAGS = \ @@ -1284,7 +1146,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.MM_Shared_Memory_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += MM_Shared_Memory_Test MM_Shared_Memory_Test_CPPFLAGS = \ @@ -1302,7 +1163,6 @@ MM_Shared_Memory_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.MT_Reactor_Timer_Test.am - noinst_PROGRAMS += MT_Reactor_Timer_Test MT_Reactor_Timer_Test_CPPFLAGS = \ @@ -1319,7 +1179,6 @@ MT_Reactor_Timer_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.MT_Reactor_Upcall_Test.am - noinst_PROGRAMS += MT_Reactor_Upcall_Test MT_Reactor_Upcall_Test_CPPFLAGS = \ @@ -1335,7 +1194,6 @@ MT_Reactor_Upcall_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.MT_Ref_Counted_Event_Handler_Test.am - noinst_PROGRAMS += MT_Reference_Counted_Event_Handler_Test MT_Reference_Counted_Event_Handler_Test_CPPFLAGS = \ @@ -1351,7 +1209,6 @@ MT_Reference_Counted_Event_Handler_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.MT_Reference_Counted_Notify_Test.am - noinst_PROGRAMS += MT_Reference_Counted_Notify_Test MT_Reference_Counted_Notify_Test_CPPFLAGS = \ @@ -1367,7 +1224,6 @@ MT_Reference_Counted_Notify_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.MT_SOCK_Test.am - noinst_PROGRAMS += MT_SOCK_Test MT_SOCK_Test_CPPFLAGS = \ @@ -1385,7 +1241,6 @@ MT_SOCK_Test_LDADD = \ ## Makefile.Malloc_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Malloc_Test Malloc_Test_CPPFLAGS = \ @@ -1404,7 +1259,6 @@ Malloc_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Manual_Event_Test.am - noinst_PROGRAMS += Manual_Event_Test Manual_Event_Test_CPPFLAGS = \ @@ -1422,7 +1276,6 @@ Manual_Event_Test_LDADD = \ ## Makefile.Map_Manager_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Map_Manager_Test Map_Manager_Test_CPPFLAGS = \ @@ -1442,7 +1295,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Map_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Map_Test Map_Test_CPPFLAGS = \ @@ -1461,7 +1313,6 @@ Map_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Max_Default_Port_Test.am - noinst_PROGRAMS += Max_Default_Port_Test Max_Default_Port_Test_CPPFLAGS = \ @@ -1478,7 +1329,6 @@ Max_Default_Port_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Max_Default_Port_Test_IPV6.am - noinst_PROGRAMS += Max_Default_Port_Test_IPV6 Max_Default_Port_Test_IPV6_CPPFLAGS = \ @@ -1496,7 +1346,6 @@ Max_Default_Port_Test_IPV6_LDADD = \ ## Makefile.Mem_Map_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Mem_Map_Test Mem_Map_Test_CPPFLAGS = \ @@ -1516,7 +1365,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Memcpy_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Memcpy_Test Memcpy_Test_CPPFLAGS = \ @@ -1536,7 +1384,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Message_Block_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Message_Block_Test Message_Block_Test_CPPFLAGS = \ @@ -1554,7 +1401,6 @@ Message_Block_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Message_Queue_Notifications_Test.am - noinst_PROGRAMS += Message_Queue_Notifications_Test Message_Queue_Notifications_Test_CPPFLAGS = \ @@ -1572,7 +1418,6 @@ Message_Queue_Notifications_Test_LDADD = \ ## Makefile.Message_Queue_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Message_Queue_Test Message_Queue_Test_CPPFLAGS = \ @@ -1592,7 +1437,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Message_Queue_Test_Ex.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Message_Queue_Test_Ex Message_Queue_Test_Ex_CPPFLAGS = \ @@ -1611,7 +1455,6 @@ Message_Queue_Test_Ex_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Multicast_Test.am - noinst_PROGRAMS += Multicast_Test Multicast_Test_CPPFLAGS = \ @@ -1627,7 +1470,6 @@ Multicast_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Multicast_Test_IPV6.am - noinst_PROGRAMS += Multicast_Test_IPV6 Multicast_Test_IPV6_CPPFLAGS = \ @@ -1645,7 +1487,6 @@ Multicast_Test_IPV6_LDADD = \ ## Makefile.Multihomed_INET_Addr_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Multihomed_INET_Addr_Test Multihomed_INET_Addr_Test_CPPFLAGS = \ @@ -1665,7 +1506,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Multihomed_INET_Addr_Test_IPV6.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Multihomed_INET_Addr_Test_IPV6 Multihomed_INET_Addr_Test_IPV6_CPPFLAGS = \ @@ -1686,7 +1526,6 @@ endif !BUILD_ACE_FOR_TAO if BUILD_ACE_OTHER if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Naming_Test Naming_Test_CPPFLAGS = \ @@ -1705,7 +1544,6 @@ endif !BUILD_ACE_FOR_TAO endif BUILD_ACE_OTHER ## Makefile.Network_Adapters_Test.am - noinst_PROGRAMS += Network_Adapters_Test Network_Adapters_Test_CPPFLAGS = \ @@ -1722,7 +1560,6 @@ Network_Adapters_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.New_Fail_Test.am - noinst_PROGRAMS += New_Fail_Test New_Fail_Test_CPPFLAGS = \ @@ -1738,7 +1575,6 @@ New_Fail_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.NonBlocking_Conn_Test.am - noinst_PROGRAMS += NonBlocking_Conn_Test NonBlocking_Conn_Test_CPPFLAGS = \ @@ -1757,7 +1593,6 @@ NonBlocking_Conn_Test_LDADD = \ ## Makefile.Notify_Performance_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Notify_Performance_Test Notify_Performance_Test_CPPFLAGS = \ @@ -1775,7 +1610,6 @@ Notify_Performance_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.OS_Test.am - noinst_PROGRAMS += OS_Test OS_Test_CPPFLAGS = \ @@ -1791,7 +1625,6 @@ OS_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Object_Manager_Test.am - noinst_PROGRAMS += Object_Manager_Test Object_Manager_Test_CPPFLAGS = \ @@ -1807,7 +1640,6 @@ Object_Manager_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Obstack_Test.am - noinst_PROGRAMS += Obstack_Test Obstack_Test_CPPFLAGS = \ @@ -1823,7 +1655,6 @@ Obstack_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.OrdMultiSet_Test.am - noinst_PROGRAMS += OrdMultiSet_Test OrdMultiSet_Test_CPPFLAGS = \ @@ -1839,7 +1670,6 @@ OrdMultiSet_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Pipe_Test.am - noinst_PROGRAMS += Pipe_Test Pipe_Test_CPPFLAGS = \ @@ -1855,7 +1685,6 @@ Pipe_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Priority_Buffer_Test.am - noinst_PROGRAMS += Priority_Buffer_Test Priority_Buffer_Test_CPPFLAGS = \ @@ -1873,7 +1702,6 @@ Priority_Buffer_Test_LDADD = \ ## Makefile.Priority_Reactor_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Priority_Reactor_Test Priority_Reactor_Test_CPPFLAGS = \ @@ -1892,7 +1720,6 @@ Priority_Reactor_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Priority_Task_Test.am - noinst_PROGRAMS += Priority_Task_Test Priority_Task_Test_CPPFLAGS = \ @@ -1910,7 +1737,6 @@ Priority_Task_Test_LDADD = \ ## Makefile.Proactor_Scatter_Gather_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Proactor_Scatter_Gather_Test Proactor_Scatter_Gather_Test_CPPFLAGS = \ @@ -1930,7 +1756,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Proactor_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Proactor_Test Proactor_Test_CPPFLAGS = \ @@ -1951,7 +1776,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Proactor_Test_IPV6.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Proactor_Test_IPV6 Proactor_Test_IPV6_CPPFLAGS = \ @@ -1971,7 +1795,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Proactor_Timer_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Proactor_Timer_Test Proactor_Timer_Test_CPPFLAGS = \ @@ -1991,7 +1814,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Process_Manager_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Process_Manager_Test Process_Manager_Test_CPPFLAGS = \ @@ -2009,7 +1831,6 @@ Process_Manager_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Process_Manual_Event_Test.am - noinst_PROGRAMS += Process_Manual_Event_Test Process_Manual_Event_Test_CPPFLAGS = \ @@ -2027,7 +1848,6 @@ Process_Manual_Event_Test_LDADD = \ ## Makefile.Process_Mutex_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Process_Mutex_Test Process_Mutex_Test_CPPFLAGS = \ @@ -2047,7 +1867,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Process_Semaphore_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Process_Semaphore_Test Process_Semaphore_Test_CPPFLAGS = \ @@ -2067,7 +1886,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Process_Strategy_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Process_Strategy_Test Process_Strategy_Test_CPPFLAGS = \ @@ -2097,7 +1915,7 @@ CLEANFILES = \ QtReactor_Test_moc.cpp QtReactor_Test_moc.cpp: $(srcdir)/QtReactor_Test.h - $(QTDIR)/bin/moc $(srcdir)/QtReactor_Test.h -o QtReactor_Test_moc.cpp + $(QTDIR)/bin/moc -o QtReactor_Test_moc.cpp $(srcdir)/QtReactor_Test.h noinst_PROGRAMS += QtReactor_Test @@ -2125,7 +1943,6 @@ endif BUILD_QT endif BUILD_ACE_QTREACTOR ## Makefile.RB_Tree_Test.am - noinst_PROGRAMS += RB_Tree_Test RB_Tree_Test_CPPFLAGS = \ @@ -2142,7 +1959,6 @@ RB_Tree_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Reactor_Dispatch_Order_Test.am - noinst_PROGRAMS += Reactor_Dispatch_Order_Test Reactor_Dispatch_Order_Test_CPPFLAGS = \ @@ -2158,7 +1974,6 @@ Reactor_Dispatch_Order_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Reactor_Exceptions_Test.am - noinst_PROGRAMS += Reactor_Exceptions_Test Reactor_Exceptions_Test_CPPFLAGS = \ @@ -2174,7 +1989,6 @@ Reactor_Exceptions_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Reactor_Notification_Queue_Test.am - noinst_PROGRAMS += Reactor_Notification_Queue_Test Reactor_Notification_Queue_Test_CPPFLAGS = \ @@ -2192,7 +2006,6 @@ Reactor_Notification_Queue_Test_LDADD = \ ## Makefile.Reactor_Notify_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Reactor_Notify_Test Reactor_Notify_Test_CPPFLAGS = \ @@ -2212,7 +2025,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Reactor_Performance_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Reactor_Performance_Test Reactor_Performance_Test_CPPFLAGS = \ @@ -2231,7 +2043,6 @@ Reactor_Performance_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Reactor_Registration_Test.am - noinst_PROGRAMS += Reactor_Registration_Test Reactor_Registration_Test_CPPFLAGS = \ @@ -2249,7 +2060,6 @@ Reactor_Registration_Test_LDADD = \ ## Makefile.Reactor_Timer_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Reactor_Timer_Test Reactor_Timer_Test_CPPFLAGS = \ @@ -2267,7 +2077,6 @@ Reactor_Timer_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Reactors_Test.am - noinst_PROGRAMS += Reactors_Test Reactors_Test_CPPFLAGS = \ @@ -2283,7 +2092,6 @@ Reactors_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Reader_Writer_Test.am - noinst_PROGRAMS += Reader_Writer_Test Reader_Writer_Test_CPPFLAGS = \ @@ -2299,7 +2107,6 @@ Reader_Writer_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Recursive_Condition_Bug_Test.am - noinst_PROGRAMS += Recursive_Condition_Bug_Test Recursive_Condition_Bug_Test_CPPFLAGS = \ @@ -2315,7 +2122,6 @@ Recursive_Condition_Bug_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Recursive_Condition_Test.am - noinst_PROGRAMS += Recursive_Condition_Test Recursive_Condition_Test_CPPFLAGS = \ @@ -2331,7 +2137,6 @@ Recursive_Condition_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Recursive_Mutex_Test.am - noinst_PROGRAMS += Recursive_Mutex_Test Recursive_Mutex_Test_CPPFLAGS = \ @@ -2349,7 +2154,6 @@ Recursive_Mutex_Test_LDADD = \ ## Makefile.Refcounted_Auto_Ptr_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Refcounted_Auto_Ptr_Test Refcounted_Auto_Ptr_Test_CPPFLAGS = \ @@ -2368,7 +2172,6 @@ Refcounted_Auto_Ptr_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Reference_Counted_Event_Handler_Test.am - noinst_PROGRAMS += Reference_Counted_Event_Handler_Test Reference_Counted_Event_Handler_Test_CPPFLAGS = \ @@ -2384,7 +2187,6 @@ Reference_Counted_Event_Handler_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Reverse_Lock_Test.am - noinst_PROGRAMS += Reverse_Lock_Test Reverse_Lock_Test_CPPFLAGS = \ @@ -2400,7 +2202,6 @@ Reverse_Lock_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.SOCK_Connector_Test.am - noinst_PROGRAMS += SOCK_Connector_Test SOCK_Connector_Test_CPPFLAGS = \ @@ -2418,7 +2219,6 @@ SOCK_Connector_Test_LDADD = \ ## Makefile.SOCK_Dgram_Bcast_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += SOCK_Dgram_Bcast_Test SOCK_Dgram_Bcast_Test_CPPFLAGS = \ @@ -2436,7 +2236,6 @@ SOCK_Dgram_Bcast_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.SOCK_Dgram_Test.am - noinst_PROGRAMS += SOCK_Dgram_Test SOCK_Dgram_Test_CPPFLAGS = \ @@ -2451,30 +2250,9 @@ SOCK_Dgram_Test_LDADD = \ libTest_Output.la \ $(ACE_BUILDDIR)/ace/libACE.la -## Makefile.SOCK_Netlink_Test.am - -if !BUILD_ACE_FOR_TAO - -noinst_PROGRAMS += SOCK_Netlink_Test - -SOCK_Netlink_Test_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) - -SOCK_Netlink_Test_SOURCES = \ - $(ACE_ROOT)/tests/Main.cpp \ - SOCK_Netlink_Test.cpp - -SOCK_Netlink_Test_LDADD = \ - libTest_Output.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -endif !BUILD_ACE_FOR_TAO - ## Makefile.SOCK_SEQPACK_SCTP_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += SOCK_SEQPACK_SCTP_Test SOCK_SEQPACK_SCTP_Test_CPPFLAGS = \ @@ -2492,7 +2270,6 @@ SOCK_SEQPACK_SCTP_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.SOCK_Send_Recv_Test.am - noinst_PROGRAMS += SOCK_Send_Recv_Test SOCK_Send_Recv_Test_CPPFLAGS = \ @@ -2508,7 +2285,6 @@ SOCK_Send_Recv_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.SOCK_Send_Recv_Test_IPV6.am - noinst_PROGRAMS += SOCK_Send_Recv_Test_IPV6 SOCK_Send_Recv_Test_IPV6_CPPFLAGS = \ @@ -2524,7 +2300,6 @@ SOCK_Send_Recv_Test_IPV6_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.SOCK_Test.am - noinst_PROGRAMS += SOCK_Test SOCK_Test_CPPFLAGS = \ @@ -2540,7 +2315,6 @@ SOCK_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.SOCK_Test_IPv6.am - noinst_PROGRAMS += SOCK_Test_IPv6 SOCK_Test_IPv6_CPPFLAGS = \ @@ -2558,7 +2332,6 @@ SOCK_Test_IPv6_LDADD = \ ## Makefile.SPIPE_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += SPIPE_Test SPIPE_Test_CPPFLAGS = \ @@ -2576,7 +2349,6 @@ SPIPE_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.SString_Test.am - noinst_PROGRAMS += SString_Test SString_Test_CPPFLAGS = \ @@ -2594,7 +2366,6 @@ SString_Test_LDADD = \ ## Makefile.SV_Shared_Memory_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += SV_Shared_Memory_Test SV_Shared_Memory_Test_CPPFLAGS = \ @@ -2614,7 +2385,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.Semaphore_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Semaphore_Test Semaphore_Test_CPPFLAGS = \ @@ -2632,7 +2402,6 @@ Semaphore_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Sendfile_Test.am - noinst_PROGRAMS += Sendfile_Test Sendfile_Test_CPPFLAGS = \ @@ -2664,7 +2433,6 @@ noinst_HEADERS += \ Service_Config_DLL_Export.h ## Makefile.Service_Config_Test.am - noinst_PROGRAMS += Service_Config_Test Service_Config_Test_CPPFLAGS = \ @@ -2680,7 +2448,6 @@ Service_Config_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Signal_Test.am - noinst_PROGRAMS += Signal_Test Signal_Test_CPPFLAGS = \ @@ -2696,7 +2463,6 @@ Signal_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Sigset_Ops_Test.am - noinst_PROGRAMS += Sigset_Ops_Test Sigset_Ops_Test_CPPFLAGS = \ @@ -2712,7 +2478,6 @@ Sigset_Ops_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Simple_Message_Block_Test.am - noinst_PROGRAMS += Simple_Message_Block_Test Simple_Message_Block_Test_CPPFLAGS = \ @@ -2730,7 +2495,6 @@ Simple_Message_Block_Test_LDADD = \ ## Makefile.Svc_Handler_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Svc_Handler_Test Svc_Handler_Test_CPPFLAGS = \ @@ -2750,7 +2514,6 @@ endif !BUILD_ACE_FOR_TAO ## Makefile.TP_Reactor_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += TP_Reactor_Test TP_Reactor_Test_CPPFLAGS = \ @@ -2769,7 +2532,6 @@ TP_Reactor_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.TSS_Static_Test.am - noinst_PROGRAMS += TSS_Static_Test TSS_Static_Test_CPPFLAGS = \ @@ -2785,7 +2547,6 @@ TSS_Static_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.TSS_Test.am - noinst_PROGRAMS += TSS_Test TSS_Test_CPPFLAGS = \ @@ -2801,7 +2562,6 @@ TSS_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Task_Ex_Test.am - noinst_PROGRAMS += Task_Ex_Test Task_Ex_Test_CPPFLAGS = \ @@ -2818,7 +2578,6 @@ Task_Ex_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Task_Test.am - noinst_PROGRAMS += Task_Test Task_Test_CPPFLAGS = \ @@ -2834,7 +2593,6 @@ Task_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Thread_Manager_Test.am - noinst_PROGRAMS += Thread_Manager_Test Thread_Manager_Test_CPPFLAGS = \ @@ -2850,7 +2608,6 @@ Thread_Manager_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Thread_Mutex_Test.am - noinst_PROGRAMS += Thread_Mutex_Test Thread_Mutex_Test_CPPFLAGS = \ @@ -2868,7 +2625,6 @@ Thread_Mutex_Test_LDADD = \ ## Makefile.Thread_Pool_Reactor_Resume_Test.am if BUILD_ACE_OTHER - noinst_PROGRAMS += Thread_Pool_Reactor_Resume_Test Thread_Pool_Reactor_Resume_Test_CPPFLAGS = \ @@ -2889,7 +2645,6 @@ endif BUILD_ACE_OTHER ## Makefile.Thread_Pool_Reactor_Test.am if BUILD_ACE_OTHER - noinst_PROGRAMS += Thread_Pool_Reactor_Test Thread_Pool_Reactor_Test_CPPFLAGS = \ @@ -2908,7 +2663,6 @@ Thread_Pool_Reactor_Test_LDADD = \ endif BUILD_ACE_OTHER ## Makefile.Thread_Pool_Test.am - noinst_PROGRAMS += Thread_Pool_Test Thread_Pool_Test_CPPFLAGS = \ @@ -2924,7 +2678,6 @@ Thread_Pool_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Time_Service_Test.am - noinst_PROGRAMS += Time_Service_Test Time_Service_Test_CPPFLAGS = \ @@ -2940,7 +2693,6 @@ Time_Service_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Time_Value_Test.am - noinst_PROGRAMS += Time_Value_Test Time_Value_Test_CPPFLAGS = \ @@ -2956,7 +2708,6 @@ Time_Value_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Timeprobe_Test.am - noinst_PROGRAMS += Timeprobe_Test Timeprobe_Test_CPPFLAGS = \ @@ -2972,7 +2723,6 @@ Timeprobe_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Timer_Cancellation_Test.am - noinst_PROGRAMS += Timer_Cancellation_Test Timer_Cancellation_Test_CPPFLAGS = \ @@ -2988,7 +2738,6 @@ Timer_Cancellation_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.Timer_Queue_Reference_Counting_Test.am - noinst_PROGRAMS += Timer_Queue_Reference_Counting_Test Timer_Queue_Reference_Counting_Test_CPPFLAGS = \ @@ -3006,7 +2755,6 @@ Timer_Queue_Reference_Counting_Test_LDADD = \ ## Makefile.Timer_Queue_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Timer_Queue_Test Timer_Queue_Test_CPPFLAGS = \ @@ -3054,7 +2802,6 @@ endif BUILD_TK endif BUILD_ACE_TKREACTOR ## Makefile.Token_Strategy_Test.am - noinst_PROGRAMS += Token_Strategy_Test Token_Strategy_Test_CPPFLAGS = \ @@ -3072,7 +2819,6 @@ Token_Strategy_Test_LDADD = \ ## Makefile.Tokens_Test.am if BUILD_ACE_TOKEN - noinst_PROGRAMS += Tokens_Test Tokens_Test_CPPFLAGS = \ @@ -3092,7 +2838,6 @@ endif BUILD_ACE_TOKEN ## Makefile.UPIPE_SAP_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += UPIPE_SAP_Test UPIPE_SAP_Test_CPPFLAGS = \ @@ -3113,7 +2858,6 @@ endif !BUILD_ACE_FOR_TAO if BUILD_ACE_UUID if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += UUIDTest UUIDTest_CPPFLAGS = \ @@ -3132,7 +2876,6 @@ endif !BUILD_ACE_FOR_TAO endif BUILD_ACE_UUID ## Makefile.Unbounded_Set_Test.am - noinst_PROGRAMS += Unbounded_Set_Test Unbounded_Set_Test_CPPFLAGS = \ @@ -3150,7 +2893,6 @@ Unbounded_Set_Test_LDADD = \ ## Makefile.Upgradable_RW_Test.am if !BUILD_ACE_FOR_TAO - noinst_PROGRAMS += Upgradable_RW_Test Upgradable_RW_Test_CPPFLAGS = \ @@ -3169,7 +2911,6 @@ Upgradable_RW_Test_LDADD = \ endif !BUILD_ACE_FOR_TAO ## Makefile.Vector_Test.am - noinst_PROGRAMS += Vector_Test Vector_Test_CPPFLAGS = \ @@ -3185,7 +2926,6 @@ Vector_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la ## Makefile.WFMO_Reactor_Test.am - noinst_PROGRAMS += WFMO_Reactor_Test WFMO_Reactor_Test_CPPFLAGS = \ diff --git a/ACE/tests/Malloc_Test.cpp b/ACE/tests/Malloc_Test.cpp index 5b260a680a0..88c2bd5e669 100644 --- a/ACE/tests/Malloc_Test.cpp +++ b/ACE/tests/Malloc_Test.cpp @@ -44,7 +44,9 @@ typedef ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex> MALLOC; #if !defined (linux) && !defined (ACE_OPENVMS) \ && !(defined (ACE_WIN32) \ - && (defined (ghs) || defined (__MINGW32__) )) \ + && (defined (ghs) \ + || defined (__MINGW32__) \ + || (!defined(ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)))) \ && !(defined (__OpenBSD__) && defined (ACE_HAS_PTHREADS)) #define ACE_TEST_REMAP_ON_FAULT // Linux seems to have problem when calling mmap from the signal handler. @@ -74,9 +76,12 @@ static const void *PARENT_BASE_ADDR = ACE_DEFAULT_BASE_ADDR; // Note that on HP-UX on PA-RISC hardware, a single range of a file // cannot be mapped into multiple virtual address ranges, even across // processes. So, though the whole PI pointer thing is tested here, -// it isn't actually using multiple address ranges. +// it isn't actually using multiple address ranges. Also, on Win9x, +// you need to map shared views to the same address. -#if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 && !defined (HPUX)) +#if (ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 && !defined (HPUX)) \ + && !(defined (ACE_WIN32) \ + && (!defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0))) # define CHILD_ADDR_DELTA (1024*1024) #else # define CHILD_ADDR_DELTA 0 @@ -302,16 +307,14 @@ child (void) return 0; } -#if defined (ACE_WIN32) +#if defined (ACE_WIN32) \ + && (!defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)) // On Win9x/Me, a shared address needs to be on the shared arena, // betweeen the second and third megabyte in the virtual address space // of the process. Also, a mapped view of a file is shared on the same // virtual address on every 32 bit process. On WinNT/2k, memory above // 2Gb is reserved for the system. So, we need to check at runtime // (we want an ACE_HAS_WINNT4 == 0 ace to run on either). -// To catch any odd case arising from Pharlap and/or WinCE, do the -// run time check and run the NT4-or-better code unless we're on -// CE or something other than NT4 (Pharlap reports itself as NT 3.51). static void get_base_addrs (void) { @@ -320,20 +323,20 @@ get_base_addrs (void) if (::GetVersionEx(&vinfo) == 0) return; - if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT && - vinfo.dwMajorVersion >= 4) + if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) PARENT_BASE_ADDR = (char*) (64 * 1024*1024); else PARENT_BASE_ADDR = (char*) ((2048UL + 512UL)*(1024UL*1024UL)); CHILD_BASE_ADDR = CHILD_ADDR_DELTA + (char*) PARENT_BASE_ADDR; } -#endif /* defined (ACE_WIN32) */ +#endif /* defined (ACE_WIN32) && (!defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)) */ int run_main (int argc, ACE_TCHAR *[]) { -#if defined (ACE_WIN32) +#if defined (ACE_WIN32) \ + && (!defined (ACE_HAS_WINNT4) || (ACE_HAS_WINNT4 == 0)) get_base_addrs(); #endif diff --git a/ACE/tests/Manual_Event_Test.cpp b/ACE/tests/Manual_Event_Test.cpp index 3c914698d56..1b28d846a71 100644 --- a/ACE/tests/Manual_Event_Test.cpp +++ b/ACE/tests/Manual_Event_Test.cpp @@ -47,6 +47,9 @@ static int test_result = 0; // state is 0). static ACE_Manual_Event evt ((unsigned int) 0); +// Default number of iterations. +static int n_iterations = 10; + // Number of worker threads. static long n_workers = 10; @@ -71,7 +74,7 @@ print_usage_and_die (void) static void parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("w:")); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("w:n:")); int c; @@ -81,6 +84,9 @@ parse_args (int argc, ACE_TCHAR *argv[]) case 'w': n_workers = ACE_OS::atoi (get_opt.opt_arg ()); break; + case 'n': + n_iterations = ACE_OS::atoi (get_opt.opt_arg ()); + break; default: print_usage_and_die (); break; diff --git a/ACE/tests/Message_Queue_Test.cpp b/ACE/tests/Message_Queue_Test.cpp index 27ae29f0470..4198ca5b6fd 100644 --- a/ACE/tests/Message_Queue_Test.cpp +++ b/ACE/tests/Message_Queue_Test.cpp @@ -299,7 +299,7 @@ single_thread_performance_test (int queue_type = 0) -1); message = "ACE_Message_Queue_Vx, single thread test"; } -#elif defined (ACE_WIN32) && defined (ACE_HAS_WIN32_OVERLAPPED_IO) +#elif defined (ACE_WIN32) && (ACE_HAS_WINNT4 != 0) else { ACE_NEW_RETURN (msgq, @@ -495,7 +495,7 @@ performance_test (int queue_type = 0) -1); message = "ACE_Message_Queue_Vx"; } -#elif defined (ACE_WIN32) && defined (ACE_HAS_WIN32_OVERLAPPED_IO) +#elif defined (ACE_WIN32) && (ACE_HAS_WINNT4 != 0) else { ACE_NEW_RETURN (queue_wrapper.q_, @@ -659,7 +659,7 @@ run_main (int argc, ACE_TCHAR *argv[]) if (status == 0) status = single_thread_performance_test (); -# if defined (VXWORKS) || defined (ACE_HAS_WIN32_OVERLAPPED_IO) +# if defined (VXWORKS) || (defined (ACE_WIN32) && (ACE_HAS_WINNT4 != 0)) // Test ACE_Message_Queue_Vx. or ACE_Message_Queue_NT if (status == 0) status = single_thread_performance_test (1); @@ -668,7 +668,7 @@ run_main (int argc, ACE_TCHAR *argv[]) if (status == 0) status = performance_test (); -# if defined (VXWORKS) || defined (ACE_HAS_WIN32_OVERLAPPED_IO) +# if defined (VXWORKS) || (defined (ACE_WIN32) && (ACE_HAS_WINNT4 != 0)) // Test ACE_Message_Queue_Vx or ACE_Message_Queue_NT if (status == 0) status = performance_test (1); diff --git a/ACE/tests/OS_Test.cpp b/ACE/tests/OS_Test.cpp index d270a19d66c..fa7b058e4e4 100644 --- a/ACE/tests/OS_Test.cpp +++ b/ACE/tests/OS_Test.cpp @@ -92,7 +92,7 @@ rename_test (void) } ACE_OS::fclose (f); -#if defined (ACE_WIN32) && defined (ACE_LACKS_WIN32_MOVEFILEEX) +#if defined (ACE_WIN32) && defined (ACE_HAS_WINNT4) && ACE_HAS_WINNT4 == 0 // Can't rename if new_file exists already. ACE_OS::unlink (new_file); #endif @@ -524,78 +524,6 @@ string_emulation_test (void) return 0; } -// Test ACE_OS::snprintf -int -snprintf_test (void) -{ - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Testing snprintf\n"))); - - int error_count = 0; - const int BUFFER_SIZE = 4; - char buf[2*BUFFER_SIZE]; - int retval; - - ACE_OS::memset(buf, 0xab, 2*BUFFER_SIZE); - retval = ACE_OS::snprintf (buf, BUFFER_SIZE, "%d", 123); - if (retval != 3) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("[1] ACE_OS::snprintf() returns %d, should be 3\n"), - retval)); - ++error_count; - } - - ACE_OS::memset(buf, 0xab, 2*BUFFER_SIZE); - retval = ACE_OS::snprintf (buf, BUFFER_SIZE, "%d", 1234); - - // HP-UX has broken vsnprintf -#if !defined (HPUX) - if (retval != 4) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("[2] ACE_OS::snprintf() returns %d, should be 4\n"), - retval)); - ++error_count; - } -#endif /* !HPUX */ - - if (buf[3] != 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("[3] ACE_OS::snprintf() doesn't terminate string correctly\n"))); - ++error_count; - } - else if (ACE_OS::strcmp(buf, "123") != 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("[4] ACE_OS::snprintf() incorrect output\n"))); - ++error_count; - } - - ACE_OS::memset(buf, 0xab, 2*BUFFER_SIZE); - retval = ACE_OS::snprintf (buf, BUFFER_SIZE, "%d", 12345); - if (retval != 5) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("[5] ACE_OS::snprintf() returns %d, should be 5\n"), - retval)); - ++error_count; - } - else if (buf[3] != 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("[6] ACE_OS::snprintf() doesn't terminate string correctly\n"))); - ++error_count; - } - else if (ACE_OS::strcmp(buf, "123") != 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("[6] ACE_OS::snprintf() incorrect output\n"))); - ++error_count; - } - - return error_count; -} static int ctime_r_test (void) @@ -911,11 +839,6 @@ run_main (int, ACE_TCHAR *[]) if ((result = string_emulation_test ()) != 0) status = result; -#if !defined (ACE_LACKS_VSNPRINTF) || defined (ACE_HAS_TRIO) - if ((result = snprintf_test ()) != 0) - status = result; -#endif /* !ACE_LACKS_VSNPRINTF || ACE_HAS_TRIO */ - if ((result = ctime_r_test ()) != 0) status = result; diff --git a/ACE/tests/Proactor_Scatter_Gather_Test.cpp b/ACE/tests/Proactor_Scatter_Gather_Test.cpp index acc7e11c5b7..a3cbb335a34 100644 --- a/ACE/tests/Proactor_Scatter_Gather_Test.cpp +++ b/ACE/tests/Proactor_Scatter_Gather_Test.cpp @@ -28,7 +28,7 @@ #include "test_config.h" -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) +#if ((defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) && !defined (ACE_HAS_WINCE)) // This currently only works on Win32 platforms (NT SP2 and above). // Support for Unix platforms supporting POSIX aio calls should be added in future. @@ -1482,4 +1482,4 @@ run_main (int, ACE_TCHAR *[]) return 0; } -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO */ +#endif /* (ACE_HAS_WINNT4 && ACE_HAS_WINNT4 != 0) && !ACE_HAS_WINCE) */ diff --git a/ACE/tests/Proactor_Test.cpp b/ACE/tests/Proactor_Test.cpp index 28a5dbcff8a..9d739b2d5e3 100644 --- a/ACE/tests/Proactor_Test.cpp +++ b/ACE/tests/Proactor_Test.cpp @@ -20,7 +20,7 @@ ACE_RCSID (tests, Proactor_Test, "$Id$") -#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)) +#if defined (ACE_HAS_THREADS) && ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) // This only works on Win32 platforms and on Unix platforms // supporting POSIX aio calls. @@ -50,7 +50,7 @@ ACE_RCSID (tests, #include "ace/Atomic_Op.h" #include "ace/Synch_Traits.h" -#if defined (ACE_WIN32) +#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) # include "ace/WIN32_Proactor.h" @@ -60,7 +60,7 @@ ACE_RCSID (tests, # include "ace/POSIX_CB_Proactor.h" # include "ace/SUN_Proactor.h" -#endif /* ACE_WIN32 */ +#endif /* defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) */ #include "Proactor_Test.h" @@ -205,7 +205,7 @@ MyTask::create_proactor (ProactorType type_proactor, size_t max_op) ACE_ASSERT (this->proactor_ == 0); -#if defined (ACE_WIN32) +#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (type_proactor); ACE_UNUSED_ARG (max_op); @@ -269,7 +269,7 @@ MyTask::create_proactor (ProactorType type_proactor, size_t max_op) break; } -#endif /* ACE_WIN32 */ +#endif // (ACE_WIN32) && !defined (ACE_HAS_WINCE) // always delete implementation 1 , not !(proactor_impl == 0) ACE_NEW_RETURN (this->proactor_, @@ -1281,7 +1281,7 @@ Client::initiate_write_stream (void) static const size_t complete_message_length = ACE_OS::strlen (complete_message); -#if defined (ACE_WIN32) +#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) ACE_Message_Block *mb1 = 0, *mb2 = 0, @@ -1319,7 +1319,7 @@ Client::initiate_write_stream (void) ACE_TEXT ("Client::ACE_Asynch_Stream::writev")), -1); } -#else /* ACE_WIN32 */ +#else /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ ACE_Message_Block *mb = 0; @@ -1346,7 +1346,7 @@ Client::initiate_write_stream (void) ACE_TEXT ("write")), -1); } -#endif /* ACE_WIN32 */ +#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ this->io_count_++; this->total_w_++; @@ -1362,7 +1362,7 @@ Client::initiate_read_stream (void) static const size_t complete_message_length = ACE_OS::strlen (complete_message); -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) +#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) && (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) ACE_Message_Block *mb1 = 0, *mb2 = 0, *mb3 = 0, @@ -1411,7 +1411,7 @@ Client::initiate_read_stream (void) ACE_TEXT ("Client::ACE_Asynch_Read_Stream::readv")), -1); } -#else /* ACE_HAS_WIN32_OVERLAPPED_IO */ +#else /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ // Try to read more chunks size_t blksize = ( complete_message_length > BUFSIZ ) ? @@ -1444,7 +1444,7 @@ Client::initiate_read_stream (void) ACE_TEXT ("read")), -1); } -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO */ +#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ this->io_count_++; this->total_r_++; @@ -1495,7 +1495,7 @@ Client::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result) ACE_TEXT ("error"), result.error ())); -#if defined (ACE_WIN32) +#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) size_t bytes_transferred = result.bytes_transferred (); char index = 0; for (ACE_Message_Block* mb_i = &mb; @@ -1526,7 +1526,7 @@ Client::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result) index, mb_i->rd_ptr ())); } -#else /* ACE_WIN32 */ +#else /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ // write 0 at string end for proper printout (if end of mb, it's 0 already) mb.rd_ptr()[0] = '\0'; // move rd_ptr backwards as required for printout @@ -1535,7 +1535,7 @@ Client::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result) ACE_TEXT ("%s = %s\n"), ACE_TEXT ("message_block"), mb.rd_ptr ())); -#endif /* ACE_WIN32 */ +#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("**** end of message ****************\n"))); @@ -1638,7 +1638,7 @@ Client::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result) ACE_TEXT ("error"), result.error ())); -#if defined (ACE_WIN32) +#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) char index = 0; for (ACE_Message_Block* mb_i = &mb; mb_i != 0; @@ -1654,14 +1654,14 @@ Client::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result) index, mb_i->rd_ptr ())); } -#else /* ACE_WIN32 */ +#else /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ // write 0 at string end for proper printout mb.rd_ptr()[result.bytes_transferred ()] = '\0'; // for proper printout ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%s = %s\n"), ACE_TEXT ("message_block"), mb.rd_ptr ())); -#endif /* ACE_WIN32 */ +#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("**** end of message ****************\n"))); @@ -1934,4 +1934,4 @@ run_main (int, ACE_TCHAR *[]) return 0; } -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ +#endif /* ACE_WIN32 && !ACE_HAS_WINCE || ACE_HAS_AIO_CALLS */ diff --git a/ACE/tests/Proactor_Test_IPV6.cpp b/ACE/tests/Proactor_Test_IPV6.cpp index 003f6915612..7ac9443d0ae 100644 --- a/ACE/tests/Proactor_Test_IPV6.cpp +++ b/ACE/tests/Proactor_Test_IPV6.cpp @@ -20,7 +20,7 @@ ACE_RCSID (tests, Proactor_Test, "$Id$") -#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS)) +#if defined (ACE_HAS_THREADS) && ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) // This only works on Win32 platforms and on Unix platforms // supporting POSIX aio calls. @@ -50,7 +50,7 @@ ACE_RCSID (tests, #include "ace/Atomic_Op.h" #include "ace/Synch_Traits.h" -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) +#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) # include "ace/WIN32_Proactor.h" @@ -60,7 +60,7 @@ ACE_RCSID (tests, # include "ace/POSIX_CB_Proactor.h" # include "ace/SUN_Proactor.h" -#endif /* defined (ACE_HAS_WIN32_OVERLAPPED_IO) */ +#endif /* defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) */ #include "Proactor_Test.h" @@ -1678,7 +1678,7 @@ Client::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result) ACE_TEXT ("error"), result.error ())); -#if defined (ACE_WIN32) +#if (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) char index = 0; for (ACE_Message_Block* mb_i = &mb; mb_i != 0; @@ -1694,14 +1694,14 @@ Client::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result) index, mb_i->rd_ptr ())); } -#else /* ACE_WIN32 */ +#else /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ // write 0 at string end for proper printout mb.rd_ptr()[result.bytes_transferred ()] = '\0'; // for proper printout ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%s = %s\n"), ACE_TEXT ("message_block"), mb.rd_ptr ())); -#endif /* ACE_WIN32 */ +#endif /* (defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) */ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("**** end of message ****************\n"))); @@ -1981,4 +1981,4 @@ run_main (int, ACE_TCHAR *[]) return 0; } -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ +#endif /* ACE_WIN32 && !ACE_HAS_WINCE || ACE_HAS_AIO_CALLS */ diff --git a/ACE/tests/Proactor_Timer_Test.cpp b/ACE/tests/Proactor_Timer_Test.cpp index 7d81bcb5ef1..b93bc7dc78f 100644 --- a/ACE/tests/Proactor_Timer_Test.cpp +++ b/ACE/tests/Proactor_Timer_Test.cpp @@ -27,7 +27,7 @@ ACE_RCSID (tests, Proactor_Timer_Test, "$Id$") -#if defined (ACE_HAS_WIN32_OVERLAPPED_IO) || defined (ACE_HAS_AIO_CALLS) +#if ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) // This only works on Win32 platforms and on Unix platforms // supporting POSIX aio calls. @@ -38,7 +38,7 @@ ACE_RCSID (tests, #include "ace/Asynch_IO.h" static int done = 0; -static size_t counter = 0; +static size_t count = 0; static int odd = 0; class Time_Handler : public ACE_Handler @@ -100,29 +100,29 @@ Time_Handler::Time_Handler (void) void Time_Handler::handle_time_out (const ACE_Time_Value &, const void *arg) { - size_t current_counter = *(reinterpret_cast<const size_t *> (arg)); - if (current_counter != counter) + size_t current_count = *(reinterpret_cast<const size_t *> (arg)); + if (current_count != count) ACE_ERROR ((LM_ERROR, ACE_TEXT ("Expected timer %d, not %d\n"), - counter, - current_counter)); + count, + current_count)); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("[%@] Timer id %d with counter #%d|%d expired.\n"), + ACE_TEXT ("[%@] Timer id %d with count #%d|%d expired.\n"), this, this->timer_id (), - counter, - current_counter)); + count, + current_count)); - if (current_counter == (ACE_MAX_TIMERS - 1)) + if (current_count == (ACE_MAX_TIMERS - 1)) done = 1; - else if (counter == ACE_MAX_TIMERS - 1) + else if (count == ACE_MAX_TIMERS - 1) { done = 1; return; } - counter += (1 + odd); + count += (1 + odd); return; } @@ -213,7 +213,7 @@ test_registering_one_handler (void) size_t which[ACE_MAX_TIMERS]; done = 0; - counter = 0; + count = 0; long secs = 0; size_t i = 0; for ( ; i < ACE_MAX_TIMERS; i++, secs++) @@ -241,7 +241,7 @@ test_canceling_odd_timers (void) size_t which[ACE_MAX_TIMERS]; done = 0; - counter = 1; + count = 1; odd = 1; size_t i = 0; long secs = 0; @@ -340,4 +340,4 @@ run_main (int, ACE_TCHAR *[]) return 0; } -#endif /* ACE_HAS_WIN32_OVERLAPPED_IO || ACE_HAS_AIO_CALLS */ +#endif /* ACE_WIN32 && !ACE_HAS_WINCE || ACE_HAS_AIO_CALLS */ diff --git a/ACE/tests/QtReactor_Test.cpp b/ACE/tests/QtReactor_Test.cpp index 1bbb2d43c74..c228802988b 100644 --- a/ACE/tests/QtReactor_Test.cpp +++ b/ACE/tests/QtReactor_Test.cpp @@ -51,7 +51,7 @@ ACE_RCSID (tests, #include "ace/OS_NS_time.h" #include "ace/Time_Value.h" -#include "ace/QtReactor/QtReactor.h" +#include "ace/QtReactor.h" #include "ace/Event_Handler.h" #include "ace/Acceptor.h" #include "ace/Connector.h" diff --git a/ACE/tests/RB_Tree_Test.cpp b/ACE/tests/RB_Tree_Test.cpp index 1b3658d72b1..c276a96cafd 100644 --- a/ACE/tests/RB_Tree_Test.cpp +++ b/ACE/tests/RB_Tree_Test.cpp @@ -97,413 +97,279 @@ run_main (int, ACE_TCHAR *[]) str_int_test.run_test (); str_str_test.run_test (); -// ======= Stress Test contributed by Klaus H. Wolf <hw@cyland.com> ========= +// ======= Stress Test contributed by Klaus H. Wolf <hw@cyland.com> ================== ACE_RB_Tree<ACE_CString, int, ACE_Less_Than<ACE_CString>, ACE_Null_Mutex> tree; tree.bind (ACE_CString ("51"), 1); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("13"), 2); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("36"), 3); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("15"), 4); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("22"), 5); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("25"), 6); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("42"), 7); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("48"), 8); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("03"), 9); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("56"), 10); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("28"), 11); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("55"), 12); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("21"), 13); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("62"), 14); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("18"), 15); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("20"), 16); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("26"), 17); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("29"), 18); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("50"), 19); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("05"), 20); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("59"), 21); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("65"), 22); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("66"), 23); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("45"), 24); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("34"), 25); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("27"), 26); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("40"), 27); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("30"), 28); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("64"), 29); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("11"), 30); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("16"), 31); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("47"), 32); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("10"), 33); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("37"), 34); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("09"), 35); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("54"), 36); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("23"), 37); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("44"), 38); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("19"), 39); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("00"), 40); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("04"), 41); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("63"), 42); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("08"), 43); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("39"), 44); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("31"), 45); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("02"), 46); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("33"), 47); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("60"), 48); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("61"), 49); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("57"), 50); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("43"), 51); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("46"), 52); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("38"), 53); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("01"), 54); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("12"), 55); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("24"), 56); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("52"), 57); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("07"), 58); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("14"), 59); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("06"), 60); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("58"), 61); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("49"), 62); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("17"), 63); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("53"), 64); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("32"), 65); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("35"), 66); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.bind (ACE_CString ("41"), 67); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("51")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("13")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("36")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("15")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("22")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("25")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("42")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("48")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("03")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("56")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("28")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("55")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("21")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("62")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("18")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("20")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("26")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("29")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("50")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("05")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("59")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("65")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("66")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("45")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("34")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("27")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("40")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("30")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("64")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("11")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("16")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("47")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("10")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("37")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("09")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("54")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("23")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("44")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("19")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("00")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("04")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("63")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("08")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("39")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("31")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("02")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("33")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("60")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("61")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("57")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("43")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("46")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("38")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("01")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("12")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("24")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("52")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("07")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("14")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("06")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("58")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("49")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("17")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("53")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("32")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("35")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); tree.unbind (ACE_CString ("41")); - if (0 != tree.test_invariant ()) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Invariant failure at line %l\n"))); + ACE_ASSERT (tree.test_invariant () == 0); // ======== End Stress Test =================== @@ -566,32 +432,20 @@ ACE_RB_Tree_Test<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::test_tree_insertion (v { INT_ID item; int k = order_index_ [i]; - if (!(k >= 0 && k < entry_count_)) - ACE_ERROR ((LM_ERROR, ACE_TEXT ("Assert failure at line %l\n"))); + ACE_ASSERT (k >= 0 && k < entry_count_); // Test the new stable ACE_Hash_Map_Manager_Ex compliant interface. - if (0 != stable_tree_.bind (key_array_ [k], item_array_ [k])) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable bind %p\n"), - ACE_TEXT ("failure"))); - - if (0 != stable_tree_.find (key_array_ [k], item) || - item != item_array_ [k]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable find %p\n"), - ACE_TEXT ("failure"))); + ACE_ASSERT (stable_tree_.bind (key_array_ [k], + item_array_ [k]) == 0); + ACE_ASSERT (stable_tree_.find (key_array_ [k], item) == 0 + && item == item_array_ [k]); // Test the deprecated interface. - if (0 == deprecated_tree_.insert (key_array_ [k], item_array_ [k])) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Deprecated insert %p\n"), - ACE_TEXT ("failure"))); - - if (0 == deprecated_tree_.find (key_array_ [k]) || - *deprecated_tree_.find (key_array_ [k]) != item_array_ [k]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Deprecated find %p\n"), - ACE_TEXT ("failure"))); + ACE_ASSERT (deprecated_tree_.insert (key_array_ [k], + item_array_ [k]) != 0); + ACE_ASSERT (deprecated_tree_.find (key_array_ [k]) != 0 + && *deprecated_tree_.find (key_array_ [k]) == + item_array_ [k]); } } @@ -615,32 +469,16 @@ ACE_RB_Tree_Test<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::test_post_insertion_it INT_ID item; item = (*stable_fwd_iter_).item (); - if (item != item_array_ [i]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable fwd iter, pass %d %p\n"), - i, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [i]); item = (*stable_rev_iter_).item (); - if (item != item_array_ [entry_count_ - i - 1]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable rev iter, pass %d %p\n"), - i, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [entry_count_ - i - 1]); item = (*deprecated_fwd_iter_).item (); - if (item != item_array_ [i]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Deprecated fwd iter, pass %d %p\n"), - i, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [i]); item = (*deprecated_rev_iter_).item (); - if (item != item_array_ [entry_count_ - i - 1]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Deprecated rev iter, pass %d %p\n"), - i, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [entry_count_ - i - 1]); // Advance each iterator. ++stable_fwd_iter_; @@ -657,18 +495,11 @@ ACE_RB_Tree_Test<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::test_post_insertion_it // Make sure each item in each tree has been visited - if (stable_fwd_iter_.done () != 1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable fwd iter not done but should be\n"))); - if (stable_rev_iter_.done () != 1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable fwd iter not done but should be\n"))); - if (deprecated_fwd_iter_.done () != 1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable fwd iter not done but should be\n"))); - if (deprecated_rev_iter_.done () != 1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable fwd iter not done but should be\n"))); + ACE_ASSERT (stable_fwd_iter_.done () == 1); + ACE_ASSERT (stable_rev_iter_.done () == 1); + ACE_ASSERT (deprecated_fwd_iter_.done () == 1); + ACE_ASSERT (deprecated_rev_iter_.done () == 1); + } template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK> void @@ -683,11 +514,7 @@ ACE_RB_Tree_Test<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::test_partial_iteration INT_ID item; item = (*part_rev_iter_).item (); - if (item != item_array_ [i]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Partial rev iter, pass %d %p\n"), - i, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [i]); part_rev_iter_++; } @@ -697,11 +524,7 @@ ACE_RB_Tree_Test<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::test_partial_iteration INT_ID item; item = (*part_fwd_iter_).item (); - if (item != item_array_ [k]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Partial fwd iter, pass %d %p\n"), - k, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [k]); part_fwd_iter_++; } } @@ -717,18 +540,10 @@ ACE_RB_Tree_Test<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::test_tree_deletion (vo { // Test the new stable ACE_Hash_Map_Manager_Ex compliant // interface. - if (stable_tree_.unbind (key_array_ [i]) != 0) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable tree, failure pass %d %p\n"), - i, - ACE_TEXT ("unbind"))); + ACE_ASSERT (stable_tree_.unbind (key_array_ [i]) == 0); // Test the deprecated interface. - if (deprecated_tree_.remove (key_array_ [i]) != 1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Deprecated tree, failure pass %d %p\n"), - i, - ACE_TEXT ("remove"))); + ACE_ASSERT (deprecated_tree_.remove (key_array_ [i]) == 1); } } @@ -753,32 +568,17 @@ ACE_RB_Tree_Test<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::test_post_deletion_ite INT_ID item; item = (*stable_fwd_iter_).item (); - if (item != item_array_ [i]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable fwd iter, pass %d %p\n"), - i, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [i]); + item = (*stable_rev_iter_).item (); - if (item != item_array_ [entry_count_ - i]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable rev iter, pass %d %p\n"), - i, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [entry_count_ - i]); item = (*deprecated_fwd_iter_).item (); - if (item != item_array_ [i]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Deprecated fwd iter, pass %d %p\n"), - i, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [i]); item = (*deprecated_rev_iter_).item (); - if (item != item_array_ [entry_count_ - i]) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Deprecated rev iter, pass %d %p\n"), - i, - ACE_TEXT ("failure"))); + ACE_ASSERT (item == item_array_ [entry_count_ - i]); // Advance each iterator via postfix increment. stable_fwd_iter_++; @@ -788,18 +588,10 @@ ACE_RB_Tree_Test<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::test_post_deletion_ite } // Make sure each item in each tree has been visited a second time. - if (stable_fwd_iter_.done () != 1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable fwd iter not done but should be\n"))); - if (stable_rev_iter_.done () != 1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Stable rev iter not done but should be\n"))); - if (deprecated_fwd_iter_.done () != 1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Deprecated fwd iter not done but should be\n"))); - if (deprecated_rev_iter_.done () != 1) - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("Deprecated rev iter not done but should be\n"))); + ACE_ASSERT (stable_fwd_iter_.done () == 1); + ACE_ASSERT (stable_rev_iter_.done () == 1); + ACE_ASSERT (deprecated_fwd_iter_.done () == 1); + ACE_ASSERT (deprecated_rev_iter_.done () == 1); } diff --git a/ACE/tests/SPIPE_Test.cpp b/ACE/tests/SPIPE_Test.cpp index 31e0ae86653..22a4427af44 100644 --- a/ACE/tests/SPIPE_Test.cpp +++ b/ACE/tests/SPIPE_Test.cpp @@ -32,7 +32,9 @@ ACE_RCSID(tests, SPIPE_Test, "SPIPE_Test.cpp,v 4.36 2002/03/06 21:48:03 nanbor Exp") -#if defined (ACE_HAS_STREAM_PIPES) || defined (ACE_HAS_WIN32_NAMED_PIPES) +#if defined (ACE_HAS_STREAM_PIPES) \ + || (defined (ACE_WIN32) && defined(ACE_HAS_WINNT4) \ + && (ACE_HAS_WINNT4 !=0)) # define TEST_HAS_STREAM_PIPES #endif @@ -62,7 +64,7 @@ client (void *) if (cli_stream.close () == -1) ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("close"))); -#if defined (ACE_HAS_WIN32_NAMED_PIPES) +#if (defined (ACE_WIN32) && defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) // Wait for server to get ready... ACE_OS::sleep (1); @@ -132,7 +134,7 @@ server (void *) new_stream.close (); acceptor.close (); -#if defined (ACE_HAS_WIN32_NAMED_PIPES) +#if (defined (ACE_WIN32) && defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) // Initialize an NT bytestream named pipe listener. if (acceptor.open (ACE_SPIPE_Addr (rendezvous), 1, @@ -175,7 +177,7 @@ server (void *) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("End of connection. Closing handle\n"))); new_stream.close (); acceptor.close (); -#endif /* defined (ACE_HAS_WIN32NAMED_PIPES) */ +#endif /* (defined (ACE_WIN32) && defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0)) */ return 0; } diff --git a/ACE/tests/SSL/Makefile.am b/ACE/tests/SSL/Makefile.am index ee10293e8ca..c3ae6261b1b 100644 --- a/ACE/tests/SSL/Makefile.am +++ b/ACE/tests/SSL/Makefile.am @@ -6,7 +6,7 @@ ## this file will be lost the next time it is generated. ## ## MPC Command: -## ./bin/mwc.pl -type automake -noreldefs ACE.mwc +## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu ACE_BUILDDIR = $(top_builddir) ACE_ROOT = $(top_srcdir) @@ -45,6 +45,7 @@ endif BUILD_SSL ## Makefile.Thread_Pool_Reactor_SSL_Test.am if BUILD_SSL +if !BUILD_ACE_FOR_TAO noinst_PROGRAMS += Thread_Pool_Reactor_SSL_Test @@ -68,6 +69,7 @@ Thread_Pool_Reactor_SSL_Test_LDADD = \ $(ACE_BUILDDIR)/ace/libACE.la \ @ACE_TLS_LIBS@ +endif !BUILD_ACE_FOR_TAO endif BUILD_SSL ## Clean up template repositories, etc. diff --git a/ACE/tests/SV_Shared_Memory_Test.cpp b/ACE/tests/SV_Shared_Memory_Test.cpp index 305e3785c96..f8351395346 100644 --- a/ACE/tests/SV_Shared_Memory_Test.cpp +++ b/ACE/tests/SV_Shared_Memory_Test.cpp @@ -140,15 +140,6 @@ run_main (int, ACE_TCHAR *[]) #if defined (ACE_HAS_SYSV_IPC) && !defined (ACE_LACKS_FORK) && \ !defined(ACE_LACKS_SYSV_SHMEM) - - // Check whether allocator was initialized. - if (myallocator ().bad ()) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Unable to initialize allocator\n")), - -1); - } - char *shm = reinterpret_cast<char *> (myallocator ().malloc (SHMSZ)); // Create the mutex and synch before spawning the child process, to diff --git a/ACE/tests/Svc_Handler_Test.cpp b/ACE/tests/Svc_Handler_Test.cpp index 09393447ba2..c36d8483e08 100644 --- a/ACE/tests/Svc_Handler_Test.cpp +++ b/ACE/tests/Svc_Handler_Test.cpp @@ -101,7 +101,9 @@ run_main (int argc, ACE_TCHAR *argv[]) file.get_path_name ()), 1); -#if !defined (VXWORKS) +#if (!defined (ACE_WIN32) \ + || (defined (ACE_HAS_WINNT4) && ACE_HAS_WINNT4 == 1)) && \ + !defined (VXWORKS) # define TEST_CAN_UNLINK_IN_ADVANCE #endif diff --git a/ACE/tests/Thread_Creation_Threshold_Test.cpp b/ACE/tests/Thread_Creation_Threshold_Test.cpp deleted file mode 100644 index c31e7ec2223..00000000000 --- a/ACE/tests/Thread_Creation_Threshold_Test.cpp +++ /dev/null @@ -1,230 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// tests -// -// = FILENAME -// Thread_Creation_Threshold_Test.cpp -// -// = DESCRIPTION -// This test program stresses how many threads can be -// consecutively (not simultaneously) created on a platform. -// Rather than testing exhaustively, it establishes a -// semi-arbitrary upper limit (MAX_THREAD)of threads. The limit -// is only partly arbitrary because it was chosen as a value that -// exceeded an observed upper limit on the values that Solaris 9 -// will accept as arguments to thr_concurrency(), used by -// ACE_OS::thr_create(THR_NEW_LWP). -// -// = AUTHOR -// Chris Cleeland <cleeland@ociweb.com> -// -// ============================================================================ - -#include "test_config.h" -#include "ace/Task.h" - -ACE_RCSID(tests, Thread_Pool_Test, "$Id$") - -#if defined (ACE_HAS_THREADS) -#include "ace/Lock_Adapter_T.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_unistd.h" - -// Number of iterations to run the test. -const int THREADS_PER_POOL = 1000; -const unsigned long MAX_THREAD = 100000; - -namespace -{ - // Change this to 'true' if you want lots of debugging messages in the log - const bool PRINT_DEBUG_MSGS = true; -} - -class Thread_Pool : public ACE_Task<ACE_MT_SYNCH> -{ - // = TITLE - // Defines a thread pool abstraction based on the <ACE_Task>. -public: - Thread_Pool (int n_threads); - // Create the thread pool containing <n_threads>. - - ~Thread_Pool (void); - // Destructor... - - virtual int svc (void); - // Iterate <n_iterations> time printing off a message and "waiting" - // for all other threads to complete this iteration. - - void start(); - // Start the threads in the pool. - - unsigned long total_threads() - { - return this->total_activated_threads_.value(); - } - - int n_threads_; - // Number of threads to spawn. - - bool operator! (); - // Returns true iff failed_ == false. - -private: - virtual int open (void * = 0); - // Spawn the threads in the pool. - - virtual int close (u_long); - // Close hook. - - ACE_Atomic_Op<ACE_Thread_Mutex, unsigned long> total_activated_threads_; - // Total number of threads activated through this thread pool ever. - - bool doprint_; - // Flag set only in worker threads to indicate whether they should print - // debug messages. - - bool failed_; - // Flag indicating that start() failed. -}; - -bool -Thread_Pool::operator!() -{ - return ! this->failed_; -} - -Thread_Pool::~Thread_Pool (void) -{ -} - -int -Thread_Pool::close (u_long) -{ - if (this->doprint_) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) worker thread closing down\n"))); - return 0; -} - -Thread_Pool::Thread_Pool (int n_threads) - : n_threads_ (n_threads) - , total_activated_threads_ (0) - , doprint_ (false) - , failed_ (false) -{ -} - -void -Thread_Pool::start () -{ - this->failed_ = false; - if (this->open () == -1) - { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) thread activation ") - ACE_TEXT ("failed after %u threads\n"), - this->total_threads())); - this->failed_ = true; - } -} - -int -Thread_Pool::svc (void) -{ - unsigned long t = ++this->total_activated_threads_; - if (PRINT_DEBUG_MSGS) // change this to 'true' for debugging - this->doprint_ = (t > 65530); - - if (this->doprint_) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT(" (%P|%t) thread started.\n"))); - - // Note that the <ACE_Task::svc_run> method automatically removes us - // from the <ACE_Thread_Manager> when the thread exits. - return 0; -} - -namespace { - void no_op() { } -} - -int -Thread_Pool::open (void *) -{ - if (PRINT_DEBUG_MSGS) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) pool start %d threads..."), - this->n_threads_)); - - if (this->total_activated_threads_ >= (65534 - this->n_threads_)) - no_op (); - - // Create a pool of worker threads. - if (this->activate (THR_NEW_LWP, - this->n_threads_) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("activate failed")), - -1); - - return 0; -} - -#endif /* ACE_HAS_THREADS */ - - -int -run_main (int, ACE_TCHAR *[]) -{ - ACE_START_TEST (ACE_TEXT ("Thread_Creation_Threshold_Test")); - -#if defined (ACE_HAS_THREADS) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) will try to start and kill up") - ACE_TEXT (" to %u threads sequentially\n"), - MAX_THREAD)); - int initial_pool_size = 50; - - // Create the worker tasks. - Thread_Pool thread_pool (initial_pool_size); - - while (!thread_pool && thread_pool.total_threads() < MAX_THREAD) - { - // Activate the task's thread pool, produce the messages that are, - // produce the messages that are consumed by the threads in the - // thread pool, and demonstrate how to shutdown by enqueueing - // "empty" messages into the queue. - thread_pool.start (); - - // Wait for all the threads to reach their exit point, at which - // point the barrier in the destructor of the <ACE_Task> portion of - // <Thread_Pool> will return. - if (thread_pool.wait () == -1) - return 1; - - if (PRINT_DEBUG_MSGS) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("%u total threads\n"), - thread_pool.total_threads())); - - int& n_threads = thread_pool.n_threads_; - const unsigned long THREAD_THRESHOLD = 63336; - if (thread_pool.total_threads() >= (THREAD_THRESHOLD - n_threads)) - n_threads = 1; - } - - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("%u total threads successfully started and died;") - ACE_TEXT (" expected %u.\n"), - thread_pool.total_threads (), - MAX_THREAD)); -#else - ACE_ERROR ((LM_INFO, - ACE_TEXT ("threads not supported on this platform\n"))); -#endif /* ACE_HAS_THREADS */ - ACE_END_TEST; - return 0; -} diff --git a/ACE/tests/Time_Value_Test.cpp b/ACE/tests/Time_Value_Test.cpp index 764b23f406d..13fd8fe3bda 100644 --- a/ACE/tests/Time_Value_Test.cpp +++ b/ACE/tests/Time_Value_Test.cpp @@ -227,10 +227,6 @@ run_main (int, ACE_TCHAR *[]) ACE_ASSERT (tv7 == tv8); // That's right! See above . . . ACE_ASSERT (tv9 == tv6); - ACE_Time_Value tv10 (1); - - ACE_ASSERT (tv10.sec() == 1); - // test multiplication by double // test simple multiplication tv1.set (1, 1); diff --git a/ACE/tests/TkReactor_Test.cpp b/ACE/tests/TkReactor_Test.cpp index 7987d44dcce..cee329ef5b2 100644 --- a/ACE/tests/TkReactor_Test.cpp +++ b/ACE/tests/TkReactor_Test.cpp @@ -34,7 +34,7 @@ ACE_RCSID (tests, #include "ace/SOCK_Connector.h" #include "ace/Service_Config.h" #include "ace/Thread_Manager.h" -#include "ace/TkReactor/TkReactor.h" +#include "ace/TkReactor.h" #include "ace/OS_NS_unistd.h" #include <tcl.h> diff --git a/ACE/tests/UPIPE_SAP_Test.cpp b/ACE/tests/UPIPE_SAP_Test.cpp index 296d746fbb6..24d08fdc5f7 100644 --- a/ACE/tests/UPIPE_SAP_Test.cpp +++ b/ACE/tests/UPIPE_SAP_Test.cpp @@ -27,8 +27,9 @@ ACE_RCSID(tests, UPIPE_SAP_Test, "$Id$") -#if defined (ACE_HAS_THREADS) && \ - (defined (ACE_HAS_STREAM_PIPES) || defined (ACE_HAS_WIN32_NAMED_PIPES)) +#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_STREAM_PIPES) || \ + (defined (ACE_WIN32) && \ + defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0))) // Global pattern static ACE_UPIPE_Addr addr (ACE_TEXT ("pattern")); @@ -137,15 +138,16 @@ acceptor (void *args) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) exiting thread\n"))); return 0; } -#endif /* ACE_HAS_THREADS && (ACE_HAS_STREAM_PIPES || ACE_HAS_WIN32_NAMED_PIPES) */ +#endif /* ACE_HAS_THREADS && defined ACE_HAS_STREAM_PIPES || (ACE_WIN32&&NT4)*/ int run_main (int, ACE_TCHAR *[]) { ACE_START_TEST (ACE_TEXT ("UPIPE_SAP_Test")); -#if defined (ACE_HAS_THREADS) && \ - (defined (ACE_HAS_STREAM_PIPES) || defined (ACE_HAS_WIN32_NAMED_PIPES)) +#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_STREAM_PIPES) || \ + (defined (ACE_WIN32) && \ + defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 != 0))) ACE_UPIPE_Acceptor acc (addr); @@ -176,7 +178,7 @@ run_main (int, ACE_TCHAR *[]) #else ACE_ERROR ((LM_INFO, ACE_TEXT ("UPIPE is not supported on this platform\n"))); #endif /* !defined (ACE_HAS_THREADS) */ -#endif /* ACE_HAS_THREADS && (ACE_HAS_STREAM_PIPES || ACE_HAS_WIN32_NAMED_PIPES) */ +#endif /* defined (ACE_HAS_THREADS) && (defined (ACE_HAS_STREAM_PIPES) || defined (ACE_WIN32) && NT4) */ ACE_END_TEST; return 0; diff --git a/ACE/tests/Unload_libACE.cpp b/ACE/tests/Unload_libACE.cpp index 8d30c021f08..f18484b6b82 100644 --- a/ACE/tests/Unload_libACE.cpp +++ b/ACE/tests/Unload_libACE.cpp @@ -150,16 +150,10 @@ main (int, char **) char buf[BUFSIZ]; strcpy (buf, ace_root); - strcat (buf, "/lib/lib"); -#if defined (ACE_LIB_NAME) - strcat (buf, ACE_LIB_NAME); -#else - strcat (buf, "ACE"); -#endif /* ACE_LIB_NAME */ #if defined (__hpux) && !(defined (__ia64) && (__ia64 == 1)) - strcat (buf, ".sl"); + strcat (buf, "/lib/libACE.sl"); #else - strcat (buf, ".so"); + strcat (buf, "/lib/libACE.so"); #endif /* (__hpux) */ handle = dlopen (buf, RTLD_LAZY); diff --git a/ACE/tests/XtAthenaReactor_Test.cpp b/ACE/tests/XtAthenaReactor_Test.cpp index cf0530ee552..d5abb90c4e0 100644 --- a/ACE/tests/XtAthenaReactor_Test.cpp +++ b/ACE/tests/XtAthenaReactor_Test.cpp @@ -32,7 +32,7 @@ ACE_RCSID (tests, XtAthenaReactor_Test, "$Id$") -#include "ace/XtReactor/XtReactor.h" +#include "ace/XtReactor.h" #include "ace/Event_Handler.h" #include "ace/Acceptor.h" #include "ace/SOCK_Acceptor.h" diff --git a/ACE/tests/XtMotifReactor_Test.cpp b/ACE/tests/XtMotifReactor_Test.cpp index 7aabc230fbb..643b1e9dfbd 100644 --- a/ACE/tests/XtMotifReactor_Test.cpp +++ b/ACE/tests/XtMotifReactor_Test.cpp @@ -31,7 +31,7 @@ ACE_RCSID (tests, XtMotifReactor_Test, "$Id$") -#include "ace/XtReactor/XtReactor.h" +#include "ace/XtReactor.h" #include "ace/Event_Handler.h" #include "ace/Acceptor.h" #include "ace/SOCK_Acceptor.h" diff --git a/ACE/tests/log/.cvsignore b/ACE/tests/log/.cvsignore new file mode 100755 index 00000000000..397b4a7624e --- /dev/null +++ b/ACE/tests/log/.cvsignore @@ -0,0 +1 @@ +*.log diff --git a/ACE/tests/run_test.lst b/ACE/tests/run_test.lst index 4568e8ba530..3efda344bde 100644 --- a/ACE/tests/run_test.lst +++ b/ACE/tests/run_test.lst @@ -19,7 +19,6 @@ ACE_Init_Test: MSVC ACE_Test Aio_Platform_Test Arg_Shifter_Test -ARGV_Test Array_Map_Test Atomic_Op_Test Auto_Event_Test @@ -34,7 +33,6 @@ Bug_1890_Regression_Test Bug_2368_Regression_Test Bug_2497_Regression_Test Bug_2540_Regression_Test -Bug_2659_Regression_Test: !ST Bug_2653_Regression_Test: !ST CDR_Array_Test: !ACE_FOR_TAO CDR_File_Test: !ACE_FOR_TAO @@ -151,7 +149,6 @@ Thread_Mutex_Test: !DISABLE_ToFix_LynxOS_PPC Thread_Pool_Reactor_Resume_Test: !DISABLE_ToFix_LynxOS_PPC !ST Thread_Pool_Reactor_Test: !DISABLE_ToFix_LynxOS_PPC Thread_Pool_Test: !DISABLE_ToFix_LynxOS_PPC -Thread_Creation_Threshold_Test Time_Service_Test: !STATIC !DISABLED !missing_netsvcs TOKEN !Unicos Time_Value_Test Timeprobe_Test diff --git a/ACE/tests/run_test.pl b/ACE/tests/run_test.pl index 6b3a49fe7b3..b7fc961454e 100755 --- a/ACE/tests/run_test.pl +++ b/ACE/tests/run_test.pl @@ -107,11 +107,6 @@ sub run_program ($) { my $program = shift; - ## Print it out before we check for the executable - ## if the executable doesn't exist, the error will show - ## up as part of the previous test. - print "auto_run_tests: tests/$program\n"; - unlink <log/$program*.log>; unlink "core"; @@ -133,6 +128,7 @@ sub run_program ($) } } + print "auto_run_tests: tests/$program\n"; my $start_time = time(); $status = $P->SpawnWaitKill (400); my $time = time() - $start_time; diff --git a/ACE/tests/test_config.h b/ACE/tests/test_config.h index 135b001628c..21ff4cdf67c 100644 --- a/ACE/tests/test_config.h +++ b/ACE/tests/test_config.h @@ -72,20 +72,16 @@ const size_t ACE_MAX_ITERATIONS = 10; const size_t ACE_MAX_PROCESSES = 10; const size_t ACE_MAX_THREADS = 4; -#ifndef ACE_START_TEST #define ACE_START_TEST(NAME) \ const ACE_TCHAR *program = NAME; \ ACE_LOG_MSG->open (program, ACE_Log_Msg::OSTREAM | ACE_Log_Msg::VERBOSE_LITE); \ if (ace_file_stream::instance()->set_output (program) != 0) \ ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("set_output failed")), -1); \ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Starting %s test at %D\n"), program)) -#endif /* ACE_START_TEST */ -#ifndef ACE_END_TEST #define ACE_END_TEST \ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Ending %s test at %D\n"), program)); \ ace_file_stream::instance()->close () -#endif /* ACE_END_TEST */ #define ACE_CLOSE_TEST_LOG ace_file_stream::instance()->close () @@ -101,9 +97,9 @@ const size_t ACE_MAX_THREADS = 4; ACE_LOG_MSG->set_flags(ACE_Log_Msg::SILENT); \ ace_file_stream::instance()->close (); -#if defined (ACE_VXWORKS) +#if defined (VXWORKS) // This is the only way I could figure out to avoid an error - // about attempting to unlink a non-existent file. + // about attempting to unlink a non-existant file. #include "ace/OS_NS_fcntl.h" diff --git a/ACE/tests/tests.mpc b/ACE/tests/tests.mpc index 64b74caa8aa..5efee793fd4 100644 --- a/ACE/tests/tests.mpc +++ b/ACE/tests/tests.mpc @@ -999,13 +999,6 @@ project(Thread Pool Test) : acetest { } } -project(Thread Creation Threshold Test) : acetest { - exename = Thread_Creation_Threshold_Test - Source_Files { - Thread_Creation_Threshold_Test.cpp - } -} - project(Timeprobe Test) : acetest { exename = Timeprobe_Test Source_Files { @@ -1374,7 +1367,7 @@ project(Based Pointer Test) : acetest { } } -project(Library Unload): unload_libace { +project(Library Unload) { avoids += wince exename = UnloadLibACE staticflags += ACE_AS_STATIC_LIBS @@ -1384,10 +1377,3 @@ project(Library Unload): unload_libace { Resource_Files { } } - -project(Bug_2659_Regression_Test) : acetest { - exename = Bug_2659_Regression_Test - Source_Files { - Bug_2659_Regression_Test.cpp - } -} diff --git a/ACE/tests/unload_libace.mpb b/ACE/tests/unload_libace.mpb deleted file mode 100644 index 7fe13bae305..00000000000 --- a/ACE/tests/unload_libace.mpb +++ /dev/null @@ -1,6 +0,0 @@ -// -*- MPC -*- -// $Id$ - -feature(ace_for_tao) { - macros += ACE_LIB_NAME=\\"ACE_FOR_TAO\\" -}
\ No newline at end of file |