OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [libstdc++-v3/] [testsuite/] [22_locale/] [numpunct/] [members/] [wchar_t/] [2.cc] - Blame information for rev 424

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 424 jeremybenn
// { dg-require-namedlocale "" }
2
 
3
// 2001-01-17 Benjamin Kosnik  <bkoz@redhat.com>
4
 
5
// Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation
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
// 22.2.3.1.1 nunpunct members
23
 
24
#include <locale>
25
#include <testsuite_hooks.h>
26
 
27
void test02()
28
{
29
  using namespace std;
30
 
31
  bool test __attribute__((unused)) = true;
32
 
33
  // basic construction
34
  locale loc_c = locale::classic();
35
  locale loc_us = locale("en_US");
36
  locale loc_is = locale("is_IS");
37
  locale loc_de = locale("de_DE");
38
  VERIFY( loc_c != loc_de );
39
  VERIFY( loc_us != loc_is );
40
  VERIFY( loc_us != loc_de );
41
  VERIFY( loc_de != loc_is );
42
 
43
  // cache the numpunct facets
44
  const numpunct<wchar_t>& nump_c = use_facet<numpunct<wchar_t> >(loc_c);
45
  const numpunct<wchar_t>& nump_us = use_facet<numpunct<wchar_t> >(loc_us);
46
  const numpunct<wchar_t>& nump_is = use_facet<numpunct<wchar_t> >(loc_is);
47
  const numpunct<wchar_t>& nump_de = use_facet<numpunct<wchar_t> >(loc_de);
48
 
49
  // sanity check the data is correct.
50
  string g1 = nump_c.grouping();
51
  wstring t1 = nump_c.truename();
52
  wstring f1 = nump_c.falsename();
53
 
54
  wchar_t dp2 = nump_us.decimal_point();
55
  wchar_t th2 = nump_us.thousands_sep();
56
  string g2 = nump_us.grouping();
57
  wstring t2 = nump_us.truename();
58
  wstring f2 = nump_us.falsename();
59
 
60
  wchar_t dp3 = nump_is.decimal_point();
61
  wchar_t th3 = nump_is.thousands_sep();
62
  string g3 = nump_is.grouping();
63
  wstring t3 = nump_is.truename();
64
  wstring f3 = nump_is.falsename();
65
 
66
  wchar_t dp4 = nump_de.decimal_point();
67
  wchar_t th4 = nump_de.thousands_sep();
68
  string g4 = nump_de.grouping();
69
  wstring t4 = nump_de.truename();
70
  wstring f4 = nump_de.falsename();
71
 
72
  VERIFY( dp2 != dp3 );
73
  VERIFY( th2 != th3 );
74
 
75
  VERIFY( dp2 != dp4 );
76
  VERIFY( th2 != th4 );
77
  // XXX This isn't actually supported right now.
78
  // VERIFY( t2 != t3 );
79
  // VERIFY( f2 != f3 );
80
}
81
 
82
int main()
83
{
84
  test02();
85
  return 0;
86
}

powered by: WebSVN 2.1.0

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