summaryrefslogtreecommitdiff
path: root/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/localization/locales/locale/locale.cons/copy.pass.cpp')
-rw-r--r--test/std/localization/locales/locale/locale.cons/copy.pass.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/test/std/localization/locales/locale/locale.cons/copy.pass.cpp b/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
index 0760cc46cdd8d..9e446e4408513 100644
--- a/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
+++ b/test/std/localization/locales/locale/locale.cons/copy.pass.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
// REQUIRES: locale.fr_FR.UTF-8
-// UNSUPPORTED: sanitizer-new-delete
// <locale>
@@ -18,22 +17,9 @@
#include <cassert>
#include <new>
+#include "count_new.hpp"
#include "platform_support.h" // locale name macros
-int new_called = 0;
-
-void* operator new(std::size_t s) throw(std::bad_alloc)
-{
- ++new_called;
- return std::malloc(s);
-}
-
-void operator delete(void* p) throw()
-{
- --new_called;
- std::free(p);
-}
-
void check(const std::locale& loc)
{
assert(std::has_facet<std::collate<char> >(loc));
@@ -78,5 +64,5 @@ int main()
check(loc);
check(loc2);
}
- assert(new_called == 0);
+ assert(globalMemCounter.checkOutstandingNewEq(0));
}