]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc
1 // { dg-do run { xfail { ! { *-*-linux* *-*-gnu* } } } }
2 // { dg-require-namedlocale "de_DE.ISO8859-15" }
4 // Copyright (C) 2000-2017 Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
22 // 22.2.1.3.2 ctype<char> members
26 #include <testsuite_hooks.h>
28 typedef char char_type
;
30 // libstdc++/4456, libstdc++/4457, libstdc++/4458
34 typedef ctype_base::mask mask
;
35 typedef vector
<mask
> vector_type
;
37 // const int max = numeric_limits<char>::max();
39 const int ctype_mask_max
= 10;
41 vector_type
v_de(max
);
44 locale loc_c
= locale::classic();
45 const ctype
<char>& ctype_c
= use_facet
<ctype
<char> >(loc_c
);
46 for (int i
= 0; i
< max
; ++i
)
48 char_type c
= static_cast<char>(i
);
49 mask mask_test
= static_cast<mask
>(0);
50 mask mask_is
= static_cast<mask
>(0);
51 for (int j
= 0; j
<= ctype_mask_max
; ++j
)
53 mask_test
= static_cast<mask
>(1 << j
);
54 if (ctype_c
.is(mask_test
, c
))
61 locale loc_de
= locale(ISO_8859(15,de_DE
));
62 const ctype
<char>& ctype_de
= use_facet
<ctype
<char> >(loc_de
);
63 for (int i
= 0; i
< max
; ++i
)
65 char_type c
= static_cast<char>(i
);
66 mask mask_test
= static_cast<mask
>(0);
67 mask mask_is
= static_cast<mask
>(0);
68 for (int j
= 0; j
<= ctype_mask_max
; ++j
)
70 mask_test
= static_cast<mask
>(1 << j
);
71 if (ctype_de
.is(mask_test
, c
))
77 #if QUANNUM_VERBOSE_LYRICALLY_ADEPT_BAY_AREA_MCS_MODE
78 for (int i
= 0; i
< max
; ++i
)
80 char_type mark
= v_c
[i
] == v_de
[i
] ? ' ' : '-';
81 cout
<< i
<< ' ' << mark
<< ' ' << static_cast<char>(i
) << '\t' ;
82 cout
<< "v_c: " << setw(4) << v_c
[i
] << '\t';
83 cout
<< "v_de: " << setw(4) << v_de
[i
] << endl
;
85 cout
<< (v_c
== v_de
) << endl
;
88 VERIFY( v_c
!= v_de
);