summaryrefslogtreecommitdiff
path: root/tests/SV_Shared_Memory_Test.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-30 00:33:43 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-30 00:33:43 +0000
commit8ca31fd725b7bd02f2038a5b3a03c3da64b6b48c (patch)
treedd496dde3c016a1db5d3882e1dc40c9af7e9aaf8 /tests/SV_Shared_Memory_Test.cpp
parent42f04951935318cb83949862c4abd11a8386cc91 (diff)
downloadATCD-8ca31fd725b7bd02f2038a5b3a03c3da64b6b48c.tar.gz
Eon
Diffstat (limited to 'tests/SV_Shared_Memory_Test.cpp')
-rw-r--r--tests/SV_Shared_Memory_Test.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/SV_Shared_Memory_Test.cpp b/tests/SV_Shared_Memory_Test.cpp
index 2b132132078..d05bce465d9 100644
--- a/tests/SV_Shared_Memory_Test.cpp
+++ b/tests/SV_Shared_Memory_Test.cpp
@@ -20,9 +20,9 @@
#include "ace/SV_Shared_Memory.h"
#include "test_config.h"
-#define SHMSZ 27
-#define SEM_KEY 1234
-#define SHM_KEY 5678
+const int SHMSZ = 27;
+const int SEM_KEY = 1234;
+const int SHM_KEY = 5678;
static void
client (void)
@@ -30,8 +30,7 @@ client (void)
ACE_SV_Shared_Memory shm_client;
char t = 'a';
- if (shm_client.open_and_attach (SHM_KEY, SHMSZ) == -1)
- ACE_OS::perror ("open"), ACE_OS::exit (1);
+ ACE_ASSERT (shm_client.open_and_attach (SHM_KEY, SHMSZ, ACE_SV_Shared_Memory::ACE_CREATE) != -1);
for (char *s = (char *) shm_client.get_segment_ptr (); *s != '\0'; s++)
{
@@ -48,8 +47,7 @@ server (void)
{
ACE_SV_Shared_Memory shm_server;
- if (shm_server.open_and_attach (SHM_KEY, SHMSZ, ACE_SV_Shared_Memory::ACE_CREATE) == -1)
- ACE_OS::perror ("open"), ACE_OS::exit (1);
+ ACE_ASSERT (shm_server.open_and_attach (SHM_KEY, SHMSZ, ACE_SV_Shared_Memory::ACE_CREATE) != -1);
char *s = (char *) shm_server.get_segment_ptr ();
@@ -63,7 +61,6 @@ server (void)
if (shm_server.remove () < 0)
ACE_OS::perror ("remove"), ACE_OS::exit (1);
- return;
}
int
@@ -76,7 +73,6 @@ main (int, char *argv[])
case -1:
ACE_ERROR ((LM_ERROR, "%p%a", "main", 1));
case 0:
- ACE_OS::sleep (1);
client ();
default:
server ();