diff options
author | gonzo <gonzo@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-06-10 07:33:55 +0000 |
---|---|---|
committer | gonzo <gonzo@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-06-10 07:33:55 +0000 |
commit | b1548a69b2dcd0455b198af029b49883d0937abe (patch) | |
tree | cbd17a5dffadf187dae53b850675c7f0567768a6 | |
parent | 4ea44ac88df971c5a6f2e0ee470ffc618bed9875 (diff) | |
download | ATCD-b1548a69b2dcd0455b198af029b49883d0937abe.tar.gz |
Tests now run OK (most of them) with BCB3
-rw-r--r-- | ChangeLog-98b | 62 | ||||
-rw-r--r-- | ace/ACE.cpp | 19 | ||||
-rw-r--r-- | ace/ACED.cpp | 4 | ||||
-rw-r--r-- | ace/Get_Opt.cpp | 2 | ||||
-rw-r--r-- | ace/Malloc.cpp | 8 | ||||
-rw-r--r-- | ace/OS.h | 13 | ||||
-rw-r--r-- | ace/SOCK_Dgram.cpp | 8 | ||||
-rw-r--r-- | ace/WFMO_Reactor.cpp | 10 | ||||
-rw-r--r-- | ace/config-win32-common.h | 7 | ||||
-rw-r--r-- | tests/Conn_Test.cpp | 41 | ||||
-rw-r--r-- | tests/Naming_Test.cpp | 6 | ||||
-rw-r--r-- | tests/Priority_Buffer_Test.cpp | 3 | ||||
-rw-r--r-- | tests/Reactor_Timer_Test.cpp | 2 | ||||
-rw-r--r-- | tests/Time_Value_Test.cpp | 10 | ||||
-rw-r--r-- | tests/Timeprobe_Test.cpp | 5 | ||||
-rw-r--r-- | tests/Tokens_Test.cpp | 6 | ||||
-rw-r--r-- | tests/UPIPE_SAP_Test.cpp | 9 | ||||
-rw-r--r-- | tests/XtReactor_Test.cpp | 7 |
18 files changed, 179 insertions, 43 deletions
diff --git a/ChangeLog-98b b/ChangeLog-98b index 3a964a1eaae..c306f727edb 100644 --- a/ChangeLog-98b +++ b/ChangeLog-98b @@ -1,3 +1,65 @@ +Wed Jun 10 01:31:46 1998 Gonzalo Diethelm <gonzo@tango.cs.wustl.edu> + + * tests/Tokens_Test.cpp: + Changed how the Borland template instantiations are protected. + + * tests/XtReactor_Test.cpp: + test_config.h must be included before asking for ACE_HAS_XT. + Was missing the Borland non-sense. + + * tests/UPIPE_SAP_Test.cpp: + Protected the Borland template instantiations. + + * tests/Timeprobe_Test.cpp: + * tests/Time_Value_Test.cpp: + Added the Borland non-sense. + + * tests/Reactor_Timer_Test.cpp: + Added a couple of casts to avoid warnings. + + * tests/Priority_Buffer_Test.cpp: + Got rid of a (seemingly) useless piece of code. + + * tests/Naming_Test.cpp: + Modified a test so that it won't give warnings. + + * tests/Conn_Test.cpp: + Was missing the Borland non-sense. + Modified an #if-protected section to get rid of a warning. + Added a few extra Borland template instantiations. + + * ace/WFMO_Reactor.cpp: + * ace/SOCK_Dgram.cpp: + Under Borland, a couple of comparisons were always true (with a + warning) because of unsignedness. + + * ace/Malloc.cpp: + Assigned the consition of an assertion to a temporary variable to + avoid a misleading warning. + + * ace/Get_Opt.cpp: + Added an explicit comparison against 0 to avoid a warning. + + * ace/ACED.cpp: + * ace/ACER.cpp: + These files had been commited with ^M at the end of lines. + + * ace/ACE.cpp: + Changed a couple of run time checks for + ACE_DIRECTORY_SEPARATOR_CHAR into compile time tests; that got rid + of a couple of warnings under BCB3 (Borland C++ Builder 3.0). + + * ace/ACE.cpp: + * tests/Conn_Test.cpp: + Used ACE_NOTREACHED to avoid further warnings. + + * ace/OS.h: + Added Borland to the empty definition of ACE_NOTREACHED. + The definition of ACE_SEH_FINALLY for the case of Borland C++ + Builder 3.0 now uses __finally. This allowed most of the tests + that were hanging to complete ok. Thanks to David Tallman + <tallman@acsys.com> for pointing this out. + Tue Jun 9 19:35:26 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> * ace/XtReactor: Integrated the new XtReactor, which should now diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 35fbe41d76c..86d83d15f7a 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -565,10 +565,11 @@ ACE::ldfind (const ASYS_TCHAR filename[], // Insert canonical directory separators. ASYS_TCHAR *separator_ptr; - if (ACE_DIRECTORY_SEPARATOR_CHAR != '/') - // Make all the directory separators ``canonical'' to simplify - // subsequent code. - ACE::strrepl (tempcopy, ACE_DIRECTORY_SEPARATOR_CHAR, '/'); +#if (ACE_DIRECTORY_SEPARATOR_CHAR != '/') + // Make all the directory separators ``canonical'' to simplify + // subsequent code. + ACE::strrepl (tempcopy, ACE_DIRECTORY_SEPARATOR_CHAR, '/'); +#endif // Separate filename from pathname. separator_ptr = ACE_OS::strrchr (tempcopy, '/'); @@ -635,9 +636,10 @@ ACE::ldfind (const ASYS_TCHAR filename[], } else { - if (ACE_DIRECTORY_SEPARATOR_CHAR != '/') - // Revert to native path name separators - ACE::strrepl (searchpathname, '/', ACE_DIRECTORY_SEPARATOR_CHAR); +#if (ACE_DIRECTORY_SEPARATOR_CHAR != '/') + // Revert to native path name separators + ACE::strrepl (searchpathname, '/', ACE_DIRECTORY_SEPARATOR_CHAR); +#endif // First, try matching the filename *without* adding a // prefix. @@ -1623,8 +1625,7 @@ ACE::handle_timed_accept (ACE_HANDLE listener, /* NOTREACHED */ } } - /* NOTREACHED */ - return 0; + ACE_NOTREACHED(return 0); } // Bind socket to an unused port. diff --git a/ace/ACED.cpp b/ace/ACED.cpp index 2af2b7164e0..44c46a46193 100644 --- a/ace/ACED.cpp +++ b/ace/ACED.cpp @@ -98,6 +98,7 @@ USEUNIT("Proactor.cpp"); USEUNIT("Process.cpp"); USEUNIT("Process_Manager.cpp"); USEUNIT("Profile_Timer.cpp"); +USEUNIT("RB_Tree.cpp"); USEUNIT("Reactor.cpp"); USEUNIT("Read_Buffer.cpp"); USEUNIT("Registry.cpp"); @@ -131,6 +132,7 @@ USEUNIT("SPIPE_Acceptor.cpp"); USEUNIT("SPIPE_Addr.cpp"); USEUNIT("SPIPE_Connector.cpp"); USEUNIT("SPIPE_Stream.cpp"); +USEUNIT("Stats.cpp"); USEUNIT("SString.cpp"); USEUNIT("Strategies.cpp"); USEUNIT("Strategies_T.cpp"); @@ -152,6 +154,8 @@ USEUNIT("Task.cpp"); USEUNIT("Task_T.cpp"); USEUNIT("Thread.cpp"); USEUNIT("Thread_Manager.cpp"); +USEUNIT("Timeprobe.cpp"); +USEUNIT("Timeprobe_T.cpp"); USEUNIT("Time_Request_Reply.cpp"); USEUNIT("Timer_Hash.cpp"); USEUNIT("Timer_Hash_T.cpp"); diff --git a/ace/Get_Opt.cpp b/ace/Get_Opt.cpp index cf72d8a5bc4..b009bc80bc7 100644 --- a/ace/Get_Opt.cpp +++ b/ace/Get_Opt.cpp @@ -109,7 +109,7 @@ ACE_Get_Opt::operator () (void) opt = (int) *this->nextchar_++; if (opt == (int) ':' - || !(oli = ACE_OS::strchr (this->optstring_, opt))) + || ((oli = ACE_OS::strchr (this->optstring_, opt)) == 0)) { // If the user didn't specify '-' as an option, assume it means // EOF. diff --git a/ace/Malloc.cpp b/ace/Malloc.cpp index 9f630abac94..8cc622a7c00 100644 --- a/ace/Malloc.cpp +++ b/ace/Malloc.cpp @@ -90,8 +90,12 @@ ACE_Allocator::instance (void) // destroy it. static void *allocator_instance = 0; - // Check this critical assumption . . . - ACE_ASSERT (sizeof allocator_instance == sizeof (ACE_New_Allocator)); + // Check this critical assumption. + // We put it in a variable first to avoid stupid compiler + // warnings that the condition may always be true/false. + int assertion = (sizeof allocator_instance == + sizeof (ACE_New_Allocator)); + ACE_ASSERT (assertion); // Initialize the allocator_instance by using a placement // new. The ACE_NEW_RETURN below doesn't actually allocate @@ -494,11 +494,11 @@ private: # define ACE_UNUSED_ARG(a) (a) #endif /* ghs */ -#if defined (__sgi) || defined (ghs) || defined (DEC_CXX) +#if defined (__sgi) || defined (ghs) || defined (DEC_CXX) || defined(__BORLANDC__) # define ACE_NOTREACHED(a) #else # define ACE_NOTREACHED(a) a -#endif /* defined (__sgi) || defined (ghs) || defined (DEC_CXX) */ +#endif /* defined (__sgi) || defined (ghs) || defined (DEC_CXX) || defined(__BORLANDC__) */ #if defined (ACE_REQUIRES_FUNC_DEFINITIONS) // It just evaporated ;-) Not pleasant. @@ -2550,8 +2550,13 @@ typedef void (*ACE_SignalHandlerV)(...); # define ACE_SEH_FINALLY if (1) # else # if defined(__BORLANDC__) -# define ACE_SEH_TRY try -# define ACE_SEH_FINALLY catch(...) +# if (__BORLANDC__ >= 0x0530) /* Borland C++ Builder 3.0 */ +# define ACE_SEH_TRY try +# define ACE_SEH_FINALLY __finally +# else +# define ACE_SEH_TRY try +# define ACE_SEH_FINALLY catch(...) +# endif # else # define ACE_SEH_TRY __try # define ACE_SEH_FINALLY __finally diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp index 546501131b2..11e7dccc477 100644 --- a/ace/SOCK_Dgram.cpp +++ b/ace/SOCK_Dgram.cpp @@ -205,9 +205,13 @@ ACE_SOCK_Dgram::send (const iovec iov[], // Determine the total length of all the buffers in <iov>. for (i = 0; i < n; i++) +#if ! (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0530)) + // The iov_len is unsigned in Borland. If we go ahead and try the + // if, it will emit a warning. if (iov[i].iov_len < 0) return -1; else +#endif length += iov[i].iov_len; char *buf; @@ -248,9 +252,13 @@ ACE_SOCK_Dgram::recv (iovec iov[], size_t i; for (i = 0; i < n; i++) +#if ! (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0530)) + // The iov_len is unsigned in Borland. If we go ahead and try the + // if, it will emit a warning. if (iov[i].iov_len < 0) return -1; else +#endif length += iov[i].iov_len; char *buf; diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp index 83ea5080a5b..78bc3813990 100644 --- a/ace/WFMO_Reactor.cpp +++ b/ace/WFMO_Reactor.cpp @@ -1377,8 +1377,14 @@ ACE_WFMO_Reactor::dispatch_handles (size_t wait_status) ; number_of_handlers_dispatched++) { - if (wait_status >= WAIT_OBJECT_0 && - wait_status <= (WAIT_OBJECT_0 + nCount)) + bool ok = ( +#if ! (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0530)) + // wait_status is unsigned in Borland; + // This >= is always true, with a warning. + wait_status >= WAIT_OBJECT_0 && +#endif + wait_status <= (WAIT_OBJECT_0 + nCount)); + if (ok) dispatch_index += wait_status - WAIT_OBJECT_0; else // Otherwise, a handle was abandoned. diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h index 50de6c8828f..7a357e1e194 100644 --- a/ace/config-win32-common.h +++ b/ace/config-win32-common.h @@ -401,6 +401,13 @@ typedef unsigned __int64 ACE_UINT64; /* Borland C++ Builder definitions. */ #if (defined(__BORLANDC__) && __BORLANDC__ >= 0x0530) +#if 0 +#ifdef ACE_HAS_NONSTATIC_OBJECT_MANAGER +#undef ACE_HAS_NONSTATIC_OBJECT_MANAGER +#endif +#define ACE_HAS_NONSTATIC_OBJECT_MANAGER 1 +#endif + #ifdef ACE_HAS_STANDARD_CPP_LIBRARY #undef ACE_HAS_STANDARD_CPP_LIBRARY #endif diff --git a/tests/Conn_Test.cpp b/tests/Conn_Test.cpp index 2efc8248de4..1877a139d44 100644 --- a/tests/Conn_Test.cpp +++ b/tests/Conn_Test.cpp @@ -32,6 +32,11 @@ #include "ace/Get_Opt.h" #include "Conn_Test.h" +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 +USELIB("..\ace\aced.lib"); +//--------------------------------------------------------------------------- +#endif /* defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 */ + // Default number of clients/servers. static int n_servers = 4; static int n_clients = 10; @@ -397,18 +402,19 @@ server (void *arg) for (;;) { // Create a new <Svc_Handler> to consume the data. - - int result = acceptor->accept (svc_handler, - &cli_addr -// Timing out is the only way for threads to stop accepting, since we -// don't have signals + #if defined (ACE_LACKS_FORK) - , options - ); + int result = acceptor->accept (svc_handler, + &cli_addr, + options); #else /* ! ACE_LACKS_FORK */ - ); - ACE_UNUSED_ARG (options); + int result = acceptor->accept (svc_handler, + &cli_addr); + ACE_UNUSED_ARG (options); #endif /* ! ACE_LACKS_FORK */ + + // Timing out is the only way for threads to stop accepting, + // since we don't have signals if (result == -1) { @@ -423,9 +429,8 @@ server (void *arg) svc_handler->recv_data (); } - - /* NOTREACHED */ - return 0; + + ACE_NOTREACHED(return 0); } #if !defined (ACE_LACKS_FORK) @@ -659,6 +664,12 @@ template class ACE_Strategy_Connector<Svc_Handler, ACE_SOCK_CONNECTOR>; template class ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH>; template class ACE_Svc_Tuple<Svc_Handler>; template class ACE_Auto_Basic_Array_Ptr<pid_t>; +#if defined (__BORLANDC__) +// Borland C++ doesn't link with these instantiations in the ACE library. +template class ACE_Double_Linked_List<ACE_Thread_Descriptor>; +template class ACE_Unbounded_Queue<ACE_Thread_Descriptor_Base>; +template class ACE_Unbounded_Queue<ACE_Thread_Descriptor*>; +#endif /* defined (__BORLANDC__) */ #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Cached_Connect_Strategy<Svc_Handler, ACE_SOCK_CONNECTOR, ACE_SYNCH_RW_MUTEX> #pragma instantiate ACE_Hash_Addr<ACE_INET_Addr> @@ -689,4 +700,10 @@ template class ACE_Auto_Basic_Array_Ptr<pid_t>; #pragma instantiate ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> #pragma instantiate ACE_Svc_Tuple<Svc_Handler> #pragma instantiate ACE_Auto_Basic_Array_Ptr<pid_t> +#if defined (__BORLANDC__) +// Borland C++ doesn't link with these instantiations in the ACE library. +#pragma instantiate ACE_Double_Linked_List<ACE_Thread_Descriptor> +#pragma instantiate ACE_Unbounded_Queue<ACE_Thread_Descriptor_Base> +#pragma instantiate ACE_Unbounded_Queue<ACE_Thread_Descriptor*> +#endif /* defined (__BORLANDC__) */ #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/tests/Naming_Test.cpp b/tests/Naming_Test.cpp index b941d868128..68b1fa484b6 100644 --- a/tests/Naming_Test.cpp +++ b/tests/Naming_Test.cpp @@ -186,11 +186,11 @@ main (int argc, char *argv[]) name_options->parse_args (argc, argv); + int unicode = 0; #if (defined (ACE_WIN32) && defined (UNICODE)) - if (name_options->use_registry () == 1) -#else - if (0) + unicode = 1; #endif /* ACE_WIN32 && UNICODE */ + if (unicode && name_options->use_registry () == 1) { name_options->namespace_dir (__TEXT ("Software\\ACE\\Name Service")); name_options->database (__TEXT ("Version 1")); diff --git a/tests/Priority_Buffer_Test.cpp b/tests/Priority_Buffer_Test.cpp index 2e33b01f970..b97e93f46c5 100644 --- a/tests/Priority_Buffer_Test.cpp +++ b/tests/Priority_Buffer_Test.cpp @@ -47,8 +47,11 @@ consumer (void *args) ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue = (ACE_Message_Queue<ACE_MT_SYNCH> *) args; u_long cur_priority = 27; +#if 0 + // This doesn't look useful at all... if (! cur_priority) /* null */; // To suppress ghs warning about unused // local variable "cur_priority". +#endif int local_count = 0; // Keep looping, reading a message out of the queue, until we diff --git a/tests/Reactor_Timer_Test.cpp b/tests/Reactor_Timer_Test.cpp index 303954fa076..be703d7a2b8 100644 --- a/tests/Reactor_Timer_Test.cpp +++ b/tests/Reactor_Timer_Test.cpp @@ -46,7 +46,7 @@ public: count += (1 + odd); - if (current_count == ACE_MAX_TIMERS - 1) + if (long(current_count) == long(ACE_MAX_TIMERS - 1)) done = 1; return 0; diff --git a/tests/Time_Value_Test.cpp b/tests/Time_Value_Test.cpp index 8e1250c44ec..ba0d8be7864 100644 --- a/tests/Time_Value_Test.cpp +++ b/tests/Time_Value_Test.cpp @@ -22,11 +22,6 @@ // Note, for this test the config.h file *must* come first! #include "ace/inc_user_config.h" -#if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 -USELIB("..\ace\aced.lib"); -//--------------------------------------------------------------------------- -#endif /* defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 */ - // Force test of ACE_U_LongLong class on Solaris, et al. #if defined (ACE_HAS_STHREADS) # include <limits.h> @@ -51,6 +46,11 @@ USELIB("..\ace\aced.lib"); #include "test_config.h" #include "ace/ACE.h" +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 +USELIB("..\ace\aced.lib"); +//--------------------------------------------------------------------------- +#endif /* defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 */ + #if defined (ACE_HAS_STHREADS) static u_long diff --git a/tests/Timeprobe_Test.cpp b/tests/Timeprobe_Test.cpp index 87aad583424..879ba85a06e 100644 --- a/tests/Timeprobe_Test.cpp +++ b/tests/Timeprobe_Test.cpp @@ -33,6 +33,11 @@ #include "tests/test_config.h" #include "ace/Timeprobe.h" +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 +USELIB("..\ace\aced.lib"); +//--------------------------------------------------------------------------- +#endif /* defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 */ + static const char *events_descriptions_0[] = { "Event Zero", diff --git a/tests/Tokens_Test.cpp b/tests/Tokens_Test.cpp index 5e81d2fe5eb..90b8c468b1c 100644 --- a/tests/Tokens_Test.cpp +++ b/tests/Tokens_Test.cpp @@ -253,11 +253,13 @@ main (int, char *[]) return 0; } +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) #if defined (__BORLANDC__) // Borland C++ doesn't link with these instantiations in the ACE library. -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Map_Manager<ACE_Token_Name,ACE_Token_Proxy*,ACE_Null_Mutex>; +#endif /* defined (__BORLANDC__) */ #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#if defined (__BORLANDC__) #pragma instantiate ACE_Map_Manager<ACE_Token_Name,ACE_Token_Proxy*,ACE_Null_Mutex> +#endif /* defined (__BORLANDC__) */ #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* __BORLANDC__ */ diff --git a/tests/UPIPE_SAP_Test.cpp b/tests/UPIPE_SAP_Test.cpp index 691fd106176..b47b24708e1 100644 --- a/tests/UPIPE_SAP_Test.cpp +++ b/tests/UPIPE_SAP_Test.cpp @@ -193,15 +193,20 @@ main (int, char *[]) return 0; } +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) #if defined (__BORLANDC__) // Borland C++ doesn't link with these instantiations in the ACE library. -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Stream<ACE_SYNCH>; template class ACE_Double_Linked_List<ACE_Thread_Descriptor>; template class ACE_Unbounded_Queue<ACE_Thread_Descriptor*>; +template class ACE_Unbounded_Queue<ACE_Thread_Descriptor_Base>; +#endif /* defined (__BORLANDC__) */ #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#if defined (__BORLANDC__) +// Borland C++ doesn't link with these instantiations in the ACE library. #pragma instantiate ACE_Stream<ACE_SYNCH> #pragma instantiate ACE_Double_Linked_List<ACE_Thread_Descriptor> #pragma instantiate ACE_Unbounded_Queue<ACE_Thread_Descriptor*> +#pragma instantiate ACE_Unbounded_Queue<ACE_Thread_Descriptor_Base> +#endif /* defined (__BORLANDC__) */ #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* __BORLANDC__ */ diff --git a/tests/XtReactor_Test.cpp b/tests/XtReactor_Test.cpp index 90c1783c3a8..98675b4f07b 100644 --- a/tests/XtReactor_Test.cpp +++ b/tests/XtReactor_Test.cpp @@ -25,6 +25,13 @@ // // ============================================================================ +#include "test_config.h" + +#if defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 +USELIB("..\ace\aced.lib"); +//--------------------------------------------------------------------------- +#endif /* defined(__BORLANDC__) && __BORLANDC__ >= 0x0530 */ + #if defined (ACE_HAS_XT) #include <ace/XtReactor.h> |