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