Version 4.2.0.1, tag libreoffice-4.2.0.1
[LibreOffice.git] / sal / qa / OStringBuffer / rtl_String_Const.h
blobd07d7e92f3ee4771199075fa4d739286c6675a0e
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 #ifndef _RTL_STRING_CONST_H_
21 #define _RTL_STRING_CONST_H_
23 #include <rtl_String_Utils.hxx>
25 #include <limits.h>
26 #include <sal/types.h>
27 #include <rtl/textenc.h>
28 #include <rtl/ustring.h>
30 #ifdef __cplusplus
31 extern "C"
33 #endif
35 static const rtl_TextEncoding kEncodingRTLTextUSASCII = RTL_TEXTENCODING_ASCII_US;
37 static const sal_uInt32 kConvertFlagsOUStringToOString = OUSTRING_TO_OSTRING_CVTFLAGS;
38 static const sal_uInt32 kConvertFlagsOStringToOUString = OSTRING_TO_OUSTRING_CVTFLAGS;
40 static const sal_Char *kTestStr1 = "Sun Microsystems";
41 static const sal_Char *kTestStr2 = "Sun Microsystems Java Technology";
42 static const sal_Char *kTestStr7 = "Sun ";
43 static const sal_Char *kTestStr8 = "Microsystems";
44 static const sal_Char *kTestStr14 = " Sun Microsystems";
45 static const sal_Char *kTestStr17 = " Sun Microsystems ";
46 static const sal_Char *kTestStr23 = " Java Technology";
47 static const sal_Char *kTestStr25 = "";
48 static const sal_Char *kTestStr27 = "s";
49 static const sal_Char *kTestStr28 = "\50\3\5\7\11\13\15\17sun";
50 static const sal_Char *kTestStr29 = "\50\3\5\7\11\13\15\17sun\21\23\25\27\31\33\50";
51 static const sal_Char *kTestStr31 = "sun Microsystems";
52 static const sal_Char *kTestStr36 = "Microsystems Java Technology";
53 static const sal_Char *kTestStr37 = "Sun Java Technology";
54 static const sal_Char *kTestStr38 = "\21\23\25\27\31\33\50";
55 static const sal_Char *kTestStr39 = "\50\3\5\7\11\13\15\17sun Sun Microsystems ";
56 static const sal_Char *kTestStr40 = "\50\3\5\7\11\13\15\17sunsun Microsystems";
57 static const sal_Char *kTestStr45 = "Sun true";
58 static const sal_Char *kTestStr46 = "Sun false";
59 static const sal_Char *kTestStr47 = "true";
60 static const sal_Char *kTestStr48 = "false";
61 static const sal_Char *kTestStr49 = "\50\3\5\7\11\13\15\17suntrue";
62 static const sal_Char *kTestStr50 = "\50\3\5\7\11\13\15\17sunfalse";
63 static const sal_Char *kTestStr51 = "Sun M";
64 //static const sal_Char *kTestStr52 = "Sun \077777";
65 //static const sal_Char *kTestStr53 = "Sun \100000";
66 //static const sal_Char *kTestStr54 = "\77777";
67 //static const sal_Char *kTestStr55 = "\100000";
68 static const sal_Char *kTestStr56 = "\50\3\5\7\11\13\15\17suns";
69 //static const sal_Char *kTestStr57 = "\50\3\5\7\11\13\15\17sun\77777";
70 //static const sal_Char *kTestStr58 = "\50\3\5\7\11\13\15\17sun\10000";
71 static const sal_Char *kTestStr59 = "Sun 11";
72 static const sal_Char *kTestStr60 = "11";
73 static const sal_Char *kTestStr61 = "\50\3\5\7\11\13\15\17sun11";
74 static const sal_Char *kTestStr62 = "Sun 0";
75 static const sal_Char *kTestStr63 = "Sun -11";
76 static const sal_Char *kTestStr64 = "Sun 2147483647";
77 static const sal_Char *kTestStr65 = "Sun -2147483648";
78 static const sal_Char *kTestStr66 = "0";
79 static const sal_Char *kTestStr67 = "-11";
80 static const sal_Char *kTestStr68 = "2147483647";
81 static const sal_Char *kTestStr69 = "-2147483648";
82 static const sal_Char *kTestStr70 = "\50\3\5\7\11\13\15\17sun0";
83 static const sal_Char *kTestStr71 = "\50\3\5\7\11\13\15\17sun-11";
84 static const sal_Char *kTestStr72 = "\50\3\5\7\11\13\15\17sun2147483647";
85 static const sal_Char *kTestStr73 = "\50\3\5\7\11\13\15\17sun-2147483648";
86 static const sal_Char *kTestStr116 = "Sun 9223372036854775807";
87 static const sal_Char *kTestStr117 = "Sun -9223372036854775808";
88 static const sal_Char *kTestStr118 = "9223372036854775807";
89 static const sal_Char *kTestStr119 = "-9223372036854775808";
90 static const sal_Char *kTestStr120 = "\50\3\5\7\11\13\15\17sun9223372036854775807";
91 static const sal_Char *kTestStr121 = "\50\3\5\7\11\13\15\17sun-9223372036854775808";
92 static const sal_Char *kTestStr143 = "Sun \377";
93 static const sal_Char *kTestStr144 = "\377";
94 static const sal_Char *kTestStr145 = "\50\3\5\7\11\13\15\17sun\377";
96 static const sal_Int32 kTestStr1Len = 16;
97 static const sal_Int32 kTestStr2Len = 32;
98 static const sal_Int32 kTestStr3Len = 16;
99 static const sal_Int32 kTestStr4Len = 16;
100 static const sal_Int32 kTestStr5Len = 16;
101 static const sal_Int32 kTestStr6Len = 15;
102 static const sal_Int32 kTestStr7Len = 4;
103 static const sal_Int32 kTestStr8Len = 12;
104 static const sal_Int32 kTestStr9Len = 32;
105 static const sal_Int32 kTestStr10Len = 17;
106 static const sal_Int32 kTestStr11Len = 17;
107 static const sal_Int32 kTestStr12Len = 18;
108 static const sal_Int32 kTestStr13Len = 19;
109 static const sal_Int32 kTestStr14Len = 19;
110 static const sal_Int32 kTestStr15Len = 20;
111 static const sal_Int32 kTestStr16Len = 20;
112 static const sal_Int32 kTestStr17Len = 22;
113 static const sal_Int32 kTestStr18Len = 16;
114 static const sal_Int32 kTestStr19Len = 22;
115 static const sal_Int32 kTestStr20Len = 3;
116 static const sal_Int32 kTestStr21Len = 3;
117 static const sal_Int32 kTestStr22Len = 32;
118 static const sal_Int32 kTestStr23Len = 16;
119 static const sal_Int32 kTestStr24Len = 31;
120 static const sal_Int32 kTestStr25Len = 0;
121 static const sal_Int32 kTestStr26Len = 4;
122 static const sal_Int32 kTestStr27Len = 1;
123 static const sal_Int32 kTestStr28Len = 11;
124 static const sal_Int32 kTestStr29Len = 18;
125 static const sal_Int32 kTestStr30Len = 10;
126 static const sal_Int32 kTestStr31Len = 16;
127 static const sal_Int32 kTestStr32Len = 16;
128 static const sal_Int32 kTestStr33Len = 1;
129 static const sal_Int32 kTestStr34Len = 11;
130 static const sal_Int32 kTestStr35Len = 11;
131 static const sal_Int32 kTestStr36Len = 28;
132 static const sal_Int32 kTestStr37Len = 20;
133 static const sal_Int32 kTestStr38Len = 7;
134 static const sal_Int32 kTestStr39Len = 33;
135 static const sal_Int32 kTestStr40Len = 27;
136 static const sal_Int32 kTestStr41Len = 3;
137 static const sal_Int32 kTestStr42Len = 10;
138 static const sal_Int32 kTestStr43Len = 13;
139 static const sal_Int32 kTestStr44Len = 2;
140 static const sal_Int32 kTestStr45Len = 8;
141 static const sal_Int32 kTestStr46Len = 9;
142 static const sal_Int32 kTestStr47Len = 4;
143 static const sal_Int32 kTestStr48Len = 5;
144 static const sal_Int32 kTestStr49Len = 15;
145 static const sal_Int32 kTestStr50Len = 16;
146 static const sal_Int32 kTestStr51Len = 5;
147 static const sal_Int32 kTestStr52Len = 5;
148 static const sal_Int32 kTestStr53Len = 5;
149 static const sal_Int32 kTestStr54Len = 1;
150 static const sal_Int32 kTestStr55Len = 1;
151 static const sal_Int32 kTestStr56Len = 12;
152 static const sal_Int32 kTestStr57Len = 12;
153 static const sal_Int32 kTestStr58Len = 12;
154 static const sal_Int32 kTestStr59Len = 6;
155 static const sal_Int32 kTestStr60Len = 2;
156 static const sal_Int32 kTestStr61Len = 13;
157 static const sal_Int32 kTestStr62Len = 5;
158 static const sal_Int32 kTestStr63Len = 7;
159 static const sal_Int32 kTestStr64Len = 14;
160 static const sal_Int32 kTestStr65Len = 15;
161 static const sal_Int32 kTestStr66Len = 1;
162 static const sal_Int32 kTestStr67Len = 3;
163 static const sal_Int32 kTestStr68Len = 10;
164 static const sal_Int32 kTestStr69Len = 11;
165 static const sal_Int32 kTestStr70Len = 12;
166 static const sal_Int32 kTestStr71Len = 14;
167 static const sal_Int32 kTestStr72Len = 21;
168 static const sal_Int32 kTestStr73Len = 22;
169 static const sal_Int32 kTestStr74Len = 7;
170 static const sal_Int32 kTestStr75Len = 7;
171 static const sal_Int32 kTestStr76Len = 10;
172 static const sal_Int32 kTestStr77Len = 12;
173 static const sal_Int32 kTestStr78Len = 12;
174 static const sal_Int32 kTestStr79Len = 13;
175 static const sal_Int32 kTestStr80Len = 13;
176 static const sal_Int32 kTestStr81Len = 3;
177 static const sal_Int32 kTestStr82Len = 3;
178 static const sal_Int32 kTestStr83Len = 6;
179 static const sal_Int32 kTestStr84Len = 8;
180 static const sal_Int32 kTestStr85Len = 8;
181 static const sal_Int32 kTestStr86Len = 9;
182 static const sal_Int32 kTestStr87Len = 9;
183 static const sal_Int32 kTestStr88Len = 14;
184 static const sal_Int32 kTestStr89Len = 14;
185 static const sal_Int32 kTestStr90Len = 17;
186 static const sal_Int32 kTestStr91Len = 19;
187 static const sal_Int32 kTestStr92Len = 19;
188 static const sal_Int32 kTestStr93Len = 20;
189 static const sal_Int32 kTestStr94Len = 20;
190 static const sal_Int32 kTestStr95Len = 8;
191 static const sal_Int32 kTestStr96Len = 8;
192 static const sal_Int32 kTestStr97Len = 11;
193 static const sal_Int32 kTestStr98Len = 13;
194 static const sal_Int32 kTestStr99Len = 13;
195 static const sal_Int32 kTestStr100Len = 14;
196 static const sal_Int32 kTestStr101Len = 14;
197 static const sal_Int32 kTestStr102Len = 4;
198 static const sal_Int32 kTestStr103Len = 4;
199 static const sal_Int32 kTestStr104Len = 7;
200 static const sal_Int32 kTestStr105Len = 9;
201 static const sal_Int32 kTestStr106Len = 9;
202 static const sal_Int32 kTestStr107Len = 10;
203 static const sal_Int32 kTestStr108Len = 10;
204 static const sal_Int32 kTestStr109Len = 15;
205 static const sal_Int32 kTestStr110Len = 15;
206 static const sal_Int32 kTestStr111Len = 18;
207 static const sal_Int32 kTestStr112Len = 20;
208 static const sal_Int32 kTestStr113Len = 20;
209 static const sal_Int32 kTestStr114Len = 21;
210 static const sal_Int32 kTestStr115Len = 21;
211 static const sal_Int32 kTestStr116Len = 23;
212 static const sal_Int32 kTestStr117Len = 24;
213 static const sal_Int32 kTestStr118Len = 19;
214 static const sal_Int32 kTestStr119Len = 20;
215 static const sal_Int32 kTestStr120Len = 30;
216 static const sal_Int32 kTestStr121Len = 31;
217 static const sal_Int32 kTestStr122Len = 16;
218 static const sal_Int32 kTestStr123Len = 21;
219 static const sal_Int32 kTestStr124Len = 23;
220 static const sal_Int32 kTestStr125Len = 30;
221 static const sal_Int32 kTestStr126Len = 12;
222 static const sal_Int32 kTestStr127Len = 17;
223 static const sal_Int32 kTestStr128Len = 19;
224 static const sal_Int32 kTestStr129Len = 26;
225 static const sal_Int32 kTestStr130Len = 23;
226 static const sal_Int32 kTestStr131Len = 28;
227 static const sal_Int32 kTestStr132Len = 30;
228 static const sal_Int32 kTestStr133Len = 37;
229 static const sal_Int32 kTestStr134Len = 22;
230 static const sal_Int32 kTestStr135Len = 24;
231 static const sal_Int32 kTestStr136Len = 31;
232 static const sal_Int32 kTestStr137Len = 18;
233 static const sal_Int32 kTestStr138Len = 20;
234 static const sal_Int32 kTestStr139Len = 27;
235 static const sal_Int32 kTestStr140Len = 29;
236 static const sal_Int32 kTestStr141Len = 31;
237 static const sal_Int32 kTestStr142Len = 38;
238 static const sal_Int32 kTestStr143Len = 5;
239 static const sal_Int32 kTestStr144Len = 1;
240 static const sal_Int32 kTestStr145Len = 12;
241 static const sal_Int32 kTestStr146Len = 19;
242 static const sal_Int32 kTestStr147Len = 19;
243 static const sal_Int32 kTestStr148Len = 19;
244 static const sal_Int32 kTestStr149Len = 32;
245 static const sal_Int32 kTestStr150Len = 32;
246 static const sal_Int32 kTestStr151Len = 31;
247 static const sal_Int32 kTestStr152Len = 31;
248 static const sal_Int32 kTestStr153Len = 31;
249 static const sal_Int32 kTestStr154Len = 36;
250 static const sal_Int32 kTestStr155Len = 36;
251 static const sal_Int32 kTestStr156Len = 36;
252 static const sal_Int32 kTestStr157Len = 49;
253 static const sal_Int32 kTestStr158Len = 49;
254 static const sal_Int32 kTestStr159Len = 49;
255 static const sal_Int32 kTestStr160Len = 48;
256 static const sal_Int32 kTestStr161Len = 48;
257 static const sal_Int32 kTestStr162Len = 48;
258 static const sal_Int32 kTestStr163Len = 15;
259 static const sal_Int32 kTestStr164Len = 15;
260 static const sal_Int32 kTestStr165Len = 15;
261 static const sal_Int32 kTestStr166Len = 28;
262 static const sal_Int32 kTestStr167Len = 28;
263 static const sal_Int32 kTestStr168Len = 28;
264 static const sal_Int32 kTestStr169Len = 27;
265 static const sal_Int32 kTestStr170Len = 27;
266 static const sal_Int32 kTestStr171Len = 27;
267 static const sal_Int32 kTestStr1PlusStr6Len = kTestStr1Len + kTestStr6Len;
269 static const sal_Int32 uTestStr1Len = 16;
270 static const sal_Int32 uTestStr2Len = 32;
271 static const sal_Int32 uTestStr3Len = 16;
272 static const sal_Int32 uTestStr4Len = 16;
273 static const sal_Int32 uTestStr5Len = 16;
274 static const sal_Int32 uTestStr9Len = 32;
275 static const sal_Int32 uTestStr22Len = 32;
277 const sal_Unicode uTestStr31[]= {0x400,0x410,0x4DF};
278 const sal_Unicode uTestStr32[]= {0x9F9F,0xA000,0x8F80,0x9AD9};
280 static const sal_Int32 uTestStr31Len = 3;
281 static const sal_Int32 uTestStr32Len = 4;
283 static const sal_Int16 kRadixBinary = 2;
284 static const sal_Int16 kRadixOctol = 8;
285 static const sal_Int16 kRadixDecimal = 10;
286 static const sal_Int16 kRadixHexdecimal = 16;
287 static const sal_Int16 kRadixBase36 = 36;
289 static const sal_Int8 kSInt8Max = SCHAR_MAX;
290 static const sal_Int16 kUInt8Max = UCHAR_MAX;
291 static const sal_Int16 kSInt16Max = SHRT_MAX;
292 static const sal_Int32 kUInt16Max = USHRT_MAX;
293 static const sal_Int32 kSInt32Max = INT_MAX;
294 static const sal_Int64 kUInt32Max = UINT_MAX;
295 static const sal_Int64 kSInt64Max = SAL_CONST_INT64(9223372036854775807);
297 //------------------------------------------------------------------------
299 static const sal_Int32 kInt32MaxNumsCount = 5;
301 static const sal_Int32 kInt32MaxNums[kInt32MaxNumsCount] =
303 kSInt8Max, kUInt8Max,
304 kSInt16Max, kUInt16Max,
305 kSInt32Max
308 static const sal_Int32 kInt64MaxNumsCount = 7;
310 static const sal_Int64 kInt64MaxNums[kInt64MaxNumsCount] =
312 kSInt8Max, kUInt8Max,
313 kSInt16Max, kUInt16Max,
314 kSInt32Max, kUInt32Max,
315 kSInt64Max
318 static const sal_Int32 kBinaryNumsCount = 16;
320 static const sal_Int32 kBinaryMaxNumsCount = 7;
322 //------------------------------------------------------------------------
324 static const sal_Int32 kOctolNumsCount = 16;
326 static const sal_Int32 kOctolMaxNumsCount = 7;
328 //------------------------------------------------------------------------
330 static const sal_Int32 kDecimalNumsCount = 16;
332 static const sal_Int32 kDecimalMaxNumsCount = 7;
334 //------------------------------------------------------------------------
336 static const sal_Int32 kHexDecimalNumsCount = 16;
338 static const sal_Int32 kHexDecimalMaxNumsCount = 7;
340 //------------------------------------------------------------------------
342 static const sal_Int32 kBase36NumsCount = 36;
344 static const sal_Int32 kBase36MaxNumsCount = 7;
346 static const sal_Int32 nDoubleCount=24;
347 static const double expValDouble[nDoubleCount]=
349 3.0,3.1,3.1415,3.1415926535,3.141592653589793,
350 3.1415926535897932,3.14159265358979323,3.1,
351 3.141592653589793238462643,9.1096e-31,2.997925e8,6.241e18,5.381e18,
352 1.7e-309,6.5822e-16,1.7e+307,2.2e30,3.1,3.1,-3.1,
353 0.0,0.0,0.0,1.00e+308
355 //------------------------------------------------------------------------
356 static const sal_Int32 nFloatCount=22;
357 static const float expValFloat[nFloatCount] =
359 3.0f,3.1f,3.1415f,3.14159f,3.141592f,
360 3.1415926f,3.14159265f,3.141592653589793238462643f,
361 6.5822e-16f,9.1096e-31f,2.997925e8f,6.241e18f,
362 1.00e38f,6.241e-37f,6.241e37f,3.1f,3.1f,-3.1f,
363 3.1f,0.0f,0.0f,0.0f
365 //------------------------------------------------------------------------
366 static const sal_Int32 nCharCount=15;
367 static const sal_Unicode expValChar[nCharCount] =
369 65,97,48,45,95,
370 21,27,29,
371 64,10,39,34,
372 0,0,83
374 //------------------------------------------------------------------------
375 static const sal_Int32 nDefaultCount=6;
376 static const sal_Unicode input1Default[nDefaultCount] =
378 77,115,85,119,32,0
380 static const sal_Int32 input2Default[nDefaultCount] =
382 0,0,0,0,0,0
384 static const sal_Int32 expValDefault[nDefaultCount] =
386 4,9,-1,-1,3,-1
388 //------------------------------------------------------------------------
389 static const sal_Int32 nNormalCount=10;
390 static const sal_Unicode input1Normal[nNormalCount] =
392 77,77,77,115,115,115,119,119,0,0
394 static const sal_Int32 input2Normal[nNormalCount] =
396 0,32,80,0,13,20,0,80,0,32
398 static const sal_Int32 expValNormal[nNormalCount] =
400 4,-1,-1,9,15,-1,-1,-1,-1,-1
402 //------------------------------------------------------------------------
403 static const sal_Int32 nlastDefaultCount=5;
404 static const sal_Unicode input1lastDefault[nlastDefaultCount] =
406 77,115,119,32,0
408 static const sal_Int32 input2lastDefault[nlastDefaultCount] =
410 31,31,31,31,31
412 static const sal_Int32 expVallastDefault[nlastDefaultCount] =
414 4,15,-1,21,-1
416 //------------------------------------------------------------------------
417 static const sal_Int32 nlastNormalCount=8;
418 static const sal_Unicode input1lastNormal[nlastNormalCount] =
420 77,77,77,115,115,119,119,0
422 static const sal_Int32 input2lastNormal[nlastNormalCount] =
424 29,0,80,31,3,31,80,31
426 static const sal_Int32 expVallastNormal[nlastNormalCount] =
428 4,-1,4,15,-1,-1,-1,-1
430 //------------------------------------------------------------------------
431 static const sal_Int32 nStrDefaultCount=6;
432 static const sal_Int32 input2StrDefault[nStrDefaultCount] =
434 0,0,0,0,0,0
436 static const sal_Int32 expValStrDefault[nStrDefaultCount] =
438 0,4,-1,-1,-1,3
440 //------------------------------------------------------------------------
441 static const sal_Int32 nStrNormalCount=9;
442 static const sal_Int32 input2StrNormal[nStrNormalCount] =
444 0,32,0,30,0,0,0,32,0
446 static const sal_Int32 expValStrNormal[nStrNormalCount] =
448 0,-1,4,-1,-1,-1,-1,-1,3
450 //------------------------------------------------------------------------
451 static const sal_Int32 nStrLastDefaultCount=6;
452 static const sal_Int32 input2StrLastDefault[nStrLastDefaultCount] =
454 31,31,31,31,31,31
456 static const sal_Int32 expValStrLastDefault[nStrLastDefaultCount] =
458 0,4,-1,-1,-1,3
460 //------------------------------------------------------------------------
461 static const sal_Int32 nStrLastNormalCount=12;
462 static const sal_Int32 input2StrLastNormal[nStrLastNormalCount] =
464 31,0,80,31,2,31,31,31,0,31,31,14
466 static const sal_Int32 expValStrLastNormal[nStrLastNormalCount] =
468 0,-1,0,4,-1,-1,-1,-1,-1,3,15,11
470 //------------------------------------------------------------------------
471 static const sal_Int32 kNonSInt32Max = INT_MIN;
472 static const sal_Int32 kNonSInt16Max = SHRT_MIN;
473 //------------------------------------------------------------------------
474 #ifdef __cplusplus
476 #endif
478 #endif /* _RTL_STRING_CONST_H_ */
480 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */