]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/2.cc
testsuite_hooks.cc: Remove try_named_locale.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 22_locale / numpunct / members / wchar_t / 2.cc
CommitLineData
f63a8495
PC
1// { dg-require-namedlocale "" }
2
5f8d36fe 3// 2001-01-17 Benjamin Kosnik <bkoz@redhat.com>
86ade44c 4
f63a8495 5// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation
86ade44c
BK
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 2, 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 COPYING. If not, write to the Free
20// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
21// USA.
22
23// 22.2.3.1.1 nunpunct members
24
25#include <locale>
26#include <testsuite_hooks.h>
27
5f8d36fe 28void test02()
86ade44c
BK
29{
30 using namespace std;
31
11f10e6b 32 bool test __attribute__((unused)) = true;
86ade44c
BK
33
34 // basic construction
35 locale loc_c = locale::classic();
f63a8495
PC
36 locale loc_us = locale("en_US");
37 locale loc_fr = locale("fr_FR");
38 locale loc_de = locale("de_DE");
86ade44c
BK
39 VERIFY( loc_c != loc_de );
40 VERIFY( loc_us != loc_fr );
41 VERIFY( loc_us != loc_de );
42 VERIFY( loc_de != loc_fr );
43
44 // cache the numpunct facets
45 const numpunct<wchar_t>& nump_c = use_facet<numpunct<wchar_t> >(loc_c);
46 const numpunct<wchar_t>& nump_us = use_facet<numpunct<wchar_t> >(loc_us);
47 const numpunct<wchar_t>& nump_fr = use_facet<numpunct<wchar_t> >(loc_fr);
48 const numpunct<wchar_t>& nump_de = use_facet<numpunct<wchar_t> >(loc_de);
49
50 // sanity check the data is correct.
86ade44c
BK
51 string g1 = nump_c.grouping();
52 wstring t1 = nump_c.truename();
53 wstring f1 = nump_c.falsename();
54
55 wchar_t dp2 = nump_us.decimal_point();
56 wchar_t th2 = nump_us.thousands_sep();
57 string g2 = nump_us.grouping();
58 wstring t2 = nump_us.truename();
59 wstring f2 = nump_us.falsename();
60
61 wchar_t dp3 = nump_fr.decimal_point();
62 wchar_t th3 = nump_fr.thousands_sep();
63 string g3 = nump_fr.grouping();
64 wstring t3 = nump_fr.truename();
65 wstring f3 = nump_fr.falsename();
66
67 wchar_t dp4 = nump_de.decimal_point();
68 wchar_t th4 = nump_de.thousands_sep();
69 string g4 = nump_de.grouping();
70 wstring t4 = nump_de.truename();
71 wstring f4 = nump_de.falsename();
72
73 VERIFY( dp2 != dp3 );
74 VERIFY( th2 != th3 );
75
76 VERIFY( dp2 != dp4 );
77 VERIFY( th2 != th4 );
5f8d36fe
BK
78 // XXX This isn't actually supported right now.
79 // VERIFY( t2 != t3 );
80 // VERIFY( f2 != f3 );
86ade44c 81}
4b9aaf63 82
86ade44c
BK
83int main()
84{
4b9aaf63 85 test02();
86ade44c
BK
86 return 0;
87}