diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-08-24 05:41:48 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2005-08-24 05:41:48 +0000 |
commit | a0052ca4c60e7a30338ab04c989fb3d4b1fae461 (patch) | |
tree | 972bdd99e0ad877aa5108210d8b01b6f52e7e06f /tests | |
parent | 09951de097bea8f56ac9db6c7dab8b336cce13c2 (diff) | |
download | ATCD-a0052ca4c60e7a30338ab04c989fb3d4b1fae461.tar.gz |
ChangeLogTag:Tue Aug 23 22:35:00 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Array_Map_Test.cpp | 24 | ||||
-rw-r--r-- | tests/Dev_Poll_Reactor_Test.cpp | 11 |
2 files changed, 23 insertions, 12 deletions
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"))); |