bump product version to 5.0.4.1
[LibreOffice.git] / cppu / qa / cppumaker / test_cppumaker.cxx
blobf6bff007b721e54f45ec561345ff8413a448f7f7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/types.h>
22 #include "FILE.hpp"
23 #include "lconv.hpp"
24 #include "tm.hpp"
25 #include "std.hpp"
26 #include "test/codemaker/cppumaker/XTest.hpp"
27 #include "test/codemaker/cppumaker/S1.hpp"
28 #include "test/codemaker/cppumaker/services/asm.hpp"
29 #include "test/codemaker/cppumaker/services/auto.hpp"
30 #include "test/codemaker/cppumaker/services/bool.hpp"
31 #include "test/codemaker/cppumaker/services/break.hpp"
32 //TODO: #include "test/codemaker/cppumaker/services/case.hpp"
33 #include "test/codemaker/cppumaker/services/catch.hpp"
34 //TODO: #include "test/codemaker/cppumaker/services/char.hpp"
35 #include "test/codemaker/cppumaker/services/class.hpp"
36 //TODO: #include "test/codemaker/cppumaker/services/const.hpp"
37 #include "test/codemaker/cppumaker/services/continue.hpp"
38 //TODO: #include "test/codemaker/cppumaker/services/default.hpp"
39 #include "test/codemaker/cppumaker/services/delete.hpp"
40 #include "test/codemaker/cppumaker/services/do.hpp"
41 //TODO: #include "test/codemaker/cppumaker/services/double.hpp"
42 #include "test/codemaker/cppumaker/services/else.hpp"
43 //TODO: #include "test/codemaker/cppumaker/services/enum.hpp"
44 #include "test/codemaker/cppumaker/services/explicit.hpp"
45 #include "test/codemaker/cppumaker/services/export.hpp"
46 #include "test/codemaker/cppumaker/services/extern.hpp"
47 #include "test/codemaker/cppumaker/services/false.hpp"
48 //TODO: #include "test/codemaker/cppumaker/services/float.hpp"
49 #include "test/codemaker/cppumaker/services/for.hpp"
50 #include "test/codemaker/cppumaker/services/friend.hpp"
51 #include "test/codemaker/cppumaker/services/goto.hpp"
52 #include "test/codemaker/cppumaker/services/if.hpp"
53 #include "test/codemaker/cppumaker/services/inline.hpp"
54 #include "test/codemaker/cppumaker/services/int.hpp"
55 //TODO: #include "test/codemaker/cppumaker/services/long.hpp"
56 #include "test/codemaker/cppumaker/services/mutable.hpp"
57 #include "test/codemaker/cppumaker/services/namespace.hpp"
58 #include "test/codemaker/cppumaker/services/new.hpp"
59 #include "test/codemaker/cppumaker/services/operator.hpp"
60 #include "test/codemaker/cppumaker/services/private.hpp"
61 #include "test/codemaker/cppumaker/services/protected.hpp"
62 #include "test/codemaker/cppumaker/services/public.hpp"
63 #include "test/codemaker/cppumaker/services/register.hpp"
64 #include "test/codemaker/cppumaker/services/return.hpp"
65 //TODO: #include "test/codemaker/cppumaker/services/short.hpp"
66 #include "test/codemaker/cppumaker/services/signed.hpp"
67 #include "test/codemaker/cppumaker/services/sizeof.hpp"
68 #include "test/codemaker/cppumaker/services/static.hpp"
69 //TODO: #include "test/codemaker/cppumaker/services/struct.hpp"
70 //TODO: #include "test/codemaker/cppumaker/services/switch.hpp"
71 #include "test/codemaker/cppumaker/services/template.hpp"
72 #include "test/codemaker/cppumaker/services/this.hpp"
73 #include "test/codemaker/cppumaker/services/throw.hpp"
74 #include "test/codemaker/cppumaker/services/true.hpp"
75 #include "test/codemaker/cppumaker/services/try.hpp"
76 //TODO: #include "test/codemaker/cppumaker/services/typedef.hpp"
77 #include "test/codemaker/cppumaker/services/typeid.hpp"
78 #include "test/codemaker/cppumaker/services/typename.hpp"
79 //TODO: #include "test/codemaker/cppumaker/services/union.hpp"
80 //TODO: #include "test/codemaker/cppumaker/services/unsigned.hpp"
81 #include "test/codemaker/cppumaker/services/using.hpp"
82 #include "test/codemaker/cppumaker/services/virtual.hpp"
83 //TODO: #include "test/codemaker/cppumaker/services/void.hpp"
84 #include "test/codemaker/cppumaker/services/volatile.hpp"
85 #include "test/codemaker/cppumaker/services/while.hpp"
86 #include "test/codemaker/cppumaker/services/and.hpp"
87 #include "test/codemaker/cppumaker/services/bitand.hpp"
88 #include "test/codemaker/cppumaker/services/bitor.hpp"
89 #include "test/codemaker/cppumaker/services/compl.hpp"
90 #include "test/codemaker/cppumaker/services/not.hpp"
91 #include "test/codemaker/cppumaker/services/or.hpp"
92 #include "test/codemaker/cppumaker/services/xor.hpp"
93 #include "test/codemaker/cppumaker/services/BUFSIZ.hpp"
94 #include "test/codemaker/cppumaker/services/CLOCKS_PER_SEC.hpp"
95 #include "test/codemaker/cppumaker/services/EDOM.hpp"
96 #include "test/codemaker/cppumaker/services/EOF.hpp"
97 #include "test/codemaker/cppumaker/services/ERANGE.hpp"
98 #include "test/codemaker/cppumaker/services/EXIT_FAILURE.hpp"
99 #include "test/codemaker/cppumaker/services/EXIT_SUCCESS.hpp"
100 #include "test/codemaker/cppumaker/services/FILENAME_MAX.hpp"
101 #include "test/codemaker/cppumaker/services/FOPEN_MAX.hpp"
102 #include "test/codemaker/cppumaker/services/HUGE_VAL.hpp"
103 #include "test/codemaker/cppumaker/services/LC_ALL.hpp"
104 #include "test/codemaker/cppumaker/services/LC_COLLATE.hpp"
105 #include "test/codemaker/cppumaker/services/LC_CTYPE.hpp"
106 #include "test/codemaker/cppumaker/services/LC_MONETARY.hpp"
107 #include "test/codemaker/cppumaker/services/LC_NUMERIC.hpp"
108 #include "test/codemaker/cppumaker/services/LC_TIME.hpp"
109 #include "test/codemaker/cppumaker/services/L_tmpnam.hpp"
110 #include "test/codemaker/cppumaker/services/MB_CUR_MAX.hpp"
111 #include "test/codemaker/cppumaker/services/NULL.hpp"
112 #include "test/codemaker/cppumaker/services/RAND_MAX.hpp"
113 #include "test/codemaker/cppumaker/services/SEEK_CUR.hpp"
114 #include "test/codemaker/cppumaker/services/SEEK_END.hpp"
115 #include "test/codemaker/cppumaker/services/SEEK_SET.hpp"
116 #include "test/codemaker/cppumaker/services/SIGABRT.hpp"
117 #include "test/codemaker/cppumaker/services/SIGFPE.hpp"
118 #include "test/codemaker/cppumaker/services/SIGILL.hpp"
119 #include "test/codemaker/cppumaker/services/SIGINT.hpp"
120 #include "test/codemaker/cppumaker/services/SIGSEGV.hpp"
121 #include "test/codemaker/cppumaker/services/SIGTERM.hpp"
122 #include "test/codemaker/cppumaker/services/SIG_DFL.hpp"
123 #include "test/codemaker/cppumaker/services/SIG_ERR.hpp"
124 #include "test/codemaker/cppumaker/services/SIG_IGN.hpp"
125 #include "test/codemaker/cppumaker/services/TMP_MAX.hpp"
126 #include "test/codemaker/cppumaker/services/WCHAR_MAX.hpp"
127 #include "test/codemaker/cppumaker/services/WCHAR_MIN.hpp"
128 #include "test/codemaker/cppumaker/services/WEOF.hpp"
129 #include "test/codemaker/cppumaker/services/assert.hpp"
130 #include "test/codemaker/cppumaker/services/errno.hpp"
131 #include "test/codemaker/cppumaker/services/offsetof.hpp"
132 #include "test/codemaker/cppumaker/services/setjmp.hpp"
133 #include "test/codemaker/cppumaker/services/stderr.hpp"
134 #include "test/codemaker/cppumaker/services/stdin.hpp"
135 #include "test/codemaker/cppumaker/services/stdout.hpp"
136 #include "test/codemaker/cppumaker/services/CHAR_BIT.hpp"
137 #include "test/codemaker/cppumaker/services/CHAR_MAX.hpp"
138 #include "test/codemaker/cppumaker/services/CHAR_MIN.hpp"
139 #include "test/codemaker/cppumaker/services/DBL_DIG.hpp"
140 #include "test/codemaker/cppumaker/services/DBL_EPSILON.hpp"
141 #include "test/codemaker/cppumaker/services/DBL_MANT_DIG.hpp"
142 #include "test/codemaker/cppumaker/services/DBL_MAX.hpp"
143 #include "test/codemaker/cppumaker/services/DBL_MAX_10_EXP.hpp"
144 #include "test/codemaker/cppumaker/services/DBL_MAX_EXP.hpp"
145 #include "test/codemaker/cppumaker/services/DBL_MIN.hpp"
146 #include "test/codemaker/cppumaker/services/DBL_MIN_10_EXP.hpp"
147 #include "test/codemaker/cppumaker/services/DBL_MIN_EXP.hpp"
148 #include "test/codemaker/cppumaker/services/FLT_DIG.hpp"
149 #include "test/codemaker/cppumaker/services/FLT_EPSILON.hpp"
150 #include "test/codemaker/cppumaker/services/FLT_MANT_DIG.hpp"
151 #include "test/codemaker/cppumaker/services/FLT_MAX.hpp"
152 #include "test/codemaker/cppumaker/services/FLT_MAX_10_EXP.hpp"
153 #include "test/codemaker/cppumaker/services/FLT_MAX_EXP.hpp"
154 #include "test/codemaker/cppumaker/services/FLT_MIN.hpp"
155 #include "test/codemaker/cppumaker/services/FLT_MIN_10_EXP.hpp"
156 #include "test/codemaker/cppumaker/services/FLT_MIN_EXP.hpp"
157 #include "test/codemaker/cppumaker/services/FLT_RADIX.hpp"
158 #include "test/codemaker/cppumaker/services/FLT_ROUNDS.hpp"
159 #include "test/codemaker/cppumaker/services/INT_MAX.hpp"
160 #include "test/codemaker/cppumaker/services/INT_MIN.hpp"
161 #include "test/codemaker/cppumaker/services/LDBL_DIG.hpp"
162 #include "test/codemaker/cppumaker/services/LDBL_EPSILON.hpp"
163 #include "test/codemaker/cppumaker/services/LDBL_MANT_DIG.hpp"
164 #include "test/codemaker/cppumaker/services/LDBL_MAX.hpp"
165 #include "test/codemaker/cppumaker/services/LDBL_MAX_10_EXP.hpp"
166 #include "test/codemaker/cppumaker/services/LDBL_MAX_EXP.hpp"
167 #include "test/codemaker/cppumaker/services/LDBL_MIN.hpp"
168 #include "test/codemaker/cppumaker/services/LDBL_MIN_10_EXP.hpp"
169 #include "test/codemaker/cppumaker/services/LDBL_MIN_EXP.hpp"
170 #include "test/codemaker/cppumaker/services/LONG_MAX.hpp"
171 #include "test/codemaker/cppumaker/services/LONG_MIN.hpp"
172 #include "test/codemaker/cppumaker/services/MB_LEN_MAX.hpp"
173 #include "test/codemaker/cppumaker/services/SCHAR_MAX.hpp"
174 #include "test/codemaker/cppumaker/services/SCHAR_MIN.hpp"
175 #include "test/codemaker/cppumaker/services/SHRT_MAX.hpp"
176 #include "test/codemaker/cppumaker/services/SHRT_MIN.hpp"
177 #include "test/codemaker/cppumaker/services/UCHAR_MAX.hpp"
178 #include "test/codemaker/cppumaker/services/UINT_MAX.hpp"
179 #include "test/codemaker/cppumaker/services/ULONG_MAX.hpp"
180 #include "test/codemaker/cppumaker/services/USHRT_MAX.hpp"
181 #include "test/codemaker/cppumaker/services/FILE.hpp"
182 #include "test/codemaker/cppumaker/services/lconv.hpp"
183 #include "test/codemaker/cppumaker/services/tm.hpp"
184 #include "test/codemaker/cppumaker/services/std.hpp"
185 #include "test/codemaker/cppumaker/services/NDEBUG.hpp"
186 #include "test/codemaker/cppumaker/services/create.hpp"
187 #include "test/codemaker/cppumaker/singletons/asm.hpp"
188 #include "test/codemaker/cppumaker/singletons/auto.hpp"
189 #include "test/codemaker/cppumaker/singletons/bool.hpp"
190 #include "test/codemaker/cppumaker/singletons/break.hpp"
191 //TODO: #include "test/codemaker/cppumaker/singletons/case.hpp"
192 #include "test/codemaker/cppumaker/singletons/catch.hpp"
193 //TODO: #include "test/codemaker/cppumaker/singletons/char.hpp"
194 #include "test/codemaker/cppumaker/singletons/class.hpp"
195 //TODO: #include "test/codemaker/cppumaker/singletons/const.hpp"
196 #include "test/codemaker/cppumaker/singletons/continue.hpp"
197 //TODO: #include "test/codemaker/cppumaker/singletons/default.hpp"
198 #include "test/codemaker/cppumaker/singletons/delete.hpp"
199 #include "test/codemaker/cppumaker/singletons/do.hpp"
200 //TODO: #include "test/codemaker/cppumaker/singletons/double.hpp"
201 #include "test/codemaker/cppumaker/singletons/else.hpp"
202 //TODO: #include "test/codemaker/cppumaker/singletons/enum.hpp"
203 #include "test/codemaker/cppumaker/singletons/explicit.hpp"
204 #include "test/codemaker/cppumaker/singletons/export.hpp"
205 #include "test/codemaker/cppumaker/singletons/extern.hpp"
206 #include "test/codemaker/cppumaker/singletons/false.hpp"
207 //TODO: #include "test/codemaker/cppumaker/singletons/float.hpp"
208 #include "test/codemaker/cppumaker/singletons/for.hpp"
209 #include "test/codemaker/cppumaker/singletons/friend.hpp"
210 #include "test/codemaker/cppumaker/singletons/goto.hpp"
211 #include "test/codemaker/cppumaker/singletons/if.hpp"
212 #include "test/codemaker/cppumaker/singletons/inline.hpp"
213 #include "test/codemaker/cppumaker/singletons/int.hpp"
214 //TODO: #include "test/codemaker/cppumaker/singletons/long.hpp"
215 #include "test/codemaker/cppumaker/singletons/mutable.hpp"
216 #include "test/codemaker/cppumaker/singletons/namespace.hpp"
217 #include "test/codemaker/cppumaker/singletons/new.hpp"
218 #include "test/codemaker/cppumaker/singletons/operator.hpp"
219 #include "test/codemaker/cppumaker/singletons/private.hpp"
220 #include "test/codemaker/cppumaker/singletons/protected.hpp"
221 #include "test/codemaker/cppumaker/singletons/public.hpp"
222 #include "test/codemaker/cppumaker/singletons/register.hpp"
223 #include "test/codemaker/cppumaker/singletons/return.hpp"
224 //TODO: #include "test/codemaker/cppumaker/singletons/short.hpp"
225 #include "test/codemaker/cppumaker/singletons/signed.hpp"
226 #include "test/codemaker/cppumaker/singletons/sizeof.hpp"
227 #include "test/codemaker/cppumaker/singletons/static.hpp"
228 //TODO: #include "test/codemaker/cppumaker/singletons/struct.hpp"
229 //TODO: #include "test/codemaker/cppumaker/singletons/switch.hpp"
230 #include "test/codemaker/cppumaker/singletons/template.hpp"
231 #include "test/codemaker/cppumaker/singletons/this.hpp"
232 #include "test/codemaker/cppumaker/singletons/throw.hpp"
233 #include "test/codemaker/cppumaker/singletons/true.hpp"
234 #include "test/codemaker/cppumaker/singletons/try.hpp"
235 //TODO: #include "test/codemaker/cppumaker/singletons/typedef.hpp"
236 #include "test/codemaker/cppumaker/singletons/typeid.hpp"
237 #include "test/codemaker/cppumaker/singletons/typename.hpp"
238 //TODO: #include "test/codemaker/cppumaker/singletons/union.hpp"
239 //TODO: #include "test/codemaker/cppumaker/singletons/unsigned.hpp"
240 #include "test/codemaker/cppumaker/singletons/using.hpp"
241 #include "test/codemaker/cppumaker/singletons/virtual.hpp"
242 //TODO: #include "test/codemaker/cppumaker/singletons/void.hpp"
243 #include "test/codemaker/cppumaker/singletons/volatile.hpp"
244 #include "test/codemaker/cppumaker/singletons/while.hpp"
245 #include "test/codemaker/cppumaker/singletons/and.hpp"
246 #include "test/codemaker/cppumaker/singletons/bitand.hpp"
247 #include "test/codemaker/cppumaker/singletons/bitor.hpp"
248 #include "test/codemaker/cppumaker/singletons/compl.hpp"
249 #include "test/codemaker/cppumaker/singletons/not.hpp"
250 #include "test/codemaker/cppumaker/singletons/or.hpp"
251 #include "test/codemaker/cppumaker/singletons/xor.hpp"
252 #include "test/codemaker/cppumaker/singletons/BUFSIZ.hpp"
253 #include "test/codemaker/cppumaker/singletons/CLOCKS_PER_SEC.hpp"
254 #include "test/codemaker/cppumaker/singletons/EDOM.hpp"
255 #include "test/codemaker/cppumaker/singletons/EOF.hpp"
256 #include "test/codemaker/cppumaker/singletons/ERANGE.hpp"
257 #include "test/codemaker/cppumaker/singletons/EXIT_FAILURE.hpp"
258 #include "test/codemaker/cppumaker/singletons/EXIT_SUCCESS.hpp"
259 #include "test/codemaker/cppumaker/singletons/FILENAME_MAX.hpp"
260 #include "test/codemaker/cppumaker/singletons/FOPEN_MAX.hpp"
261 #include "test/codemaker/cppumaker/singletons/HUGE_VAL.hpp"
262 #include "test/codemaker/cppumaker/singletons/LC_ALL.hpp"
263 #include "test/codemaker/cppumaker/singletons/LC_COLLATE.hpp"
264 #include "test/codemaker/cppumaker/singletons/LC_CTYPE.hpp"
265 #include "test/codemaker/cppumaker/singletons/LC_MONETARY.hpp"
266 #include "test/codemaker/cppumaker/singletons/LC_NUMERIC.hpp"
267 #include "test/codemaker/cppumaker/singletons/LC_TIME.hpp"
268 #include "test/codemaker/cppumaker/singletons/L_tmpnam.hpp"
269 #include "test/codemaker/cppumaker/singletons/MB_CUR_MAX.hpp"
270 #include "test/codemaker/cppumaker/singletons/NULL.hpp"
271 #include "test/codemaker/cppumaker/singletons/RAND_MAX.hpp"
272 #include "test/codemaker/cppumaker/singletons/SEEK_CUR.hpp"
273 #include "test/codemaker/cppumaker/singletons/SEEK_END.hpp"
274 #include "test/codemaker/cppumaker/singletons/SEEK_SET.hpp"
275 #include "test/codemaker/cppumaker/singletons/SIGABRT.hpp"
276 #include "test/codemaker/cppumaker/singletons/SIGFPE.hpp"
277 #include "test/codemaker/cppumaker/singletons/SIGILL.hpp"
278 #include "test/codemaker/cppumaker/singletons/SIGINT.hpp"
279 #include "test/codemaker/cppumaker/singletons/SIGSEGV.hpp"
280 #include "test/codemaker/cppumaker/singletons/SIGTERM.hpp"
281 #include "test/codemaker/cppumaker/singletons/SIG_DFL.hpp"
282 #include "test/codemaker/cppumaker/singletons/SIG_ERR.hpp"
283 #include "test/codemaker/cppumaker/singletons/SIG_IGN.hpp"
284 #include "test/codemaker/cppumaker/singletons/TMP_MAX.hpp"
285 #include "test/codemaker/cppumaker/singletons/WCHAR_MAX.hpp"
286 #include "test/codemaker/cppumaker/singletons/WCHAR_MIN.hpp"
287 #include "test/codemaker/cppumaker/singletons/WEOF.hpp"
288 #include "test/codemaker/cppumaker/singletons/assert.hpp"
289 #include "test/codemaker/cppumaker/singletons/errno.hpp"
290 #include "test/codemaker/cppumaker/singletons/offsetof.hpp"
291 #include "test/codemaker/cppumaker/singletons/setjmp.hpp"
292 #include "test/codemaker/cppumaker/singletons/stderr.hpp"
293 #include "test/codemaker/cppumaker/singletons/stdin.hpp"
294 #include "test/codemaker/cppumaker/singletons/stdout.hpp"
295 #include "test/codemaker/cppumaker/singletons/CHAR_BIT.hpp"
296 #include "test/codemaker/cppumaker/singletons/CHAR_MAX.hpp"
297 #include "test/codemaker/cppumaker/singletons/CHAR_MIN.hpp"
298 #include "test/codemaker/cppumaker/singletons/DBL_DIG.hpp"
299 #include "test/codemaker/cppumaker/singletons/DBL_EPSILON.hpp"
300 #include "test/codemaker/cppumaker/singletons/DBL_MANT_DIG.hpp"
301 #include "test/codemaker/cppumaker/singletons/DBL_MAX.hpp"
302 #include "test/codemaker/cppumaker/singletons/DBL_MAX_10_EXP.hpp"
303 #include "test/codemaker/cppumaker/singletons/DBL_MAX_EXP.hpp"
304 #include "test/codemaker/cppumaker/singletons/DBL_MIN.hpp"
305 #include "test/codemaker/cppumaker/singletons/DBL_MIN_10_EXP.hpp"
306 #include "test/codemaker/cppumaker/singletons/DBL_MIN_EXP.hpp"
307 #include "test/codemaker/cppumaker/singletons/FLT_DIG.hpp"
308 #include "test/codemaker/cppumaker/singletons/FLT_EPSILON.hpp"
309 #include "test/codemaker/cppumaker/singletons/FLT_MANT_DIG.hpp"
310 #include "test/codemaker/cppumaker/singletons/FLT_MAX.hpp"
311 #include "test/codemaker/cppumaker/singletons/FLT_MAX_10_EXP.hpp"
312 #include "test/codemaker/cppumaker/singletons/FLT_MAX_EXP.hpp"
313 #include "test/codemaker/cppumaker/singletons/FLT_MIN.hpp"
314 #include "test/codemaker/cppumaker/singletons/FLT_MIN_10_EXP.hpp"
315 #include "test/codemaker/cppumaker/singletons/FLT_MIN_EXP.hpp"
316 #include "test/codemaker/cppumaker/singletons/FLT_RADIX.hpp"
317 #include "test/codemaker/cppumaker/singletons/FLT_ROUNDS.hpp"
318 #include "test/codemaker/cppumaker/singletons/INT_MAX.hpp"
319 #include "test/codemaker/cppumaker/singletons/INT_MIN.hpp"
320 #include "test/codemaker/cppumaker/singletons/LDBL_DIG.hpp"
321 #include "test/codemaker/cppumaker/singletons/LDBL_EPSILON.hpp"
322 #include "test/codemaker/cppumaker/singletons/LDBL_MANT_DIG.hpp"
323 #include "test/codemaker/cppumaker/singletons/LDBL_MAX.hpp"
324 #include "test/codemaker/cppumaker/singletons/LDBL_MAX_10_EXP.hpp"
325 #include "test/codemaker/cppumaker/singletons/LDBL_MAX_EXP.hpp"
326 #include "test/codemaker/cppumaker/singletons/LDBL_MIN.hpp"
327 #include "test/codemaker/cppumaker/singletons/LDBL_MIN_10_EXP.hpp"
328 #include "test/codemaker/cppumaker/singletons/LDBL_MIN_EXP.hpp"
329 #include "test/codemaker/cppumaker/singletons/LONG_MAX.hpp"
330 #include "test/codemaker/cppumaker/singletons/LONG_MIN.hpp"
331 #include "test/codemaker/cppumaker/singletons/MB_LEN_MAX.hpp"
332 #include "test/codemaker/cppumaker/singletons/SCHAR_MAX.hpp"
333 #include "test/codemaker/cppumaker/singletons/SCHAR_MIN.hpp"
334 #include "test/codemaker/cppumaker/singletons/SHRT_MAX.hpp"
335 #include "test/codemaker/cppumaker/singletons/SHRT_MIN.hpp"
336 #include "test/codemaker/cppumaker/singletons/UCHAR_MAX.hpp"
337 #include "test/codemaker/cppumaker/singletons/UINT_MAX.hpp"
338 #include "test/codemaker/cppumaker/singletons/ULONG_MAX.hpp"
339 #include "test/codemaker/cppumaker/singletons/USHRT_MAX.hpp"
340 #include "test/codemaker/cppumaker/singletons/FILE.hpp"
341 #include "test/codemaker/cppumaker/singletons/lconv.hpp"
342 #include "test/codemaker/cppumaker/singletons/tm.hpp"
343 #include "test/codemaker/cppumaker/singletons/std.hpp"
344 #include "test/codemaker/cppumaker/singletons/NDEBUG.hpp"
345 #include "test/codemaker/cppumaker/singletons/get.hpp"
346 #include "test/codemaker/cppumaker/HelperEnum.hpp"
347 #include "test/codemaker/cppumaker/HelperStruct.hpp"
348 #include "test/codemaker/cppumaker/BigStruct.hpp"
349 #include "test/codemaker/cppumaker/Struct.hpp"
350 #include "test/codemaker/cppumaker/StructUsage.hpp"
351 #include "test/codemaker/cppumaker/AlignmentDerivedStruct.hpp"
352 #include "test/codemaker/cppumaker/TestException1.hpp"
353 #include "test/codemaker/cppumaker/TestException2.hpp"
354 #include "test/codemaker/cppumaker/Constants.hpp"
356 #include "boost/scoped_array.hpp"
357 #include "com/sun/star/uno/Any.hxx"
358 #include "com/sun/star/uno/Type.hxx"
359 #include "com/sun/star/uno/TypeClass.hpp"
360 #include <cppunit/TestFixture.h>
361 #include <cppunit/extensions/HelperMacros.h>
362 #include <cppunit/plugin/TestPlugIn.h>
363 #include "rtl/ustring.hxx"
365 #include <cstddef>
366 #include <iostream>
368 namespace com { namespace sun { namespace star { namespace uno {
370 std::ostream & operator <<(
371 std::ostream & out,
372 SAL_UNUSED_PARAMETER com::sun::star::uno::Exception const &)
374 return out << "<UNO exception>";
377 } } } }
379 namespace test { namespace codemaker { namespace cppumaker {
381 bool operator ==(
382 test::codemaker::cppumaker::TestException1 const & e1,
383 test::codemaker::cppumaker::TestException1 const & e2)
385 return e1.Message == e2.Message && e1.Context == e2.Context
386 && e1.m1 == e2.m1 && e1.m2 == e2.m2 && e1.m3 == e2.m3
387 && e1.m4.member1 == e2.m4.member1 && e1.m4.member2 == e2.m4.member2;
390 } } }
392 namespace {
394 class Test: public CppUnit::TestFixture {
395 public:
396 void testBigStruct();
398 void testPolyStruct();
400 void testExceptions();
402 void testConstants();
404 CPPUNIT_TEST_SUITE(Test);
405 CPPUNIT_TEST(testBigStruct);
406 CPPUNIT_TEST(testPolyStruct);
407 CPPUNIT_TEST(testExceptions);
408 CPPUNIT_TEST(testConstants);
409 CPPUNIT_TEST_SUITE_END();
412 struct Guard {
413 explicit Guard(void * buffer):
414 p(new(buffer) test::codemaker::cppumaker::BigStruct) {}
416 ~Guard() { p->test::codemaker::cppumaker::BigStruct::~BigStruct(); }
418 test::codemaker::cppumaker::BigStruct * const p;
421 void Test::testBigStruct() {
422 // Default-initialize a BigStruct instance on top of a memory buffer filled
423 // with random data, and make sure that all members are default-initialized:
424 boost::scoped_array< char > buffer(
425 new char[sizeof (test::codemaker::cppumaker::BigStruct)]);
426 for (std::size_t i = 0; i < sizeof (test::codemaker::cppumaker::BigStruct);
427 ++i)
429 buffer[i] = '\x56';
431 Guard guard(buffer.get());
432 CPPUNIT_ASSERT_EQUAL(guard.p->m1, sal_False);
433 CPPUNIT_ASSERT_EQUAL(guard.p->m2, static_cast< sal_Int8 >(0));
434 CPPUNIT_ASSERT_EQUAL(guard.p->m3, static_cast< sal_Int16 >(0));
435 CPPUNIT_ASSERT_EQUAL(guard.p->m4, static_cast< sal_uInt16 >(0));
436 CPPUNIT_ASSERT_EQUAL(guard.p->m5, static_cast< sal_Int32 >(0));
437 CPPUNIT_ASSERT_EQUAL(guard.p->m6, static_cast< sal_uInt32 >(0));
438 CPPUNIT_ASSERT_EQUAL(guard.p->m7, static_cast< sal_Int64 >(0));
439 CPPUNIT_ASSERT_EQUAL(guard.p->m8, static_cast< sal_uInt64 >(0));
440 CPPUNIT_ASSERT_EQUAL(guard.p->m9, 0.0f);
441 CPPUNIT_ASSERT_EQUAL(guard.p->m10, 0.0);
442 CPPUNIT_ASSERT_EQUAL(guard.p->m11, static_cast< sal_Unicode >(0));
443 CPPUNIT_ASSERT_EQUAL(guard.p->m12.getLength(), static_cast< sal_Int32 >(0));
444 CPPUNIT_ASSERT_EQUAL(
445 +guard.p->m13.getTypeClass(), +com::sun::star::uno::TypeClass_VOID);
446 CPPUNIT_ASSERT_EQUAL(guard.p->m14.hasValue(), false);
447 CPPUNIT_ASSERT_EQUAL(guard.p->m15.getLength(), static_cast< sal_Int32 >(0));
448 CPPUNIT_ASSERT_EQUAL(
449 +guard.p->m16, +test::codemaker::cppumaker::HelperEnum_ZERO);
450 CPPUNIT_ASSERT_EQUAL(guard.p->m17.m1, sal_False);
451 CPPUNIT_ASSERT_EQUAL(guard.p->m17.m2.is(), false);
452 CPPUNIT_ASSERT_EQUAL(guard.p->m18.is(), false);
453 CPPUNIT_ASSERT_EQUAL(guard.p->m19, static_cast< sal_Int8 >(0));
454 CPPUNIT_ASSERT_EQUAL(
455 +guard.p->m20, +test::codemaker::cppumaker::HelperEnum_ZERO);
456 CPPUNIT_ASSERT_EQUAL(guard.p->m21.getLength(), static_cast< sal_Int32 >(0));
457 CPPUNIT_ASSERT_EQUAL(guard.p->m22.getLength(), static_cast< sal_Int32 >(0));
458 CPPUNIT_ASSERT_EQUAL(guard.p->m23.getLength(), static_cast< sal_Int32 >(0));
460 //This is a very platform specific test.
461 #if defined __GNUC__ && __GNUC__ >= 3 // see CPPU_GCC3_ALIGN
462 #if defined(LINUX) && (defined (X86_64) || defined(X86) || defined(PPC))
463 CPPUNIT_ASSERT_EQUAL(
464 #if defined X86_64 || defined PPC
465 static_cast< std::size_t >(24),
466 #else
467 static_cast< std::size_t >(16),
468 #endif
469 sizeof (test::codemaker::cppumaker::AlignmentDerivedStruct));
470 #endif
471 #endif
473 com::sun::star::uno::Type t(
474 cppu::UnoType< test::codemaker::cppumaker::BigStruct >::get());
475 typelib_TypeDescription * td = NULL;
476 t.getDescription(&td);
477 typelib_typedescription_complete(&td);
478 fprintf(stdout, "#### 1\n");
479 CPPUNIT_ASSERT(td != NULL);
480 CPPUNIT_ASSERT_EQUAL(+typelib_TypeClass_STRUCT, +td->eTypeClass);
481 typelib_StructTypeDescription * std =
482 reinterpret_cast< typelib_StructTypeDescription * >(td);
483 CPPUNIT_ASSERT_EQUAL(+typelib_TypeClass_UNSIGNED_SHORT, +std->aBase.ppTypeRefs[3]->eTypeClass); // unsigned short m4;
484 CPPUNIT_ASSERT_EQUAL(+typelib_TypeClass_CHAR, +std->aBase.ppTypeRefs[10]->eTypeClass); // char m11;
487 void Test::testPolyStruct() {
488 CPPUNIT_ASSERT_EQUAL(
489 rtl::OUString(
490 "test.codemaker.cppumaker.Struct<char,short>"),
491 (com::sun::star::uno::makeAny(
492 test::codemaker::cppumaker::Struct< sal_Unicode, sal_Int16 >()).
493 getValueType().getTypeName()));
495 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >
496 aEmptySequence;
498 CPPUNIT_ASSERT_EQUAL(
499 (test::codemaker::cppumaker::make_Struct< sal_uInt32, sal_Bool >(5,
500 aEmptySequence).member1),
501 static_cast< sal_uInt32 >(5));
504 void Test::testExceptions() {
505 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >
506 aEmptySequence;
508 test::codemaker::cppumaker::TestException1 e11(
509 rtl::OUString("abc"), 0, 1,
510 com::sun::star::uno::makeAny(123.0),
511 test::codemaker::cppumaker::HelperEnum_ONE,
512 test::codemaker::cppumaker::Struct<sal_Int32, sal_Int32>(5, aEmptySequence), 2);
513 test::codemaker::cppumaker::TestException1 e12(e11);
514 CPPUNIT_ASSERT_EQUAL(e11, e12);
515 test::codemaker::cppumaker::TestException1 e13;
516 e13 = e11;
517 CPPUNIT_ASSERT_EQUAL(e11, e13);
518 test::codemaker::cppumaker::TestException2 e21(
519 rtl::OUString("abc"), 0, 1,
520 com::sun::star::uno::makeAny(123.0),
521 test::codemaker::cppumaker::HelperEnum_ONE,
522 test::codemaker::cppumaker::Struct<sal_Int32, sal_Int32>(5, aEmptySequence), 2);
523 test::codemaker::cppumaker::TestException2 e22(e21);
524 CPPUNIT_ASSERT_EQUAL(e21, e22);
525 test::codemaker::cppumaker::TestException2 e23;
526 e23 = e21;
527 CPPUNIT_ASSERT_EQUAL(e21, e23);
530 void Test::testConstants() {
531 CPPUNIT_ASSERT_EQUAL(
532 SAL_MIN_INT8, test::codemaker::cppumaker::Constants::byteMin);
533 CPPUNIT_ASSERT_EQUAL(
534 SAL_MAX_INT8, test::codemaker::cppumaker::Constants::byteMax);
535 CPPUNIT_ASSERT_EQUAL(
536 SAL_MIN_INT16, test::codemaker::cppumaker::Constants::shortMin);
537 CPPUNIT_ASSERT_EQUAL(
538 SAL_MAX_INT16, test::codemaker::cppumaker::Constants::shortMax);
539 CPPUNIT_ASSERT_EQUAL(
540 static_cast< sal_uInt16 >(0),
541 test::codemaker::cppumaker::Constants::unsignedShortMin);
542 CPPUNIT_ASSERT_EQUAL(
543 SAL_MAX_UINT16,
544 test::codemaker::cppumaker::Constants::unsignedShortMax);
545 CPPUNIT_ASSERT_EQUAL(
546 SAL_MIN_INT32, test::codemaker::cppumaker::Constants::longMin);
547 CPPUNIT_ASSERT_EQUAL(
548 SAL_MAX_INT32, test::codemaker::cppumaker::Constants::longMax);
549 CPPUNIT_ASSERT_EQUAL(
550 static_cast< sal_uInt32 >(0),
551 test::codemaker::cppumaker::Constants::unsignedLongMin);
552 CPPUNIT_ASSERT_EQUAL(
553 SAL_MAX_UINT32, test::codemaker::cppumaker::Constants::unsignedLongMax);
554 CPPUNIT_ASSERT_EQUAL(
555 SAL_MIN_INT64, test::codemaker::cppumaker::Constants::hyperMin);
556 CPPUNIT_ASSERT_EQUAL(
557 SAL_MAX_INT64, test::codemaker::cppumaker::Constants::hyperMax);
558 CPPUNIT_ASSERT_EQUAL(
559 static_cast< sal_uInt64 >(0),
560 test::codemaker::cppumaker::Constants::unsignedHyperMin);
561 CPPUNIT_ASSERT_EQUAL(
562 SAL_MAX_UINT64,
563 test::codemaker::cppumaker::Constants::unsignedHyperMax);
566 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
570 CPPUNIT_PLUGIN_IMPLEMENT();
572 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */