Merge from mainline (163495:164578).
[official-gcc/graphite-test-results.git] / libstdc++-v3 / testsuite / 22_locale / numpunct / members / wchar_t / 2.cc
blob8b8d22ad60cc95026e803db716b7fdf19d6b126b
1 // { dg-require-namedlocale "en_US" }
2 // { dg-require-namedlocale "is_IS" }
3 // { dg-require-namedlocale "de_DE" }
5 // 2001-01-17 Benjamin Kosnik <bkoz@redhat.com>
7 // Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation
8 //
9 // This file is part of the GNU ISO C++ Library. This library is free
10 // software; you can redistribute it and/or modify it under the
11 // terms of the GNU General Public License as published by the
12 // Free Software Foundation; either version 3, or (at your option)
13 // any later version.
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
20 // You should have received a copy of the GNU General Public License along
21 // with this library; see the file COPYING3. If not see
22 // <http://www.gnu.org/licenses/>.
24 // 22.2.3.1.1 nunpunct members
26 #include <locale>
27 #include <testsuite_hooks.h>
29 void test02()
31 using namespace std;
33 bool test __attribute__((unused)) = true;
35 // basic construction
36 locale loc_c = locale::classic();
37 locale loc_us = locale("en_US");
38 locale loc_is = locale("is_IS");
39 locale loc_de = locale("de_DE");
40 VERIFY( loc_c != loc_de );
41 VERIFY( loc_us != loc_is );
42 VERIFY( loc_us != loc_de );
43 VERIFY( loc_de != loc_is );
45 // cache the numpunct facets
46 const numpunct<wchar_t>& nump_c = use_facet<numpunct<wchar_t> >(loc_c);
47 const numpunct<wchar_t>& nump_us = use_facet<numpunct<wchar_t> >(loc_us);
48 const numpunct<wchar_t>& nump_is = use_facet<numpunct<wchar_t> >(loc_is);
49 const numpunct<wchar_t>& nump_de = use_facet<numpunct<wchar_t> >(loc_de);
51 // sanity check the data is correct.
52 string g1 = nump_c.grouping();
53 wstring t1 = nump_c.truename();
54 wstring f1 = nump_c.falsename();
56 wchar_t dp2 = nump_us.decimal_point();
57 wchar_t th2 = nump_us.thousands_sep();
58 string g2 = nump_us.grouping();
59 wstring t2 = nump_us.truename();
60 wstring f2 = nump_us.falsename();
62 wchar_t dp3 = nump_is.decimal_point();
63 wchar_t th3 = nump_is.thousands_sep();
64 string g3 = nump_is.grouping();
65 wstring t3 = nump_is.truename();
66 wstring f3 = nump_is.falsename();
68 wchar_t dp4 = nump_de.decimal_point();
69 wchar_t th4 = nump_de.thousands_sep();
70 string g4 = nump_de.grouping();
71 wstring t4 = nump_de.truename();
72 wstring f4 = nump_de.falsename();
74 VERIFY( dp2 != dp3 );
75 VERIFY( th2 != th3 );
77 VERIFY( dp2 != dp4 );
78 VERIFY( th2 != th4 );
79 // XXX This isn't actually supported right now.
80 // VERIFY( t2 != t3 );
81 // VERIFY( f2 != f3 );
84 int main()
86 test02();
87 return 0;