summaryrefslogtreecommitdiff
path: root/tests/IOStream_Test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/IOStream_Test.cpp')
-rw-r--r--tests/IOStream_Test.cpp74
1 files changed, 36 insertions, 38 deletions
diff --git a/tests/IOStream_Test.cpp b/tests/IOStream_Test.cpp
index b7867aa97dc..b9673a8a00c 100644
--- a/tests/IOStream_Test.cpp
+++ b/tests/IOStream_Test.cpp
@@ -184,14 +184,13 @@ client (void *arg = 0)
if (connector.connect (server, addr) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT (" (%t) %p\n"),
- ASYS_TEXT ("Failed to connect to server thread")),
+ " (%t) %p\n",
+ "Failed to connect to server thread"),
0);
// Send a string to the server which it can interpret as a qchar[]
const char *str = "\"This is a test string.\"";
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT (" (%P|%t) Client Sending: (%s)\n"),
- ASYS_WIDE_STRING (str)));
+ ACE_DEBUG ((LM_DEBUG, " (%P|%t) Client Sending: (%s)\n", str));
server << str << endl;
// Allow the server to get the string and echo it to the user. (The
@@ -204,8 +203,8 @@ client (void *arg = 0)
str = "\"THIS IS A TEST STRING.\"";
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Client Sending: (%s)\n"),
- ASYS_WIDE_STRING (str)));
+ " (%P|%t) Client Sending: (%s)\n",
+ str));
server << str << endl;
// Again, give the server time to display the happenings to the
@@ -217,7 +216,7 @@ client (void *arg = 0)
// the server.
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Client Receiving\n")));
+ " (%P|%t) Client Receiving\n"));
ACE_Time_Value timeout (2);
ACE_Time_Value *timeoutp = &timeout;
@@ -235,13 +234,13 @@ client (void *arg = 0)
if (eof)
{
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Unrecoverable stream error/eof\n")));
+ " (%P|%t) Unrecoverable stream error/eof\n"));
break;
}
else
{
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Recoverable stream error/timed out)\n")));
+ " (%P|%t) Recoverable stream error/timed out)\n"));
server.clear (0);
}
}
@@ -252,7 +251,7 @@ client (void *arg = 0)
server >> d;
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Client Received: int %d float %f long %d float %f double %f\n"),
+ " (%P|%t) Client Received: int %d float %f long %d float %f double %f\n",
i,
f1,
(int) l,
@@ -299,8 +298,8 @@ server (void *arg = 0)
if (acceptor->get_local_addr (server_addr) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("%p\n"),
- ASYS_TEXT ("get_local_addr")),
+ "%p\n",
+ "get_local_addr"),
0);
#if defined (ACE_HAS_THREADS)
@@ -308,14 +307,14 @@ server (void *arg = 0)
(void *) &server_addr,
THR_NEW_LWP | THR_DETACHED) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT (" (%t) %p\n"),
- ASYS_TEXT ("spawing client thread")),
+ " (%t) %p\n",
+ "spawing client thread"),
0);
#endif /* ACE_HAS_THREADS */
if (acceptor->accept (client_handler) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT (" (%P|%t) Failed to accept new client_handler")),
+ " (%P|%t) Failed to accept new client_handler"),
0);
// Read a qbuf[] from the client. Notice that all of the client's
@@ -325,8 +324,8 @@ server (void *arg = 0)
client_handler >> qbuf;
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Server Received: (\"%s\")\n"),
- ASYS_WIDE_STRING ((char *) qbuf)));
+ " (%P|%t) Server Received: (\"%s\")\n",
+ qbuf));
// Give the client time to announce the next test to the user.
ACE_OS::sleep (2);
@@ -349,7 +348,7 @@ server (void *arg = 0)
if (buf.length () > 0)
ACE_DEBUG ((LM_DEBUG,
"%s ",
- ASYS_WIDE_STRING (buf.c_str ())));
+ buf.c_str ()));
}
ACE_DEBUG ((LM_DEBUG,
@@ -358,7 +357,7 @@ server (void *arg = 0)
char buf[BUFSIZ];
ACE_OS::memset (buf, 0, sizeof buf);
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Server Received: (")));
+ " (%P|%t) Server Received: ("));
while (ACE_OS::strlen (buf) == 0
|| buf[ACE_OS::strlen (buf) - 1] != '"')
@@ -366,12 +365,12 @@ server (void *arg = 0)
if (! (client_handler >> buf))
break;
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT ("%s "),
- ASYS_WIDE_STRING (buf)));
+ "%s ",
+ buf));
}
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (")\n")));
+ ")\n"));
#endif /* ACE_HAS_STRING_CLASS */
// Send some non-textual data to the client. We use a single
@@ -381,11 +380,11 @@ server (void *arg = 0)
// command or the implicit <<endl.
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Server sleeping\n")));
+ " (%P|%t) Server sleeping\n"));
ACE_OS::sleep (5);
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Server Sending: 1 .12342134 666555444 23.45 -46.5e9 \n")));
+ " (%P|%t) Server Sending: 1 .12342134 666555444 23.45 -46.5e9 \n"));
client_handler << 1 << " ";
client_handler << .12342134 << " ";
client_handler << 666555444 << " ";
@@ -404,7 +403,7 @@ server (void *arg = 0)
client_handler >> i >> f1 >> l >> f2 >> d;
ACE_DEBUG ((LM_DEBUG,
- ASYS_TEXT (" (%P|%t) Server Received: int %d float %g long %d float %g double %g\n"),
+ " (%P|%t) Server Received: int %d float %g long %d float %g double %g\n",
i,
f1,
(int) l,
@@ -429,16 +428,15 @@ spawn (void)
if (acceptor.open (ACE_sap_any_cast (const ACE_INET_Addr &)) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT (" (%P|%t) %p\n"),
- ASYS_TEXT ("open")),
+ " (%P|%t) %p\n",
+ "open"),
-1);
#if defined (ACE_HAS_THREADS)
else if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (server),
&acceptor,
THR_NEW_LWP | THR_DETACHED) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
- ASYS_TEXT ("%p\n"),
- ASYS_TEXT ("spawning server thread")),
+ "%p\n", "spawning server thread"),
-1);
// Wait for the client and server thread to exit.
@@ -450,8 +448,8 @@ spawn (void)
{
case -1:
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT ("%p\n%a"),
- ASYS_TEXT ("fork failed")));
+ "%p\n%a",
+ "fork failed"));
ACE_OS::_exit (-1);
case 0: // In child
{
@@ -460,8 +458,8 @@ spawn (void)
if (acceptor.get_local_addr (server_addr) == -1)
ACE_ERROR ((LM_ERROR,
- ASYS_TEXT ("%p\n"),
- ASYS_TEXT ("get_local_addr")));
+ "%p\n",
+ "get_local_addr"));
else
client ((void *) &server_addr);
ACE_END_LOG;
@@ -476,7 +474,7 @@ spawn (void)
}
#else
ACE_ERROR_RETURN ((LM_INFO,
- ASYS_TEXT ("threads *and* processes not supported on this platform\n")),
+ "threads *and* processes not supported on this platform\n"),
-1);
#endif /* ACE_HAS_THREADS */
@@ -487,16 +485,16 @@ spawn (void)
#endif /* !ACE_LACKS_ACE_IOSTREAM */
int
-main (int, ASYS_TCHAR *[])
+main (int, char *[])
{
- ACE_START_TEST (ASYS_TEXT ("IOStream_Test"));
+ ACE_START_TEST ("IOStream_Test");
#if !defined (ACE_LACKS_ACE_IOSTREAM)
- ACE_INIT_LOG (ASYS_TEXT ("IOStream_Test-children"));
+ ACE_INIT_LOG ("IOStream_Test-children");
spawn ();
#else
ACE_ERROR ((LM_INFO,
- ASYS_TEXT ("ACE_IOSTREAM not supported on this platform\n")));
+ "ACE_IOSTREAM not supported on this platform\n"));
#endif /* !ACE_LACKS_ACE_IOSTREAM */
ACE_END_TEST;
return 0;