Skip to content

Commit 63a14a3

Browse files
committed
Updated: libcxx/test/std/input.output/span.streams/ospanstream/ospanstream.cons/assign.move.pass.cpp
1 parent bb9af9a commit 63a14a3

File tree

1 file changed

+21
-28
lines changed

1 file changed

+21
-28
lines changed

libcxx/test/std/input.output/span.streams/ospanstream/ospanstream.cons/ctor.move.pass.cpp

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void test() {
3737
assert(!sp.empty());
3838
assert(sp.size() == 4);
3939

40-
// Mode: default (`in` | `out`)
40+
// Mode: default (`out`)
4141
{
4242
SpStream rhsSpSt{sp};
4343
assert(rhsSpSt.span().data() == arr);
@@ -54,23 +54,6 @@ void test() {
5454
assert(rhsSpSt.span().empty());
5555
assert(rhsSpSt.span().size() == 0);
5656
}
57-
// Mode: `in`
58-
{
59-
SpStream rhsSpSt{sp, std::ios_base::in};
60-
assert(rhsSpSt.span().data() == arr);
61-
assert(rhsSpSt.span().empty());
62-
assert(rhsSpSt.span().size() == 0);
63-
64-
SpStream spSt{std::move(rhsSpSt)};
65-
assert(spSt.span().data() == arr);
66-
assert(spSt.span().empty());
67-
assert(spSt.span().size() == 0);
68-
69-
// Test after move
70-
assert(rhsSpSt.span().data() == arr);
71-
assert(rhsSpSt.span().empty());
72-
assert(rhsSpSt.span().size() == 0);
73-
}
7457
// Mode `out`
7558
{
7659
SpStream rhsSpSt{sp, std::ios_base::out};
@@ -88,26 +71,26 @@ void test() {
8871
assert(rhsSpSt.span().empty());
8972
assert(rhsSpSt.span().size() == 0);
9073
}
91-
// Mode: multiple
74+
// Mode `ate`
9275
{
93-
SpStream rhsSpSt{sp, std::ios_base::in | std::ios_base::out | std::ios_base::binary};
76+
SpStream rhsSpSt{sp, std::ios_base::out | std::ios_base::ate};
9477
assert(rhsSpSt.span().data() == arr);
95-
assert(rhsSpSt.span().empty());
96-
assert(rhsSpSt.span().size() == 0);
78+
assert(!rhsSpSt.span().empty());
79+
assert(rhsSpSt.span().size() == 4);
9780

9881
SpStream spSt{std::move(rhsSpSt)};
9982
assert(spSt.span().data() == arr);
100-
assert(spSt.span().empty());
101-
assert(spSt.span().size() == 0);
83+
assert(!spSt.span().empty());
84+
assert(spSt.span().size() == 4);
10285

10386
// Test after move
10487
assert(rhsSpSt.span().data() == arr);
105-
assert(rhsSpSt.span().empty());
106-
assert(rhsSpSt.span().size() == 0);
88+
assert(!rhsSpSt.span().empty());
89+
assert(rhsSpSt.span().size() == 4);
10790
}
108-
// Mode `ate`
91+
// Mode: multiple
10992
{
110-
SpStream rhsSpSt{sp, std::ios_base::out | std::ios_base::ate};
93+
SpStream rhsSpSt{sp, std::ios_base::ate | std::ios_base::binary};
11194
assert(rhsSpSt.span().data() == arr);
11295
assert(!rhsSpSt.span().empty());
11396
assert(rhsSpSt.span().size() == 4);
@@ -128,12 +111,22 @@ int main(int, char**) {
128111
#ifndef TEST_HAS_NO_NASTY_STRING
129112
test<nasty_char, nasty_char_traits>();
130113
#endif
114+
131115
test<char>();
132116
test<char, constexpr_char_traits<char>>();
133117
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
134118
test<wchar_t>();
135119
test<wchar_t, constexpr_char_traits<wchar_t>>();
136120
#endif
137121

122+
#ifndef TEST_HAS_NO_CHAR8_T
123+
test<char8_t>();
124+
test<char8_t, constexpr_char_traits<char8_t>>();
125+
#endif
126+
test<char16_t>();
127+
test<char16_t, constexpr_char_traits<char16_t>>();
128+
test<char32_t>();
129+
test<char32_t, constexpr_char_traits<char32_t>>();
130+
138131
return 0;
139132
}

0 commit comments

Comments
 (0)