34#ifndef _RWSTD_NO_EXT_CXX_0X
40template <
class T,
class U>
60 "%s<%s>::type is %{?}exactly%{:}not%{;} %s",
61 trait, typeT, same, typeU);
64#define TEST(Trait,TypeT,TypeU) \
65 test_trait(__LINE__, \
66 std::is_same<Trait<TypeT>::type, TypeU>::value, \
67 #Trait, #TypeT, #TypeU)
73#define CV const volatile
77static void test_remove_const ()
79 TEST (std::remove_const,
int,
int);
80 TEST (std::remove_const,
C int,
int);
81 TEST (std::remove_const,
V int,
V int);
82 TEST (std::remove_const,
CV int,
V int);
84 TEST (std::remove_const,
int*,
int*);
85 TEST (std::remove_const,
C int*,
C int*);
86 TEST (std::remove_const,
V int*,
V int*);
87 TEST (std::remove_const,
CV int*,
CV int*);
89 TEST (std::remove_const,
int*
C ,
int* );
90 TEST (std::remove_const,
int*
V,
int*
V);
91 TEST (std::remove_const,
int*
CV,
int*
V);
93 TEST (std::remove_const,
C int*
C ,
C int* );
94 TEST (std::remove_const,
C int*
V,
C int*
V);
95 TEST (std::remove_const,
C int*
CV,
C int*
V);
97 TEST (std::remove_const,
V int*
C ,
V int* );
98 TEST (std::remove_const,
V int*
V,
V int*
V);
99 TEST (std::remove_const,
V int*
CV,
V int*
V);
101 TEST (std::remove_const,
CV int*
C ,
CV int* );
102 TEST (std::remove_const,
CV int*
V,
CV int*
V);
106static void test_remove_volatile ()
108 TEST (std::remove_volatile,
int,
int);
109 TEST (std::remove_volatile,
C int,
C int);
110 TEST (std::remove_volatile,
V int,
int);
111 TEST (std::remove_volatile,
CV int,
C int);
113 TEST (std::remove_volatile,
int*,
int*);
114 TEST (std::remove_volatile,
C int*,
C int*);
115 TEST (std::remove_volatile,
V int*,
V int*);
116 TEST (std::remove_volatile,
CV int*,
CV int*);
118 TEST (std::remove_volatile,
int*
C ,
int*
C);
119 TEST (std::remove_volatile,
int*
V,
int* );
120 TEST (std::remove_volatile,
int*
CV,
int*
C);
122 TEST (std::remove_volatile,
C int*
C ,
C int*
C);
123 TEST (std::remove_volatile,
C int*
V,
C int* );
124 TEST (std::remove_volatile,
C int*
CV,
C int*
C);
126 TEST (std::remove_volatile,
V int*
C ,
V int*
C);
127 TEST (std::remove_volatile,
V int*
V,
V int* );
128 TEST (std::remove_volatile,
V int*
CV,
V int*
C);
130 TEST (std::remove_volatile,
CV int*
C ,
CV int*
C);
131 TEST (std::remove_volatile,
CV int*
V,
CV int* );
132 TEST (std::remove_volatile,
CV int*
CV,
CV int*
C);
135static void test_remove_cv ()
137 TEST (std::remove_cv,
int,
int);
138 TEST (std::remove_cv,
C int,
int);
139 TEST (std::remove_cv,
V int,
int);
140 TEST (std::remove_cv,
CV int,
int);
142 TEST (std::remove_cv,
int*,
int*);
143 TEST (std::remove_cv,
C int*,
C int*);
144 TEST (std::remove_cv,
V int*,
V int*);
145 TEST (std::remove_cv,
CV int*,
CV int*);
147 TEST (std::remove_cv,
int*
C ,
int*);
148 TEST (std::remove_cv,
int*
V,
int*);
149 TEST (std::remove_cv,
int*
CV,
int*);
151 TEST (std::remove_cv,
C int*
C ,
C int*);
152 TEST (std::remove_cv,
C int*
V,
C int*);
153 TEST (std::remove_cv,
C int*
CV,
C int*);
155 TEST (std::remove_cv,
V int*
C ,
V int*);
156 TEST (std::remove_cv,
V int*
V,
V int*);
157 TEST (std::remove_cv,
V int*
CV,
V int*);
159 TEST (std::remove_cv,
CV int*
C ,
CV int*);
160 TEST (std::remove_cv,
CV int*
V,
CV int*);
166static void test_add_const ()
168 TEST (std::add_const,
int,
C int);
169 TEST (std::add_const,
C int,
C int);
170 TEST (std::add_const,
V int,
CV int);
171 TEST (std::add_const,
CV int,
CV int);
173 TEST (std::add_const,
int*,
int*
C);
174 TEST (std::add_const,
C int*,
C int*
C);
175 TEST (std::add_const,
V int*,
V int*
C);
176 TEST (std::add_const,
CV int*,
CV int*
C);
178 TEST (std::add_const,
int*
C ,
int*
C);
179 TEST (std::add_const,
int*
V,
int*
CV);
180 TEST (std::add_const,
int*
CV,
int*
CV);
182 TEST (std::add_const,
C int*
C ,
C int*
C );
183 TEST (std::add_const,
C int*
V,
C int*
CV);
186 TEST (std::add_const,
V int*
C ,
V int*
C );
187 TEST (std::add_const,
V int*
V,
V int*
CV);
190 TEST (std::add_const,
CV int*
C ,
CV int*
C );
194 TEST (std::add_const,
void (*)(),
void (*
C)());
197 TEST (std::add_const,
int&,
int&);
198 TEST (std::add_const,
C int&,
C int&);
199 TEST (std::add_const,
V int&,
V int&);
200 TEST (std::add_const,
CV int&,
CV int&);
202 TEST (std::add_const,
void (&)(),
void (&)());
205 TEST (std::add_const,
void (),
void ());
208static void test_add_volatile ()
210 TEST (std::add_volatile,
int,
V int);
211 TEST (std::add_volatile,
C int,
CV int);
212 TEST (std::add_volatile,
V int,
V int);
213 TEST (std::add_volatile,
CV int,
CV int);
215 TEST (std::add_volatile,
int*,
int*
V);
216 TEST (std::add_volatile,
C int*,
C int*
V);
217 TEST (std::add_volatile,
V int*,
V int*
V);
218 TEST (std::add_volatile,
CV int*,
CV int*
V);
220 TEST (std::add_volatile,
int*
C ,
int*
CV);
221 TEST (std::add_volatile,
int*
V,
int*
V);
222 TEST (std::add_volatile,
int*
CV,
int*
CV);
224 TEST (std::add_volatile,
C int*
C ,
C int*
CV);
225 TEST (std::add_volatile,
C int*
V,
C int*
V);
226 TEST (std::add_volatile,
C int*
CV,
C int*
CV);
228 TEST (std::add_volatile,
V int*
C ,
V int*
CV);
229 TEST (std::add_volatile,
V int*
V,
V int*
V);
230 TEST (std::add_volatile,
V int*
CV,
V int*
CV);
233 TEST (std::add_volatile,
CV int*
V,
CV int*
V);
236 TEST (std::add_volatile,
void (*)(),
void (*
V)());
239 TEST (std::add_volatile,
int&,
int&);
240 TEST (std::add_volatile,
C int&,
C int&);
241 TEST (std::add_volatile,
V int&,
V int&);
242 TEST (std::add_volatile,
CV int&,
CV int&);
244 TEST (std::add_volatile,
void (&)(),
void (&)());
247 TEST (std::add_volatile,
void (),
void ());
250static void test_add_cv ()
252 TEST (std::add_cv,
int,
CV int);
253 TEST (std::add_cv,
C int,
CV int);
254 TEST (std::add_cv,
V int,
CV int);
257 TEST (std::add_cv,
int*,
int*
CV);
258 TEST (std::add_cv,
C int*,
C int*
CV);
259 TEST (std::add_cv,
V int*,
V int*
CV);
262 TEST (std::add_cv,
int*
C ,
int*
CV);
263 TEST (std::add_cv,
int*
V,
int*
CV);
264 TEST (std::add_cv,
int*
CV,
int*
CV);
266 TEST (std::add_cv,
C int*
C ,
C int*
CV);
270 TEST (std::add_cv,
V int*
C ,
V int*
CV);
278 TEST (std::add_cv,
void (*)(),
void (*
CV)());
281 TEST (std::add_cv,
int&,
int&);
282 TEST (std::add_cv,
C int&,
C int&);
283 TEST (std::add_cv,
V int&,
V int&);
284 TEST (std::add_cv,
CV int&,
CV int&);
286 TEST (std::add_cv,
void (&)(),
void (&)());
289 TEST (std::add_cv,
void (),
void ());
297 test_remove_volatile();
316 "test disabled because _RWSTD_NO_EXT_CXX_0X is defined");
324int main (
int argc,
char *argv[])
326 return rw_test (argc, argv, __FILE__,
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
_TEST_EXPORT int rw_test(int argc, char *argv[], const char *filename, const char *clause, const char *comment, int(*testfun)(int, char **), const char *optspec,...)
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_warn(int, const char *, int, const char *,...)