sync master with lastest vba changes
[ooovba.git] / codemaker / test / cppumaker / test_codemaker_cppumaker.cxx
blob94f8569f5dc502d019e861c9dffc9845d0efb79a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: test_codemaker_cppumaker.cxx,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_codemaker.hxx"
34 #include "FILE.hpp"
35 #include "lconv.hpp"
36 #include "tm.hpp"
37 #include "std.hpp"
38 #include "test/codemaker/cppumaker/XTest.hpp"
39 #include "test/codemaker/cppumaker/S1.hpp"
40 #include "test/codemaker/cppumaker/services/asm.hpp"
41 #include "test/codemaker/cppumaker/services/auto.hpp"
42 #include "test/codemaker/cppumaker/services/bool.hpp"
43 #include "test/codemaker/cppumaker/services/break.hpp"
44 //TODO: #include "test/codemaker/cppumaker/services/case.hpp"
45 #include "test/codemaker/cppumaker/services/catch.hpp"
46 //TODO: #include "test/codemaker/cppumaker/services/char.hpp"
47 #include "test/codemaker/cppumaker/services/class.hpp"
48 //TODO: #include "test/codemaker/cppumaker/services/const.hpp"
49 #include "test/codemaker/cppumaker/services/continue.hpp"
50 //TODO: #include "test/codemaker/cppumaker/services/default.hpp"
51 #include "test/codemaker/cppumaker/services/delete.hpp"
52 #include "test/codemaker/cppumaker/services/do.hpp"
53 //TODO: #include "test/codemaker/cppumaker/services/double.hpp"
54 #include "test/codemaker/cppumaker/services/else.hpp"
55 //TODO: #include "test/codemaker/cppumaker/services/enum.hpp"
56 #include "test/codemaker/cppumaker/services/explicit.hpp"
57 #include "test/codemaker/cppumaker/services/export.hpp"
58 #include "test/codemaker/cppumaker/services/extern.hpp"
59 #include "test/codemaker/cppumaker/services/false.hpp"
60 //TODO: #include "test/codemaker/cppumaker/services/float.hpp"
61 #include "test/codemaker/cppumaker/services/for.hpp"
62 #include "test/codemaker/cppumaker/services/friend.hpp"
63 #include "test/codemaker/cppumaker/services/goto.hpp"
64 #include "test/codemaker/cppumaker/services/if.hpp"
65 #include "test/codemaker/cppumaker/services/inline.hpp"
66 #include "test/codemaker/cppumaker/services/int.hpp"
67 //TODO: #include "test/codemaker/cppumaker/services/long.hpp"
68 #include "test/codemaker/cppumaker/services/mutable.hpp"
69 #include "test/codemaker/cppumaker/services/namespace.hpp"
70 #include "test/codemaker/cppumaker/services/new.hpp"
71 #include "test/codemaker/cppumaker/services/operator.hpp"
72 #include "test/codemaker/cppumaker/services/private.hpp"
73 #include "test/codemaker/cppumaker/services/protected.hpp"
74 #include "test/codemaker/cppumaker/services/public.hpp"
75 #include "test/codemaker/cppumaker/services/register.hpp"
76 #include "test/codemaker/cppumaker/services/return.hpp"
77 //TODO: #include "test/codemaker/cppumaker/services/short.hpp"
78 #include "test/codemaker/cppumaker/services/signed.hpp"
79 #include "test/codemaker/cppumaker/services/sizeof.hpp"
80 #include "test/codemaker/cppumaker/services/static.hpp"
81 //TODO: #include "test/codemaker/cppumaker/services/struct.hpp"
82 //TODO: #include "test/codemaker/cppumaker/services/switch.hpp"
83 #include "test/codemaker/cppumaker/services/template.hpp"
84 #include "test/codemaker/cppumaker/services/this.hpp"
85 #include "test/codemaker/cppumaker/services/throw.hpp"
86 #include "test/codemaker/cppumaker/services/true.hpp"
87 #include "test/codemaker/cppumaker/services/try.hpp"
88 //TODO: #include "test/codemaker/cppumaker/services/typedef.hpp"
89 #include "test/codemaker/cppumaker/services/typeid.hpp"
90 #include "test/codemaker/cppumaker/services/typename.hpp"
91 //TODO: #include "test/codemaker/cppumaker/services/union.hpp"
92 //TODO: #include "test/codemaker/cppumaker/services/unsigned.hpp"
93 #include "test/codemaker/cppumaker/services/using.hpp"
94 #include "test/codemaker/cppumaker/services/virtual.hpp"
95 //TODO: #include "test/codemaker/cppumaker/services/void.hpp"
96 #include "test/codemaker/cppumaker/services/volatile.hpp"
97 #include "test/codemaker/cppumaker/services/while.hpp"
98 #include "test/codemaker/cppumaker/services/and.hpp"
99 #include "test/codemaker/cppumaker/services/bitand.hpp"
100 #include "test/codemaker/cppumaker/services/bitor.hpp"
101 #include "test/codemaker/cppumaker/services/compl.hpp"
102 #include "test/codemaker/cppumaker/services/not.hpp"
103 #include "test/codemaker/cppumaker/services/or.hpp"
104 #include "test/codemaker/cppumaker/services/xor.hpp"
105 #include "test/codemaker/cppumaker/services/BUFSIZ.hpp"
106 #include "test/codemaker/cppumaker/services/CLOCKS_PER_SEC.hpp"
107 #include "test/codemaker/cppumaker/services/EDOM.hpp"
108 #include "test/codemaker/cppumaker/services/EOF.hpp"
109 #include "test/codemaker/cppumaker/services/ERANGE.hpp"
110 #include "test/codemaker/cppumaker/services/EXIT_FAILURE.hpp"
111 #include "test/codemaker/cppumaker/services/EXIT_SUCCESS.hpp"
112 #include "test/codemaker/cppumaker/services/FILENAME_MAX.hpp"
113 #include "test/codemaker/cppumaker/services/FOPEN_MAX.hpp"
114 #include "test/codemaker/cppumaker/services/HUGE_VAL.hpp"
115 #include "test/codemaker/cppumaker/services/LC_ALL.hpp"
116 #include "test/codemaker/cppumaker/services/LC_COLLATE.hpp"
117 #include "test/codemaker/cppumaker/services/LC_CTYPE.hpp"
118 #include "test/codemaker/cppumaker/services/LC_MONETARY.hpp"
119 #include "test/codemaker/cppumaker/services/LC_NUMERIC.hpp"
120 #include "test/codemaker/cppumaker/services/LC_TIME.hpp"
121 #include "test/codemaker/cppumaker/services/L_tmpnam.hpp"
122 #include "test/codemaker/cppumaker/services/MB_CUR_MAX.hpp"
123 #include "test/codemaker/cppumaker/services/NULL.hpp"
124 #include "test/codemaker/cppumaker/services/RAND_MAX.hpp"
125 #include "test/codemaker/cppumaker/services/SEEK_CUR.hpp"
126 #include "test/codemaker/cppumaker/services/SEEK_END.hpp"
127 #include "test/codemaker/cppumaker/services/SEEK_SET.hpp"
128 #include "test/codemaker/cppumaker/services/SIGABRT.hpp"
129 #include "test/codemaker/cppumaker/services/SIGFPE.hpp"
130 #include "test/codemaker/cppumaker/services/SIGILL.hpp"
131 #include "test/codemaker/cppumaker/services/SIGINT.hpp"
132 #include "test/codemaker/cppumaker/services/SIGSEGV.hpp"
133 #include "test/codemaker/cppumaker/services/SIGTERM.hpp"
134 #include "test/codemaker/cppumaker/services/SIG_DFL.hpp"
135 #include "test/codemaker/cppumaker/services/SIG_ERR.hpp"
136 #include "test/codemaker/cppumaker/services/SIG_IGN.hpp"
137 #include "test/codemaker/cppumaker/services/TMP_MAX.hpp"
138 #include "test/codemaker/cppumaker/services/WCHAR_MAX.hpp"
139 #include "test/codemaker/cppumaker/services/WCHAR_MIN.hpp"
140 #include "test/codemaker/cppumaker/services/WEOF.hpp"
141 #include "test/codemaker/cppumaker/services/assert.hpp"
142 #include "test/codemaker/cppumaker/services/errno.hpp"
143 #include "test/codemaker/cppumaker/services/offsetof.hpp"
144 #include "test/codemaker/cppumaker/services/setjmp.hpp"
145 #include "test/codemaker/cppumaker/services/stderr.hpp"
146 #include "test/codemaker/cppumaker/services/stdin.hpp"
147 #include "test/codemaker/cppumaker/services/stdout.hpp"
148 #include "test/codemaker/cppumaker/services/CHAR_BIT.hpp"
149 #include "test/codemaker/cppumaker/services/CHAR_MAX.hpp"
150 #include "test/codemaker/cppumaker/services/CHAR_MIN.hpp"
151 #include "test/codemaker/cppumaker/services/DBL_DIG.hpp"
152 #include "test/codemaker/cppumaker/services/DBL_EPSILON.hpp"
153 #include "test/codemaker/cppumaker/services/DBL_MANT_DIG.hpp"
154 #include "test/codemaker/cppumaker/services/DBL_MAX.hpp"
155 #include "test/codemaker/cppumaker/services/DBL_MAX_10_EXP.hpp"
156 #include "test/codemaker/cppumaker/services/DBL_MAX_EXP.hpp"
157 #include "test/codemaker/cppumaker/services/DBL_MIN.hpp"
158 #include "test/codemaker/cppumaker/services/DBL_MIN_10_EXP.hpp"
159 #include "test/codemaker/cppumaker/services/DBL_MIN_EXP.hpp"
160 #include "test/codemaker/cppumaker/services/FLT_DIG.hpp"
161 #include "test/codemaker/cppumaker/services/FLT_EPSILON.hpp"
162 #include "test/codemaker/cppumaker/services/FLT_MANT_DIG.hpp"
163 #include "test/codemaker/cppumaker/services/FLT_MAX.hpp"
164 #include "test/codemaker/cppumaker/services/FLT_MAX_10_EXP.hpp"
165 #include "test/codemaker/cppumaker/services/FLT_MAX_EXP.hpp"
166 #include "test/codemaker/cppumaker/services/FLT_MIN.hpp"
167 #include "test/codemaker/cppumaker/services/FLT_MIN_10_EXP.hpp"
168 #include "test/codemaker/cppumaker/services/FLT_MIN_EXP.hpp"
169 #include "test/codemaker/cppumaker/services/FLT_RADIX.hpp"
170 #include "test/codemaker/cppumaker/services/FLT_ROUNDS.hpp"
171 #include "test/codemaker/cppumaker/services/INT_MAX.hpp"
172 #include "test/codemaker/cppumaker/services/INT_MIN.hpp"
173 #include "test/codemaker/cppumaker/services/LDBL_DIG.hpp"
174 #include "test/codemaker/cppumaker/services/LDBL_EPSILON.hpp"
175 #include "test/codemaker/cppumaker/services/LDBL_MANT_DIG.hpp"
176 #include "test/codemaker/cppumaker/services/LDBL_MAX.hpp"
177 #include "test/codemaker/cppumaker/services/LDBL_MAX_10_EXP.hpp"
178 #include "test/codemaker/cppumaker/services/LDBL_MAX_EXP.hpp"
179 #include "test/codemaker/cppumaker/services/LDBL_MIN.hpp"
180 #include "test/codemaker/cppumaker/services/LDBL_MIN_10_EXP.hpp"
181 #include "test/codemaker/cppumaker/services/LDBL_MIN_EXP.hpp"
182 #include "test/codemaker/cppumaker/services/LONG_MAX.hpp"
183 #include "test/codemaker/cppumaker/services/LONG_MIN.hpp"
184 #include "test/codemaker/cppumaker/services/MB_LEN_MAX.hpp"
185 #include "test/codemaker/cppumaker/services/SCHAR_MAX.hpp"
186 #include "test/codemaker/cppumaker/services/SCHAR_MIN.hpp"
187 #include "test/codemaker/cppumaker/services/SHRT_MAX.hpp"
188 #include "test/codemaker/cppumaker/services/SHRT_MIN.hpp"
189 #include "test/codemaker/cppumaker/services/UCHAR_MAX.hpp"
190 #include "test/codemaker/cppumaker/services/UINT_MAX.hpp"
191 #include "test/codemaker/cppumaker/services/ULONG_MAX.hpp"
192 #include "test/codemaker/cppumaker/services/USHRT_MAX.hpp"
193 #include "test/codemaker/cppumaker/services/FILE.hpp"
194 #include "test/codemaker/cppumaker/services/lconv.hpp"
195 #include "test/codemaker/cppumaker/services/tm.hpp"
196 #include "test/codemaker/cppumaker/services/std.hpp"
197 #include "test/codemaker/cppumaker/services/NDEBUG.hpp"
198 #include "test/codemaker/cppumaker/services/create.hpp"
199 #include "test/codemaker/cppumaker/singletons/asm.hpp"
200 #include "test/codemaker/cppumaker/singletons/auto.hpp"
201 #include "test/codemaker/cppumaker/singletons/bool.hpp"
202 #include "test/codemaker/cppumaker/singletons/break.hpp"
203 //TODO: #include "test/codemaker/cppumaker/singletons/case.hpp"
204 #include "test/codemaker/cppumaker/singletons/catch.hpp"
205 //TODO: #include "test/codemaker/cppumaker/singletons/char.hpp"
206 #include "test/codemaker/cppumaker/singletons/class.hpp"
207 //TODO: #include "test/codemaker/cppumaker/singletons/const.hpp"
208 #include "test/codemaker/cppumaker/singletons/continue.hpp"
209 //TODO: #include "test/codemaker/cppumaker/singletons/default.hpp"
210 #include "test/codemaker/cppumaker/singletons/delete.hpp"
211 #include "test/codemaker/cppumaker/singletons/do.hpp"
212 //TODO: #include "test/codemaker/cppumaker/singletons/double.hpp"
213 #include "test/codemaker/cppumaker/singletons/else.hpp"
214 //TODO: #include "test/codemaker/cppumaker/singletons/enum.hpp"
215 #include "test/codemaker/cppumaker/singletons/explicit.hpp"
216 #include "test/codemaker/cppumaker/singletons/export.hpp"
217 #include "test/codemaker/cppumaker/singletons/extern.hpp"
218 #include "test/codemaker/cppumaker/singletons/false.hpp"
219 //TODO: #include "test/codemaker/cppumaker/singletons/float.hpp"
220 #include "test/codemaker/cppumaker/singletons/for.hpp"
221 #include "test/codemaker/cppumaker/singletons/friend.hpp"
222 #include "test/codemaker/cppumaker/singletons/goto.hpp"
223 #include "test/codemaker/cppumaker/singletons/if.hpp"
224 #include "test/codemaker/cppumaker/singletons/inline.hpp"
225 #include "test/codemaker/cppumaker/singletons/int.hpp"
226 //TODO: #include "test/codemaker/cppumaker/singletons/long.hpp"
227 #include "test/codemaker/cppumaker/singletons/mutable.hpp"
228 #include "test/codemaker/cppumaker/singletons/namespace.hpp"
229 #include "test/codemaker/cppumaker/singletons/new.hpp"
230 #include "test/codemaker/cppumaker/singletons/operator.hpp"
231 #include "test/codemaker/cppumaker/singletons/private.hpp"
232 #include "test/codemaker/cppumaker/singletons/protected.hpp"
233 #include "test/codemaker/cppumaker/singletons/public.hpp"
234 #include "test/codemaker/cppumaker/singletons/register.hpp"
235 #include "test/codemaker/cppumaker/singletons/return.hpp"
236 //TODO: #include "test/codemaker/cppumaker/singletons/short.hpp"
237 #include "test/codemaker/cppumaker/singletons/signed.hpp"
238 #include "test/codemaker/cppumaker/singletons/sizeof.hpp"
239 #include "test/codemaker/cppumaker/singletons/static.hpp"
240 //TODO: #include "test/codemaker/cppumaker/singletons/struct.hpp"
241 //TODO: #include "test/codemaker/cppumaker/singletons/switch.hpp"
242 #include "test/codemaker/cppumaker/singletons/template.hpp"
243 #include "test/codemaker/cppumaker/singletons/this.hpp"
244 #include "test/codemaker/cppumaker/singletons/throw.hpp"
245 #include "test/codemaker/cppumaker/singletons/true.hpp"
246 #include "test/codemaker/cppumaker/singletons/try.hpp"
247 //TODO: #include "test/codemaker/cppumaker/singletons/typedef.hpp"
248 #include "test/codemaker/cppumaker/singletons/typeid.hpp"
249 #include "test/codemaker/cppumaker/singletons/typename.hpp"
250 //TODO: #include "test/codemaker/cppumaker/singletons/union.hpp"
251 //TODO: #include "test/codemaker/cppumaker/singletons/unsigned.hpp"
252 #include "test/codemaker/cppumaker/singletons/using.hpp"
253 #include "test/codemaker/cppumaker/singletons/virtual.hpp"
254 //TODO: #include "test/codemaker/cppumaker/singletons/void.hpp"
255 #include "test/codemaker/cppumaker/singletons/volatile.hpp"
256 #include "test/codemaker/cppumaker/singletons/while.hpp"
257 #include "test/codemaker/cppumaker/singletons/and.hpp"
258 #include "test/codemaker/cppumaker/singletons/bitand.hpp"
259 #include "test/codemaker/cppumaker/singletons/bitor.hpp"
260 #include "test/codemaker/cppumaker/singletons/compl.hpp"
261 #include "test/codemaker/cppumaker/singletons/not.hpp"
262 #include "test/codemaker/cppumaker/singletons/or.hpp"
263 #include "test/codemaker/cppumaker/singletons/xor.hpp"
264 #include "test/codemaker/cppumaker/singletons/BUFSIZ.hpp"
265 #include "test/codemaker/cppumaker/singletons/CLOCKS_PER_SEC.hpp"
266 #include "test/codemaker/cppumaker/singletons/EDOM.hpp"
267 #include "test/codemaker/cppumaker/singletons/EOF.hpp"
268 #include "test/codemaker/cppumaker/singletons/ERANGE.hpp"
269 #include "test/codemaker/cppumaker/singletons/EXIT_FAILURE.hpp"
270 #include "test/codemaker/cppumaker/singletons/EXIT_SUCCESS.hpp"
271 #include "test/codemaker/cppumaker/singletons/FILENAME_MAX.hpp"
272 #include "test/codemaker/cppumaker/singletons/FOPEN_MAX.hpp"
273 #include "test/codemaker/cppumaker/singletons/HUGE_VAL.hpp"
274 #include "test/codemaker/cppumaker/singletons/LC_ALL.hpp"
275 #include "test/codemaker/cppumaker/singletons/LC_COLLATE.hpp"
276 #include "test/codemaker/cppumaker/singletons/LC_CTYPE.hpp"
277 #include "test/codemaker/cppumaker/singletons/LC_MONETARY.hpp"
278 #include "test/codemaker/cppumaker/singletons/LC_NUMERIC.hpp"
279 #include "test/codemaker/cppumaker/singletons/LC_TIME.hpp"
280 #include "test/codemaker/cppumaker/singletons/L_tmpnam.hpp"
281 #include "test/codemaker/cppumaker/singletons/MB_CUR_MAX.hpp"
282 #include "test/codemaker/cppumaker/singletons/NULL.hpp"
283 #include "test/codemaker/cppumaker/singletons/RAND_MAX.hpp"
284 #include "test/codemaker/cppumaker/singletons/SEEK_CUR.hpp"
285 #include "test/codemaker/cppumaker/singletons/SEEK_END.hpp"
286 #include "test/codemaker/cppumaker/singletons/SEEK_SET.hpp"
287 #include "test/codemaker/cppumaker/singletons/SIGABRT.hpp"
288 #include "test/codemaker/cppumaker/singletons/SIGFPE.hpp"
289 #include "test/codemaker/cppumaker/singletons/SIGILL.hpp"
290 #include "test/codemaker/cppumaker/singletons/SIGINT.hpp"
291 #include "test/codemaker/cppumaker/singletons/SIGSEGV.hpp"
292 #include "test/codemaker/cppumaker/singletons/SIGTERM.hpp"
293 #include "test/codemaker/cppumaker/singletons/SIG_DFL.hpp"
294 #include "test/codemaker/cppumaker/singletons/SIG_ERR.hpp"
295 #include "test/codemaker/cppumaker/singletons/SIG_IGN.hpp"
296 #include "test/codemaker/cppumaker/singletons/TMP_MAX.hpp"
297 #include "test/codemaker/cppumaker/singletons/WCHAR_MAX.hpp"
298 #include "test/codemaker/cppumaker/singletons/WCHAR_MIN.hpp"
299 #include "test/codemaker/cppumaker/singletons/WEOF.hpp"
300 #include "test/codemaker/cppumaker/singletons/assert.hpp"
301 #include "test/codemaker/cppumaker/singletons/errno.hpp"
302 #include "test/codemaker/cppumaker/singletons/offsetof.hpp"
303 #include "test/codemaker/cppumaker/singletons/setjmp.hpp"
304 #include "test/codemaker/cppumaker/singletons/stderr.hpp"
305 #include "test/codemaker/cppumaker/singletons/stdin.hpp"
306 #include "test/codemaker/cppumaker/singletons/stdout.hpp"
307 #include "test/codemaker/cppumaker/singletons/CHAR_BIT.hpp"
308 #include "test/codemaker/cppumaker/singletons/CHAR_MAX.hpp"
309 #include "test/codemaker/cppumaker/singletons/CHAR_MIN.hpp"
310 #include "test/codemaker/cppumaker/singletons/DBL_DIG.hpp"
311 #include "test/codemaker/cppumaker/singletons/DBL_EPSILON.hpp"
312 #include "test/codemaker/cppumaker/singletons/DBL_MANT_DIG.hpp"
313 #include "test/codemaker/cppumaker/singletons/DBL_MAX.hpp"
314 #include "test/codemaker/cppumaker/singletons/DBL_MAX_10_EXP.hpp"
315 #include "test/codemaker/cppumaker/singletons/DBL_MAX_EXP.hpp"
316 #include "test/codemaker/cppumaker/singletons/DBL_MIN.hpp"
317 #include "test/codemaker/cppumaker/singletons/DBL_MIN_10_EXP.hpp"
318 #include "test/codemaker/cppumaker/singletons/DBL_MIN_EXP.hpp"
319 #include "test/codemaker/cppumaker/singletons/FLT_DIG.hpp"
320 #include "test/codemaker/cppumaker/singletons/FLT_EPSILON.hpp"
321 #include "test/codemaker/cppumaker/singletons/FLT_MANT_DIG.hpp"
322 #include "test/codemaker/cppumaker/singletons/FLT_MAX.hpp"
323 #include "test/codemaker/cppumaker/singletons/FLT_MAX_10_EXP.hpp"
324 #include "test/codemaker/cppumaker/singletons/FLT_MAX_EXP.hpp"
325 #include "test/codemaker/cppumaker/singletons/FLT_MIN.hpp"
326 #include "test/codemaker/cppumaker/singletons/FLT_MIN_10_EXP.hpp"
327 #include "test/codemaker/cppumaker/singletons/FLT_MIN_EXP.hpp"
328 #include "test/codemaker/cppumaker/singletons/FLT_RADIX.hpp"
329 #include "test/codemaker/cppumaker/singletons/FLT_ROUNDS.hpp"
330 #include "test/codemaker/cppumaker/singletons/INT_MAX.hpp"
331 #include "test/codemaker/cppumaker/singletons/INT_MIN.hpp"
332 #include "test/codemaker/cppumaker/singletons/LDBL_DIG.hpp"
333 #include "test/codemaker/cppumaker/singletons/LDBL_EPSILON.hpp"
334 #include "test/codemaker/cppumaker/singletons/LDBL_MANT_DIG.hpp"
335 #include "test/codemaker/cppumaker/singletons/LDBL_MAX.hpp"
336 #include "test/codemaker/cppumaker/singletons/LDBL_MAX_10_EXP.hpp"
337 #include "test/codemaker/cppumaker/singletons/LDBL_MAX_EXP.hpp"
338 #include "test/codemaker/cppumaker/singletons/LDBL_MIN.hpp"
339 #include "test/codemaker/cppumaker/singletons/LDBL_MIN_10_EXP.hpp"
340 #include "test/codemaker/cppumaker/singletons/LDBL_MIN_EXP.hpp"
341 #include "test/codemaker/cppumaker/singletons/LONG_MAX.hpp"
342 #include "test/codemaker/cppumaker/singletons/LONG_MIN.hpp"
343 #include "test/codemaker/cppumaker/singletons/MB_LEN_MAX.hpp"
344 #include "test/codemaker/cppumaker/singletons/SCHAR_MAX.hpp"
345 #include "test/codemaker/cppumaker/singletons/SCHAR_MIN.hpp"
346 #include "test/codemaker/cppumaker/singletons/SHRT_MAX.hpp"
347 #include "test/codemaker/cppumaker/singletons/SHRT_MIN.hpp"
348 #include "test/codemaker/cppumaker/singletons/UCHAR_MAX.hpp"
349 #include "test/codemaker/cppumaker/singletons/UINT_MAX.hpp"
350 #include "test/codemaker/cppumaker/singletons/ULONG_MAX.hpp"
351 #include "test/codemaker/cppumaker/singletons/USHRT_MAX.hpp"
352 #include "test/codemaker/cppumaker/singletons/FILE.hpp"
353 #include "test/codemaker/cppumaker/singletons/lconv.hpp"
354 #include "test/codemaker/cppumaker/singletons/tm.hpp"
355 #include "test/codemaker/cppumaker/singletons/std.hpp"
356 #include "test/codemaker/cppumaker/singletons/NDEBUG.hpp"
357 #include "test/codemaker/cppumaker/singletons/get.hpp"
358 #include "test/codemaker/cppumaker/HelperEnum.hpp"
359 #include "test/codemaker/cppumaker/HelperStruct.hpp"
360 #include "test/codemaker/cppumaker/BigStruct.hpp"
361 #include "test/codemaker/cppumaker/Struct.hpp"
362 #include "test/codemaker/cppumaker/StructUsage.hpp"
363 #include "test/codemaker/cppumaker/AlignmentDerivedStruct.hpp"
364 #include "test/codemaker/cppumaker/TestException1.hpp"
365 #include "test/codemaker/cppumaker/TestException2.hpp"
366 #include "test/codemaker/cppumaker/Constants.hpp"
368 #include "boost/scoped_array.hpp"
369 #include "com/sun/star/uno/Any.hxx"
370 #include "com/sun/star/uno/Type.hxx"
371 #include "com/sun/star/uno/TypeClass.hpp"
372 #include "cppunit/simpleheader.hxx"
373 #include "rtl/ustring.h"
374 #include "rtl/ustring.hxx"
376 #include <cstddef>
377 #include <iostream>
379 namespace {
381 class Test: public CppUnit::TestFixture {
382 public:
383 void testBigStruct();
385 void testPolyCharStruct();
387 void testExceptions();
389 void testConstants();
391 CPPUNIT_TEST_SUITE(Test);
392 CPPUNIT_TEST(testBigStruct);
393 CPPUNIT_TEST(testPolyCharStruct);
394 CPPUNIT_TEST(testExceptions);
395 CPPUNIT_TEST(testConstants);
396 CPPUNIT_TEST_SUITE_END();
399 struct Guard {
400 explicit Guard(void * buffer):
401 p(new(buffer) test::codemaker::cppumaker::BigStruct) {}
403 ~Guard() { p->test::codemaker::cppumaker::BigStruct::~BigStruct(); }
405 test::codemaker::cppumaker::BigStruct * const p;
408 void Test::testBigStruct() {
409 // Default-initialize a BigStruct instance on top of a memory buffer filled
410 // with random data, and make sure that all members are default-initialized:
411 boost::scoped_array< char > buffer(
412 new char[sizeof (test::codemaker::cppumaker::BigStruct)]);
413 for (std::size_t i = 0; i < sizeof (test::codemaker::cppumaker::BigStruct);
414 ++i)
416 buffer[i] = '\x56';
418 Guard guard(buffer.get());
419 CPPUNIT_ASSERT_EQUAL(guard.p->m1, sal_False);
420 CPPUNIT_ASSERT_EQUAL(guard.p->m2, static_cast< sal_Int8 >(0));
421 CPPUNIT_ASSERT_EQUAL(guard.p->m3, static_cast< sal_Int16 >(0));
422 CPPUNIT_ASSERT_EQUAL(guard.p->m4, static_cast< sal_uInt16 >(0));
423 CPPUNIT_ASSERT_EQUAL(guard.p->m5, static_cast< sal_Int32 >(0));
424 CPPUNIT_ASSERT_EQUAL(guard.p->m6, static_cast< sal_uInt32 >(0));
425 CPPUNIT_ASSERT_EQUAL(guard.p->m7, static_cast< sal_Int64 >(0));
426 CPPUNIT_ASSERT_EQUAL(guard.p->m8, static_cast< sal_uInt64 >(0));
427 CPPUNIT_ASSERT_EQUAL(guard.p->m9, 0.0f);
428 CPPUNIT_ASSERT_EQUAL(guard.p->m10, 0.0);
429 CPPUNIT_ASSERT_EQUAL(guard.p->m11, static_cast< sal_Unicode >(0));
430 CPPUNIT_ASSERT_EQUAL(guard.p->m12.getLength(), static_cast< sal_Int32 >(0));
431 CPPUNIT_ASSERT_EQUAL(
432 guard.p->m13.getTypeClass(), com::sun::star::uno::TypeClass_VOID);
433 CPPUNIT_ASSERT_EQUAL(guard.p->m14.hasValue(), sal_False);
434 CPPUNIT_ASSERT_EQUAL(guard.p->m15.getLength(), static_cast< sal_Int32 >(0));
435 CPPUNIT_ASSERT_EQUAL(
436 guard.p->m16, test::codemaker::cppumaker::HelperEnum_ZERO);
437 CPPUNIT_ASSERT_EQUAL(guard.p->m17.m1, sal_False);
438 CPPUNIT_ASSERT_EQUAL(guard.p->m17.m2.is(), sal_False);
439 CPPUNIT_ASSERT_EQUAL(guard.p->m18.is(), sal_False);
440 CPPUNIT_ASSERT_EQUAL(guard.p->m19, static_cast< sal_Int8 >(0));
441 CPPUNIT_ASSERT_EQUAL(
442 guard.p->m20, test::codemaker::cppumaker::HelperEnum_ZERO);
443 CPPUNIT_ASSERT_EQUAL(guard.p->m21.getLength(), static_cast< sal_Int32 >(0));
444 CPPUNIT_ASSERT_EQUAL(guard.p->m22.getLength(), static_cast< sal_Int32 >(0));
445 CPPUNIT_ASSERT_EQUAL(guard.p->m23.getLength(), static_cast< sal_Int32 >(0));
447 #if defined(__GNUC__) && __GNUC__ >= 3
448 # if !defined(X86_64)
449 CPPUNIT_ASSERT_EQUAL(
450 static_cast< std::size_t >(16),
451 sizeof (test::codemaker::cppumaker::AlignmentDerivedStruct));
452 # else
453 CPPUNIT_ASSERT_EQUAL(
454 static_cast< std::size_t >(24),
455 sizeof (test::codemaker::cppumaker::AlignmentDerivedStruct));
456 # endif
457 #endif
459 com::sun::star::uno::Type t(
460 cppu::UnoType< test::codemaker::cppumaker::BigStruct >::get());
461 typelib_TypeDescription * td = NULL;
462 t.getDescription(&td);
463 typelib_typedescription_complete(&td);
464 fprintf(stdout, "#### 1\n");
465 CPPUNIT_ASSERT(td != NULL);
466 CPPUNIT_ASSERT_EQUAL(typelib_TypeClass_STRUCT, td->eTypeClass);
467 typelib_StructTypeDescription * std =
468 reinterpret_cast< typelib_StructTypeDescription * >(td);
469 CPPUNIT_ASSERT_EQUAL(typelib_TypeClass_UNSIGNED_SHORT, std->aBase.ppTypeRefs[3]->eTypeClass); // unsigned short m4;
470 CPPUNIT_ASSERT_EQUAL(typelib_TypeClass_CHAR, std->aBase.ppTypeRefs[10]->eTypeClass); // char m11;
473 void Test::testPolyCharStruct() {
474 CPPUNIT_ASSERT_EQUAL(
475 rtl::OUString(
476 RTL_CONSTASCII_USTRINGPARAM(
477 "test.codemaker.cppumaker.Struct<char,short>")),
478 (com::sun::star::uno::makeAny(
479 test::codemaker::cppumaker::Struct< sal_Unicode, sal_Int16 >()).
480 getValueType().getTypeName()));
483 namespace {
485 bool operator ==(
486 test::codemaker::cppumaker::TestException1 const & e1,
487 test::codemaker::cppumaker::TestException1 const & e2)
489 return e1.Message == e2.Message && e1.Context == e2.Context
490 && e1.m1 == e2.m1 && e1.m2 == e2.m2 && e1.m3 == e2.m3
491 && e1.m4.member1 == e2.m4.member1 && e1.m4.member2 == e2.m4.member2;
494 std::ostream & operator <<(
495 std::ostream & out, com::sun::star::uno::Exception const &)
497 return out << "<UNO exception>";
502 void Test::testExceptions() {
503 test::codemaker::cppumaker::TestException1 e11(
504 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("abc")), 0, 1,
505 com::sun::star::uno::makeAny(123.0),
506 test::codemaker::cppumaker::HelperEnum_ONE,
507 test::codemaker::cppumaker::Struct<sal_Int32, sal_Int32>(5, 0), 2);
508 test::codemaker::cppumaker::TestException1 e12(e11);
509 CPPUNIT_ASSERT_EQUAL(e11, e12);
510 test::codemaker::cppumaker::TestException1 e13;
511 e13 = e11;
512 CPPUNIT_ASSERT_EQUAL(e11, e13);
513 test::codemaker::cppumaker::TestException2 e21(
514 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("abc")), 0, 1,
515 com::sun::star::uno::makeAny(123.0),
516 test::codemaker::cppumaker::HelperEnum_ONE,
517 test::codemaker::cppumaker::Struct<sal_Int32, sal_Int32>(5, 0), 2);
518 test::codemaker::cppumaker::TestException2 e22(e21);
519 CPPUNIT_ASSERT_EQUAL(e21, e22);
520 test::codemaker::cppumaker::TestException2 e23;
521 e23 = e21;
522 CPPUNIT_ASSERT_EQUAL(e21, e23);
525 void Test::testConstants() {
526 CPPUNIT_ASSERT_EQUAL(
527 SAL_MIN_INT8, test::codemaker::cppumaker::Constants::byteMin);
528 CPPUNIT_ASSERT_EQUAL(
529 SAL_MAX_INT8, test::codemaker::cppumaker::Constants::byteMax);
530 CPPUNIT_ASSERT_EQUAL(
531 static_cast< sal_Int8 >(-1),
532 test::codemaker::cppumaker::Constants::byteNeg);
533 CPPUNIT_ASSERT_EQUAL(
534 SAL_MIN_INT16, test::codemaker::cppumaker::Constants::shortMin);
535 CPPUNIT_ASSERT_EQUAL(
536 SAL_MAX_INT16, test::codemaker::cppumaker::Constants::shortMax);
537 CPPUNIT_ASSERT_EQUAL(
538 static_cast< sal_uInt16 >(0),
539 test::codemaker::cppumaker::Constants::unsignedShortMin);
540 CPPUNIT_ASSERT_EQUAL(
541 SAL_MAX_UINT16,
542 test::codemaker::cppumaker::Constants::unsignedShortMax);
543 CPPUNIT_ASSERT_EQUAL(
544 SAL_MIN_INT32, test::codemaker::cppumaker::Constants::longMin);
545 CPPUNIT_ASSERT_EQUAL(
546 SAL_MAX_INT32, test::codemaker::cppumaker::Constants::longMax);
547 CPPUNIT_ASSERT_EQUAL(
548 static_cast< sal_uInt32 >(0),
549 test::codemaker::cppumaker::Constants::unsignedLongMin);
550 CPPUNIT_ASSERT_EQUAL(
551 SAL_MAX_UINT32, test::codemaker::cppumaker::Constants::unsignedLongMax);
552 CPPUNIT_ASSERT_EQUAL(
553 SAL_MIN_INT64, test::codemaker::cppumaker::Constants::hyperMin);
554 CPPUNIT_ASSERT_EQUAL(
555 SAL_MAX_INT64, test::codemaker::cppumaker::Constants::hyperMax);
556 CPPUNIT_ASSERT_EQUAL(
557 static_cast< sal_uInt64 >(0),
558 test::codemaker::cppumaker::Constants::unsignedHyperMin);
559 CPPUNIT_ASSERT_EQUAL(
560 SAL_MAX_UINT64,
561 test::codemaker::cppumaker::Constants::unsignedHyperMax);
564 CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(Test, "alltests");
568 NOADDITIONAL;