summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2002-08-27 17:38:26 +0000
committerSteve Huston <shuston@riverace.com>2002-08-27 17:38:26 +0000
commit7b5a429be6bcb7376736b32d9ef8b632abd3d45e (patch)
tree975bd4989100178940b9f15c0ad737d40b783b54 /tests
parent85e3f3910c6931831afed75e4593f56309a6f610 (diff)
downloadATCD-7b5a429be6bcb7376736b32d9ef8b632abd3d45e.tar.gz
ChangeLogTag:Tue Aug 27 13:28:17 2002 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/Buffer_Stream_Test.cpp2
-rw-r--r--tests/CDR_Array_Test.cpp9
-rw-r--r--tests/CDR_Test.cpp2
-rw-r--r--tests/Cache_Map_Manager_Test.cpp2
-rw-r--r--tests/Cache_Map_Manager_Test.h2
-rw-r--r--tests/Handle_Set_Test.cpp16
-rw-r--r--tests/MT_Reactor_Timer_Test.cpp3
-rw-r--r--tests/MT_SOCK_Test.cpp20
-rw-r--r--tests/Mem_Map_Test.cpp4
-rw-r--r--tests/Message_Block_Test.cpp4
-rw-r--r--tests/Message_Queue_Notifications_Test.cpp2
-rw-r--r--tests/Priority_Buffer_Test.cpp2
-rw-r--r--tests/Proactor_Scatter_Gather_Test.cpp6
-rw-r--r--tests/Proactor_Test.cpp70
-rw-r--r--tests/SOCK_Send_Recv_Test.cpp2
-rw-r--r--tests/SOCK_Test.cpp21
-rw-r--r--tests/Semaphore_Test.cpp2
-rw-r--r--tests/TP_Reactor_Test.cpp18
-rw-r--r--tests/TP_Reactor_Test.h2
-rw-r--r--tests/TSS_Test.cpp2
-rw-r--r--tests/Thread_Pool_Reactor_Resume_Test.cpp2
-rw-r--r--tests/Thread_Pool_Reactor_Test.cpp2
-rw-r--r--tests/Thread_Pool_Test.cpp4
-rw-r--r--tests/Upgradable_RW_Test.cpp6
24 files changed, 127 insertions, 78 deletions
diff --git a/tests/Buffer_Stream_Test.cpp b/tests/Buffer_Stream_Test.cpp
index 3f15dc447b2..f35d2698f08 100644
--- a/tests/Buffer_Stream_Test.cpp
+++ b/tests/Buffer_Stream_Test.cpp
@@ -175,7 +175,7 @@ Consumer::svc (void)
if (result == -1)
break;
- int length = mb->length ();
+ size_t length = mb->length ();
if (length > 0)
{
diff --git a/tests/CDR_Array_Test.cpp b/tests/CDR_Array_Test.cpp
index 4ee99fe6d21..d1cb547add3 100644
--- a/tests/CDR_Array_Test.cpp
+++ b/tests/CDR_Array_Test.cpp
@@ -155,7 +155,7 @@ private:
static ACE_UINT32 seal = 0xdeadbeef;
void
-zero (char* p, int k)
+zero (char* p, size_t k)
{
char* end = p + k;
while (p < end)
@@ -189,7 +189,7 @@ CDR_Test<T, H>::CDR_Test (int total, int niter, int use_array)
char* srcbuf;
char* dstbuf;
{
- const int stotal =
+ const size_t stotal =
(total + 10) * H::size () + sizeof(ACE_UINT32) + ACE_CDR::MAX_ALIGNMENT;
ACE_NEW(srcbuf, char[stotal]);
@@ -394,7 +394,8 @@ CDR_Test<T, H>::do_test (int total, int niter, int use_array,
int n;
for (n = 0; n < niter; n++)
{
- int size = H::size () * (dst_offset + total) + ACE_CDR::MAX_ALIGNMENT;
+ size_t size = H::size () * (dst_offset + total) +
+ ACE_CDR::MAX_ALIGNMENT;
ACE_OutputCDR os (dstbuf, size);
// This is intrusive...
@@ -498,7 +499,7 @@ CDR_Test<T, H>::do_test (int total, int niter, int use_array,
{
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("====== Read iteration %d\n"), n));
- int size = (total + dst_offset) * H::size ();
+ size_t size = (total + dst_offset) * H::size ();
ACE_InputCDR is (toread, size, opposite_byte_order);
// This is intrusive...
diff --git a/tests/CDR_Test.cpp b/tests/CDR_Test.cpp
index e4242dc3967..dda55b701f7 100644
--- a/tests/CDR_Test.cpp
+++ b/tests/CDR_Test.cpp
@@ -112,7 +112,7 @@ short_stream (void)
os.write_double_array (d_array, 3);
const ACE_Message_Block *out_mb = os.begin ();
- u_int len = out_mb->length ();
+ size_t len = out_mb->length ();
// Create an input stream (copy constructor)
ACE_InputCDR is (os);
diff --git a/tests/Cache_Map_Manager_Test.cpp b/tests/Cache_Map_Manager_Test.cpp
index 3b7937d4e8e..dec12796a7a 100644
--- a/tests/Cache_Map_Manager_Test.cpp
+++ b/tests/Cache_Map_Manager_Test.cpp
@@ -542,7 +542,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
ACE_LOG_MSG->clr_flags (ACE_Log_Msg::VERBOSE_LITE);
// Providing random a unique seed.
- ACE_OS::srand (ACE_static_cast (size_t, ACE_OS::time (0)));
+ ACE_OS::srand (ACE_static_cast (u_int, ACE_OS::time (0)));
// Create the lookup array.
ACE_NEW_RETURN (lookup_array,
diff --git a/tests/Cache_Map_Manager_Test.h b/tests/Cache_Map_Manager_Test.h
index 5f75635a04c..a6bead7858d 100644
--- a/tests/Cache_Map_Manager_Test.h
+++ b/tests/Cache_Map_Manager_Test.h
@@ -31,7 +31,7 @@ public:
u_long operator () (size_t t) const
{
// Simply returns t
- return t;
+ return ACE_static_cast (u_long, t);
}
};
diff --git a/tests/Handle_Set_Test.cpp b/tests/Handle_Set_Test.cpp
index cc5cafa3d92..ce87f195ffd 100644
--- a/tests/Handle_Set_Test.cpp
+++ b/tests/Handle_Set_Test.cpp
@@ -68,6 +68,11 @@ test_duplicates (size_t count)
// <ACE_DEFAULT_SELECT_REACTOR_SIZE> is less than any of these
// <HANDLE> values, the logic in <test_boundaries> will simply ignore
// these values.
+#if defined (ACE_WIN64)
+ // The casts below are legit...
+# pragma warning(push)
+# pragma warning(disable : 4312)
+#endif /* ACE_WIN64 */
static ACE_HANDLE handle_vector[] =
{
(ACE_HANDLE) 0,
@@ -86,6 +91,9 @@ static ACE_HANDLE handle_vector[] =
(ACE_HANDLE) ACE_DEFAULT_SELECT_REACTOR_SIZE,
ACE_INVALID_HANDLE
};
+#if defined (ACE_WIN64)
+# pragma warning(pop)
+#endif /* ACE_WIN64 */
static void
test_boundaries (void)
@@ -118,6 +126,11 @@ test_boundaries (void)
// Insert the vector of <ACE_HANDLE>s into the set.
+#if defined (ACE_WIN64)
+ // The casts below are legit...
+# pragma warning(push)
+# pragma warning(disable : 4312)
+#endif /* ACE_WIN64 */
for (int i = 0;
handle_vector[i] != ACE_INVALID_HANDLE;
i++)
@@ -128,6 +141,9 @@ test_boundaries (void)
set.insert (handle_vector[i]);
}
}
+#if defined (ACE_WIN64)
+# pragma warning(pop)
+#endif /* ACE_WIN64 */
int count = 0;
diff --git a/tests/MT_Reactor_Timer_Test.cpp b/tests/MT_Reactor_Timer_Test.cpp
index 9026b5a6e98..f9f5b2b3c24 100644
--- a/tests/MT_Reactor_Timer_Test.cpp
+++ b/tests/MT_Reactor_Timer_Test.cpp
@@ -149,7 +149,8 @@ Dispatch_Count_Handler::Dispatch_Count_Handler (void)
ACE_Reactor *r = ACE_Reactor::instance ();
- this->input_seen_ = this->notify_seen_ = this->timers_fired_ = 0;
+ this->input_seen_ = this->notify_seen_ = 0;
+ this->timers_fired_ = 0;
// Initialize the pipe.
if (this->pipe_.open () == -1)
diff --git a/tests/MT_SOCK_Test.cpp b/tests/MT_SOCK_Test.cpp
index 19b80154007..314be674a4f 100644
--- a/tests/MT_SOCK_Test.cpp
+++ b/tests/MT_SOCK_Test.cpp
@@ -146,7 +146,15 @@ server (void *arg)
handle_set.reset ();
handle_set.set_bit (peer_acceptor->get_handle ());
- int result = ACE_OS::select (int (peer_acceptor->get_handle ()) + 1,
+ int select_width;
+# if defined (ACE_WIN64)
+ // This arg is ignored on Windows and causes pointer truncation
+ // warnings on 64-bit compiles.
+ select_width = 0;
+# else
+ select_width = int (peer_acceptor->get_handle ()) + 1;
+# endif /* ACE_WIN64 */
+ int result = ACE_OS::select (select_width,
handle_set,
0, 0, &tv);
ACE_ASSERT (tv == def_timeout);
@@ -191,7 +199,15 @@ server (void *arg)
{
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) waiting in select\n")));
- if (ACE_OS::select (int (new_stream.get_handle ()) + 1,
+ int select_width;
+# if defined (ACE_WIN64)
+ // This arg is ignored on Windows and causes pointer truncation
+ // warnings on 64-bit compiles.
+ select_width = 0;
+# else
+ select_width = int (new_stream.get_handle ()) + 1;
+# endif /* ACE_WIN64 */
+ if (ACE_OS::select (select_width,
handle_set,
0, 0, 0) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/tests/Mem_Map_Test.cpp b/tests/Mem_Map_Test.cpp
index a9e4b9054c0..54583b54c74 100644
--- a/tests/Mem_Map_Test.cpp
+++ b/tests/Mem_Map_Test.cpp
@@ -33,12 +33,12 @@ static const int NUM_LINES = 15;
static void
reverse_file (ACE_HANDLE file_handle,
char *array,
- int size)
+ size_t size)
{
int count = 0;
// LynxOS 3.0.0/PowerPC needs the volatile qualifier, with -O2
// optimization enabled and without ACE_HAS_INLINE.
- volatile int i = size;
+ volatile size_t i = size;
--i;
if (array[i] == '\0')
diff --git a/tests/Message_Block_Test.cpp b/tests/Message_Block_Test.cpp
index 2971e25ba59..52074394384 100644
--- a/tests/Message_Block_Test.cpp
+++ b/tests/Message_Block_Test.cpp
@@ -98,7 +98,7 @@ Worker_Task::svc (void)
ACE_ASSERT (this->msg_queue ()->dequeue_head (mb) != -1);
- int length = mb->length ();
+ size_t length = mb->length ();
// If there's a next() Task then "logically" copy the message by
// calling <duplicate> and send it on down the pipeline. Note
@@ -203,7 +203,7 @@ produce (Worker_Task &worker_task,
ACE_TCHAR buf[BUFSIZ];
ACE_OS::sprintf (buf, ACE_SIZE_T_FORMAT_SPECIFIER, count);
- int n = (ACE_OS::strlen (buf) + 1) * sizeof (ACE_TCHAR);
+ size_t n = (ACE_OS::strlen (buf) + 1) * sizeof (ACE_TCHAR);
// Allocate a new message.
ACE_NEW_RETURN (mb,
diff --git a/tests/Message_Queue_Notifications_Test.cpp b/tests/Message_Queue_Notifications_Test.cpp
index 502b5557262..cc3b4840f01 100644
--- a/tests/Message_Queue_Notifications_Test.cpp
+++ b/tests/Message_Queue_Notifications_Test.cpp
@@ -205,7 +205,7 @@ Watermark_Test::producer (void)
{
int i = watermark_iterations;
- for (int hwm = this->hwm_;
+ for (ssize_t hwm = this->hwm_;
hwm >= 0 ;
hwm -= this->len_)
{
diff --git a/tests/Priority_Buffer_Test.cpp b/tests/Priority_Buffer_Test.cpp
index b71a4c6084e..4f123885a04 100644
--- a/tests/Priority_Buffer_Test.cpp
+++ b/tests/Priority_Buffer_Test.cpp
@@ -68,7 +68,7 @@ consumer (void *args)
local_count++;
- int length = mb->length ();
+ size_t length = mb->length ();
if (length > 0)
{
diff --git a/tests/Proactor_Scatter_Gather_Test.cpp b/tests/Proactor_Scatter_Gather_Test.cpp
index 7220de98eae..40b2bbc40d3 100644
--- a/tests/Proactor_Scatter_Gather_Test.cpp
+++ b/tests/Proactor_Scatter_Gather_Test.cpp
@@ -132,7 +132,7 @@ last_chunk (ACE_Message_Block *chain,
if (!chain)
return 0;
- size_t index = 1;
+ int index = 1;
last = chain;
while (0 != last->cont ())
{
@@ -335,8 +335,8 @@ private:
// Output file
ACE_Asynch_Write_File wf_;
ACE_HANDLE output_file_handle_;
- size_t writing_file_offset_;
- size_t reported_file_offset_;
+ u_long writing_file_offset_;
+ u_long reported_file_offset_;
ACE_Message_Block *odd_chain_;
ACE_Message_Block *even_chain_;
long io_count_;
diff --git a/tests/Proactor_Test.cpp b/tests/Proactor_Test.cpp
index d8c06c1423a..30253749cf4 100644
--- a/tests/Proactor_Test.cpp
+++ b/tests/Proactor_Test.cpp
@@ -86,7 +86,7 @@ static int loglevel = 0; // 0 full , 1 only errors
static const size_t MIN_TIME = 1; // min 1 sec
static const size_t MAX_TIME = 3600; // max 1 hour
-static size_t seconds = 2; // default time to run - 2 seconds
+static u_int seconds = 2; // default time to run - 2 seconds
static ACE_TCHAR complete_message[] =
ACE_TEXT ("GET / HTTP/1.1\r\n")
@@ -165,7 +165,7 @@ public:
virtual int svc (void);
- int start (size_t num_threads,
+ int start (int num_threads,
ProactorType type_proactor,
size_t max_op );
int stop (void);
@@ -283,7 +283,7 @@ MyTask::delete_proactor (void)
}
int
-MyTask::start (size_t num_threads,
+MyTask::start (int num_threads,
ProactorType type_proactor,
size_t max_op)
{
@@ -362,8 +362,8 @@ public:
Receiver (Acceptor *acceptor = 0, int index = -1);
~Receiver (void);
- long get_total_snd (void) { return this->total_snd_; }
- long get_total_rcv (void) { return this->total_rcv_; }
+ size_t get_total_snd (void) { return this->total_snd_; }
+ size_t get_total_rcv (void) { return this->total_rcv_; }
long get_total_w (void) { return this->total_w_; }
long get_total_r (void) { return this->total_r_; }
@@ -400,8 +400,8 @@ private:
long io_count_;
int flg_cancel_;
- long total_snd_;
- long total_rcv_;
+ size_t total_snd_;
+ size_t total_rcv_;
long total_w_;
long total_r_;
};
@@ -411,8 +411,8 @@ class Acceptor : public ACE_Asynch_Acceptor<Receiver>
friend class Receiver;
public:
int get_number_sessions (void) { return this->sessions_; }
- long get_total_snd (void) { return this->total_snd_; }
- long get_total_rcv (void) { return this->total_rcv_; }
+ size_t get_total_snd (void) { return this->total_snd_; }
+ size_t get_total_rcv (void) { return this->total_rcv_; }
long get_total_w (void) { return this->total_w_; }
long get_total_r (void) { return this->total_r_; }
@@ -432,8 +432,8 @@ private:
ACE_SYNCH_RECURSIVE_MUTEX lock_;
int sessions_;
Receiver *list_receivers_[MAX_RECEIVERS];
- long total_snd_;
- long total_rcv_;
+ size_t total_snd_;
+ size_t total_rcv_;
long total_w_;
long total_r_;
};
@@ -715,17 +715,17 @@ Receiver::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result)
ACE_TEXT ("bytes_transfered"),
result.bytes_transferred ()));
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("%s = %u\n"),
+ ACE_TEXT ("%s = %@\n"),
ACE_TEXT ("act"),
- (u_long) result.act ()));
+ result.act ()));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("%s = %d\n"),
ACE_TEXT ("success"),
result.success ()));
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("%s = %u\n"),
+ ACE_TEXT ("%s = %@\n"),
ACE_TEXT ("completion_key"),
- (u_long) result.completion_key ()));
+ result.completion_key ()));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("%s = %d\n"),
ACE_TEXT ("error"),
@@ -792,17 +792,17 @@ Receiver::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result)
ACE_TEXT ("bytes_transfered"),
result.bytes_transferred ()));
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("%s = %u\n"),
+ ACE_TEXT ("%s = %@\n"),
ACE_TEXT ("act"),
- (u_long) result.act ()));
+ result.act ()));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("%s = %d\n"),
ACE_TEXT ("success"),
result.success ()));
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("%s = %u\n"),
+ ACE_TEXT ("%s = %@\n"),
ACE_TEXT ("completion_key"),
- (u_long) result.completion_key ()));
+ result.completion_key ()));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("%s = %d\n"),
ACE_TEXT ("error"),
@@ -850,8 +850,8 @@ public:
Sender (Connector *connector = 0, int index = -1);
~Sender (void);
- long get_total_snd (void) { return this->total_snd_; }
- long get_total_rcv (void) { return this->total_rcv_; }
+ size_t get_total_snd (void) { return this->total_snd_; }
+ size_t get_total_rcv (void) { return this->total_rcv_; }
long get_total_w (void) { return this->total_w_; }
long get_total_r (void) { return this->total_r_; }
@@ -877,8 +877,8 @@ private:
long io_count_;
int flg_cancel_;
- long total_snd_;
- long total_rcv_;
+ size_t total_snd_;
+ size_t total_rcv_;
long total_w_;
long total_r_;
};
@@ -888,8 +888,8 @@ class Connector : public ACE_Asynch_Connector<Sender>
friend class Sender;
public:
int get_number_sessions (void) { return this->sessions_; }
- long get_total_snd (void) { return this->total_snd_; }
- long get_total_rcv (void) { return this->total_rcv_; }
+ size_t get_total_snd (void) { return this->total_snd_; }
+ size_t get_total_rcv (void) { return this->total_rcv_; }
long get_total_w (void) { return this->total_w_; }
long get_total_r (void) { return this->total_r_; }
@@ -910,8 +910,8 @@ private:
ACE_SYNCH_RECURSIVE_MUTEX lock_;
int sessions_;
Sender *list_senders_[MAX_SENDERS];
- long total_snd_;
- long total_rcv_;
+ size_t total_snd_;
+ size_t total_rcv_;
long total_w_;
long total_r_;
};
@@ -1338,17 +1338,17 @@ Sender::handle_write_stream (const ACE_Asynch_Write_Stream::Result &result)
ACE_TEXT ("bytes_transfered"),
result.bytes_transferred ()));
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("%s = %u\n"),
+ ACE_TEXT ("%s = %@\n"),
ACE_TEXT ("act"),
- (u_long) result.act ()));
+ result.act ()));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("%s = %d\n"),
ACE_TEXT ("success"),
result.success ()));
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("%s = %u\n"),
+ ACE_TEXT ("%s = %@\n"),
ACE_TEXT ("completion_key"),
- (u_long) result.completion_key ()));
+ result.completion_key ()));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("%s = %d\n"),
ACE_TEXT ("error"),
@@ -1450,17 +1450,17 @@ Sender::handle_read_stream (const ACE_Asynch_Read_Stream::Result &result)
ACE_TEXT ("bytes_transfered"),
result.bytes_transferred ()));
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("%s = %u\n"),
+ ACE_TEXT ("%s = %@\n"),
ACE_TEXT ("act"),
- (u_long) result.act ()));
+ result.act ()));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("%s = %d\n"),
ACE_TEXT ("success"),
result.success ()));
ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("%s = %u\n"),
+ ACE_TEXT ("%s = %@\n"),
ACE_TEXT ("completion_key"),
- (u_long) result.completion_key ()));
+ result.completion_key ()));
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("%s = %d\n"),
ACE_TEXT ("error"),
diff --git a/tests/SOCK_Send_Recv_Test.cpp b/tests/SOCK_Send_Recv_Test.cpp
index c1ff063f0b0..940babdb42d 100644
--- a/tests/SOCK_Send_Recv_Test.cpp
+++ b/tests/SOCK_Send_Recv_Test.cpp
@@ -95,7 +95,7 @@ client (void *arg)
// The server will verify that this data pattern gets there intact.
for (i = 0; i < sizeof buffer; ++i)
- buffer[i] = i;
+ buffer[i] = ACE_static_cast (u_char, i);
iovec iov[5];
diff --git a/tests/SOCK_Test.cpp b/tests/SOCK_Test.cpp
index bbcbb7e0707..23bb01f841a 100644
--- a/tests/SOCK_Test.cpp
+++ b/tests/SOCK_Test.cpp
@@ -111,7 +111,15 @@ server (void *arg)
handle_set.reset ();
handle_set.set_bit (peer_acceptor->get_handle ());
- int result = ACE_OS::select (int (peer_acceptor->get_handle ()) + 1,
+ int select_width;
+# if defined (ACE_WIN64)
+ // This arg is ignored on Windows and causes pointer truncation
+ // warnings on 64-bit compiles.
+ select_width = 0;
+# else
+ select_width = int (peer_acceptor->get_handle ()) + 1;
+# endif /* ACE_WIN64 */
+ int result = ACE_OS::select (select_width,
handle_set,
0, 0, &tv);
ACE_ASSERT (tv == def_timeout);
@@ -140,10 +148,17 @@ server (void *arg)
handle_set.set_bit (new_stream.get_handle ());
// Read data from client (terminate on error).
-
+ int select_width;
for (ssize_t r_bytes; ;)
{
- if (ACE_OS::select (int (new_stream.get_handle ()) + 1,
+# if defined (ACE_WIN64)
+ // This arg is ignored on Windows and causes pointer truncation
+ // warnings on 64-bit compiles.
+ select_width = 0;
+# else
+ select_width = int (new_stream.get_handle ()) + 1;
+# endif /* ACE_WIN64 */
+ if (ACE_OS::select (select_width,
handle_set,
0, 0, 0) == -1)
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%P|%t) %p\n"), ACE_TEXT ("select")), 0);
diff --git a/tests/Semaphore_Test.cpp b/tests/Semaphore_Test.cpp
index 55c73ba94e9..cdc8b671572 100644
--- a/tests/Semaphore_Test.cpp
+++ b/tests/Semaphore_Test.cpp
@@ -144,7 +144,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
static void *
worker (void *)
{
- for (size_t iterations = 1;
+ for (long iterations = 1;
iterations <= n_iterations;
iterations++)
{
diff --git a/tests/TP_Reactor_Test.cpp b/tests/TP_Reactor_Test.cpp
index ab0e355edb3..06a536bba07 100644
--- a/tests/TP_Reactor_Test.cpp
+++ b/tests/TP_Reactor_Test.cpp
@@ -75,7 +75,7 @@ static int both = 0;
static const ACE_TCHAR *host = 0;
// number of Senders instances
-static size_t senders = 1;
+static int senders = 1;
// duplex mode: == 0 half-duplex
// != 0 full duplex
@@ -92,7 +92,7 @@ static int loglevel = 1; // 0 full , 1 only errors
static const size_t MIN_TIME = 1; // min 1 sec
static const size_t MAX_TIME = 3600; // max 1 hour
-static size_t seconds = 2; // default time to run - 2 seconds
+static u_int seconds = 2; // default time to run - 2 seconds
static char data[] =
"GET / HTTP/1.1\r\n"
@@ -133,7 +133,7 @@ public:
virtual int svc (void);
- int start (size_t num_threads);
+ int start (int num_threads);
int stop (void);
private:
@@ -193,7 +193,7 @@ MyTask::delete_reactor (void)
}
int
-MyTask::start (size_t num_threads)
+MyTask::start (int num_threads)
{
if (this->create_reactor () == -1)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -358,7 +358,7 @@ Acceptor::make_svc_handler (Receiver *&sh)
if (sessions_ >= MAX_RECEIVERS)
return -1;
- for (size_t i = 0; i < MAX_RECEIVERS; ++i)
+ for (int i = 0; i < MAX_RECEIVERS; ++i)
if (this->list_receivers_ [i] == 0)
{
ACE_NEW_RETURN (sh,
@@ -565,7 +565,7 @@ Receiver::handle_output (ACE_HANDLE h)
int err = 0;
ssize_t res = 0;
- int bytes = 0;
+ size_t bytes = 0;
int qcount = this->getq (mb, &tv);
@@ -736,7 +736,7 @@ Connector::make_svc_handler (Sender * & sh)
if (sessions_ >= MAX_SENDERS)
return -1;
- for (size_t i = 0; i < MAX_SENDERS; ++i)
+ for (int i = 0; i < MAX_SENDERS; ++i)
if (this->list_senders_ [i] == 0)
{
ACE_NEW_RETURN (sh,
@@ -822,7 +822,7 @@ Sender::initiate_write (void)
{
if ( this->msg_queue ()->message_count () < 20) // flow control
{
- int nbytes = ACE_OS::strlen (send_buf_);
+ size_t nbytes = ACE_OS_String::strlen (send_buf_);
ACE_Message_Block *mb = 0;
ACE_NEW_RETURN (mb,
@@ -964,7 +964,7 @@ Sender::handle_output (ACE_HANDLE h)
int err=0;
ssize_t res=0;
- int bytes=0;
+ size_t bytes=0;
int qcount = this->getq (mb , & tv);
diff --git a/tests/TP_Reactor_Test.h b/tests/TP_Reactor_Test.h
index 6f192b5efb3..d6341e5f0da 100644
--- a/tests/TP_Reactor_Test.h
+++ b/tests/TP_Reactor_Test.h
@@ -167,7 +167,7 @@ class Connector: public ACE_Connector<Sender,ACE_SOCK_CONNECTOR>
{
friend class Sender;
public:
- long get_number_sessions (void) { return sessions_; }
+ size_t get_number_sessions (void) { return sessions_; }
long get_total_snd (void) { return this->total_snd_; }
long get_total_rcv (void) { return this->total_rcv_; }
long get_total_w (void) { return this->total_w_; }
diff --git a/tests/TSS_Test.cpp b/tests/TSS_Test.cpp
index 7f98fe32646..8f5881eb344 100644
--- a/tests/TSS_Test.cpp
+++ b/tests/TSS_Test.cpp
@@ -93,7 +93,7 @@ worker (void *c)
{
// Cast the arg to a long, first, because a pointer is the same
// size as a long on all current ACE platforms.
- int count = (int) (long) c;
+ int count = ACE_reinterpret_cast (int, c);
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) worker, iterations = %d\n"), count));
diff --git a/tests/Thread_Pool_Reactor_Resume_Test.cpp b/tests/Thread_Pool_Reactor_Resume_Test.cpp
index 3dde6a34920..86b42311e00 100644
--- a/tests/Thread_Pool_Reactor_Resume_Test.cpp
+++ b/tests/Thread_Pool_Reactor_Resume_Test.cpp
@@ -304,7 +304,7 @@ worker (void *)
ACE_OS::sleep (3);
const ACE_TCHAR *msg = ACE_TEXT ("Message from Connection worker");
ACE_TCHAR buf [BUFSIZ];
- buf[0] = ACE_OS::strlen (msg) + 1;
+ buf[0] = ACE_static_cast (ACE_TCHAR, (ACE_OS_String::strlen (msg) + 1));
ACE_OS::strcpy (&buf[1], msg);
ACE_INET_Addr addr (rendezvous);
diff --git a/tests/Thread_Pool_Reactor_Test.cpp b/tests/Thread_Pool_Reactor_Test.cpp
index 42c2fb8abf6..821164fc748 100644
--- a/tests/Thread_Pool_Reactor_Test.cpp
+++ b/tests/Thread_Pool_Reactor_Test.cpp
@@ -251,7 +251,7 @@ worker (void *)
ACE_OS::sleep (3);
const ACE_TCHAR *msg = ACE_TEXT ("Message from Connection worker");
ACE_TCHAR buf [BUFSIZ];
- buf[0] = ACE_OS::strlen (msg) + 1;
+ buf[0] = ACE_static_cast (ACE_TCHAR, (ACE_OS_String::strlen (msg) + 1));
ACE_OS::strcpy (&buf[1], msg);
ACE_INET_Addr addr (rendezvous);
diff --git a/tests/Thread_Pool_Test.cpp b/tests/Thread_Pool_Test.cpp
index c2247ac6aeb..b6584a3bc17 100644
--- a/tests/Thread_Pool_Test.cpp
+++ b/tests/Thread_Pool_Test.cpp
@@ -137,7 +137,7 @@ Thread_Pool::svc (void)
break;
}
- int length = mb->length ();
+ size_t length = mb->length ();
if (length > 0)
ACE_DEBUG ((LM_DEBUG,
@@ -358,7 +358,7 @@ Thread_Pool::test_empty_message_shutdown (void)
this->thr_count ()));
this->dump ();
- int i = 0;
+ size_t i = 0;
// Enqueue an empty message to flag each consumer thread to
// inform it to shutdown.
diff --git a/tests/Upgradable_RW_Test.cpp b/tests/Upgradable_RW_Test.cpp
index 9b8cd9dffa1..0571ce1b4ce 100644
--- a/tests/Upgradable_RW_Test.cpp
+++ b/tests/Upgradable_RW_Test.cpp
@@ -27,7 +27,7 @@ ACE_RCSID(tests, Upgradable_RW_Test, "$Id$")
#if defined (ACE_HAS_THREADS)
// Default number of iterations.
-static size_t n_iterations = 50;
+static long n_iterations = 50;
// Maximum string length used
static const size_t MAX_STRING_SIZE = 200;
@@ -36,10 +36,10 @@ static const size_t MAX_STRING_SIZE = 200;
// #define RW_MUTEX 1
// Default number of readers.
-static size_t n_readers = 10;
+static u_int n_readers = 10;
// Default number of writers.
-static size_t n_writers = 0;
+static u_int n_writers = 0;
// Number of entries in the hash map
static u_int n_entries = 10;