OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [libstdc++-v3/] [testsuite/] [22_locale/] [money_put/] [put/] [char/] [9780-3.cc] - Blame information for rev 783

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 742 jeremybenn
// { dg-require-namedlocale "de_DE" }
2
// { dg-require-namedlocale "es_ES" }
3
 
4
// Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009
5
// Free Software Foundation, Inc.
6
//
7
// This file is part of the GNU ISO C++ Library.  This library is free
8
// software; you can redistribute it and/or modify it under the
9
// terms of the GNU General Public License as published by the
10
// Free Software Foundation; either version 3, or (at your option)
11
// any later version.
12
 
13
// This library is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
// GNU General Public License for more details.
17
 
18
// You should have received a copy of the GNU General Public License along
19
// with this library; see the file COPYING3.  If not see
20
// <http://www.gnu.org/licenses/>.
21
 
22
#include <sstream>
23
#include <locale>
24
#include <testsuite_hooks.h>
25
 
26
int main()
27
{
28
  using namespace std;
29
 
30
  bool test __attribute__((unused)) = true;
31
  locale l1 = locale("de_DE");
32
  locale l2 = locale("es_ES");
33
 
34
  const money_put<char>& mp = use_facet<money_put<char> >(l1);
35
  ostringstream oss;
36
  oss.imbue(l2);
37
  oss.setf(ios_base::showbase);
38
 
39
  long double ld = -1234567890;
40
  mp.put(oss.rdbuf(), true, oss, ' ', ld); // -EUR  12.345.678,90
41
  string res = oss.str();
42
 
43
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 7)
44
  VERIFY( res == "-12.345.678,90 EUR " );
45
#else
46
  VERIFY( res == "-EUR  12.345.678,90" );
47
#endif
48
 
49
  return 0;
50
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.