1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: constant.tests,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 EXPECT SUCCESS "constant.tests 1":
34 const boolean C1 = FALSE;
37 const unsigned short C4 = 0;
39 const unsigned long C6 = 0;
41 const unsigned hyper C8 = 0;
43 const double C10 = 0.0;
47 EXPECT SUCCESS "constant.tests 2":
49 const boolean C1 = FALSE;
52 const unsigned short C4 = 0;
54 const unsigned long C6 = 0;
56 const unsigned hyper C8 = 0;
58 const double C10 = 0.0;
62 EXPECT FAILURE "constant.tests 3":
68 EXPECT FAILURE "constant.tests 4":
74 EXPECT FAILURE "constant.tests 5":
80 EXPECT FAILURE "constant.tests 6":
86 EXPECT SUCCESS "constant.tests 7":
90 EXPECT SUCCESS "constant.tests 8":
93 const byte C2 = -0200;
94 const byte C3 = -0x80;
98 const short C7 = -32768;
99 const short C8 = -0100000;
100 const short C9 = -0x8000;
101 const short C10 = 32767;
102 const short C11 = 077777;
103 const short C12 = 0x7FFF;
104 const unsigned short C13 = 0;
105 const unsigned short C14 = 0x0;
106 const unsigned short C15 = 65535;
107 const unsigned short C16 = 0177777;
108 const unsigned short C17 = 0xFFFF;
109 const long C18 = -2147483648;
110 const long C19 = -020000000000;
111 const long C20 = -0x80000000;
112 const long C21 = 2147483647;
113 const long C22 = 017777777777;
114 const long C23 = 0x7FFFFFFF;
115 const unsigned long C24 = 0;
116 const unsigned long C25 = 0x0;
117 const unsigned long C26 = 4294967295;
118 const unsigned long C27 = 037777777777;
119 const unsigned long C28 = 0xFFFFFFFF;
120 const hyper C29 = -9223372036854775808;
121 const hyper C30 = -01000000000000000000000;
122 const hyper C31 = -0x8000000000000000;
123 const hyper C32 = 9223372036854775807;
124 const hyper C33 = 0777777777777777777777;
125 const hyper C34 = 0x7FFFFFFFFFFFFFFF;
126 const unsigned hyper C35 = 0;
127 const unsigned hyper C36 = 0x0;
128 const unsigned hyper C37 = 18446744073709551615;
129 const unsigned hyper C38 = 01777777777777777777777;
130 const unsigned hyper C39 = 0xFFFFFFFFFFFFFFFF;
134 EXPECT FAILURE "constant.tests 9":
135 module m { const byte C = -129; };
138 EXPECT FAILURE "constant.tests 10":
139 module m { const byte C = -0201; };
142 EXPECT FAILURE "constant.tests 11":
143 module m { const byte C = -0x81; };
146 EXPECT FAILURE "constant.tests 12":
147 module m { const byte C = 256; };
150 EXPECT FAILURE "constant.tests 13":
151 module m { const byte C = 0400; };
154 EXPECT FAILURE "constant.tests 14":
155 module m { const byte C = 0x100; };
158 EXPECT FAILURE "constant.tests 15":
159 module m { const short C = -32769; };
162 EXPECT FAILURE "constant.tests 16":
163 module m { const short C = -0100001; };
166 EXPECT FAILURE "constant.tests 17":
167 module m { const short C = -0x8001; };
170 EXPECT FAILURE "constant.tests 18":
171 module m { const short C = 32768; };
174 EXPECT FAILURE "constant.tests 19":
175 module m { const short C = 0100000; };
178 EXPECT FAILURE "constant.tests 20":
179 module m { const short C = 0x8000; };
182 EXPECT FAILURE "constant.tests 21":
183 module m { const unsigned short C = -1; };
186 EXPECT FAILURE "constant.tests 22":
187 module m { const unsigned short C = -01; };
190 EXPECT FAILURE "constant.tests 23":
191 module m { const unsigned short C = -0x1; };
194 EXPECT FAILURE "constant.tests 24":
195 module m { const unsigned short C = 65536; };
198 EXPECT FAILURE "constant.tests 25":
199 module m { const unsigned short C = 0200000; };
202 EXPECT FAILURE "constant.tests 26":
203 module m { const unsigned short C = 0x10000; };
206 EXPECT FAILURE "constant.tests 27":
207 module m { const long C = -2147483649; };
210 EXPECT FAILURE "constant.tests 28":
211 module m { const long C = -020000000001; };
214 EXPECT FAILURE "constant.tests 29":
215 module m { const long C = -0x80000001; };
218 EXPECT FAILURE "constant.tests 30":
219 module m { const long C = 2147483648; };
222 EXPECT FAILURE "constant.tests 31":
223 module m { const long C = 020000000000; };
226 EXPECT FAILURE "constant.tests 32":
227 module m { const long C = 0x80000000; };
230 EXPECT FAILURE "constant.tests 33":
231 module m { const unsigned long C = -1; };
234 EXPECT FAILURE "constant.tests 34":
235 module m { const unsigned long C = -01; };
238 EXPECT FAILURE "constant.tests 35":
239 module m { const unsigned long C = -0x1; };
242 EXPECT FAILURE "constant.tests 36":
243 module m { const unsigned long C = 4294967296; };
246 EXPECT FAILURE "constant.tests 37":
247 module m { const unsigned long C = 040000000000; };
250 EXPECT FAILURE "constant.tests 38":
251 module m { const unsigned long C = 0x100000000; };
254 EXPECT FAILURE "constant.tests 39":
255 module m { const hyper C = -9223372036854775809; };
258 EXPECT FAILURE "constant.tests 40":
259 module m { const hyper C = -01000000000000000000001; };
262 EXPECT FAILURE "constant.tests 41":
263 module m { const hyper C = -0x8000000000000001; };
266 EXPECT FAILURE "constant.tests 42":
267 module m { const hyper C = 9223372036854775808; };
270 EXPECT FAILURE "constant.tests 43":
271 module m { const hyper C = 01000000000000000000000; };
274 EXPECT FAILURE "constant.tests 44":
275 module m { const hyper C = 0x8000000000000000; };
278 EXPECT FAILURE "constant.tests 45":
279 module m { const unsigned hyper C = -1; };
282 EXPECT FAILURE "constant.tests 46":
283 module m { const unsigned hyper C = -01; };
286 EXPECT FAILURE "constant.tests 47":
287 module m { const unsigned hyper C = -0x1; };
290 EXPECT FAILURE "constant.tests 48":
291 module m { const unsigned hyper C = 18446744073709551616; };
294 EXPECT FAILURE "constant.tests 49":
295 module m { const unsigned hyper C = 02000000000000000000000; };
298 EXPECT FAILURE "constant.tests 50":
299 module m { const unsigned hyper C = 0x10000000000000000; };