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