1 // 2011-10-28 Paolo Carlini <paolo.carlini@oracle.com>
3 // Copyright (C) 2011-2025 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
22 #include <testsuite_hooks.h>
29 VERIFY( ms0
.count(0) == 0 );
30 VERIFY( ms0
.count(1) == 0 );
33 VERIFY( ms0
.count(0) == 0 );
34 VERIFY( ms0
.count(1) == 1 );
37 VERIFY( ms0
.count(0) == 0 );
38 VERIFY( ms0
.count(1) == 2 );
41 VERIFY( ms0
.count(2) == 1 );
46 VERIFY( ms0
.count(3) == 3 );
49 VERIFY( ms0
.count(2) == 0 );
52 VERIFY( ms0
.count(0) == 0 );
54 multiset
<int> ms1(ms0
);
55 VERIFY( ms1
.count(0) == 0 );
56 VERIFY( ms1
.count(1) == 2 );
57 VERIFY( ms1
.count(2) == 0 );
58 VERIFY( ms1
.count(3) == 3 );
61 VERIFY( ms0
.count(0) == 0 );
62 VERIFY( ms0
.count(1) == 0 );
63 VERIFY( ms0
.count(2) == 0 );
64 VERIFY( ms0
.count(3) == 0 );
71 VERIFY( ms1
.count(4) == 1 );
72 VERIFY( ms1
.count(5) == 4 );
75 VERIFY( ms1
.count(1) == 0 );
77 ms1
.erase(ms1
.find(5));
78 VERIFY( ms1
.count(5) == 3 );
82 VERIFY( ms1
.count(1) == 2 );
85 VERIFY( ms1
.count(5) == 0 );
87 ms1
.erase(ms1
.find(4));
88 VERIFY( ms1
.count(4) == 0 );
91 VERIFY( ms1
.count(0) == 0 );
92 VERIFY( ms1
.count(1) == 0 );
93 VERIFY( ms1
.count(2) == 0 );
94 VERIFY( ms1
.count(3) == 0 );
95 VERIFY( ms1
.count(4) == 0 );
96 VERIFY( ms1
.count(5) == 0 );