#include <cstdlib>
#include <ext/mt_allocator.h>
+#include <testsuite_hooks.h>
#include <testsuite_allocator.h>
using __gnu_cxx::__mt_alloc;
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(void* v) 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;
}
-