]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/ext/mt_allocator/check_new.cc
testsuite_allocator.h (check_delete): New.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / ext / mt_allocator / check_new.cc
index 9e08821460234e17dca576ffda1bf773992d9aeb..e3a08f33adbe75f19aa520f6bf851aa000b521db 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <cstdlib>
 #include <ext/mt_allocator.h>
+#include <testsuite_hooks.h>
 #include <testsuite_allocator.h>
 
 using __gnu_cxx::__mt_alloc;
@@ -30,25 +31,26 @@ void*
 operator new(std::size_t n) throw(std::bad_alloc)
 {
   new_called = true;
-  requested = n;
   return std::malloc(n);
 }
 
 void
-operator delete(void *v) throw()
+operator delete(voidv) throw()
 {
   delete_called = true;
   return std::free(v);
 }
 
-bool test03() 
+void test01() 
 { 
+  // Uses new but delete only optionally.
+  bool test __attribute__((unused)) = true;
   typedef __mt_alloc<unsigned int> allocator_type;
-  return (__gnu_test::check_new<allocator_type, true>() == true); 
+  VERIFY( bool(__gnu_test::check_new<allocator_type, true>()) ); 
 }
 
 int main()
 {
-  return test03();
+  test01();
+  return 0;
 }
-