1132718Skan// { dg-require-namedlocale "" }
2132718Skan
3132718Skan// Copyright (C) 2003, 2005 Free Software Foundation
4132718Skan//
5132718Skan// This file is part of the GNU ISO C++ Library.  This library is free
6132718Skan// software; you can redistribute it and/or modify it under the
7132718Skan// terms of the GNU General Public License as published by the
8132718Skan// Free Software Foundation; either version 2, or (at your option)
9132718Skan// any later version.
10132718Skan
11132718Skan// This library is distributed in the hope that it will be useful,
12132718Skan// but WITHOUT ANY WARRANTY; without even the implied warranty of
13132718Skan// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14132718Skan// GNU General Public License for more details.
15132718Skan
16132718Skan// You should have received a copy of the GNU General Public License along
17132718Skan// with this library; see the file COPYING.  If not, write to the Free
18132718Skan// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19132718Skan// USA.
20132718Skan
21132718Skan// 22.2.6.1.1 money_get members
22132718Skan
23132718Skan#include <locale>
24132718Skan#include <sstream>
25132718Skan#include <testsuite_hooks.h>
26132718Skan
27169689Skanvoid test01()
28169689Skan{
29169689Skan  using namespace std;
30132718Skan  typedef istreambuf_iterator<char> iterator_type;
31132718Skan
32132718Skan  bool test __attribute__((unused)) = true;
33132718Skan
34132718Skan  locale loc_us = locale("en_US");
35132718Skan
36132718Skan  iterator_type end;
37169689Skan  istringstream iss;
38  iss.imbue(loc_us);
39
40  const money_get<char>& mon_get = use_facet<money_get<char> >(iss.getloc());
41
42  iss.str("$.00 ");
43  iterator_type is_it(iss);
44  string extracted_amount;
45  ios_base::iostate err = ios_base::goodbit;
46  mon_get.get(is_it, end, false, iss, err, extracted_amount);
47  VERIFY( extracted_amount == "0" );
48  VERIFY( err == ios_base::goodbit );
49}
50
51int main()
52{
53  test01();
54  return 0;
55}
56