1 // Copyright (C) 2004-2013 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);
31 bool test __attribute__((unused)) = true;
51 VERIFY( is_01.rdstate() == std::ios_base::eofbit );
53 std::wstring str_02(L"0x32 0X33 033 33");
54 std::wstringbuf isbuf_02(str_02);
55 std::wistream is_02(&isbuf_02);
56 is_02.unsetf(std::ios_base::basefield);
65 VERIFY( is_02.rdstate() == std::ios_base::eofbit );
67 std::wstringbuf isbuf_03(str_02);
68 std::wistream is_03(&isbuf_03);
72 is_03 >> std::dec >> n >> c >> m;
77 is_03 >> std::oct >> m >> c >> n;
82 is_03 >> std::dec >> m >> n;
85 VERIFY( is_03.rdstate() == std::ios_base::eofbit );
87 std::wstring str_04(L"3. 4.5E+2a5E-3 .6E1");
88 std::wstringbuf isbuf_04(str_04);
89 std::wistream is_04(&isbuf_04);
101 VERIFY( is_03.rdstate() == std::ios_base::eofbit );
103 std::wstring str_05(L"0E20 5Ea E16");
104 std::wstringbuf isbuf_05(str_05);
105 std::wistream is_05(&isbuf_05);
112 VERIFY( is_05.rdstate() == std::ios_base::failbit );
119 VERIFY( is_05.rdstate() == std::ios_base::failbit );