summaryrefslogtreecommitdiff
path: root/tests/IOStream_Test.cpp
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-05 22:07:51 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-05 22:07:51 +0000
commite649fbd0fa57e31b900e682634a0c8020d283349 (patch)
treec47983948cd6eb9304352a32daa524c1d46a4f1c /tests/IOStream_Test.cpp
parenta4b64a2fa1217ad5c4d08ee57fa8d7746ee54c59 (diff)
downloadATCD-e649fbd0fa57e31b900e682634a0c8020d283349.tar.gz
updated to work with the standard C++ library version of iostreams
Diffstat (limited to 'tests/IOStream_Test.cpp')
-rw-r--r--tests/IOStream_Test.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/tests/IOStream_Test.cpp b/tests/IOStream_Test.cpp
index 3da2d1d7fe0..76037989328 100644
--- a/tests/IOStream_Test.cpp
+++ b/tests/IOStream_Test.cpp
@@ -97,7 +97,7 @@ operator>> (ACE_SOCK_IOStream & stream, qchar *buf)
*buf = '\0'; // Initialize the string
- stream >> c;
+ stream.get(c);
if (!stream) // eat space up to the first char
return stream;
@@ -127,10 +127,12 @@ operator<< (ACE_SOCK_IOStream &stream, qchar *buf)
{
stream.put ('"');
while (*buf)
- if (*buf == '"')
- stream.put ('\\');
+ {
+ if (*buf == '"')
+ stream.put ('\\');
- stream.put ((char) *buf++);
+ stream.put ((char) *buf++);
+ }
stream.put ('"');
return stream;
@@ -281,6 +283,23 @@ server (void *arg = 0)
// Compared to the method above, this is quite messy. Notice also
// that whitespace is lost.
+#if defined(ACE_HAS_STRING_CLASS) && defined (ACE_HAS_STANDARD_CPP_LIBRARY)
+ ACE_IOStream_String buf;
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Server Received: ("));
+
+ while (client_handler &&
+ (buf.length() == 0 || buf[buf.length() - 1] != '\n'))
+ {
+ client_handler >> buf;
+ if (buf.length() > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG, "%s ", buf.c_str()));
+ }
+ }
+
+ ACE_DEBUG ((LM_DEBUG, ")\n"));
+
+#else
char buf[BUFSIZ];
ACE_OS::memset (buf, 0, sizeof buf);
ACE_DEBUG ((LM_DEBUG, "(%P|%t) Server Received: ("));
@@ -293,6 +312,7 @@ server (void *arg = 0)
}
ACE_DEBUG ((LM_DEBUG, ")\n"));
+#endif
// Send some non-textual data to the client. We use a single
// character to separate the fields but we could have used any valid