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/>.
22 #include <testsuite_hooks.h>
24 struct MyNP : std::numpunct<wchar_t>
26 std::wstring do_truename() const;
27 std::wstring do_falsename() const;
31 MyNP::do_truename() const
33 std::wstring s(L"yea");
38 MyNP::do_falsename() const
40 std::wstring s(L"nay");
47 bool test __attribute__((unused)) = true;
48 const wchar_t lit[] = L"1 0\n"
61 std::wostringstream oss;
62 oss << true << L" " << false << std::endl;
63 oss << std::boolalpha;
64 oss << true << L" " << false << std::endl;
66 oss << L":" << std::setw(6) << std::internal << true << L":" << std::endl;
67 oss << L":" << std::setw(6) << std::left << true << L":" << std::endl;
68 oss << L":" << std::setw(6) << std::right << false << L":" << std::endl;
69 oss << std::noboolalpha;
70 oss << L":" << std::setw(3) << std::internal << true << L":" << std::endl;
71 oss << L":" << std::setw(3) << std::left << true << L":" << std::endl;
72 oss << L":" << std::setw(3) << std::right << false << L":" << std::endl;
74 std::locale loc = std::locale(std::locale::classic(), new MyNP);
77 oss << std::boolalpha;
78 oss << true << L" " << false << std::endl;
80 oss << L":" << std::setw(6) << std::internal << true << L":" << std::endl;
81 oss << L":" << std::setw(6) << std::left << true << L":" << std::endl;
82 oss << L":" << std::setw(6) << std::right << false << L":" << std::endl;
85 VERIFY( oss.str() == lit );