summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog45
-rw-r--r--tests/Conn_Test.cpp6
-rw-r--r--tests/FIFO_Test.cpp2
-rw-r--r--tests/MT_Reference_Counted_Event_Handler_Test.cpp6
-rw-r--r--tests/Naming_Test.cpp16
-rw-r--r--tests/Pipe_Test.cpp11
-rw-r--r--tests/Process_Mutex_Test.cpp23
-rw-r--r--tests/Process_Strategy_Test.cpp16
-rw-r--r--tests/SSL/aix_hack_for_main.cpp32
-rw-r--r--tests/aix_hack_for_main.cpp32
-rw-r--r--tests/run_test.lst4
11 files changed, 95 insertions, 98 deletions
diff --git a/ChangeLog b/ChangeLog
index aff2e73827e..e524ad4135d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,46 @@
+Mon May 16 09:01:07 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * tests/Conn_Test.cpp:
+
+ Force this test to use threads (instead of fork) on MacOS X.
+
+ * tests/FIFO_Test.cpp:
+
+ Sleep 1 second (as is done on AIX and HP-UX) before attempting to
+ receive from the fifo.
+
+ * tests/MT_Reference_Counted_Event_Handler_Test.cpp:
+
+ Set global_event_loop_thread_variable before activating the thread
+ that may use it.
+
+ * tests/Naming_Test.cpp:
+
+ Allow the user to determine the location of the context file by
+ the TMPDIR, TEMP and TMP environment variables.
+
+ * tests/Pipe_Test.cpp:
+ * tests/Process_Mutex_Test.cpp:
+
+ Use the value from argv[0] instead of hardcoding the exe name.
+ The hardcoded name does not work on Windows Release builds.
+
+ * tests/Process_Strategy_Test.cpp:
+
+ Use threads by default on HP-UX instead of fork.
+ Added a timeout for the recv() call in
+ Counting_Service::handle_input() for HP-UX only.
+
+ * tests/run_test.lst:
+
+ Added a configuration for NO_MCAST for machines that do not have
+ multicast capabilities or the multicast implementation is broken.
+
+ * tests/SSL/aix_hack_for_main.cpp:
+ * tests/aix_hack_for_main.cpp:
+
+ Removed these files. They are no longer needed due to MPC.
+
Mon May 16 08:52:11 2005 Chad Elliott <elliott_c@ociweb.com>
* bin/MakeProjectCreator/config/crosscompile.mpb:
@@ -15,7 +58,7 @@ Mon May 16 08:52:11 2005 Chad Elliott <elliott_c@ociweb.com>
input file dependencies.
Changed the OBJS setting to use $(notdir) only if the source file
- contains ../ and added explicit rules for source files that are
+ contains ../ and added explicit rules for source files that are
located in subdirectories.
* include/makeinclude/platform_macosx_panther.GNU:
diff --git a/tests/Conn_Test.cpp b/tests/Conn_Test.cpp
index 6b587e2e314..48627c82229 100644
--- a/tests/Conn_Test.cpp
+++ b/tests/Conn_Test.cpp
@@ -45,6 +45,12 @@ ACE_RCSID(tests, Conn_Test, "$Id$")
static const char ACE_ALPHABET[] = "abcdefghijklmnopqrstuvwxyz";
+// This test doesn't work well using fork() on MacOS X. So we
+// will force it to use threads instead.
+#if defined (__APPLE__)
+# define ACE_LACKS_FORK
+#endif /* __APPLE__ */
+
// The following works around bugs with some operating systems, which
// don't allow multiple threads/process to call accept() on the same
// listen-mode port/socket. Also, note that since timed accept is
diff --git a/tests/FIFO_Test.cpp b/tests/FIFO_Test.cpp
index 5fa60ffaf6c..8a7f7a64a44 100644
--- a/tests/FIFO_Test.cpp
+++ b/tests/FIFO_Test.cpp
@@ -115,7 +115,7 @@ server (void *arg)
// On AIX, select() always seems to select a fifo handle as a normal file,
// always readable. Just wait a second...
-# if defined (AIX) || defined (HPUX)
+# if defined (AIX) || defined (HPUX) || defined (__osf__)
ACE_OS::sleep (1);
# endif /* AIX || HPUX */
diff --git a/tests/MT_Reference_Counted_Event_Handler_Test.cpp b/tests/MT_Reference_Counted_Event_Handler_Test.cpp
index 6182fb4e2b9..ccddb26839e 100644
--- a/tests/MT_Reference_Counted_Event_Handler_Test.cpp
+++ b/tests/MT_Reference_Counted_Event_Handler_Test.cpp
@@ -1123,12 +1123,12 @@ testing (ACE_Reactor *reactor,
*reactor);
if (run_event_loop_thread)
{
+ global_event_loop_thread_variable =
+ &event_loop_thread;
+
result =
event_loop_thread.activate ();
ACE_ASSERT (result == 0);
-
- global_event_loop_thread_variable =
- &event_loop_thread;
}
// Create a thread to run the purger.
diff --git a/tests/Naming_Test.cpp b/tests/Naming_Test.cpp
index 04b76992dfc..50b6a9ec500 100644
--- a/tests/Naming_Test.cpp
+++ b/tests/Naming_Test.cpp
@@ -200,6 +200,22 @@ run_main (int argc, ACE_TCHAR *argv[])
}
else
{
+ // Allow the user to determine where the context file will be
+ // located just in case the current directory is not suitable for
+ // locking. We don't just set namespace_dir () on name_options
+ // because that is not sufficient to work around locking problems
+ // for Tru64 when the current directory is NFS mounted from a
+ // system that does not properly support locking.
+ const char* temp_envs[] = { "TMPDIR", "TEMP", "TMP", 0 };
+ for(const char** temp_env = temp_envs; *temp_env != 0; ++temp_env)
+ {
+ char* temp_dir = ACE_OS::getenv(*temp_env);
+ if (temp_dir != 0)
+ {
+ ACE_OS::chdir (temp_dir);
+ break;
+ }
+ }
ACE_OS::strcpy (temp_file, ACE::basename (name_options->process_name (),
ACE_DIRECTORY_SEPARATOR_CHAR));
ACE_OS::strcat (temp_file, ACE_TEXT ("XXXXXX"));
diff --git a/tests/Pipe_Test.cpp b/tests/Pipe_Test.cpp
index 264c0331755..f1d7792eb80 100644
--- a/tests/Pipe_Test.cpp
+++ b/tests/Pipe_Test.cpp
@@ -103,14 +103,9 @@ run_main (int argc, ACE_TCHAR *argv[])
ACE_INIT_LOG (ACE_TEXT("Pipe_Test-children"));
ACE_Process_Options options;
- if (close_pipe == 0)
- options.command_line (ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR
- ACE_TEXT ("Pipe_Test") ACE_PLATFORM_EXE_SUFFIX
- ACE_TEXT (" -c -d"));
- else
- options.command_line (ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR
- ACE_TEXT ("Pipe_Test") ACE_PLATFORM_EXE_SUFFIX
- ACE_TEXT (" -c"));
+ options.command_line (ACE_TEXT ("%s -c%s"),
+ argv[0],
+ close_pipe == 0 ? " -d" : "");
ACE_exitcode status = 0;
diff --git a/tests/Process_Mutex_Test.cpp b/tests/Process_Mutex_Test.cpp
index 279e1a40b6f..cdf1c85180c 100644
--- a/tests/Process_Mutex_Test.cpp
+++ b/tests/Process_Mutex_Test.cpp
@@ -152,27 +152,14 @@ run_main (int argc, ACE_TCHAR *argv[])
ACE_Process_Mutex mutex( mutex_name );
# endif
- ACE_Process_Options options;
- if (release_mutex == 0)
- options.command_line (ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR
- ACE_TEXT ("Process_Mutex_Test")
- ACE_PLATFORM_EXE_SUFFIX
#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
- ACE_TEXT (" -c -n %ls -d"),
+ static const ACE_TCHAR* format = ACE_TEXT ("%ls -c -n %ls%s");
#else
- ACE_TEXT (" -c -n %s -d"),
+ static const ACE_TCHAR* format = ACE_TEXT ("%s -c -n %s%s");
#endif /* !ACE_WIN32 && ACE_USES_WCHAR */
- mutex_name);
- else
- options.command_line (ACE_TEXT (".") ACE_DIRECTORY_SEPARATOR_STR
- ACE_TEXT ("Process_Mutex_Test")
- ACE_PLATFORM_EXE_SUFFIX
-#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
- ACE_TEXT (" -c -n %ls"),
-#else
- ACE_TEXT (" -c -n %s"),
-#endif /* !ACE_WIN32 && ACE_USES_WCHAR */
- mutex_name);
+ ACE_Process_Options options;
+ options.command_line (format, argv[0], mutex_name,
+ release_mutex == 0 ? " -d" : "");
// Spawn <n_processes> child processes that will contend for the
// lock.
diff --git a/tests/Process_Strategy_Test.cpp b/tests/Process_Strategy_Test.cpp
index 0b53482a25e..f74e36939d3 100644
--- a/tests/Process_Strategy_Test.cpp
+++ b/tests/Process_Strategy_Test.cpp
@@ -57,6 +57,11 @@
ACE_RCSID(tests, Process_Strategy_Test, "$Id$")
+// This test does not function properly when fork() is used on HP-UX
+#if defined(__hpux)
+#define ACE_LACKS_FORK
+#endif /* __hpux */
+
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class ACE_Accept_Strategy<Counting_Service, ACE_SOCK_ACCEPTOR>;
template class ACE_Acceptor<Counting_Service, ACE_SOCK_ACCEPTOR>;
@@ -409,6 +414,14 @@ int
Counting_Service::handle_input (ACE_HANDLE)
{
char buf[BUFSIZ];
+ ACE_Time_Value* timeout = 0;
+#if defined (__hpux)
+ // Even though we're in handle_input, there seems to be a
+ // situation on HP-UX where there is nothing to recv just yet.
+ // So, we recv() with a timeout and everything works.
+ ACE_Time_Value hpux_timeout (3);
+ timeout = &hpux_timeout;
+#endif /* __hpux */
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) reading from peer on %d\n"),
@@ -416,7 +429,8 @@ Counting_Service::handle_input (ACE_HANDLE)
size_t len;
// Read the PDU length first.
ssize_t bytes = this->peer ().recv ((void *) &len,
- sizeof len);
+ sizeof len,
+ timeout);
if (bytes <= 0)
return -1;
diff --git a/tests/SSL/aix_hack_for_main.cpp b/tests/SSL/aix_hack_for_main.cpp
deleted file mode 100644
index 1f962c360af..00000000000
--- a/tests/SSL/aix_hack_for_main.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-// $Id$
-
-//=============================================================================
-/**
- * @file aix_hack_for_main.cpp
- *
- * $Id$
- *
- * This file is simply to force the Makefile to compile Main.cpp
- * before it's needed in a test program that requires templates.
- * Why is this needed? Because AIX Visual Age C++ has a template
- * instantiation mechanism unlike any other in the way it remembers
- * where templates are needed. We've previously worked around this
- * by forcibly deleting the tempinc directory before compiling each
- * test's source file. This worked because every test was in one file.
- * When Main.cpp was added, this broke the scheme. This file simply
- * gets Main.cpp to compile, then the resulting Main.o can be reused
- * for each test, and it's again safe to delete the tempinc directory
- * before each test compile.
- * Hopefully, MPC will save us from this wretchedness...
- *
- * @author Steve Huston <shuston@riverace.com>
- */
-//=============================================================================
-
-#include "test_config.h"
-
-int
-run_main (int, ACE_TCHAR *[])
-{
- return 0;
-}
diff --git a/tests/aix_hack_for_main.cpp b/tests/aix_hack_for_main.cpp
deleted file mode 100644
index 1f962c360af..00000000000
--- a/tests/aix_hack_for_main.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-// $Id$
-
-//=============================================================================
-/**
- * @file aix_hack_for_main.cpp
- *
- * $Id$
- *
- * This file is simply to force the Makefile to compile Main.cpp
- * before it's needed in a test program that requires templates.
- * Why is this needed? Because AIX Visual Age C++ has a template
- * instantiation mechanism unlike any other in the way it remembers
- * where templates are needed. We've previously worked around this
- * by forcibly deleting the tempinc directory before compiling each
- * test's source file. This worked because every test was in one file.
- * When Main.cpp was added, this broke the scheme. This file simply
- * gets Main.cpp to compile, then the resulting Main.o can be reused
- * for each test, and it's again safe to delete the tempinc directory
- * before each test compile.
- * Hopefully, MPC will save us from this wretchedness...
- *
- * @author Steve Huston <shuston@riverace.com>
- */
-//=============================================================================
-
-#include "test_config.h"
-
-int
-run_main (int, ACE_TCHAR *[])
-{
- return 0;
-}
diff --git a/tests/run_test.lst b/tests/run_test.lst
index ffeff5a5d38..b64b6a64053 100644
--- a/tests/run_test.lst
+++ b/tests/run_test.lst
@@ -76,7 +76,7 @@ Message_Block_Test: !chorus
Message_Queue_Notifications_Test
Message_Queue_Test: !chorus
Message_Queue_Test_Ex: !chorus
-Multicast_Test: !ST
+Multicast_Test: !ST !NO_MCAST
Multihomed_INET_Addr_Test
Naming_Test: !chorus !LynxOS !Unicos !VxWorks
Network_Adapters_Test
@@ -147,7 +147,7 @@ Vector_Test
WFMO_Reactor_Test
INET_Addr_Test_IPV6
Max_Default_Port_Test_IPV6
-Multicast_Test_IPV6
+Multicast_Test_IPV6: !NO_MCAST
Multihomed_INET_Addr_Test_IPV6
Proactor_Test_IPV6
SOCK_Send_Recv_Test_IPV6