summaryrefslogtreecommitdiff
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
parent8db07b95476a40304b49e4d033ccbec76501fed4 (diff)
downloadATCD-492dcbc1f79531956403abb2313de416d847ce1b.tar.gz
Revert changes for the moment
* ACE/ace/Numeric_Limits.h: * ACE/tests/New_Fail_Test.cpp:
-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)