summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Mesnier <mesnier_p@ociweb.com>2004-11-01 13:38:52 +0000
committerPhil Mesnier <mesnier_p@ociweb.com>2004-11-01 13:38:52 +0000
commit0dfeb8d3055649a63c3dbb8579d22292c419ec8a (patch)
treea6a862cbe783db11e7fe3de69956a2944bfec67d
parent9941e97df0283d2f45083ac976b09bdcfecc061a (diff)
downloadATCD-0dfeb8d3055649a63c3dbb8579d22292c419ec8a.tar.gz
ChangeLog tag: Mon Nov 1 07:34:03 2004 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r--ChangeLog13
-rwxr-xr-xtests/HTBP/Reactor_Tests/Reactor_Tests.mpc5
-rw-r--r--tests/HTBP/Send_Large_Msg/Send_Large_Msg.mpc6
-rw-r--r--tests/HTBP/Send_Large_Msg/Test_Output.cpp236
-rw-r--r--tests/HTBP/Send_Recv_Tests/SendRecv_Test.mpc3
-rw-r--r--tests/HTBP/Send_Recv_Tests/Test_Output.cpp236
-rw-r--r--tests/HTBP/htbptest.mpb3
-rwxr-xr-xtests/HTBP/ping/ping.mpc4
8 files changed, 23 insertions, 483 deletions
diff --git a/ChangeLog b/ChangeLog
index fa3cdc140d8..49be377609f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Mon Nov 1 07:34:03 2004 Phil Mesnier <mesnier_p@ociweb.com>
+
+ * tests/HTBP/htbptest.mpb:
+ * tests/HTBP/Reactor_Tests/Reactor_Tests.mpc:
+ * tests/HTBP/Send_Large_Msg/Send_Large_Msg.mpc:
+ * tests/HTBP/Send_Large_Msg/Test_Output.cpp:
+ * tests/HTBP/Send_Recv_Tests/SendRecv_Test.mpc:
+ * tests/HTBP/Send_Recv_Tests/Test_Output.cpp:
+ * tests/HTBP/ping/ping.mpc:
+
+ Removed duplicate Test_Output.cpp source and added a new base
+ project that includes libTest_Output.so.
+
Mon Nov 1 07:16:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/FlReactor_Test.cpp:
diff --git a/tests/HTBP/Reactor_Tests/Reactor_Tests.mpc b/tests/HTBP/Reactor_Tests/Reactor_Tests.mpc
index dea52462a66..aa7577ca5b3 100755
--- a/tests/HTBP/Reactor_Tests/Reactor_Tests.mpc
+++ b/tests/HTBP/Reactor_Tests/Reactor_Tests.mpc
@@ -2,7 +2,7 @@
//
// $Id$
-project(*Server): aceexe, htbp {
+project(*Server): htbptest {
exename = server
Source_Files {
@@ -10,8 +10,7 @@ project(*Server): aceexe, htbp {
}
}
-project(*Client): aceexe, htbp {
- libs += ACE_HTBP
+project(*Client): htbptest {
exename = client
Source_Files {
diff --git a/tests/HTBP/Send_Large_Msg/Send_Large_Msg.mpc b/tests/HTBP/Send_Large_Msg/Send_Large_Msg.mpc
index 6b054a48584..aa7577ca5b3 100644
--- a/tests/HTBP/Send_Large_Msg/Send_Large_Msg.mpc
+++ b/tests/HTBP/Send_Large_Msg/Send_Large_Msg.mpc
@@ -2,20 +2,18 @@
//
// $Id$
-project(*Server): aceexe, htbp {
+project(*Server): htbptest {
exename = server
Source_Files {
server.cpp
- Test_Output.cpp
}
}
-project(*Client): aceexe, htbp {
+project(*Client): htbptest {
exename = client
Source_Files {
client.cpp
- Test_Output.cpp
}
}
diff --git a/tests/HTBP/Send_Large_Msg/Test_Output.cpp b/tests/HTBP/Send_Large_Msg/Test_Output.cpp
deleted file mode 100644
index adb9e9e8e46..00000000000
--- a/tests/HTBP/Send_Large_Msg/Test_Output.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-// -*- C++ -*-
-
-// ============================================================================
-/**
- * @file Test_Output.cpp
- *
- * $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>
- * @author Don Hinton <dhinton@dresystems.com>
- */
-// ============================================================================
-
-#include "tests/test_config.h"
-#include "ace/OS_NS_stdio.h"
-#include "ace/OS_NS_string.h"
-#include "ace/OS_NS_sys_stat.h"
-#include "ace/Guard_T.h"
-#include "ace/Object_Manager.h"
-
-// FUZZ: disable check_for_streams_include
-#include "ace/streams.h"
-
-#include "ace/Framework_Component.h"
-#include "ace/Log_Msg.h"
-#include "ace/ACE.h"
-
-#if defined (VXWORKS)
-# include "ace/OS_NS_unistd.h"
-# include "ace/OS_NS_fcntl.h"
-#endif /* VXWORKS */
-
-ACE_Test_Output *ACE_Test_Output::instance_ = 0;
-
-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 */
-}
-
-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 */
-}
-
-OFSTREAM *
-ACE_Test_Output::output_file (void)
-{
- return this->output_file_;
-}
-
-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)
-# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR)
- test_dir = ACE_OS::getenv (ACE_TEXT ("ACE_TEST_DIR"));
-# else
- ACE_TCHAR tempenv[MAXPATHLEN];
- char *test_dir_n = ACE_OS::getenv ("ACE_TEST_DIR");
- if (test_dir_n == 0)
- test_dir = 0;
- else
- {
- ACE_OS::strcpy (tempenv, ACE_TEXT_CHAR_TO_TCHAR (test_dir_n));
- test_dir = tempenv;
- }
-# endif /* ACE_WIN32 || !ACE_USES_WCHAR */
-
- if (test_dir == 0)
-#endif /* ACE_HAS_WINCE */
- test_dir = ACE_TEXT ("");
-
- // This could be done with ACE_OS::sprintf() but it requires different
- // format strings for wide-char POSIX vs. narrow-char POSIX and Windows.
- // Easier to keep straight like this.
- ACE_OS_String::strcpy (temp, test_dir);
- ACE_OS_String::strcat (temp, ACE_LOG_DIRECTORY);
- ACE_OS_String::strcat
- (temp, ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR));
- ACE_OS_String::strcat (temp, 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;
-}
-
-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_Test_Output*
-ACE_Test_Output::instance ()
-{
- if (ACE_Test_Output::instance_ == 0)
- {
- // Perform Double-Checked Locking Optimization.
- ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
- *ACE_Static_Object_Lock::instance (), 0));
-
- if (ACE_Test_Output::instance_ == 0)
- {
- ACE_NEW_RETURN (ACE_Test_Output::instance_,
- ACE_Test_Output,
- 0);
- ACE_REGISTER_FRAMEWORK_COMPONENT(ACE_Test_Output, ACE_Test_Output::instance_)
- }
- }
- return ACE_Test_Output::instance_;
-}
-
-const ACE_TCHAR *
-ACE_Test_Output::dll_name (void)
-{
- return ACE_TEXT ("Test_Output");
-}
-
-const ACE_TCHAR *
-ACE_Test_Output::name (void)
-{
- return ACE_TEXT ("ACE_Test_Output");
-}
-
-void
-ACE_Test_Output::close_singleton (void)
-{
- delete ACE_Test_Output::instance_;
- ACE_Test_Output::instance_ = 0;
-}
-
-void
-randomize (int array[], size_t size)
-{
- size_t i;
-
- for (i = 0; i < size; i++)
- array [i] = ACE_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;
- }
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
- template class ACE_Framework_Component_T<ACE_Test_Output>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-# pragma instantiate ACE_Framework_Component_T<ACE_Test_Output>;
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/tests/HTBP/Send_Recv_Tests/SendRecv_Test.mpc b/tests/HTBP/Send_Recv_Tests/SendRecv_Test.mpc
index 70fa11a84db..a5a5cbdb6d3 100644
--- a/tests/HTBP/Send_Recv_Tests/SendRecv_Test.mpc
+++ b/tests/HTBP/Send_Recv_Tests/SendRecv_Test.mpc
@@ -2,11 +2,10 @@
//
// $Id$
-project: aceexe, htbp {
+project: htbptest {
exename = SendRecv_Test
Source_Files {
SendRecv_Test.cpp
- Test_Output.cpp
}
}
diff --git a/tests/HTBP/Send_Recv_Tests/Test_Output.cpp b/tests/HTBP/Send_Recv_Tests/Test_Output.cpp
deleted file mode 100644
index adb9e9e8e46..00000000000
--- a/tests/HTBP/Send_Recv_Tests/Test_Output.cpp
+++ /dev/null
@@ -1,236 +0,0 @@
-// -*- C++ -*-
-
-// ============================================================================
-/**
- * @file Test_Output.cpp
- *
- * $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>
- * @author Don Hinton <dhinton@dresystems.com>
- */
-// ============================================================================
-
-#include "tests/test_config.h"
-#include "ace/OS_NS_stdio.h"
-#include "ace/OS_NS_string.h"
-#include "ace/OS_NS_sys_stat.h"
-#include "ace/Guard_T.h"
-#include "ace/Object_Manager.h"
-
-// FUZZ: disable check_for_streams_include
-#include "ace/streams.h"
-
-#include "ace/Framework_Component.h"
-#include "ace/Log_Msg.h"
-#include "ace/ACE.h"
-
-#if defined (VXWORKS)
-# include "ace/OS_NS_unistd.h"
-# include "ace/OS_NS_fcntl.h"
-#endif /* VXWORKS */
-
-ACE_Test_Output *ACE_Test_Output::instance_ = 0;
-
-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 */
-}
-
-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 */
-}
-
-OFSTREAM *
-ACE_Test_Output::output_file (void)
-{
- return this->output_file_;
-}
-
-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)
-# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR)
- test_dir = ACE_OS::getenv (ACE_TEXT ("ACE_TEST_DIR"));
-# else
- ACE_TCHAR tempenv[MAXPATHLEN];
- char *test_dir_n = ACE_OS::getenv ("ACE_TEST_DIR");
- if (test_dir_n == 0)
- test_dir = 0;
- else
- {
- ACE_OS::strcpy (tempenv, ACE_TEXT_CHAR_TO_TCHAR (test_dir_n));
- test_dir = tempenv;
- }
-# endif /* ACE_WIN32 || !ACE_USES_WCHAR */
-
- if (test_dir == 0)
-#endif /* ACE_HAS_WINCE */
- test_dir = ACE_TEXT ("");
-
- // This could be done with ACE_OS::sprintf() but it requires different
- // format strings for wide-char POSIX vs. narrow-char POSIX and Windows.
- // Easier to keep straight like this.
- ACE_OS_String::strcpy (temp, test_dir);
- ACE_OS_String::strcat (temp, ACE_LOG_DIRECTORY);
- ACE_OS_String::strcat
- (temp, ACE::basename (filename, ACE_DIRECTORY_SEPARATOR_CHAR));
- ACE_OS_String::strcat (temp, 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;
-}
-
-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_Test_Output*
-ACE_Test_Output::instance ()
-{
- if (ACE_Test_Output::instance_ == 0)
- {
- // Perform Double-Checked Locking Optimization.
- ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon,
- *ACE_Static_Object_Lock::instance (), 0));
-
- if (ACE_Test_Output::instance_ == 0)
- {
- ACE_NEW_RETURN (ACE_Test_Output::instance_,
- ACE_Test_Output,
- 0);
- ACE_REGISTER_FRAMEWORK_COMPONENT(ACE_Test_Output, ACE_Test_Output::instance_)
- }
- }
- return ACE_Test_Output::instance_;
-}
-
-const ACE_TCHAR *
-ACE_Test_Output::dll_name (void)
-{
- return ACE_TEXT ("Test_Output");
-}
-
-const ACE_TCHAR *
-ACE_Test_Output::name (void)
-{
- return ACE_TEXT ("ACE_Test_Output");
-}
-
-void
-ACE_Test_Output::close_singleton (void)
-{
- delete ACE_Test_Output::instance_;
- ACE_Test_Output::instance_ = 0;
-}
-
-void
-randomize (int array[], size_t size)
-{
- size_t i;
-
- for (i = 0; i < size; i++)
- array [i] = ACE_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;
- }
-}
-
-#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
- template class ACE_Framework_Component_T<ACE_Test_Output>;
-#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)
-# pragma instantiate ACE_Framework_Component_T<ACE_Test_Output>;
-#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
diff --git a/tests/HTBP/htbptest.mpb b/tests/HTBP/htbptest.mpb
new file mode 100644
index 00000000000..f07dd2fb9a3
--- /dev/null
+++ b/tests/HTBP/htbptest.mpb
@@ -0,0 +1,3 @@
+project : aceexe, htbp {
+ libs += Test_Output
+}
diff --git a/tests/HTBP/ping/ping.mpc b/tests/HTBP/ping/ping.mpc
index 61e59146a93..aa7577ca5b3 100755
--- a/tests/HTBP/ping/ping.mpc
+++ b/tests/HTBP/ping/ping.mpc
@@ -2,7 +2,7 @@
//
// $Id$
-project(*Server): aceexe, htbp {
+project(*Server): htbptest {
exename = server
Source_Files {
@@ -10,7 +10,7 @@ project(*Server): aceexe, htbp {
}
}
-project(*Client): aceexe, htbp {
+project(*Client): htbptest {
exename = client
Source_Files {