Skip to content

Commit d0ec83a

Browse files
committed
Apply reviewer suggestions
1 parent 7c90e0e commit d0ec83a

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

libcxx/test/std/containers/sequences/vector.bool/assign_iter_iter.pass.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
// <vector>
1010

11-
// void assign(_InputIterator __first, _InputIterator __last);
12-
// void assign(_ForwardIterator __first, _ForwardIterator __last);
11+
// template <class InputIt>
12+
// constexpr void assign(InputIt first, InputIt last);
1313

1414
#include <vector>
1515
#include <cassert>
@@ -26,19 +26,19 @@ TEST_CONSTEXPR_CXX20 bool tests() {
2626
v.assign(It(in.begin()), It(in.end()));
2727
assert(v == in);
2828
}
29-
{ // No reallocation: fit wintin current size
30-
bool in[] = {false, true, false, true, true};
31-
TEST_CONSTEXPR std::size_t N = sizeof(in) / sizeof(in[0]);
29+
{ // No reallocation: fit within current size
30+
bool in[] = {false, true, false, true, true};
31+
std::size_t N = sizeof(in) / sizeof(in[0]);
3232
std::vector<bool> v(2 * N, false);
3333
using It = forward_iterator<bool*>;
3434
v.assign(It(in), It(in + N));
3535
assert(v.size() == N);
3636
for (std::size_t i = 0; i < N; ++i)
3737
assert(v[i] == in[i]);
3838
}
39-
{ // No reallocation: fit wintin spare space
40-
bool in[] = {false, true, false, true, true};
41-
TEST_CONSTEXPR std::size_t N = sizeof(in) / sizeof(in[0]);
39+
{ // No reallocation: fit within spare space
40+
bool in[] = {false, true, false, true, true};
41+
std::size_t N = sizeof(in) / sizeof(in[0]);
4242
std::vector<bool> v(N / 2, false);
4343
v.reserve(N * 2);
4444
using It = forward_iterator<bool*>;
@@ -58,19 +58,19 @@ TEST_CONSTEXPR_CXX20 bool tests() {
5858
v.assign(It(in.begin()), It(in.end()));
5959
assert(v == in);
6060
}
61-
{ // No reallocation: fit wintin current size
62-
bool in[] = {false, true, false, true, true};
63-
TEST_CONSTEXPR std::size_t N = sizeof(in) / sizeof(in[0]);
61+
{ // No reallocation: fit within current size
62+
bool in[] = {false, true, false, true, true};
63+
std::size_t N = sizeof(in) / sizeof(in[0]);
6464
std::vector<bool> v(2 * N, false);
6565
using It = cpp17_input_iterator<bool*>;
6666
v.assign(It(in), It(in + N));
6767
assert(v.size() == N);
6868
for (std::size_t i = 0; i < N; ++i)
6969
assert(v[i] == in[i]);
7070
}
71-
{ // No reallocation: fit wintin spare space
72-
bool in[] = {false, true, false, true, true};
73-
TEST_CONSTEXPR std::size_t N = sizeof(in) / sizeof(in[0]);
71+
{ // No reallocation: fit within spare space
72+
bool in[] = {false, true, false, true, true};
73+
std::size_t N = sizeof(in) / sizeof(in[0]);
7474
std::vector<bool> v(N / 2, false);
7575
v.reserve(N * 2);
7676
using It = cpp17_input_iterator<bool*>;

libcxx/test/std/containers/sequences/vector.bool/assign_size_value.pass.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// <vector>
1010

11-
// void assign(size_type __n, const value_type& __x);
11+
// void assign(size_type n, const value_type& x);
1212

1313
#include <vector>
1414
#include <cassert>
@@ -18,24 +18,24 @@
1818
TEST_CONSTEXPR_CXX20 bool tests() {
1919
{ // Test with various cases where assign may or may not trigger reallocations
2020
{ // Reallocation happens
21-
TEST_CONSTEXPR std::size_t N = 128;
21+
std::size_t N = 128;
2222
std::vector<bool> v(5, false);
2323
assert(v.capacity() < N);
2424
v.assign(N, true);
2525
assert(v.size() == N);
2626
for (std::size_t i = 0; i < N; ++i)
2727
assert(v[i] == true);
2828
}
29-
{ // No reallocation: fit wintin current size
30-
TEST_CONSTEXPR std::size_t N = 5;
29+
{ // No reallocation: fit within current size
30+
std::size_t N = 5;
3131
std::vector<bool> v(2 * N, false);
3232
v.assign(N, true);
3333
assert(v.size() == N);
3434
for (std::size_t i = 0; i < N; ++i)
3535
assert(v[i] == true);
3636
}
37-
{ // No reallocation: fit wintin spare space
38-
TEST_CONSTEXPR std::size_t N = 5;
37+
{ // No reallocation: fit within spare space
38+
std::size_t N = 5;
3939
std::vector<bool> v(N / 2, false);
4040
v.reserve(N * 2);
4141
v.assign(N, true);

0 commit comments

Comments
 (0)