summaryrefslogtreecommitdiff
path: root/ACE/tests/New_Fail_Test.cpp
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2021-03-09 15:40:07 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2021-03-09 15:40:07 +0100
commit492dcbc1f79531956403abb2313de416d847ce1b (patch)
tree73994992d7bbfab0dee59cf54350445d1f376133 /ACE/tests/New_Fail_Test.cpp
parent8db07b95476a40304b49e4d033ccbec76501fed4 (diff)
downloadATCD-492dcbc1f79531956403abb2313de416d847ce1b.tar.gz
Revert changes for the moment
* ACE/ace/Numeric_Limits.h: * ACE/tests/New_Fail_Test.cpp:
Diffstat (limited to 'ACE/tests/New_Fail_Test.cpp')
-rw-r--r--ACE/tests/New_Fail_Test.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/ACE/tests/New_Fail_Test.cpp b/ACE/tests/New_Fail_Test.cpp
index 4d1350fe712..10957e455fe 100644
--- a/ACE/tests/New_Fail_Test.cpp
+++ b/ACE/tests/New_Fail_Test.cpp
@@ -20,7 +20,7 @@
#include "ace/Log_Msg.h"
#include "ace/OS_Memory.h"
#include "ace/CORBA_macros.h"
-#include <stdint.h>
+#include "ace/Numeric_Limits.h"
// This test allocates all of the heap memory, forcing 'new' to fail
// because of a lack of memory. The ACE_NEW macros should prevent an
@@ -31,11 +31,12 @@
// wrong. The allocated memory is always freed to avoid masking a leak
// somewhere else in the test.
-// Most we can do, by a quarter
-static const size_t BIG_BLOCK = SIZE_MAX / 4;
+// Most we can do, by half. Using max alone gets "invalid allocation size"
+// messages on stdout on Windows.
+static const size_t BIG_BLOCK = ACE_Numeric_Limits<size_t>::max () / 2;
// Shouldn't take many "as much as possible" tries to get a failure.
-static constexpr int MAX_ALLOCS_IN_TEST = 20;
+static const int MAX_ALLOCS_IN_TEST = 2;
static void
try_ace_new (char **p)