Skip to content

Commit 9f931f5

Browse files
Remove assert(test());
1 parent 2e4f30b commit 9f931f5

File tree

78 files changed

+2218
-2218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2218
-2218
lines changed

libcxx/test/std/containers/associative/map/compare.pass.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ TEST_CONSTEXPR_CXX26 bool test() {
3737
m_contains[Key(0)] = 42;
3838

3939
Iter it = m_empty.find(Key(0));
40-
assert(it == m_empty.end());
40+
it == m_empty.end();
4141
it = m_contains.find(Key(0));
42-
assert(it != m_contains.end());
42+
it != m_contains.end();
4343
}
4444
{
4545
MapT map;
4646
IterBool result = map.insert(std::make_pair(Key(0), 42));
47-
assert(result.second);
48-
assert(result.first->second == 42);
47+
result.second;
48+
result.first->second == 42;
4949
IterBool result2 = map.insert(std::make_pair(Key(0), 43));
50-
assert(!result2.second);
51-
assert(map[Key(0)] == 42);
50+
!result2.second;
51+
map[Key(0)] == 42;
5252
}
5353
return true;
5454
}
5555

5656
int main(int, char**) {
57-
assert(test());
57+
test();
5858
#if TEST_STD_VER >= 26
5959
static_assert(test());
6060
#endif

libcxx/test/std/containers/associative/map/get_allocator.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ TEST_CONSTEXPR_CXX26 bool test() {
2424
{
2525
std::allocator<ValueType> alloc;
2626
const std::map<int, std::string> m(alloc);
27-
assert(m.get_allocator() == alloc);
27+
m.get_allocator() == alloc;
2828
}
2929
{
3030
other_allocator<ValueType> alloc(1);
3131
const std::map<int, std::string, std::less<int>, other_allocator<ValueType> > m(alloc);
32-
assert(m.get_allocator() == alloc);
32+
m.get_allocator() == alloc;
3333
}
3434
return true;
3535
}
3636

3737
int main(int, char**) {
38-
assert(test());
38+
test();
3939
#if TEST_STD_VER >= 26
4040
static_assert(test());
4141
#endif

libcxx/test/std/containers/associative/map/incomplete_type.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ TEST_CONSTEXPR_CXX26 bool test() {
3838
}
3939

4040
int main(int, char**) {
41-
assert(test());
41+
test();
4242
#if TEST_STD_VER >= 26
4343
static_assert(test());
4444
#endif

libcxx/test/std/containers/associative/map/map.access/at.pass.cpp

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,28 @@ TEST_CONSTEXPR_CXX26 bool test() {
3333
V(8, 8.5),
3434
};
3535
std::map<int, double> m(ar, ar + sizeof(ar) / sizeof(ar[0]));
36-
assert(m.size() == 7);
37-
assert(m.at(1) == 1.5);
36+
m.size() == 7;
37+
m.at(1) == 1.5;
3838
m.at(1) = -1.5;
39-
assert(m.at(1) == -1.5);
40-
assert(m.at(2) == 2.5);
41-
assert(m.at(3) == 3.5);
42-
assert(m.at(4) == 4.5);
43-
assert(m.at(5) == 5.5);
39+
m.at(1) == -1.5;
40+
m.at(2) == 2.5;
41+
m.at(3) == 3.5;
42+
m.at(4) == 4.5;
43+
m.at(5) == 5.5;
4444
#ifndef TEST_HAS_NO_EXCEPTIONS
4545

4646
// throwing is not allowed during constant evaluation
4747
if (!TEST_IS_CONSTANT_EVALUATED)
4848
try {
4949
TEST_IGNORE_NODISCARD m.at(6);
50-
assert(false);
50+
false;
5151
} catch (std::out_of_range&) {
5252
}
5353

5454
#endif
55-
assert(m.at(7) == 7.5);
56-
assert(m.at(8) == 8.5);
57-
assert(m.size() == 7);
55+
m.at(7) == 7.5;
56+
m.at(8) == 8.5;
57+
m.size() == 7;
5858
}
5959
{
6060
typedef std::pair<const int, double> V;
@@ -68,25 +68,25 @@ TEST_CONSTEXPR_CXX26 bool test() {
6868
V(8, 8.5),
6969
};
7070
const std::map<int, double> m(ar, ar + sizeof(ar) / sizeof(ar[0]));
71-
assert(m.size() == 7);
72-
assert(m.at(1) == 1.5);
73-
assert(m.at(2) == 2.5);
74-
assert(m.at(3) == 3.5);
75-
assert(m.at(4) == 4.5);
76-
assert(m.at(5) == 5.5);
71+
m.size() == 7;
72+
m.at(1) == 1.5;
73+
m.at(2) == 2.5;
74+
m.at(3) == 3.5;
75+
m.at(4) == 4.5;
76+
m.at(5) == 5.5;
7777
#ifndef TEST_HAS_NO_EXCEPTIONS
7878
// throwing is not allowed during constant evaluation
7979
if (!TEST_IS_CONSTANT_EVALUATED)
8080
try {
8181
TEST_IGNORE_NODISCARD m.at(6);
82-
assert(false);
82+
false;
8383
} catch (std::out_of_range&) {
8484
}
8585
#endif
8686

87-
assert(m.at(7) == 7.5);
88-
assert(m.at(8) == 8.5);
89-
assert(m.size() == 7);
87+
m.at(7) == 7.5;
88+
m.at(8) == 8.5;
89+
m.size() == 7;
9090
}
9191
#if TEST_STD_VER >= 11
9292
{
@@ -101,27 +101,27 @@ TEST_CONSTEXPR_CXX26 bool test() {
101101
V(8, 8.5),
102102
};
103103
std::map<int, double, std::less<int>, min_allocator<V>> m(ar, ar + sizeof(ar) / sizeof(ar[0]));
104-
assert(m.size() == 7);
105-
assert(m.at(1) == 1.5);
104+
m.size() == 7;
105+
m.at(1) == 1.5;
106106
m.at(1) = -1.5;
107-
assert(m.at(1) == -1.5);
108-
assert(m.at(2) == 2.5);
109-
assert(m.at(3) == 3.5);
110-
assert(m.at(4) == 4.5);
111-
assert(m.at(5) == 5.5);
107+
m.at(1) == -1.5;
108+
m.at(2) == 2.5;
109+
m.at(3) == 3.5;
110+
m.at(4) == 4.5;
111+
m.at(5) == 5.5;
112112
# ifndef TEST_HAS_NO_EXCEPTIONS
113113

114114
// throwing is not allowed during constant evaluation
115115
if (!TEST_IS_CONSTANT_EVALUATED)
116116
try {
117117
TEST_IGNORE_NODISCARD m.at(6);
118-
assert(false);
118+
false;
119119
} catch (std::out_of_range&) {
120120
}
121121
# endif
122-
assert(m.at(7) == 7.5);
123-
assert(m.at(8) == 8.5);
124-
assert(m.size() == 7);
122+
m.at(7) == 7.5;
123+
m.at(8) == 8.5;
124+
m.size() == 7;
125125
}
126126
{
127127
typedef std::pair<const int, double> V;
@@ -135,32 +135,32 @@ TEST_CONSTEXPR_CXX26 bool test() {
135135
V(8, 8.5),
136136
};
137137
const std::map<int, double, std::less<int>, min_allocator<V>> m(ar, ar + sizeof(ar) / sizeof(ar[0]));
138-
assert(m.size() == 7);
139-
assert(m.at(1) == 1.5);
140-
assert(m.at(2) == 2.5);
141-
assert(m.at(3) == 3.5);
142-
assert(m.at(4) == 4.5);
143-
assert(m.at(5) == 5.5);
138+
m.size() == 7;
139+
m.at(1) == 1.5;
140+
m.at(2) == 2.5;
141+
m.at(3) == 3.5;
142+
m.at(4) == 4.5;
143+
m.at(5) == 5.5;
144144
# ifndef TEST_HAS_NO_EXCEPTIONS
145145
// throwing is not allowed during constant evaluation
146146
if (!TEST_IS_CONSTANT_EVALUATED)
147147
try {
148148
TEST_IGNORE_NODISCARD m.at(6);
149-
assert(false);
149+
false;
150150
} catch (std::out_of_range&) {
151151
}
152152

153153
# endif
154-
assert(m.at(7) == 7.5);
155-
assert(m.at(8) == 8.5);
156-
assert(m.size() == 7);
154+
m.at(7) == 7.5;
155+
m.at(8) == 8.5;
156+
m.size() == 7;
157157
}
158158
#endif
159159
return true;
160160
}
161161

162162
int main(int, char**) {
163-
assert(test());
163+
test();
164164
#if TEST_STD_VER >= 26
165165
static_assert(test());
166166
#endif

libcxx/test/std/containers/associative/map/map.access/empty.pass.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,28 @@ TEST_CONSTEXPR_CXX26 bool test() {
2222
{
2323
typedef std::map<int, double> M;
2424
M m;
25-
assert(m.empty());
25+
m.empty();
2626
m.insert(M::value_type(1, 1.5));
27-
assert(!m.empty());
27+
!m.empty();
2828
m.clear();
29-
assert(m.empty());
29+
m.empty();
3030
}
3131
#if TEST_STD_VER >= 11
3232
{
3333
typedef std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> M;
3434
M m;
35-
assert(m.empty());
35+
m.empty();
3636
m.insert(M::value_type(1, 1.5));
37-
assert(!m.empty());
37+
!m.empty();
3838
m.clear();
39-
assert(m.empty());
39+
m.empty();
4040
}
4141
#endif
4242
return true;
4343
}
4444

4545
int main(int, char**) {
46-
assert(test());
46+
test();
4747
#if TEST_STD_VER >= 26
4848
static_assert(test());
4949
#endif

libcxx/test/std/containers/associative/map/map.access/index_key.pass.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ TEST_CONSTEXPR_CXX26 bool test() {
3636
V(8, 8.5),
3737
};
3838
std::map<int, double> m(ar, ar + sizeof(ar) / sizeof(ar[0]));
39-
assert(m.size() == 7);
40-
assert(m[1] == 1.5);
41-
assert(m.size() == 7);
39+
m.size() == 7;
40+
m[1] == 1.5;
41+
m.size() == 7;
4242
m[1] = -1.5;
43-
assert(m[1] == -1.5);
44-
assert(m.size() == 7);
45-
assert(m[6] == 0);
46-
assert(m.size() == 8);
43+
m[1] == -1.5;
44+
m.size() == 7;
45+
m[6] == 0;
46+
m.size() == 8;
4747
m[6] = 6.5;
48-
assert(m[6] == 6.5);
49-
assert(m.size() == 8);
48+
m[6] == 6.5;
49+
m.size() == 8;
5050
}
5151
#if TEST_STD_VER >= 11
5252
{
@@ -61,18 +61,18 @@ TEST_CONSTEXPR_CXX26 bool test() {
6161
V(8, 8.5),
6262
};
6363
std::map<int, double, std::less<int>, min_allocator<V>> m(ar, ar + sizeof(ar) / sizeof(ar[0]));
64-
assert(m.size() == 7);
65-
assert(m[1] == 1.5);
66-
assert(m.size() == 7);
64+
m.size() == 7;
65+
m[1] == 1.5;
66+
m.size() == 7;
6767
const int i = 1;
6868
m[i] = -1.5;
69-
assert(m[1] == -1.5);
70-
assert(m.size() == 7);
71-
assert(m[6] == 0);
72-
assert(m.size() == 8);
69+
m[1] == -1.5;
70+
m.size() == 7;
71+
m[6] == 0;
72+
m.size() == 8;
7373
m[6] = 6.5;
74-
assert(m[6] == 6.5);
75-
assert(m.size() == 8);
74+
m[6] == 6.5;
75+
m.size() == 8;
7676
}
7777
# ifndef TEST_IS_CONSTANT_EVALUATED
7878
// static can't be constexpr
@@ -89,23 +89,23 @@ TEST_CONSTEXPR_CXX26 bool test() {
8989
const Key k(1);
9090
cc->expect<std::piecewise_construct_t const&, std::tuple<Key const&>&&, std::tuple<>&&>();
9191
MappedType& mref = c[k];
92-
assert(!cc->unchecked());
92+
!cc->unchecked();
9393
{
9494
DisableAllocationGuard g;
9595
MappedType& mref2 = c[k];
96-
assert(&mref == &mref2);
96+
&mref == &mref2;
9797
}
9898
}
9999
{
100100
Container c;
101101
Key k(1);
102102
cc->expect<std::piecewise_construct_t const&, std::tuple<Key const&>&&, std::tuple<>&&>();
103103
MappedType& mref = c[k];
104-
assert(!cc->unchecked());
104+
!cc->unchecked();
105105
{
106106
DisableAllocationGuard g;
107107
MappedType& mref2 = c[k];
108-
assert(&mref == &mref2);
108+
&mref == &mref2;
109109
}
110110
}
111111
}
@@ -125,24 +125,24 @@ TEST_CONSTEXPR_CXX26 bool test() {
125125
};
126126
std::map<int, double, std::less<>> m(ar, ar + sizeof(ar) / sizeof(ar[0]));
127127

128-
assert(m.size() == 7);
129-
assert(m[1] == 1.5);
130-
assert(m.size() == 7);
128+
m.size() == 7;
129+
m[1] == 1.5;
130+
m.size() == 7;
131131
m[1] = -1.5;
132-
assert(m[1] == -1.5);
133-
assert(m.size() == 7);
134-
assert(m[6] == 0);
135-
assert(m.size() == 8);
132+
m[1] == -1.5;
133+
m.size() == 7;
134+
m[6] == 0;
135+
m.size() == 8;
136136
m[6] = 6.5;
137-
assert(m[6] == 6.5);
138-
assert(m.size() == 8);
137+
m[6] == 6.5;
138+
m.size() == 8;
139139
}
140140
#endif
141141
return true;
142142
}
143143

144144
int main(int, char**) {
145-
assert(test());
145+
test();
146146
#if TEST_STD_VER >= 26
147147
static_assert(test());
148148
#endif

0 commit comments

Comments
 (0)