summaryrefslogtreecommitdiff
path: root/ACE/tests
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2021-06-07 21:22:22 +0200
committerGitHub <noreply@github.com>2021-06-07 21:22:22 +0200
commit072c0939cc2a824ced1fb3ab7091b74c3bb092c3 (patch)
tree434d62446c8d490c0309774d510b39e9c4150a81 /ACE/tests
parent6f6f7ea0c8fcde679ef21a59a4686043b02d3057 (diff)
parentd8971212c4f9e3ddef1965d93e55a9814f0161a4 (diff)
downloadATCD-072c0939cc2a824ced1fb3ab7091b74c3bb092c3.tar.gz
Merge branch 'master' into jwi-ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB
Diffstat (limited to 'ACE/tests')
-rw-r--r--ACE/tests/DLL_Test_Impl.cpp9
-rw-r--r--ACE/tests/DLL_Test_Impl.h7
-rw-r--r--ACE/tests/Dynamic_Test.cpp16
-rw-r--r--ACE/tests/New_Fail_Test.cpp5
4 files changed, 11 insertions, 26 deletions
diff --git a/ACE/tests/DLL_Test_Impl.cpp b/ACE/tests/DLL_Test_Impl.cpp
index 06b093a852d..8457a82623f 100644
--- a/ACE/tests/DLL_Test_Impl.cpp
+++ b/ACE/tests/DLL_Test_Impl.cpp
@@ -52,24 +52,21 @@ Hello_Impl::operator new (size_t bytes)
return ::new char[bytes];
}
-#if defined (ACE_HAS_NEW_NOTHROW)
- /// Overloaded new operator, nothrow_t variant.
+/// Overloaded new operator, nothrow_t variant.
void *
-Hello_Impl::operator new (size_t bytes, const ACE_nothrow_t &nt)
+Hello_Impl::operator new (size_t bytes, const std::nothrow_t &nt)
{
ACE_DEBUG ((LM_INFO, "Hello_Impl::new\n"));
return ::new (nt) char[bytes];
}
void
-Hello_Impl::operator delete (void *ptr, const ACE_nothrow_t&) throw ()
+Hello_Impl::operator delete (void *ptr, const std::nothrow_t&) throw ()
{
ACE_DEBUG ((LM_INFO, "Hello_Impl::delete\n"));
::delete [] static_cast<char *> (ptr);
}
-#endif /* ACE_HAS_NEW_NOTHROW */
-
void
Hello_Impl::operator delete (void *ptr)
{
diff --git a/ACE/tests/DLL_Test_Impl.h b/ACE/tests/DLL_Test_Impl.h
index 0ca5c5323d0..97db4904e42 100644
--- a/ACE/tests/DLL_Test_Impl.h
+++ b/ACE/tests/DLL_Test_Impl.h
@@ -50,14 +50,11 @@ public:
// DLL/SO.
void *operator new (size_t bytes);
-#if defined (ACE_HAS_NEW_NOTHROW)
/// Overloaded new operator, nothrow_t variant.
- void *operator new (size_t bytes, const ACE_nothrow_t &nt);
- void operator delete (void *p, const ACE_nothrow_t&) throw ();
-#endif /* ACE_HAS_NEW_NOTHROW */
+ void *operator new (size_t bytes, const std::nothrow_t &nt);
+ void operator delete (void *p, const std::nothrow_t&) throw ();
void operator delete (void *ptr);
-
};
#endif /* ACE_TESTS_DLL_TEST_IMPL_H */
diff --git a/ACE/tests/Dynamic_Test.cpp b/ACE/tests/Dynamic_Test.cpp
index 0ffc523544b..958ac6fa10e 100644
--- a/ACE/tests/Dynamic_Test.cpp
+++ b/ACE/tests/Dynamic_Test.cpp
@@ -24,11 +24,8 @@ public:
void *operator new (size_t n);
-#if defined (ACE_HAS_NEW_NOTHROW)
- void *operator new (size_t n, const ACE_nothrow_t&) throw();
- void operator delete (void *p, const ACE_nothrow_t&) throw ();
-#endif
-
+ void *operator new (size_t n, const std::nothrow_t&) throw();
+ void operator delete (void *p, const std::nothrow_t&) throw ();
void * operator new (size_t n, void *p);
void operator delete (void *);
@@ -63,9 +60,8 @@ A::operator new (size_t n)
}
}
-#if defined (ACE_HAS_NEW_NOTHROW)
void*
-A::operator new (size_t n, const ACE_nothrow_t&) throw()
+A::operator new (size_t n, const std::nothrow_t&) throw()
{
ACE_Dynamic *const dynamic_instance = ACE_Dynamic::instance ();
@@ -84,18 +80,16 @@ A::operator new (size_t n, const ACE_nothrow_t&) throw()
// storage, depending on config flags).
dynamic_instance->set ();
- return ::new(ACE_nothrow) char[n];
+ return ::new(std::nothrow) char[n];
}
}
void
-A::operator delete (void *p, const ACE_nothrow_t&) throw()
+A::operator delete (void *p, const std::nothrow_t&) throw()
{
::delete [] static_cast <char *> (p);
}
-#endif /* ACE_HAS_NEW_NOTHROW */
-
void
A::operator delete (void *obj)
{
diff --git a/ACE/tests/New_Fail_Test.cpp b/ACE/tests/New_Fail_Test.cpp
index 10957e455fe..a63539c77d1 100644
--- a/ACE/tests/New_Fail_Test.cpp
+++ b/ACE/tests/New_Fail_Test.cpp
@@ -176,10 +176,7 @@ run_main (int, ACE_TCHAR *[])
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("Caught exception during test; ")
- ACE_TEXT ("ACE_bad_alloc not defined correctly, or\n")));
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("ACE_NEW_THROWS_EXCEPTIONS is not #defined ")
- ACE_TEXT ("(and should be).\n")));
+ ACE_TEXT ("ACE_bad_alloc not defined correctly\n")));
// Mark test failure
status = 1;
}