]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 22_locale / numpunct / members / char / 2.cc
CommitLineData
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
33590f13 5// 2001-01-17 Benjamin Kosnik <bkoz@redhat.com>
0214010c 6
85ec4feb 7// Copyright (C) 2001-2018 Free Software Foundation, Inc.
0214010c
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)
0214010c
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/>.
0214010c
BK
23
24// 22.2.3.1.1 nunpunct members
25
26#include <locale>
fe413112 27#include <testsuite_hooks.h>
0214010c 28
5f8d36fe 29void test02()
0214010c
BK
30{
31 using namespace std;
0214010c
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));
13f83598 38 VERIFY( loc_c != loc_de );
118f7432 39 VERIFY( loc_us != loc_is );
13f83598 40 VERIFY( loc_us != loc_de );
118f7432 41 VERIFY( loc_de != loc_is );
0214010c
BK
42
43 // cache the numpunct facets
44 const numpunct<char>& nump_c = use_facet<numpunct<char> >(loc_c);
45 const numpunct<char>& nump_us = use_facet<numpunct<char> >(loc_us);
118f7432 46 const numpunct<char>& nump_is = use_facet<numpunct<char> >(loc_is);
13f83598 47 const numpunct<char>& nump_de = use_facet<numpunct<char> >(loc_de);
0214010c
BK
48
49 // sanity check the data is correct.
0214010c
BK
50 string g1 = nump_c.grouping();
51 string t1 = nump_c.truename();
52 string f1 = nump_c.falsename();
53
54 char dp2 = nump_us.decimal_point();
55 char th2 = nump_us.thousands_sep();
56 string g2 = nump_us.grouping();
57 string t2 = nump_us.truename();
58 string f2 = nump_us.falsename();
59
118f7432
PC
60 char dp3 = nump_is.decimal_point();
61 char th3 = nump_is.thousands_sep();
62 string g3 = nump_is.grouping();
63 string t3 = nump_is.truename();
64 string f3 = nump_is.falsename();
0214010c 65
13f83598
BK
66 char dp4 = nump_de.decimal_point();
67 char th4 = nump_de.thousands_sep();
68 string g4 = nump_de.grouping();
69 string t4 = nump_de.truename();
70 string f4 = nump_de.falsename();
71
72 VERIFY( dp2 != dp3 );
73 VERIFY( th2 != th3 );
13f83598
BK
74
75 VERIFY( dp2 != dp4 );
76 VERIFY( th2 != th4 );
86ade44c
BK
77 // XXX This isn't actually supported right now.
78 // VERIFY( t2 != t3 );
79 // VERIFY( f2 != f3 );
0214010c
BK
80}
81
82int main()
83{
3d838e28 84 test02();
0214010c
BK
85 return 0;
86}