]>
Commit | Line | Data |
---|---|---|
5f8d36fe | 1 | // 2001-01-17 Benjamin Kosnik <bkoz@redhat.com> |
86ade44c | 2 | |
5f8d36fe | 3 | // Copyright (C) 2001, 2002, 2003 Free Software Foundation |
86ade44c BK |
4 | // |
5 | // This file is part of the GNU ISO C++ Library. This library is free | |
6 | // software; you can redistribute it and/or modify it under the | |
7 | // terms of the GNU General Public License as published by the | |
8 | // Free Software Foundation; either version 2, or (at your option) | |
9 | // any later version. | |
10 | ||
11 | // This library is distributed in the hope that it will be useful, | |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | // GNU General Public License for more details. | |
15 | ||
16 | // You should have received a copy of the GNU General Public License along | |
17 | // with this library; see the file COPYING. If not, write to the Free | |
18 | // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
19 | // USA. | |
20 | ||
21 | // 22.2.3.1.1 nunpunct members | |
22 | ||
23 | #include <locale> | |
24 | #include <testsuite_hooks.h> | |
25 | ||
5f8d36fe | 26 | void test02() |
86ade44c BK |
27 | { |
28 | using namespace std; | |
29 | ||
11f10e6b | 30 | bool test __attribute__((unused)) = true; |
86ade44c BK |
31 | |
32 | // basic construction | |
33 | locale loc_c = locale::classic(); | |
aecf642c BK |
34 | locale loc_us = __gnu_test::try_named_locale("en_US"); |
35 | locale loc_fr = __gnu_test::try_named_locale("fr_FR"); | |
36 | locale loc_de = __gnu_test::try_named_locale("de_DE"); | |
86ade44c BK |
37 | VERIFY( loc_c != loc_de ); |
38 | VERIFY( loc_us != loc_fr ); | |
39 | VERIFY( loc_us != loc_de ); | |
40 | VERIFY( loc_de != loc_fr ); | |
41 | ||
42 | // cache the numpunct facets | |
43 | const numpunct<wchar_t>& nump_c = use_facet<numpunct<wchar_t> >(loc_c); | |
44 | const numpunct<wchar_t>& nump_us = use_facet<numpunct<wchar_t> >(loc_us); | |
45 | const numpunct<wchar_t>& nump_fr = use_facet<numpunct<wchar_t> >(loc_fr); | |
46 | const numpunct<wchar_t>& nump_de = use_facet<numpunct<wchar_t> >(loc_de); | |
47 | ||
48 | // sanity check the data is correct. | |
86ade44c BK |
49 | string g1 = nump_c.grouping(); |
50 | wstring t1 = nump_c.truename(); | |
51 | wstring f1 = nump_c.falsename(); | |
52 | ||
53 | wchar_t dp2 = nump_us.decimal_point(); | |
54 | wchar_t th2 = nump_us.thousands_sep(); | |
55 | string g2 = nump_us.grouping(); | |
56 | wstring t2 = nump_us.truename(); | |
57 | wstring f2 = nump_us.falsename(); | |
58 | ||
59 | wchar_t dp3 = nump_fr.decimal_point(); | |
60 | wchar_t th3 = nump_fr.thousands_sep(); | |
61 | string g3 = nump_fr.grouping(); | |
62 | wstring t3 = nump_fr.truename(); | |
63 | wstring f3 = nump_fr.falsename(); | |
64 | ||
65 | wchar_t dp4 = nump_de.decimal_point(); | |
66 | wchar_t th4 = nump_de.thousands_sep(); | |
67 | string g4 = nump_de.grouping(); | |
68 | wstring t4 = nump_de.truename(); | |
69 | wstring f4 = nump_de.falsename(); | |
70 | ||
71 | VERIFY( dp2 != dp3 ); | |
72 | VERIFY( th2 != th3 ); | |
73 | ||
74 | VERIFY( dp2 != dp4 ); | |
75 | VERIFY( th2 != th4 ); | |
5f8d36fe BK |
76 | // XXX This isn't actually supported right now. |
77 | // VERIFY( t2 != t3 ); | |
78 | // VERIFY( f2 != f3 ); | |
86ade44c | 79 | } |
4b9aaf63 | 80 | |
86ade44c BK |
81 | int main() |
82 | { | |
4b9aaf63 | 83 | test02(); |
86ade44c BK |
84 | return 0; |
85 | } |