Debian Codegraph @

libcxx/test/std/strings/c.strings/cwctype.pass.cpp

raw
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // <cwctype>
10
11 // XFAIL: no-wide-characters
12
13 #include <cwctype>
14 #include <type_traits>
15
16 #include "test_macros.h"
17
18 #ifndef WEOF
19 # error WEOF not defined
20 #endif
21
22 #ifdef iswalnum
23 # error iswalnum defined
24 #endif
25
26 #ifdef iswalpha
27 # error iswalpha defined
28 #endif
29
30 #ifdef iswblank
31 # error iswblank defined
32 #endif
33
34 #ifdef iswcntrl
35 # error iswcntrl defined
36 #endif
37
38 #ifdef iswdigit
39 # error iswdigit defined
40 #endif
41
42 #ifdef iswgraph
43 # error iswgraph defined
44 #endif
45
46 #ifdef iswlower
47 # error iswlower defined
48 #endif
49
50 #ifdef iswprint
51 # error iswprint defined
52 #endif
53
54 #ifdef iswpunct
55 # error iswpunct defined
56 #endif
57
58 #ifdef iswspace
59 # error iswspace defined
60 #endif
61
62 #ifdef iswupper
63 # error iswupper defined
64 #endif
65
66 #ifdef iswxdigit
67 # error iswxdigit defined
68 #endif
69
70 #ifdef iswctype
71 # error iswctype defined
72 #endif
73
74 #ifdef wctype
75 # error wctype defined
76 #endif
77
78 #ifdef towlower
79 # error towlower defined
80 #endif
81
82 #ifdef towupper
83 # error towupper defined
84 #endif
85
86 #ifdef towctrans
87 # error towctrans defined
88 #endif
89
90 #ifdef wctrans
91 # error wctrans defined
92 #endif
93
94 int main(int, char**) {
95 std::wint_t w = 0;
96 ASSERT_SAME_TYPE(int, decltype(std::iswalnum(w)));
97 ASSERT_SAME_TYPE(int, decltype(std::iswalpha(w)));
98 ASSERT_SAME_TYPE(int, decltype(std::iswblank(w)));
99 ASSERT_SAME_TYPE(int, decltype(std::iswcntrl(w)));
100 ASSERT_SAME_TYPE(int, decltype(std::iswdigit(w)));
101 ASSERT_SAME_TYPE(int, decltype(std::iswgraph(w)));
102 ASSERT_SAME_TYPE(int, decltype(std::iswlower(w)));
103 ASSERT_SAME_TYPE(int, decltype(std::iswprint(w)));
104 ASSERT_SAME_TYPE(int, decltype(std::iswpunct(w)));
105 ASSERT_SAME_TYPE(int, decltype(std::iswspace(w)));
106 ASSERT_SAME_TYPE(int, decltype(std::iswupper(w)));
107 ASSERT_SAME_TYPE(int, decltype(std::iswxdigit(w)));
108
109 ASSERT_SAME_TYPE(int, decltype(std::iswctype(w, std::wctype_t())));
110
111 ASSERT_SAME_TYPE(std::wctype_t, decltype(std::wctype("")));
112 ASSERT_SAME_TYPE(std::wint_t, decltype(std::towlower(w)));
113 ASSERT_SAME_TYPE(std::wint_t, decltype(std::towupper(w)));
114 ASSERT_SAME_TYPE(std::wint_t, decltype(std::towctrans(w, std::wctrans_t())));
115 ASSERT_SAME_TYPE(std::wctrans_t, decltype(std::wctrans("")));
116
117 return 0;
118 }