]> 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
be803e41 1// { dg-require-namedlocale "en_US.ISO8859-1" }
2// { dg-require-namedlocale "is_IS.ISO8859-1" }
3// { dg-require-namedlocale "de_DE.ISO8859-15" }
e590fca1 4
c099f5df 5// 2001-01-17 Benjamin Kosnik <bkoz@redhat.com>
20752884 6
f1717362 7// Copyright (C) 2001-2016 Free Software Foundation, Inc.
20752884 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
6bc9506f 12// Free Software Foundation; either version 3, or (at your option)
20752884 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
6bc9506f 21// with this library; see the file COPYING3. If not see
22// <http://www.gnu.org/licenses/>.
20752884 23
24// 22.2.3.1.1 nunpunct members
25
26#include <locale>
0194306c 27#include <testsuite_hooks.h>
20752884 28
2f14cd74 29void test02()
20752884 30{
31 using namespace std;
32
f8ef786c 33 bool test __attribute__((unused)) = true;
20752884 34
35 // basic construction
36 locale loc_c = locale::classic();
be803e41 37 locale loc_us = locale(ISO_8859(1,en_US));
38 locale loc_is = locale(ISO_8859(1,is_IS));
39 locale loc_de = locale(ISO_8859(15,de_DE));
23e98236 40 VERIFY( loc_c != loc_de );
e4a59e8f 41 VERIFY( loc_us != loc_is );
23e98236 42 VERIFY( loc_us != loc_de );
e4a59e8f 43 VERIFY( loc_de != loc_is );
20752884 44
45 // cache the numpunct facets
46 const numpunct<char>& nump_c = use_facet<numpunct<char> >(loc_c);
47 const numpunct<char>& nump_us = use_facet<numpunct<char> >(loc_us);
e4a59e8f 48 const numpunct<char>& nump_is = use_facet<numpunct<char> >(loc_is);
23e98236 49 const numpunct<char>& nump_de = use_facet<numpunct<char> >(loc_de);
20752884 50
51 // sanity check the data is correct.
20752884 52 string g1 = nump_c.grouping();
53 string t1 = nump_c.truename();
54 string f1 = nump_c.falsename();
55
56 char dp2 = nump_us.decimal_point();
57 char th2 = nump_us.thousands_sep();
58 string g2 = nump_us.grouping();
59 string t2 = nump_us.truename();
60 string f2 = nump_us.falsename();
61
e4a59e8f 62 char dp3 = nump_is.decimal_point();
63 char th3 = nump_is.thousands_sep();
64 string g3 = nump_is.grouping();
65 string t3 = nump_is.truename();
66 string f3 = nump_is.falsename();
20752884 67
23e98236 68 char dp4 = nump_de.decimal_point();
69 char th4 = nump_de.thousands_sep();
70 string g4 = nump_de.grouping();
71 string t4 = nump_de.truename();
72 string f4 = nump_de.falsename();
73
74 VERIFY( dp2 != dp3 );
75 VERIFY( th2 != th3 );
23e98236 76
77 VERIFY( dp2 != dp4 );
78 VERIFY( th2 != th4 );
24a656f2 79 // XXX This isn't actually supported right now.
80 // VERIFY( t2 != t3 );
81 // VERIFY( f2 != f3 );
20752884 82}
83
84int main()
85{
3eb7dfb2 86 test02();
20752884 87 return 0;
88}