summaryrefslogtreecommitdiff
path: root/tests/UPIPE_SAP_Test.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-18 03:56:19 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-18 03:56:19 +0000
commit7bb925dd16296885ea65ec8f73e3ce09047bfcd9 (patch)
treef8913a7ba038ec752e3d98e49b18950a374a85a9 /tests/UPIPE_SAP_Test.cpp
parentc02747c251c74f4abcf638ba7659ba4f87b7f45c (diff)
downloadATCD-7bb925dd16296885ea65ec8f73e3ce09047bfcd9.tar.gz
ywhoopie!!
More new stuff, more things will break!! I have no idea about this file. Heck, I am not even Doug!
Diffstat (limited to 'tests/UPIPE_SAP_Test.cpp')
-rw-r--r--tests/UPIPE_SAP_Test.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/tests/UPIPE_SAP_Test.cpp b/tests/UPIPE_SAP_Test.cpp
index 7934c31e26c..72bbc80871c 100644
--- a/tests/UPIPE_SAP_Test.cpp
+++ b/tests/UPIPE_SAP_Test.cpp
@@ -46,7 +46,10 @@ peer1 (void *)
if (con.connect (c_stream, addr) == -1)
ACE_DEBUG ((LM_DEBUG, "(%t) peer1 ACE_UPIPE_Connector failed\n"));
- ACE_Message_Block *mb = new ACE_Message_Block (20);
+ ACE_Message_Block *mb;
+
+ ACE_NEW_RETURN (mb, ACE_Message_Block (20), 0);
+
mb->copy ("hello", 6);
if (c_stream.send (mb) == -1)
@@ -141,11 +144,14 @@ peer2 (void *)
return 0;
}
+#endif /* ACE_HAS_THREADS */
+
int
-main (int argc, char *argv[])
+main (int, char *argv[])
{
ACE_START_TEST ("UPIPE_SAP_Test.cpp");
+#if defined (ACE_HAS_THREADS)
// Spawn a peer2 thread.
if (ACE_Service_Config::thr_mgr ()->spawn (ACE_THR_FUNC (peer2),
(void *) 0,
@@ -154,14 +160,9 @@ main (int argc, char *argv[])
// Wait for peer2 and peer1 threads to exit.
ACE_Service_Config::thr_mgr ()->wait ();
-
+#else
+ ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n"));
+#endif /* ACE_HAS_THREADS */
ACE_END_TEST;
return 0;
}
-#else
-int
-main (int, char *[])
-{
- ACE_ERROR_RETURN ((LM_ERROR, "threads not supported on this platform\n"), -1);
-}
-#endif /* ACE_HAS_THREADS */