]>
Commit | Line | Data |
---|---|---|
f63a8495 PC |
1 | // { dg-require-namedlocale "" } |
2 | ||
33590f13 | 3 | // 2001-01-17 Benjamin Kosnik <bkoz@redhat.com> |
0214010c | 4 | |
f63a8495 | 5 | // Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation |
0214010c 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> | |
fe413112 | 26 | #include <testsuite_hooks.h> |
0214010c | 27 | |
5f8d36fe | 28 | void test02() |
0214010c BK |
29 | { |
30 | using namespace std; | |
31 | ||
11f10e6b | 32 | bool test __attribute__((unused)) = true; |
0214010c 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"); | |
13f83598 | 39 | VERIFY( loc_c != loc_de ); |
13f83598 BK |
40 | VERIFY( loc_us != loc_fr ); |
41 | VERIFY( loc_us != loc_de ); | |
42 | VERIFY( loc_de != loc_fr ); | |
0214010c BK |
43 | |
44 | // cache the numpunct facets | |
45 | const numpunct<char>& nump_c = use_facet<numpunct<char> >(loc_c); | |
46 | const numpunct<char>& nump_us = use_facet<numpunct<char> >(loc_us); | |
47 | const numpunct<char>& nump_fr = use_facet<numpunct<char> >(loc_fr); | |
13f83598 | 48 | const numpunct<char>& nump_de = use_facet<numpunct<char> >(loc_de); |
0214010c BK |
49 | |
50 | // sanity check the data is correct. | |
0214010c BK |
51 | string g1 = nump_c.grouping(); |
52 | string t1 = nump_c.truename(); | |
53 | string f1 = nump_c.falsename(); | |
54 | ||
55 | char dp2 = nump_us.decimal_point(); | |
56 | char th2 = nump_us.thousands_sep(); | |
57 | string g2 = nump_us.grouping(); | |
58 | string t2 = nump_us.truename(); | |
59 | string f2 = nump_us.falsename(); | |
60 | ||
61 | char dp3 = nump_fr.decimal_point(); | |
62 | char th3 = nump_fr.thousands_sep(); | |
63 | string g3 = nump_fr.grouping(); | |
64 | string t3 = nump_fr.truename(); | |
65 | string f3 = nump_fr.falsename(); | |
66 | ||
13f83598 BK |
67 | char dp4 = nump_de.decimal_point(); |
68 | char th4 = nump_de.thousands_sep(); | |
69 | string g4 = nump_de.grouping(); | |
70 | string t4 = nump_de.truename(); | |
71 | string f4 = nump_de.falsename(); | |
72 | ||
73 | VERIFY( dp2 != dp3 ); | |
74 | VERIFY( th2 != th3 ); | |
13f83598 BK |
75 | |
76 | VERIFY( dp2 != dp4 ); | |
77 | VERIFY( th2 != th4 ); | |
86ade44c BK |
78 | // XXX This isn't actually supported right now. |
79 | // VERIFY( t2 != t3 ); | |
80 | // VERIFY( f2 != f3 ); | |
0214010c BK |
81 | } |
82 | ||
83 | int main() | |
84 | { | |
3d838e28 | 85 | test02(); |
0214010c BK |
86 | return 0; |
87 | } |