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 //===----------------------------------------------------------------------===//
11 // template <class charT, class traits = char_traits<charT> >
12 // class basic_ostream;
14 // explicit basic_ostream(basic_streambuf<charT,traits>* sb);
19 #include "test_macros.h"
21 template <class CharT
>
23 : public std::basic_streambuf
<CharT
>
32 std::basic_ostream
<char> os(&sb
);
33 assert(os
.rdbuf() == &sb
);
34 assert(os
.tie() == 0);
35 assert(os
.fill() == ' ');
36 assert(os
.rdstate() == os
.goodbit
);
37 assert(os
.exceptions() == os
.goodbit
);
38 assert(os
.flags() == (os
.skipws
| os
.dec
));
39 assert(os
.precision() == 6);
40 assert(os
.getloc().name() == "C");
42 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
45 std::basic_ostream
<wchar_t> os(&sb
);
46 assert(os
.rdbuf() == &sb
);
47 assert(os
.tie() == 0);
48 assert(os
.fill() == L
' ');
49 assert(os
.rdstate() == os
.goodbit
);
50 assert(os
.exceptions() == os
.goodbit
);
51 assert(os
.flags() == (os
.skipws
| os
.dec
));
52 assert(os
.precision() == 6);
53 assert(os
.getloc().name() == "C");