summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2005-08-24 05:41:48 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2005-08-24 05:41:48 +0000
commita0052ca4c60e7a30338ab04c989fb3d4b1fae461 (patch)
tree972bdd99e0ad877aa5108210d8b01b6f52e7e06f
parent09951de097bea8f56ac9db6c7dab8b336cce13c2 (diff)
downloadATCD-a0052ca4c60e7a30338ab04c989fb3d4b1fae461.tar.gz
ChangeLogTag:Tue Aug 23 22:35:00 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
-rw-r--r--ChangeLog13
-rw-r--r--tests/Array_Map_Test.cpp24
-rw-r--r--tests/Dev_Poll_Reactor_Test.cpp11
3 files changed, 36 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index bdbcf4763f8..5ffbd825265 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Tue Aug 23 22:35:00 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
+
+ * tests/Array_Map_Test.cpp (reference_count_test):
+
+ Added some assertions to further verify correct ACE_Array_Map
+ operation.
+
+ * tests/Dev_Poll_Reactor_Test.cpp (handle_input):
+
+ Fixed loop variable increment. A for-scope variable was
+ shadowing the "bytes_read" value, preventing the loop variable
+ from being updated correctly.
+
Tue Aug 23 22:24:16 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
* ace/Atomic_Op_T.cpp:
diff --git a/tests/Array_Map_Test.cpp b/tests/Array_Map_Test.cpp
index 7516608feb1..76c989156b8 100644
--- a/tests/Array_Map_Test.cpp
+++ b/tests/Array_Map_Test.cpp
@@ -419,24 +419,32 @@ reference_count_test (void)
ACE_ASSERT (counted.refcount () == 2);
+
+ std::pair<Map::iterator, bool> result;
+
{
- // enter a new scope block to assure destruction of temporaries
- // on systems like Solaris
+ // Enter a new scope block to assure destruction of temporaries
+ // on systems like Solaris / Sun C++.
+
+ result = map.insert (std::make_pair (ACE_TString (ACE_TEXT ("Two")),
+ counted));
- map.insert (std::make_pair (ACE_TString (ACE_TEXT ("Two")),
- counted));
+ ACE_ASSERT (result.second);
}
ACE_ASSERT (counted.refcount () == 3);
{
- // enter a new scope block to assure destruction of temporaries
- // on systems like Solaris
+ // Enter a new scope block to assure destruction of temporaries
+ // on systems like Solaris / Sun C++.
- map.insert (std::make_pair (ACE_TString (ACE_TEXT ("Three")),
- counted));
+ result = map.insert (std::make_pair (ACE_TString (ACE_TEXT ("Three")),
+ counted));
+
+ ACE_ASSERT (result.second);
}
+
ACE_ASSERT (counted.refcount () == 4);
Map::size_type const erased = map.erase (ACE_TEXT ("One"));
diff --git a/tests/Dev_Poll_Reactor_Test.cpp b/tests/Dev_Poll_Reactor_Test.cpp
index 7d851ca0842..673602c64ca 100644
--- a/tests/Dev_Poll_Reactor_Test.cpp
+++ b/tests/Dev_Poll_Reactor_Test.cpp
@@ -201,16 +201,18 @@ Server::handle_input (ACE_HANDLE /* handle */)
ssize_t bytes_read = 0;
- for (char * buf = buffer; buf < buffer + BUFSIZ; buf += bytes_read)
+ char * const begin = buffer;
+ char * const end = buffer + BUFSIZ;
+
+ for (char * buf = begin; buf != end; buf += bytes_read)
{
// Keep reading until it is no longer possible to do so.
//
// This is done since the underlying event demultiplexing
- // mechanism may be "state change" interface (as opposed to
+ // mechanism may have a "state change" interface (as opposed to
// "state monitoring"), in which case a "speculative" read is
// done.
- ssize_t bytes_read =
- this->peer ().recv (buf, BUFSIZ);
+ bytes_read = this->peer ().recv (buf, BUFSIZ - bytes_read);
ACE_DEBUG ((LM_DEBUG,
"****** bytes_read = %d\n",
@@ -472,6 +474,7 @@ server_worker (void *p)
if (reactor.run_reactor_event_loop () != 0)
{
ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("%p\n"),
ACE_TEXT ("Error when running server ")
ACE_TEXT ("reactor event loop\n")));