line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include "test.h" |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
#include |
4
|
|
|
|
|
|
|
#include |
5
|
|
|
|
|
|
|
#include |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
using namespace panda; |
8
|
|
|
|
|
|
|
using namespace test; |
9
|
|
|
|
|
|
|
using test::Allocator; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
using String = panda::basic_string, Allocator>; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
static const string_view key1 = "key1key1key1key1key1key1key1key1key1key1key1key1key1key1key1key1key1key1key1key1"; |
14
|
|
|
|
|
|
|
static const string_view key2 = "key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2key2"; |
15
|
18
|
|
|
|
|
|
static const string val1 = "1111111111111111111111111111111111111111"; |
16
|
18
|
|
|
|
|
|
static const string val2 = "22222222222222222222222222222222222222222222222222"; |
17
|
18
|
|
|
|
|
|
static const string val3 = "333333333333333333333333333333333333333333333333333333333333"; |
18
|
|
|
|
|
|
|
static const string_view nokey = "nokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokeynokey"; |
19
|
18
|
|
|
|
|
|
static const string skey1 = string(key1); |
20
|
18
|
|
|
|
|
|
static const string skey2 = string(key2); |
21
|
|
|
|
|
|
|
|
22
|
25
|
|
|
|
|
|
TEST_CASE("string_map", "[string_containers]") { |
23
|
14
|
|
|
|
|
|
string_map c; |
24
|
7
|
50
|
|
|
|
|
c.emplace(skey1, val1); |
25
|
7
|
50
|
|
|
|
|
c.emplace(skey2, val2); |
26
|
7
|
|
|
|
|
|
get_allocs(); |
27
|
|
|
|
|
|
|
|
28
|
8
|
50
|
|
|
|
|
SECTION("find") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
29
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1)->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
30
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key2)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
31
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
8
|
50
|
|
|
|
|
SECTION("at") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
35
|
1
|
50
|
|
|
|
|
REQUIRE(c.at(key1) == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
36
|
1
|
50
|
|
|
|
|
REQUIRE(c.at(key2) == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
37
|
1
|
50
|
|
|
|
|
REQUIRE_THROWS(c.at(nokey)); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
8
|
50
|
|
|
|
|
SECTION("count") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
41
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key1) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
42
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key2) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
43
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
8
|
50
|
|
|
|
|
SECTION("equal_range") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
47
|
1
|
50
|
|
|
|
|
auto p = c.equal_range(key1); |
48
|
1
|
|
|
|
|
|
auto it = p.first; |
49
|
1
|
50
|
|
|
|
|
REQUIRE((it++)->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
50
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
1
|
50
|
|
|
|
|
p = c.equal_range(key2); |
53
|
1
|
|
|
|
|
|
it = p.first; |
54
|
1
|
50
|
|
|
|
|
REQUIRE((it++)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
55
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
1
|
50
|
|
|
|
|
p = c.equal_range(nokey); |
58
|
1
|
50
|
|
|
|
|
REQUIRE(p.first == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
8
|
50
|
|
|
|
|
SECTION("lower_bound") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
62
|
1
|
50
|
|
|
|
|
REQUIRE(c.lower_bound("0")->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
63
|
1
|
50
|
|
|
|
|
REQUIRE(c.lower_bound(key1)->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
64
|
1
|
50
|
|
|
|
|
REQUIRE(c.lower_bound(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
8
|
50
|
|
|
|
|
SECTION("upper_bound") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
68
|
1
|
50
|
|
|
|
|
REQUIRE(c.upper_bound("0")->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
69
|
1
|
50
|
|
|
|
|
REQUIRE(c.upper_bound(key1)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
70
|
1
|
50
|
|
|
|
|
REQUIRE(c.upper_bound(key2) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
8
|
50
|
|
|
|
|
SECTION("erase") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
74
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
75
|
1
|
|
|
|
|
|
auto stat = get_allocs(); |
76
|
1
|
50
|
|
|
|
|
REQUIRE(stat.is_empty()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
77
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
78
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
79
|
1
|
50
|
|
|
|
|
REQUIRE(c.at(key2) == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
80
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
81
|
|
|
|
|
|
|
} |
82
|
7
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
24
|
|
|
|
|
|
TEST_CASE("string_multimap", "[string_containers]") { |
85
|
12
|
|
|
|
|
|
string_multimap c; |
86
|
6
|
50
|
|
|
|
|
c.emplace(skey1, val1); |
87
|
6
|
50
|
|
|
|
|
c.emplace(skey2, val2); |
88
|
6
|
50
|
|
|
|
|
c.emplace(skey1, val3); |
89
|
6
|
|
|
|
|
|
get_allocs(); |
90
|
|
|
|
|
|
|
|
91
|
7
|
50
|
|
|
|
|
SECTION("find") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
92
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1)->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
93
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key2)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
94
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
7
|
50
|
|
|
|
|
SECTION("count") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
98
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key1) == 2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
99
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key2) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
100
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
7
|
50
|
|
|
|
|
SECTION("equal_range") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
104
|
1
|
50
|
|
|
|
|
auto p = c.equal_range(key1); |
105
|
1
|
|
|
|
|
|
auto it = p.first; |
106
|
1
|
50
|
|
|
|
|
REQUIRE((it++)->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
107
|
1
|
50
|
|
|
|
|
REQUIRE((it++)->second == val3); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
108
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
1
|
50
|
|
|
|
|
p = c.equal_range(key2); |
111
|
1
|
|
|
|
|
|
it = p.first; |
112
|
1
|
50
|
|
|
|
|
REQUIRE((it++)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
113
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
114
|
|
|
|
|
|
|
|
115
|
1
|
50
|
|
|
|
|
p = c.equal_range(nokey); |
116
|
1
|
50
|
|
|
|
|
REQUIRE(p.first == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
7
|
50
|
|
|
|
|
SECTION("lower_bound") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
120
|
1
|
50
|
|
|
|
|
REQUIRE(c.lower_bound("0")->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
121
|
1
|
50
|
|
|
|
|
REQUIRE(c.lower_bound(key1)->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
122
|
1
|
50
|
|
|
|
|
REQUIRE(c.lower_bound(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
7
|
50
|
|
|
|
|
SECTION("upper_bound") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
126
|
1
|
50
|
|
|
|
|
REQUIRE(c.upper_bound("0")->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
127
|
1
|
50
|
|
|
|
|
REQUIRE(c.upper_bound(key1)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
128
|
1
|
50
|
|
|
|
|
REQUIRE(c.upper_bound(key2) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
7
|
50
|
|
|
|
|
SECTION("erase") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
132
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
133
|
1
|
|
|
|
|
|
auto stat = get_allocs(); |
134
|
1
|
50
|
|
|
|
|
REQUIRE(stat.is_empty()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
135
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
136
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
137
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key2)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
138
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
139
|
|
|
|
|
|
|
} |
140
|
6
|
|
|
|
|
|
} |
141
|
|
|
|
|
|
|
|
142
|
23
|
|
|
|
|
|
TEST_CASE("unordered_string_map", "[string_containers]") { |
143
|
10
|
|
|
|
|
|
unordered_string_map c; |
144
|
5
|
50
|
|
|
|
|
c.emplace(skey1, val1); |
145
|
5
|
50
|
|
|
|
|
c.emplace(skey2, val2); |
146
|
5
|
|
|
|
|
|
get_allocs(); |
147
|
|
|
|
|
|
|
|
148
|
6
|
50
|
|
|
|
|
SECTION("find") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
149
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1)->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
150
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key2)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
151
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
6
|
50
|
|
|
|
|
SECTION("at") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
155
|
1
|
50
|
|
|
|
|
REQUIRE(c.at(key1) == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
156
|
1
|
50
|
|
|
|
|
REQUIRE(c.at(key2) == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
157
|
1
|
50
|
|
|
|
|
REQUIRE_THROWS(c.at(nokey)); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
158
|
|
|
|
|
|
|
} |
159
|
|
|
|
|
|
|
|
160
|
6
|
50
|
|
|
|
|
SECTION("count") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
161
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key1) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
162
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key2) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
163
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
164
|
|
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
6
|
50
|
|
|
|
|
SECTION("equal_range") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
167
|
1
|
50
|
|
|
|
|
auto p = c.equal_range(key1); |
168
|
1
|
|
|
|
|
|
auto it = p.first; |
169
|
1
|
50
|
|
|
|
|
REQUIRE((it++)->second == val1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
170
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
171
|
|
|
|
|
|
|
|
172
|
1
|
50
|
|
|
|
|
p = c.equal_range(key2); |
173
|
1
|
|
|
|
|
|
it = p.first; |
174
|
1
|
50
|
|
|
|
|
REQUIRE((it++)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
175
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
176
|
|
|
|
|
|
|
|
177
|
1
|
50
|
|
|
|
|
p = c.equal_range(nokey); |
178
|
1
|
50
|
|
|
|
|
REQUIRE(p.first == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
6
|
50
|
|
|
|
|
SECTION("erase") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
182
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
183
|
1
|
|
|
|
|
|
auto stat = get_allocs(); |
184
|
1
|
50
|
|
|
|
|
REQUIRE(stat.is_empty()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
185
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
186
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
187
|
1
|
50
|
|
|
|
|
REQUIRE(c.at(key2) == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
188
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
189
|
|
|
|
|
|
|
} |
190
|
5
|
|
|
|
|
|
} |
191
|
|
|
|
|
|
|
|
192
|
22
|
|
|
|
|
|
TEST_CASE("unordered_string_multimap", "[string_containers]") { |
193
|
8
|
|
|
|
|
|
unordered_string_multimap c; |
194
|
4
|
50
|
|
|
|
|
c.emplace(skey1, val1); |
195
|
4
|
50
|
|
|
|
|
c.emplace(skey2, val2); |
196
|
4
|
50
|
|
|
|
|
c.emplace(skey1, val3); |
197
|
4
|
|
|
|
|
|
get_allocs(); |
198
|
|
|
|
|
|
|
|
199
|
5
|
50
|
|
|
|
|
SECTION("find") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
200
|
2
|
50
|
|
|
|
|
auto val = c.find(key1)->second; |
|
|
50
|
|
|
|
|
|
201
|
1
|
50
|
|
|
|
|
REQUIRE((val == val1 || val == val3)); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
202
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key2)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
203
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
5
|
50
|
|
|
|
|
SECTION("count") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
207
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key1) == 2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
208
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key2) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
209
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
210
|
|
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
|
212
|
5
|
50
|
|
|
|
|
SECTION("equal_range") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
213
|
1
|
50
|
|
|
|
|
auto p = c.equal_range(key1); |
214
|
1
|
|
|
|
|
|
auto it = p.first; |
215
|
2
|
50
|
|
|
|
|
auto v1 = (it++)->second; |
216
|
1
|
50
|
|
|
|
|
REQUIRE((v1 == val1 || v1 == val3)); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
217
|
2
|
50
|
|
|
|
|
auto v2 = (it++)->second; |
218
|
1
|
50
|
|
|
|
|
REQUIRE((v2 == val1 || v2 == val3)); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
219
|
1
|
50
|
|
|
|
|
REQUIRE(v2 != v1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
220
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
221
|
|
|
|
|
|
|
|
222
|
1
|
50
|
|
|
|
|
p = c.equal_range(key2); |
223
|
1
|
|
|
|
|
|
it = p.first; |
224
|
1
|
50
|
|
|
|
|
REQUIRE((it++)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
225
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
226
|
|
|
|
|
|
|
|
227
|
1
|
50
|
|
|
|
|
p = c.equal_range(nokey); |
228
|
1
|
50
|
|
|
|
|
REQUIRE(p.first == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
|
231
|
5
|
50
|
|
|
|
|
SECTION("erase") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
232
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
233
|
1
|
|
|
|
|
|
auto stat = get_allocs(); |
234
|
1
|
50
|
|
|
|
|
REQUIRE(stat.is_empty()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
235
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
236
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
237
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key2)->second == val2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
238
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
239
|
|
|
|
|
|
|
} |
240
|
4
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
|
242
|
24
|
|
|
|
|
|
TEST_CASE("string_set", "[string_containers]") { |
243
|
12
|
|
|
|
|
|
string_set c; |
244
|
6
|
50
|
|
|
|
|
c.emplace(skey1); |
245
|
6
|
50
|
|
|
|
|
c.emplace(skey2); |
246
|
6
|
|
|
|
|
|
get_allocs(); |
247
|
|
|
|
|
|
|
|
248
|
7
|
50
|
|
|
|
|
SECTION("find") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
249
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key1) == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
250
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key2) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
251
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
|
254
|
7
|
50
|
|
|
|
|
SECTION("count") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
255
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key1) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
256
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key2) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
257
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
258
|
|
|
|
|
|
|
} |
259
|
|
|
|
|
|
|
|
260
|
7
|
50
|
|
|
|
|
SECTION("equal_range") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
261
|
1
|
50
|
|
|
|
|
auto p = c.equal_range(key1); |
262
|
1
|
|
|
|
|
|
auto it = p.first; |
263
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
264
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
265
|
|
|
|
|
|
|
|
266
|
1
|
50
|
|
|
|
|
p = c.equal_range(key2); |
267
|
1
|
|
|
|
|
|
it = p.first; |
268
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
269
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
270
|
|
|
|
|
|
|
|
271
|
1
|
50
|
|
|
|
|
p = c.equal_range(nokey); |
272
|
1
|
50
|
|
|
|
|
REQUIRE(p.first == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
273
|
|
|
|
|
|
|
} |
274
|
|
|
|
|
|
|
|
275
|
7
|
50
|
|
|
|
|
SECTION("lower_bound") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
276
|
1
|
50
|
|
|
|
|
REQUIRE(*c.lower_bound("0") == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
277
|
1
|
50
|
|
|
|
|
REQUIRE(*c.lower_bound(key1) == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
278
|
1
|
50
|
|
|
|
|
REQUIRE(c.lower_bound(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
279
|
|
|
|
|
|
|
} |
280
|
|
|
|
|
|
|
|
281
|
7
|
50
|
|
|
|
|
SECTION("upper_bound") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
282
|
1
|
50
|
|
|
|
|
REQUIRE(*c.upper_bound("0") == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
283
|
1
|
50
|
|
|
|
|
REQUIRE(*c.upper_bound(key1) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
284
|
1
|
50
|
|
|
|
|
REQUIRE(c.upper_bound(key2) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
|
287
|
7
|
50
|
|
|
|
|
SECTION("erase") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
288
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
289
|
1
|
|
|
|
|
|
auto stat = get_allocs(); |
290
|
1
|
50
|
|
|
|
|
REQUIRE(stat.is_empty()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
291
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
292
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
293
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key2) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
294
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
295
|
|
|
|
|
|
|
} |
296
|
6
|
|
|
|
|
|
} |
297
|
|
|
|
|
|
|
|
298
|
24
|
|
|
|
|
|
TEST_CASE("string_multiset", "[string_containers]") { |
299
|
12
|
|
|
|
|
|
string_multiset c; |
300
|
6
|
50
|
|
|
|
|
c.emplace(skey1); |
301
|
6
|
50
|
|
|
|
|
c.emplace(skey2); |
302
|
6
|
50
|
|
|
|
|
c.emplace(skey1); |
303
|
6
|
|
|
|
|
|
get_allocs(); |
304
|
|
|
|
|
|
|
|
305
|
7
|
50
|
|
|
|
|
SECTION("find") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
306
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key1) == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
307
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key2) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
308
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
309
|
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
|
311
|
7
|
50
|
|
|
|
|
SECTION("count") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
312
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key1) == 2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
313
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key2) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
314
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
315
|
|
|
|
|
|
|
} |
316
|
|
|
|
|
|
|
|
317
|
7
|
50
|
|
|
|
|
SECTION("equal_range") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
318
|
1
|
50
|
|
|
|
|
auto p = c.equal_range(key1); |
319
|
1
|
|
|
|
|
|
auto it = p.first; |
320
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
321
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
322
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
323
|
|
|
|
|
|
|
|
324
|
1
|
50
|
|
|
|
|
p = c.equal_range(key2); |
325
|
1
|
|
|
|
|
|
it = p.first; |
326
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
327
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
328
|
|
|
|
|
|
|
|
329
|
1
|
50
|
|
|
|
|
p = c.equal_range(nokey); |
330
|
1
|
50
|
|
|
|
|
REQUIRE(p.first == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
331
|
|
|
|
|
|
|
} |
332
|
|
|
|
|
|
|
|
333
|
7
|
50
|
|
|
|
|
SECTION("lower_bound") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
334
|
1
|
50
|
|
|
|
|
REQUIRE(*c.lower_bound("0") == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
335
|
1
|
50
|
|
|
|
|
REQUIRE(*c.lower_bound(key1) == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
336
|
1
|
50
|
|
|
|
|
REQUIRE(c.lower_bound(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
337
|
|
|
|
|
|
|
} |
338
|
|
|
|
|
|
|
|
339
|
7
|
50
|
|
|
|
|
SECTION("upper_bound") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
340
|
1
|
50
|
|
|
|
|
REQUIRE(*c.upper_bound("0") == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
341
|
1
|
50
|
|
|
|
|
REQUIRE(*c.upper_bound(key1) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
342
|
1
|
50
|
|
|
|
|
REQUIRE(c.upper_bound(key2) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
343
|
|
|
|
|
|
|
} |
344
|
|
|
|
|
|
|
|
345
|
7
|
50
|
|
|
|
|
SECTION("erase") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
346
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
347
|
1
|
|
|
|
|
|
auto stat = get_allocs(); |
348
|
1
|
50
|
|
|
|
|
REQUIRE(stat.is_empty()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
349
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
350
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
351
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key2) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
352
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
353
|
|
|
|
|
|
|
} |
354
|
6
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
|
356
|
22
|
|
|
|
|
|
TEST_CASE("unordered_string_set", "[string_containers]") { |
357
|
8
|
|
|
|
|
|
unordered_string_set c; |
358
|
4
|
50
|
|
|
|
|
c.emplace(skey1); |
359
|
4
|
50
|
|
|
|
|
c.emplace(skey2); |
360
|
4
|
|
|
|
|
|
get_allocs(); |
361
|
|
|
|
|
|
|
|
362
|
5
|
50
|
|
|
|
|
SECTION("find") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
363
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key1) == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
364
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key2) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
365
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
366
|
|
|
|
|
|
|
} |
367
|
|
|
|
|
|
|
|
368
|
5
|
50
|
|
|
|
|
SECTION("count") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
369
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key1) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
370
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key2) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
371
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
372
|
|
|
|
|
|
|
} |
373
|
|
|
|
|
|
|
|
374
|
5
|
50
|
|
|
|
|
SECTION("equal_range") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
375
|
1
|
50
|
|
|
|
|
auto p = c.equal_range(key1); |
376
|
1
|
|
|
|
|
|
auto it = p.first; |
377
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
378
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
379
|
|
|
|
|
|
|
|
380
|
1
|
50
|
|
|
|
|
p = c.equal_range(key2); |
381
|
1
|
|
|
|
|
|
it = p.first; |
382
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
383
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
384
|
|
|
|
|
|
|
|
385
|
1
|
50
|
|
|
|
|
p = c.equal_range(nokey); |
386
|
1
|
50
|
|
|
|
|
REQUIRE(p.first == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
387
|
|
|
|
|
|
|
} |
388
|
|
|
|
|
|
|
|
389
|
5
|
50
|
|
|
|
|
SECTION("erase") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
390
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
391
|
1
|
|
|
|
|
|
auto stat = get_allocs(); |
392
|
1
|
50
|
|
|
|
|
REQUIRE(stat.is_empty()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
393
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
394
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
395
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key2) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
396
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
397
|
|
|
|
|
|
|
} |
398
|
4
|
|
|
|
|
|
} |
399
|
|
|
|
|
|
|
|
400
|
22
|
|
|
|
|
|
TEST_CASE("unordered_string_multiset", "[string_containers]") { |
401
|
8
|
|
|
|
|
|
unordered_string_multiset c; |
402
|
4
|
50
|
|
|
|
|
c.emplace(skey1); |
403
|
4
|
50
|
|
|
|
|
c.emplace(skey2); |
404
|
4
|
50
|
|
|
|
|
c.emplace(skey1); |
405
|
4
|
|
|
|
|
|
get_allocs(); |
406
|
|
|
|
|
|
|
|
407
|
5
|
50
|
|
|
|
|
SECTION("find") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
408
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key1) == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
409
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key2) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
410
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(nokey) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
411
|
|
|
|
|
|
|
} |
412
|
|
|
|
|
|
|
|
413
|
5
|
50
|
|
|
|
|
SECTION("count") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
414
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key1) == 2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
415
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(key2) == 1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
416
|
1
|
50
|
|
|
|
|
REQUIRE(c.count(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
417
|
|
|
|
|
|
|
} |
418
|
|
|
|
|
|
|
|
419
|
5
|
50
|
|
|
|
|
SECTION("equal_range") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
420
|
1
|
50
|
|
|
|
|
auto p = c.equal_range(key1); |
421
|
1
|
|
|
|
|
|
auto it = p.first; |
422
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
423
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key1); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
424
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
425
|
|
|
|
|
|
|
|
426
|
1
|
50
|
|
|
|
|
p = c.equal_range(key2); |
427
|
1
|
|
|
|
|
|
it = p.first; |
428
|
1
|
50
|
|
|
|
|
REQUIRE(*it++ == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
429
|
1
|
50
|
|
|
|
|
REQUIRE(it == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
430
|
|
|
|
|
|
|
|
431
|
1
|
50
|
|
|
|
|
p = c.equal_range(nokey); |
432
|
1
|
50
|
|
|
|
|
REQUIRE(p.first == p.second); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
433
|
|
|
|
|
|
|
} |
434
|
|
|
|
|
|
|
|
435
|
5
|
50
|
|
|
|
|
SECTION("erase") { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
436
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(nokey) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
437
|
1
|
|
|
|
|
|
auto stat = get_allocs(); |
438
|
1
|
50
|
|
|
|
|
REQUIRE(stat.is_empty()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
439
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
440
|
1
|
50
|
|
|
|
|
REQUIRE(c.find(key1) == c.end()); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
441
|
1
|
50
|
|
|
|
|
REQUIRE(*c.find(key2) == key2); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
442
|
1
|
50
|
|
|
|
|
REQUIRE(c.erase(key1) == 0); |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
443
|
|
|
|
|
|
|
} |
444
|
76
|
50
|
|
|
|
|
} |
|
|
50
|
|
|
|
|
|