summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/CPP_Test.cpp261
-rw-r--r--tests/Shared_Memory_SV_Test.cpp83
-rwxr-xr-xtests/run_tests.ksh6
-rw-r--r--tests/tests.mak18
-rw-r--r--tests/tests.mdpbin2908 -> 18681 bytes
-rw-r--r--tests/version_tests/version_tests.mdpbin164864 -> 164864 bytes
6 files changed, 3 insertions, 365 deletions
diff --git a/tests/CPP_Test.cpp b/tests/CPP_Test.cpp
deleted file mode 100644
index 4c0bd291a50..00000000000
--- a/tests/CPP_Test.cpp
+++ /dev/null
@@ -1,261 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// tests
-//
-// = FILENAME
-// CPP_Test.cpp
-//
-// = DESCRIPTION
-// This is a simple test of the ACE_SOCK_Acceptor and
-// AC_SOCK_Connector classes. 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. No user input is required as far as command line
-// arguments are concerned.
-//
-// = AUTHOR
-// Prashant Jain and Doug Schmidt
-//
-// ============================================================================
-
-#include "ace/OS.h"
-#include "ace/Thread.h"
-#include "ace/Service_Config.h"
-#include "ace/SOCK_Connector.h"
-#include "ace/SOCK_Acceptor.h"
-#include "ace/SOCK_Stream.h"
-#include "ace/INET_Addr.h"
-#include "ace/Handle_Set.h"
-#include "test_config.h"
-
-static void *
-client (void *arg)
-{
-#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (ACE_Service_Config::thr_mgr ());
- ACE_NEW_THREAD;
-#endif /* (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS) */
-
- ACE_INET_Addr *remote_addr = (ACE_INET_Addr *) arg;
- ACE_INET_Addr server_addr (remote_addr->get_port_number (), "localhost");
- ACE_SOCK_Stream cli_stream;
- ACE_SOCK_Connector con;
-
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) starting non-blocking connect\n"));
- // Initiate timed, non-blocking connection with server.
-
- // Attempt a non-blocking connect to the server, reusing the local
- // addr if necessary.
- if (con.connect (cli_stream, server_addr,
- (ACE_Time_Value *) &ACE_Time_Value::zero) == -1)
- {
- if (errno != EWOULDBLOCK)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "connection failed"));
-
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) starting timed connect\n"));
-
- // Check if non-blocking connection is in progress,
- // and wait up to ACE_DEFAULT_TIMEOUT seconds for it to complete.
- ACE_Time_Value tv (ACE_DEFAULT_TIMEOUT);
-
- if (con.complete (cli_stream, &server_addr, &tv) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) %p\n", "connection failed"), 0);
- else
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) connected to %s\n",
- server_addr.get_host_name ()));
- }
-
- if (cli_stream.disable (ACE_NONBLOCK) == -1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "disable"));
-
- // Send data to server (correctly handles "incomplete writes").
-
- for (char c = 'a'; c <= 'z'; c++)
- if (cli_stream.send_n (&c, 1) == -1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "send_n"));
-
- // Explicitly close the writer-side of the connection.
- if (cli_stream.close_writer () == -1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "close_writer"));
-
- char buf[1];
-
- // Wait for handshake with server.
- if (cli_stream.recv_n (buf, 1) != 1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "recv_n"));
-
- // Close the connection completely.
- if (cli_stream.close () == -1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "close"));
-
- return 0;
-}
-
-static void *
-server (void *arg)
-{
-#if (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS)
- // Insert thread into thr_mgr
- ACE_Thread_Control thread_control (ACE_Service_Config::thr_mgr ());
- ACE_NEW_THREAD;
-#endif /* (defined (ACE_WIN32) || defined (VXWORKS)) && defined (ACE_HAS_THREADS) */
-
- ACE_SOCK_Acceptor *peer_acceptor = (ACE_SOCK_Acceptor *) arg;
-
- if (peer_acceptor->enable (ACE_NONBLOCK) == -1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "enable"));
-
- // Keep these objects out here to prevent excessive constructor
- // calls...
- ACE_SOCK_Stream new_stream;
- ACE_INET_Addr cli_addr;
- ACE_Handle_Set handle_set;
- ACE_Time_Value tv (ACE_DEFAULT_TIMEOUT);
- // Performs the iterative server activities.
-
- for (;;)
- {
- char buf[BUFSIZ];
- char t = 'a';
-
- handle_set.reset ();
- handle_set.set_bit (peer_acceptor->get_handle ());
-
- int result = ACE_OS::select (int (peer_acceptor->get_handle ()) + 1,
- handle_set,
- 0, 0, &tv);
- if (result == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) %p\n", "select"), 0);
- else if (result == 0)
- {
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) select timed out, shutting down\n"));
- return 0;
- }
-
- // Create a new ACE_SOCK_Stream endpoint (note automatic restart
- // if errno == EINTR).
-
- while ((result = peer_acceptor->accept (new_stream, &cli_addr)) != -1)
- {
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) client %s connected from %d\n",
- cli_addr.get_host_name (), cli_addr.get_port_number ()));
-
- // Enable non-blocking I/O.
- if (new_stream.enable (ACE_NONBLOCK) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) %p\n", "enable"), 0);
-
- handle_set.reset ();
- handle_set.set_bit (new_stream.get_handle ());
-
- // Read data from client (terminate on error).
-
- for (ssize_t r_bytes; ;)
- {
- if (ACE_OS::select (int (new_stream.get_handle ()) + 1,
- handle_set,
- 0, 0, 0) == -1)
- ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) %p\n", "select"), 0);
-
- while ((r_bytes = new_stream.recv_n (buf, 1)) > 0)
- {
- ACE_ASSERT (t == buf[0]);
- t++;
- }
-
- if (r_bytes == 0)
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) reached end of input, connection closed by client\n"));
-
- // Handshake back with client.
- if (new_stream.send_n ("", 1) != 1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "send_n"));
-
- // Close endpoint.
- if (new_stream.close () == -1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "close"));
- return 0;
- }
- else if (r_bytes == -1)
- {
- if (errno == EWOULDBLOCK)
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) no input available, going back to reading\n"));
- else
- ACE_ERROR_RETURN ((LM_ERROR, "(%P|%t) %p\n", "recv_n"), 0);
- }
- }
- }
-
- if (result == -1)
- {
- if (errno == EWOULDBLOCK)
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) no connections available, going back to accepting\n"));
- else
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "accept"));
- }
- }
- return 0;
-}
-
-static void
-spawn (void)
-{
- // Acceptor
- ACE_SOCK_Acceptor peer_acceptor;
-
- // Create a server address.
- ACE_INET_Addr server_addr;
-
- // Bind listener to any port and then find out what the port was.
- if (peer_acceptor.open (ACE_Addr::sap_any) == -1
- || peer_acceptor.get_local_addr (server_addr) == -1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "open"));
- else
- {
- ACE_DEBUG ((LM_DEBUG, "(%P|%t) starting server at port %d\n",
- server_addr.get_port_number ()));
-
-#if !defined (ACE_WIN32) && !defined (VXWORKS)
- switch (ACE_OS::fork ())
- {
- case -1:
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n%a", "fork failed"));
- exit (-1);
- case 0:
- ACE_LOG_MSG->sync ("child");
- client (&server_addr);
- default:
- server ((void *) &peer_acceptor);
- ACE_OS::wait ();
- }
-#elif defined (ACE_HAS_THREADS)
- if (ACE_Service_Config::thr_mgr ()->spawn
- (ACE_THR_FUNC (server), (void *) &peer_acceptor, THR_NEW_LWP | THR_DETACHED) == -1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n%a", "thread create failed"));
-
- if (ACE_Service_Config::thr_mgr ()->spawn
- (ACE_THR_FUNC (client), (void *) &server_addr, THR_NEW_LWP | THR_DETACHED) == -1)
- ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n%a", "thread create failed"));
-
- // Wait for the threads to exit.
- ACE_Service_Config::thr_mgr ()->wait ();
-#else
- ACE_ERROR ((LM_ERROR, "(%P|%t) only one thread may be run in a process on this platform\n%a", 1));
-#endif /* ACE_HAS_THREADS */
- }
-}
-
-int
-main (int, char *[])
-{
- ACE_START_TEST ("CPP_Test");
-
- spawn ();
-
- ACE_END_TEST;
- return 0;
-}
diff --git a/tests/Shared_Memory_SV_Test.cpp b/tests/Shared_Memory_SV_Test.cpp
deleted file mode 100644
index a3654a7745b..00000000000
--- a/tests/Shared_Memory_SV_Test.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-// $Id$
-
-// ============================================================================
-//
-// = LIBRARY
-// tests
-//
-// = FILENAME
-// Shared_Memory_SV_Test.cpp
-//
-// = DESCRIPTION
-// This is a simple test of ACE_Shared_Memory_SV
-//
-// = AUTHOR
-// Prashant Jain and Doug Schmidt
-//
-// ============================================================================
-
-
-#include "ace/Shared_Memory_SV.h"
-#include "test_config.h"
-
-const int SHMSZ = 27;
-const int SHM_KEY = 5678;
-
-static void
-client (void)
-{
- char t = 'a';
- ACE_Shared_Memory_SV shm_client (SHM_KEY, SHMSZ,
- ACE_Shared_Memory_SV::ACE_CREATE);
- char *shm = (char *) shm_client.malloc ();
-
- for (char *s = shm; *s != '\0'; s++)
- {
- ACE_ASSERT (t == s[0]);
- t++;
- }
- *shm = '*';
- ACE_OS::exit (0);
-}
-
-static void
-server (void)
-{
- ACE_Shared_Memory_SV shm_server (SHM_KEY, SHMSZ,
- ACE_Shared_Memory_SV::ACE_CREATE);
- char *shm = (char *) shm_server.malloc ();
- char *s = shm;
-
- for (char c = 'a'; c <= 'z'; c++)
- *s++ = c;
-
- *s = '\0';
-
- while (*shm != '*')
- ACE_OS::sleep (1);
-
- if (shm_server.remove () < 0)
- ACE_ERROR ((LM_ERROR, "%p\n", "remove"));
-}
-
-int
-main (int, char *argv [])
-{
- ACE_START_TEST ("Shared_Memory_SV_Test.cpp");
-
- switch (ACE_OS::fork ())
- {
- case -1:
- ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "fork"), 1);
- case 0:
- client ();
- break;
- default:
- server ();
- break;
- }
-
- ACE_END_TEST;
- return 0;
-}
-
diff --git a/tests/run_tests.ksh b/tests/run_tests.ksh
deleted file mode 100755
index a4d7f0d8b17..00000000000
--- a/tests/run_tests.ksh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/ksh -f
-
-. ./run_tests.sh
-
-# EOF
-
diff --git a/tests/tests.mak b/tests/tests.mak
index 51e707e286f..05c149aa441 100644
--- a/tests/tests.mak
+++ b/tests/tests.mak
@@ -5283,8 +5283,6 @@ DEP_CPP_MESSA=\
{$(INCLUDE)}"\ace\Free_List.i"\
{$(INCLUDE)}"\ace\Handle_Set.h"\
{$(INCLUDE)}"\ace\Handle_Set.i"\
- {$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
- {$(INCLUDE)}"\ace\Hash_Map_Manager.h"\
{$(INCLUDE)}"\ace\IO_Cntl_Msg.h"\
{$(INCLUDE)}"\ace\Log_Msg.h"\
{$(INCLUDE)}"\ace\Log_Priority.h"\
@@ -5304,22 +5302,16 @@ DEP_CPP_MESSA=\
{$(INCLUDE)}"\ace\Memory_Pool.i"\
{$(INCLUDE)}"\ace\Message_Block.h"\
{$(INCLUDE)}"\ace\Message_Block.i"\
- {$(INCLUDE)}"\ace\Message_Queue.cpp"\
{$(INCLUDE)}"\ace\Message_Queue.h"\
- {$(INCLUDE)}"\ace\Message_Queue.i"\
{$(INCLUDE)}"\ace\Object_Manager.h"\
{$(INCLUDE)}"\ace\Object_Manager.i"\
{$(INCLUDE)}"\ace\OS.h"\
{$(INCLUDE)}"\ace\OS.i"\
{$(INCLUDE)}"\ace\Reactor.h"\
- {$(INCLUDE)}"\ace\Reactor.i"\
- {$(INCLUDE)}"\ace\Reactor_Impl.h"\
{$(INCLUDE)}"\ace\Service_Config.h"\
{$(INCLUDE)}"\ace\Service_Config.i"\
{$(INCLUDE)}"\ace\Service_Object.h"\
{$(INCLUDE)}"\ace\Service_Object.i"\
- {$(INCLUDE)}"\ace\Service_Types.h"\
- {$(INCLUDE)}"\ace\Service_Types.i"\
{$(INCLUDE)}"\ace\Shared_Object.h"\
{$(INCLUDE)}"\ace\Shared_Object.i"\
{$(INCLUDE)}"\ace\Signal.h"\
@@ -5328,31 +5320,24 @@ DEP_CPP_MESSA=\
{$(INCLUDE)}"\ace\SString.i"\
{$(INCLUDE)}"\ace\stdcpp.h"\
{$(INCLUDE)}"\ace\Strategies.h"\
- {$(INCLUDE)}"\ace\Strategies_T.cpp"\
{$(INCLUDE)}"\ace\Strategies_T.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Complex.i"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.h"\
{$(INCLUDE)}"\ace\SV_Semaphore_Simple.i"\
- {$(INCLUDE)}"\ace\Svc_Conf_Tokens.h"\
{$(INCLUDE)}"\ace\Synch.h"\
{$(INCLUDE)}"\ace\Synch.i"\
- {$(INCLUDE)}"\ace\Synch_Options.h"\
{$(INCLUDE)}"\ace\Synch_T.cpp"\
{$(INCLUDE)}"\ace\Synch_T.h"\
{$(INCLUDE)}"\ace\Synch_T.i"\
{$(INCLUDE)}"\ace\Thread.h"\
{$(INCLUDE)}"\ace\Thread.i"\
- {$(INCLUDE)}"\ace\Thread_Manager.h"\
- {$(INCLUDE)}"\ace\Thread_Manager.i"\
{$(INCLUDE)}"\ace\Timer_Queue.h"\
{$(INCLUDE)}"\ace\Timer_Queue_T.cpp"\
{$(INCLUDE)}"\ace\Timer_Queue_T.h"\
{$(INCLUDE)}"\ace\Timer_Queue_T.i"\
{$(INCLUDE)}"\ace\Trace.h"\
{$(INCLUDE)}"\ace\Version.h"\
- {$(INCLUDE)}"\ace\WFMO_Reactor.h"\
- {$(INCLUDE)}"\ace\WFMO_Reactor.i"\
{$(INCLUDE)}"\ace\ws2tcpip.h"\
@@ -7628,6 +7613,8 @@ DEP_CPP_REACTOR_P=\
{$(INCLUDE)}"\ace\Handle_Set.i"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.cpp"\
{$(INCLUDE)}"\ace\Hash_Map_Manager.h"\
+ {$(INCLUDE)}"\ace\High_Res_Timer.h"\
+ {$(INCLUDE)}"\ace\High_Res_Timer.i"\
{$(INCLUDE)}"\ace\INET_Addr.h"\
{$(INCLUDE)}"\ace\INET_Addr.i"\
{$(INCLUDE)}"\ace\IO_Cntl_Msg.h"\
@@ -7669,6 +7656,7 @@ DEP_CPP_REACTOR_P=\
{$(INCLUDE)}"\ace\Pipe.h"\
{$(INCLUDE)}"\ace\Pipe.i"\
{$(INCLUDE)}"\ace\Profile_Timer.h"\
+ {$(INCLUDE)}"\ace\Profile_Timer.i"\
{$(INCLUDE)}"\ace\Reactor.h"\
{$(INCLUDE)}"\ace\Reactor.i"\
{$(INCLUDE)}"\ace\Reactor_Impl.h"\
diff --git a/tests/tests.mdp b/tests/tests.mdp
index 2afc64117ed..04c8793eedd 100644
--- a/tests/tests.mdp
+++ b/tests/tests.mdp
Binary files differ
diff --git a/tests/version_tests/version_tests.mdp b/tests/version_tests/version_tests.mdp
index b6b9a3f94b3..094f98e6fe6 100644
--- a/tests/version_tests/version_tests.mdp
+++ b/tests/version_tests/version_tests.mdp
Binary files differ