diff options
author | sharath <sharath@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-01-31 03:50:20 +0000 |
---|---|---|
committer | sharath <sharath@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-01-31 03:50:20 +0000 |
commit | 16f40bbebf1adf938e47523c0595e86017c7b832 (patch) | |
tree | bc47e33e33ea01cc097fca972f5faba570a08644 /tests/Log_Msg_Test.cpp | |
parent | 5ba8a9510140bcfd6f3c65784195855b53742e74 (diff) | |
download | ATCD-16f40bbebf1adf938e47523c0595e86017c7b832.tar.gz |
ChangeLogTag: 'head -1 ChangeLog'
Diffstat (limited to 'tests/Log_Msg_Test.cpp')
-rw-r--r-- | tests/Log_Msg_Test.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/tests/Log_Msg_Test.cpp b/tests/Log_Msg_Test.cpp index 156e106552a..507a76e4d2b 100644 --- a/tests/Log_Msg_Test.cpp +++ b/tests/Log_Msg_Test.cpp @@ -343,23 +343,30 @@ test_ostream (void) // Open up the file. if (connector.connect (file, ACE_FILE_Addr (filename)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, + { + // Set the ostream back to NULL to prevent "later functions using myostream". + ACE_LOG_MSG->msg_ostream (ace_file_stream::instance ()->output_file ()); + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("connect failed for %p\n"), filename), 1); + } + // Unlink this file right away so that it is automatically removed - // when the process exits. - else if (ACE_OS::unlink (filename) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("unlink failed for %p\n"), - filename), - 1); + // when the process exits.Ignore error returns in case this operation + // is not supported. + ACE_OS::unlink(filename); + ACE_FILE_Info info; if (file.get_info (info) == -1) - ACE_ERROR_RETURN ((LM_ERROR, + { + // Set the ostream back to NULL to prevent "later functions using myostream". + ACE_LOG_MSG->msg_ostream (ace_file_stream::instance ()->output_file ()); + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("get_info failed on %p\n"), filename), -1); + } // Allocate the input buffer char *buffer; @@ -373,11 +380,15 @@ test_ostream (void) ssize_t size = file.recv (buffer, info.size_); if (size != info.size_) + { + // Set the ostream back to NULL to prevent "later functions using myostream". + ACE_LOG_MSG->msg_ostream (ace_file_stream::instance ()->output_file ()); ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Read %d bytes, rather than expected %d bytes\n"), size, info.size_), -1); + } // Make sure to NUL-terminate this turkey! buffer[size] = '\0'; @@ -404,7 +415,6 @@ int main (int, char *argv[]) { ACE_START_TEST (ACE_TEXT ("Log_Msg_Test")); - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("**** running ostream test\n"))); |