summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ACE/ace/Numeric_Limits.h4
-rw-r--r--ACE/tests/New_Fail_Test.cpp9
2 files changed, 7 insertions, 6 deletions
diff --git a/ACE/ace/Numeric_Limits.h b/ACE/ace/Numeric_Limits.h
index 9b6f05cad30..bcb140aa154 100644
--- a/ACE/ace/Numeric_Limits.h
+++ b/ACE/ace/Numeric_Limits.h
@@ -60,8 +60,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template <typename T>
struct ACE_Numeric_Limits
{
- static constexpr T min () { return std::numeric_limits<T>::min (); }
- static constexpr T max () { return std::numeric_limits<T>::max (); }
+ static const T min () { return std::numeric_limits<T>::min (); }
+ static const T max () { return std::numeric_limits<T>::max (); }
};
ACE_END_VERSIONED_NAMESPACE_DECL
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)