]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/22_locale/collate_byname/named_equivalence.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 22_locale / collate_byname / named_equivalence.cc
CommitLineData
4216708a 1// { dg-require-namedlocale "de_DE.ISO8859-15" }
f63a8495 2
bf5fe473
BK
3// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
4
a945c346 5// Copyright (C) 2001-2024 Free Software Foundation, Inc.
bf5fe473
BK
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
748086b7 10// Free Software Foundation; either version 3, or (at your option)
bf5fe473
BK
11// any later version.
12
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.
17
18// You should have received a copy of the GNU General Public License along
748086b7
JJ
19// with this library; see the file COPYING3. If not see
20// <http://www.gnu.org/licenses/>.
bf5fe473
BK
21
22// 22.2.4.2 Template class collate_byname
23
24#include <locale>
1b716e90 25#include <cstring>
bf5fe473
BK
26#include <testsuite_hooks.h>
27
28void test01()
29{
30 using namespace std;
31 typedef std::collate<char>::string_type string_type;
32
bf5fe473
BK
33 string str;
34 locale loc_c = locale::classic();
35
4216708a 36 locale loc_de = locale(ISO_8859(15,de_DE));
bf5fe473
BK
37 str = loc_de.name();
38
4216708a 39 locale loc_byname(locale::classic(), new collate_byname<char>(ISO_8859(15,de_DE)));
bf5fe473
BK
40 str = loc_byname.name();
41
42 VERIFY( loc_de != loc_byname );
43
44 // cache the collate facets
45 const collate<char>& coll_de = use_facet<collate<char> >(loc_de);
46
4216708a 47 // Check German "de_DE.ISO8859-15" locale.
bf5fe473
BK
48 int i1;
49 int i2;
50 long l1;
51 long l2;
52