diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/tests/Bug_1576_Regression_Test.cpp | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/tests/Bug_1576_Regression_Test.cpp')
-rw-r--r-- | ACE/tests/Bug_1576_Regression_Test.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/ACE/tests/Bug_1576_Regression_Test.cpp b/ACE/tests/Bug_1576_Regression_Test.cpp new file mode 100644 index 00000000000..e0986fe9fa9 --- /dev/null +++ b/ACE/tests/Bug_1576_Regression_Test.cpp @@ -0,0 +1,66 @@ +/** + * @file Bug_1576_Regression_Test.cpp + * + * $Id$ + * + * Reproduces the problems reported in bug 1576: + * http://deuce.doc.wustl.edu/bugzilla/show_bug.cgi?id=1576 + * + * @author Carlos O'Ryan <coryan@atdesk.com> + */ + +#include "test_config.h" +#include "ace/DLL.h" + +ACE_RCSID (tests, + Bug_1576_Regression_Test, + "$Id$") + +int +run_main (int, ACE_TCHAR *[]) +{ + ACE_START_TEST (ACE_TEXT ("Bug_1576_Regression_Test")); + + ACE_DLL dll; + + const ACE_TCHAR * dll_name = ACE_TEXT ("NOT_A_DLL") ACE_DLL_SUFFIX; + + // Normally applications should check the return value, but if they + // ignore it... + int result = dll.open (dll_name); + + if(result == -1) + { + // Use dll.error() is you want to get the error text, but we don't this in + // this test because else the error is shown on the scoreboard + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("Load failed, as expected\n"))); + } + else + { + ACE_ERROR((LM_ERROR, + ACE_TEXT ("Success loading %s ? It should have failed!\n"), + dll_name)); + } + + // ... and then use the DLL library, the program crashes (instead of + // just getting an error ... + void * symbol = dll.symbol (ACE_TEXT ("SHOULD_CRASH")); + + if(symbol == 0) + { + // Use dll.error() is you want to get the error text, but we don't this in + // this test because else the error is shown on the scoreboard + ACE_DEBUG((LM_DEBUG, + ACE_TEXT ("Symbol lookup failed, as expected\n"))); + } + else + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Found symbol ? It should have failed!\n"))); + } + + ACE_END_TEST; + + return 0; +} |