summaryrefslogtreecommitdiff
path: root/tests/New_Fail_Test.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>1999-04-22 16:02:14 +0000
committerSteve Huston <shuston@riverace.com>1999-04-22 16:02:14 +0000
commit46183aaa21b734d70cdb939eb3aadc03bbea98fb (patch)
tree81bdb3442f96aa02071c2faa01969cab3144bac9 /tests/New_Fail_Test.cpp
parent67cec969bd0023624828dfe7243fd2733a33af9d (diff)
downloadATCD-46183aaa21b734d70cdb939eb3aadc03bbea98fb.tar.gz
Add all g++ variants to the dont-do-this-really section. Add some more
explanation for why.
Diffstat (limited to 'tests/New_Fail_Test.cpp')
-rw-r--r--tests/New_Fail_Test.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/New_Fail_Test.cpp b/tests/New_Fail_Test.cpp
index 0fcbc4baef9..09237eb3829 100644
--- a/tests/New_Fail_Test.cpp
+++ b/tests/New_Fail_Test.cpp
@@ -12,6 +12,12 @@
// Checks to be sure that a failed ACE_NEW[_RETURN] doesn't end up throwing
// an exception up to the caller.
//
+// Note that this test doesn't get a real attempt on platforms which:
+// 1. Are known to throw exceptions when 'new' runs out of resources,
+// 2. Are built with exceptions disabled.
+// In these cases, the test puts a message in the log noting that a failed
+// new will throw an exception, and trust that the user accepts that risk.
+//
// = AUTHOR
// Steve Huston
//
@@ -63,8 +69,15 @@ main (int, ASYS_TCHAR *[])
ACE_START_TEST (ASYS_TEXT ("New_Fail_Test"));
int status = 0;
-#if defined (__SUNPRO_CC) && !defined (ACE_HAS_EXCEPTIONS)
+ // Some platforms are known to throw an exception on a failed 'new', but
+ // are customarily built without exception support to improve performance.
+ // These platforms are noted, and the test passes.
+ // For new ports, it is wise to let this test run. Depending on intended
+ // conditions, exceptions can be disabled when the port is complete.
+#if (defined (__SUNPRO_CC) || defined (__GNUG__)) && \
+ !defined (ACE_HAS_EXCEPTIONS)
ACE_DEBUG ((LM_NOTICE, "Out-of-memory will throw an unhandled exception\n"));
+ ACE_DEBUG ((LM_NOTICE, "Rebuild with exceptions=1 to prevent this, but it may impair performance.\n"));
#else
char *blocks[MAX_ALLOCS_IN_TEST];