]>
Commit | Line | Data |
---|---|---|
4216708a JM |
1 | // { dg-require-namedlocale "en_US.ISO8859-1" } |
2 | // { dg-require-namedlocale "is_IS.ISO8859-1" } | |
3 | // { dg-require-namedlocale "de_DE.ISO8859-15" } | |
f63a8495 | 4 | |
5f8d36fe | 5 | // 2001-01-17 Benjamin Kosnik <bkoz@redhat.com> |
86ade44c | 6 | |
8d9254fc | 7 | // Copyright (C) 2001-2020 Free Software Foundation, Inc. |
86ade44c BK |
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 | |
748086b7 | 12 | // Free Software Foundation; either version 3, or (at your option) |
86ade44c BK |
13 | // any later version. |
14 | ||
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. | |
19 | ||
20 | // You should have received a copy of the GNU General Public License along | |
748086b7 JJ |
21 | // with this library; see the file COPYING3. If not see |
22 | // <http://www.gnu.org/licenses/>. | |
86ade44c BK |
23 | |
24 | // 22.2.3.1.1 nunpunct members | |
25 | ||
26 | #include <locale> | |
27 | #include <testsuite_hooks.h> | |
28 | ||
5f8d36fe | 29 | void test02() |
86ade44c BK |
30 | { |
31 | using namespace std; | |
86ade44c BK |
32 | |
33 | // basic construction | |
34 | locale loc_c = locale::classic(); | |
4216708a JM |
35 | locale loc_us = locale(ISO_8859(1,en_US)); |
36 | locale loc_is = locale(ISO_8859(1,is_IS)); | |
37 | locale loc_de = locale(ISO_8859(15,de_DE)); | |
86ade44c | 38 | VERIFY( loc_c != loc_de ); |
118f7432 | 39 | VERIFY( loc_us != loc_is ); |
86ade44c | 40 | VERIFY( loc_us != loc_de ); |
118f7432 | 41 | VERIFY( loc_de != loc_is ); |
86ade44c BK |
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); | |
118f7432 | 46 | const numpunct<wchar_t>& nump_is = use_facet<numpunct<wchar_t> >(loc_is); |
86ade44c BK |
47 | const numpunct<wchar_t>& nump_de = use_facet<numpunct<wchar_t> >(loc_de); |
48 | ||
49 | // sanity check the data is correct. | |
86ade44c BK |
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 | ||
118f7432 PC |
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(); | |
86ade44c BK |
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 ); | |
5f8d36fe BK |
77 | // XXX This isn't actually supported right now. |
78 | // VERIFY( t2 != t3 ); | |
79 | // VERIFY( f2 != f3 ); | |
86ade44c | 80 | } |
4b9aaf63 | 81 | |
86ade44c BK |
82 | int main() |
83 | { | |
4b9aaf63 | 84 | test02(); |
86ade44c BK |
85 | return 0; |
86 | } |