2 // Testing allocator for the C++ library testsuite.
4 // Copyright (C) 2002-2017 Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
23 #include <testsuite_allocator.h>
27 typedef tracker_allocator_counter counter_type
;
29 counter_type::size_type
30 counter_type::allocationCount_
= 0;
32 counter_type::size_type
33 counter_type::deallocationCount_
= 0;
35 int counter_type::constructCount_
= 0;
36 int counter_type::destructCount_
= 0;
39 check_construct_destroy(const char* tag
, int expected_c
, int expected_d
)
42 if (counter_type::get_construct_count() != expected_c
43 || counter_type::get_destruct_count() != expected_d
)
45 std::cerr
<< tag
<< ": "
46 << " construct = " << counter_type::get_construct_count()
47 << " (should be " << expected_c
<< "),"
48 << " destroy = " << counter_type::get_destruct_count()
49 << " (should be " << expected_d
<< ")"
55 } // namespace __cxx_test