]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/10.cc
1 // Copyright (C) 2004-2020 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // 27.6.1.2.2 arithmetic extractors
23 #include <testsuite_hooks.h>
27 std::wstring
str_01(L
"0 00 000 +0 +0 -0");
28 std::wstringbuf
isbuf_01(str_01
);
29 std::wistream
is_01(&isbuf_01
);
49 VERIFY( is_01
.rdstate() == std::ios_base::eofbit
);
51 std::wstring
str_02(L
"0x32 0X33 033 33");
52 std::wstringbuf
isbuf_02(str_02
);
53 std::wistream
is_02(&isbuf_02
);
54 is_02
.unsetf(std::ios_base::basefield
);
63 VERIFY( is_02
.rdstate() == std::ios_base::eofbit
);
65 std::wstringbuf
isbuf_03(str_02
);
66 std::wistream
is_03(&isbuf_03
);
70 is_03
>> std::dec
>> n
>> c
>> m
;
75 is_03
>> std::oct
>> m
>> c
>> n
;
80 is_03
>> std::dec
>> m
>> n
;
83 VERIFY( is_03
.rdstate() == std::ios_base::eofbit
);
85 std::wstring
str_04(L
"3. 4.5E+2a5E-3 .6E1");
86 std::wstringbuf
isbuf_04(str_04
);
87 std::wistream
is_04(&isbuf_04
);
99 VERIFY( is_03
.rdstate() == std::ios_base::eofbit
);
101 std::wstring
str_05(L
"0E20 5Ea E16");
102 std::wstringbuf
isbuf_05(str_05
);
103 std::wistream
is_05(&isbuf_05
);
110 VERIFY( is_05
.rdstate() == std::ios_base::failbit
);
117 VERIFY( is_05
.rdstate() == std::ios_base::failbit
);