diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Buffer_Stream_Test.cpp | 8 | ||||
-rw-r--r-- | tests/Conn_Test.cpp | 12 | ||||
-rw-r--r-- | tests/MM_Shared_Memory_Test.cpp | 8 | ||||
-rw-r--r-- | tests/Mem_Map_Test.cpp | 6 | ||||
-rw-r--r-- | tests/Priority_Buffer_Test.cpp | 4 | ||||
-rw-r--r-- | tests/SOCK_Test.cpp | 8 | ||||
-rw-r--r-- | tests/SPIPE_Test.cpp | 8 | ||||
-rw-r--r-- | tests/test_config.h | 2 |
8 files changed, 29 insertions, 27 deletions
diff --git a/tests/Buffer_Stream_Test.cpp b/tests/Buffer_Stream_Test.cpp index 2ba15d15cc3..4444b1ed070 100644 --- a/tests/Buffer_Stream_Test.cpp +++ b/tests/Buffer_Stream_Test.cpp @@ -112,11 +112,11 @@ Producer::svc (void) ACE_NEW_THREAD; // Keep reading stdin, until we reach EOF. - for (char c = 'a'; c <= 'z'; c++) + for (char *c = ACE_ALPHABET; *c != '\0'; c++) { // Allocate a new message. char d[2]; - d[0] = c; + d[0] = *c; d[1] = '\0'; ACE_Message_Block *mb; @@ -152,7 +152,7 @@ Consumer::svc (void) ACE_Message_Block *mb = 0; int result = 0; - char c = 'a'; + char *c = ACE_ALPHABET; char *output; // Keep looping, reading a message out of the queue, until we @@ -171,7 +171,7 @@ Consumer::svc (void) if (length > 0) { output = mb->rd_ptr (); - ACE_ASSERT (c == output[0]); + ACE_ASSERT (*c == output[0]); c++; } mb->release (); diff --git a/tests/Conn_Test.cpp b/tests/Conn_Test.cpp index b5482267d31..d5b6dd3ef5d 100644 --- a/tests/Conn_Test.cpp +++ b/tests/Conn_Test.cpp @@ -66,8 +66,8 @@ Svc_Handler::send_data (void) { // Send data to server. - for (char c = 'a'; c <= 'z'; c++) - if (this->peer ().send_n (&c, 1) == -1) + for (char *c = ACE_ALPHABET; *c != '\0'; c++) + if (this->peer ().send_n (c, 1) == -1) ACE_ERROR ((LM_ERROR, "(%P|%t) %p\n", "send_n")); } @@ -79,7 +79,7 @@ Svc_Handler::recv_data (void) ACE_Handle_Set handle_set; handle_set.set_bit (new_stream.get_handle ()); - char t = 'a'; + char *t = ACE_ALPHABET; // Read data from client (terminate on error). @@ -97,13 +97,13 @@ Svc_Handler::recv_data (void) while ((r_bytes = new_stream.recv (&c, 1)) > 0) { - ACE_ASSERT (t == c); + ACE_ASSERT (*t == c); // We need to guard against cached connections, which // will send multiple sequences of letters from 'a' -> // 'z' through the same connection. - if (t == 'z') - t = 'a'; + if (*t == 'z') + t = ACE_ALPHABET; else t++; } diff --git a/tests/MM_Shared_Memory_Test.cpp b/tests/MM_Shared_Memory_Test.cpp index b20083a1d22..6149e201fda 100644 --- a/tests/MM_Shared_Memory_Test.cpp +++ b/tests/MM_Shared_Memory_Test.cpp @@ -42,13 +42,13 @@ client (void *) #endif /* ACE_WIN32 */ ACE_OS::sleep (3); - char t = 'a'; + char *t = ACE_ALPHABET; ACE_Shared_Memory_MM shm_client (shm_key); char *shm = (char *) shm_client.malloc (); for (char *s = shm; *s != '\0'; s++) { - ACE_ASSERT (t == s[0]); + ACE_ASSERT (*t == s[0]); t++; } *shm = '*'; @@ -72,8 +72,8 @@ server (void *) char *shm = (char *) shm_server.malloc (); char *s = shm; - for (char c = 'a'; c <= 'z'; c++) - *s++ = c; + for (char *c = ACE_ALPHABET; *c != '\0'; c++) + *s++ = *c; *s = '\0'; diff --git a/tests/Mem_Map_Test.cpp b/tests/Mem_Map_Test.cpp index fa9078bc608..3ad9cc12a97 100644 --- a/tests/Mem_Map_Test.cpp +++ b/tests/Mem_Map_Test.cpp @@ -57,8 +57,8 @@ create_test_file (int size, int num_lines) char *mybuf; ACE_NEW_RETURN (mybuf, char[size + 1], -1); - char c = 'a'; - char d = c; + char *c = ACE_ALPHABET; + char *d = c; ACE_HANDLE file_handle = ACE_OS::open (ACE_DEFAULT_TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, @@ -71,7 +71,7 @@ create_test_file (int size, int num_lines) { for (int i = 0; i < size; i++) { - mybuf[i] = c; + mybuf[i] = *c; c++; } diff --git a/tests/Priority_Buffer_Test.cpp b/tests/Priority_Buffer_Test.cpp index 3a1134c63a2..7fe6d7cd33a 100644 --- a/tests/Priority_Buffer_Test.cpp +++ b/tests/Priority_Buffer_Test.cpp @@ -94,14 +94,14 @@ producer (void *args) ACE_Message_Block *mb = 0; - for (char c = 'a'; c <= 'z'; c++) + for (char *c = ACE_ALPHABET; *c != '\0'; c++) { count++; // Allocate a new message ACE_NEW_RETURN (mb, ACE_Message_Block (1), 0); - *mb->rd_ptr () = c; + *mb->rd_ptr () = *c; // Set the priority. mb->msg_priority (count); diff --git a/tests/SOCK_Test.cpp b/tests/SOCK_Test.cpp index 08b8683ad76..4dfc0ac5023 100644 --- a/tests/SOCK_Test.cpp +++ b/tests/SOCK_Test.cpp @@ -71,8 +71,8 @@ client (void *arg) // Send data to server (correctly handles "incomplete writes"). - for (char c = 'a'; c <= 'z'; c++) - if (cli_stream.send_n (&c, 1) == -1) + for (char *c = ACE_ALPHABET; *c != '\0'; 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. @@ -119,7 +119,7 @@ server (void *arg) for (;;) { char buf[BUFSIZ]; - char t = 'a'; + char *t = ACE_ALPHABET; handle_set.reset (); handle_set.set_bit (peer_acceptor->get_handle ()); @@ -163,7 +163,7 @@ server (void *arg) while ((r_bytes = new_stream.recv (buf, 1)) > 0) { - ACE_ASSERT (t == buf[0]); + ACE_ASSERT (*t == buf[0]); t++; } diff --git a/tests/SPIPE_Test.cpp b/tests/SPIPE_Test.cpp index c06dded2721..f47368c9e71 100644 --- a/tests/SPIPE_Test.cpp +++ b/tests/SPIPE_Test.cpp @@ -51,8 +51,8 @@ client (void *) if (con.connect (cli_stream, ACE_SPIPE_Addr (ACE_WIDE_STRING (rendezvous))) == -1) ACE_ERROR ((LM_ERROR, "%p\n", rendezvous)); - for (char c = 'a'; c <= 'z'; c++) - if (cli_stream.send (&c, 1) == -1) + for (char *c = ACE_ALPHABET; *c != '\0'; c++) + if (cli_stream.send (c, 1) == -1) ACE_ERROR ((LM_ERROR, "%p\n", "send_n")); if (cli_stream.close () == -1) @@ -74,7 +74,7 @@ server (void *) ACE_SPIPE_Acceptor acceptor; ACE_SPIPE_Stream new_stream; char buf[BUFSIZ]; - char t = 'a'; + char *t = ACE_ALPHABET; const char *rendezvous = PIPE_NAME; @@ -93,7 +93,7 @@ server (void *) while (new_stream.recv (buf, 1) > 0) { - ACE_ASSERT (t == buf[0]); + ACE_ASSERT (*t == buf[0]); t++; } ACE_DEBUG ((LM_DEBUG, "End of connection. Closing handle\n")); diff --git a/tests/test_config.h b/tests/test_config.h index 0608be4ca34..cec49951d40 100644 --- a/tests/test_config.h +++ b/tests/test_config.h @@ -135,6 +135,8 @@ const int ACE_MAX_INTERVAL = 0; const int ACE_MAX_ITERATIONS = 10; const int ACE_MAX_PROCESSES = 10; +char ACE_ALPHABET[] = "abcdefghijklmnopqrstuvwxyz"; + class ACE_Test_Output { public: |