1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // REQUIRES: locale.fr_FR.UTF-8
13 // template <class charT, class traits> class basic_ios
15 // void move(basic_ios&& rhs);
21 #include "test_macros.h"
22 #include "platform_support.h" // locale name macros
25 : public std::streambuf
33 testios(std::streambuf
* p
) : std::ios(p
) {}
34 void move(std::ios
& x
) {std::ios::move(x
);}
37 bool f1_called
= false;
38 bool f2_called
= false;
40 bool g1_called
= false;
41 bool g2_called
= false;
42 bool g3_called
= false;
44 void f1(std::ios_base::event
, std::ios_base
&, int)
49 void f2(std::ios_base::event
, std::ios_base
&, int)
54 void g1(std::ios_base::event ev
, std::ios_base
&, int index
)
56 if (ev
== std::ios_base::imbue_event
)
63 void g2(std::ios_base::event ev
, std::ios_base
&, int index
)
65 if (ev
== std::ios_base::imbue_event
)
72 void g3(std::ios_base::event ev
, std::ios_base
&, int index
)
74 if (ev
== std::ios_base::imbue_event
)
86 ios2
.flags(std::ios::showpoint
| std::ios::uppercase
);
89 ios2
.imbue(std::locale(LOCALE_fr_FR_UTF_8
));
90 ios2
.exceptions(std::ios::eofbit
);
91 ios2
.setstate(std::ios::goodbit
);
92 ios2
.register_callback(g1
, 7);
93 ios2
.register_callback(g2
, 8);
94 ios2
.register_callback(g3
, 9);
104 ios2
.tie((std::ostream
*)2);
109 assert(ios1
.rdstate() == std::ios::goodbit
);
110 assert(ios1
.rdbuf() == 0);
111 assert(ios1
.flags() == (std::ios::showpoint
| std::ios::uppercase
));
112 assert(ios1
.precision() == 2);
113 assert(ios1
.width() == 12);
114 assert(ios1
.getloc().name() == LOCALE_fr_FR_UTF_8
);
115 assert(ios1
.exceptions() == std::ios::eofbit
);
121 assert(ios1
.iword(0) == 4);
122 assert(ios1
.iword(1) == 5);
123 assert(ios1
.iword(2) == 6);
124 assert(ios1
.iword(3) == 7);
125 assert(ios1
.iword(4) == 8);
126 assert(ios1
.iword(5) == 9);
127 assert(ios1
.pword(0) == &d1
);
128 assert(ios1
.pword(1) == &d2
);
129 assert(ios1
.tie() == (std::ostream
*)2);
130 assert(ios1
.fill() == '2');
131 ios1
.imbue(std::locale("C"));
138 assert(ios2
.rdbuf() == &sb2
);
139 assert(ios2
.tie() == 0);