Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libstdc++-v3 / testsuite / 22_locale / numpunct / members / char / 2.cc
blob590bc36a9c0c7fb3aa16eaa0bbab4e74c993c3dd
1 // { dg-require-namedlocale "" }
3 // 2001-01-17 Benjamin Kosnik <bkoz@redhat.com>
5 // Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation
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.
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.
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, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 // USA.
23 // 22.2.3.1.1 nunpunct members
25 #include <locale>
26 #include <testsuite_hooks.h>
28 void test02()
30 using namespace std;
32 bool test __attribute__((unused)) = true;
34 // basic construction
35 locale loc_c = locale::classic();
36 locale loc_us = locale("en_US");
37 locale loc_fr = locale("fr_FR");
38 locale loc_de = locale("de_DE");
39 VERIFY( loc_c != loc_de );
40 VERIFY( loc_us != loc_fr );
41 VERIFY( loc_us != loc_de );
42 VERIFY( loc_de != loc_fr );
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);
48 const numpunct<char>& nump_de = use_facet<numpunct<char> >(loc_de);
50 // sanity check the data is correct.
51 string g1 = nump_c.grouping();
52 string t1 = nump_c.truename();
53 string f1 = nump_c.falsename();
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();
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();
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();
73 VERIFY( dp2 != dp3 );
74 VERIFY( th2 != th3 );
76 VERIFY( dp2 != dp4 );
77 VERIFY( th2 != th4 );
78 // XXX This isn't actually supported right now.
79 // VERIFY( t2 != t3 );
80 // VERIFY( f2 != f3 );
83 int main()
85 test02();
86 return 0;