2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This file incorporates work covered by the following license notice:
10 # Licensed to the Apache Software Foundation (ASF) under one or more
11 # contributor license agreements. See the NOTICE file distributed
12 # with this work for additional information regarding copyright
13 # ownership. The ASF licenses this file to you under the Apache
14 # License, Version 2.0 (the "License"); you may not use this file
15 # except in compliance with the License. You may obtain a copy of
16 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 EXPECT SUCCESS "constant.tests 1":
21 const boolean C1 = FALSE;
24 const unsigned short C4 = 0;
26 const unsigned long C6 = 0;
28 const unsigned hyper C8 = 0;
30 const double C10 = 0.0;
34 EXPECT SUCCESS "constant.tests 2":
36 const boolean C1 = FALSE;
39 const unsigned short C4 = 0;
41 const unsigned long C6 = 0;
43 const unsigned hyper C8 = 0;
45 const double C10 = 0.0;
49 EXPECT FAILURE "constant.tests 3":
55 EXPECT FAILURE "constant.tests 4":
61 EXPECT FAILURE "constant.tests 5":
67 EXPECT FAILURE "constant.tests 6":
73 EXPECT SUCCESS "constant.tests 7":
77 EXPECT SUCCESS "constant.tests 8":
80 const byte C2 = -0200;
81 const byte C3 = -0x80;
85 const short C7 = -32768;
86 const short C8 = -0100000;
87 const short C9 = -0x8000;
88 const short C10 = 32767;
89 const short C11 = 077777;
90 const short C12 = 0x7FFF;
91 const unsigned short C13 = 0;
92 const unsigned short C14 = 0x0;
93 const unsigned short C15 = 65535;
94 const unsigned short C16 = 0177777;
95 const unsigned short C17 = 0xFFFF;
96 const long C18 = -2147483648;
97 const long C19 = -020000000000;
98 const long C20 = -0x80000000;
99 const long C21 = 2147483647;
100 const long C22 = 017777777777;
101 const long C23 = 0x7FFFFFFF;
102 const unsigned long C24 = 0;
103 const unsigned long C25 = 0x0;
104 const unsigned long C26 = 4294967295;
105 const unsigned long C27 = 037777777777;
106 const unsigned long C28 = 0xFFFFFFFF;
107 const hyper C29 = -9223372036854775808;
108 const hyper C30 = -01000000000000000000000;
109 const hyper C31 = -0x8000000000000000;
110 const hyper C32 = 9223372036854775807;
111 const hyper C33 = 0777777777777777777777;
112 const hyper C34 = 0x7FFFFFFFFFFFFFFF;
113 const unsigned hyper C35 = 0;
114 const unsigned hyper C36 = 0x0;
115 const unsigned hyper C37 = 18446744073709551615;
116 const unsigned hyper C38 = 01777777777777777777777;
117 const unsigned hyper C39 = 0xFFFFFFFFFFFFFFFF;
121 EXPECT FAILURE "constant.tests 9":
122 module m { const byte C = -129; };
125 EXPECT FAILURE "constant.tests 10":
126 module m { const byte C = -0201; };
129 EXPECT FAILURE "constant.tests 11":
130 module m { const byte C = -0x81; };
133 EXPECT FAILURE "constant.tests 12":
134 module m { const byte C = 256; };
137 EXPECT FAILURE "constant.tests 13":
138 module m { const byte C = 0400; };
141 EXPECT FAILURE "constant.tests 14":
142 module m { const byte C = 0x100; };
145 EXPECT FAILURE "constant.tests 15":
146 module m { const short C = -32769; };
149 EXPECT FAILURE "constant.tests 16":
150 module m { const short C = -0100001; };
153 EXPECT FAILURE "constant.tests 17":
154 module m { const short C = -0x8001; };
157 EXPECT FAILURE "constant.tests 18":
158 module m { const short C = 32768; };
161 EXPECT FAILURE "constant.tests 19":
162 module m { const short C = 0100000; };
165 EXPECT FAILURE "constant.tests 20":
166 module m { const short C = 0x8000; };
169 EXPECT FAILURE "constant.tests 21":
170 module m { const unsigned short C = -1; };
173 EXPECT FAILURE "constant.tests 22":
174 module m { const unsigned short C = -01; };
177 EXPECT FAILURE "constant.tests 23":
178 module m { const unsigned short C = -0x1; };
181 EXPECT FAILURE "constant.tests 24":
182 module m { const unsigned short C = 65536; };
185 EXPECT FAILURE "constant.tests 25":
186 module m { const unsigned short C = 0200000; };
189 EXPECT FAILURE "constant.tests 26":
190 module m { const unsigned short C = 0x10000; };
193 EXPECT FAILURE "constant.tests 27":
194 module m { const long C = -2147483649; };
197 EXPECT FAILURE "constant.tests 28":
198 module m { const long C = -020000000001; };
201 EXPECT FAILURE "constant.tests 29":
202 module m { const long C = -0x80000001; };
205 EXPECT FAILURE "constant.tests 30":
206 module m { const long C = 2147483648; };
209 EXPECT FAILURE "constant.tests 31":
210 module m { const long C = 020000000000; };
213 EXPECT FAILURE "constant.tests 32":
214 module m { const long C = 0x80000000; };
217 EXPECT FAILURE "constant.tests 33":
218 module m { const unsigned long C = -1; };
221 EXPECT FAILURE "constant.tests 34":
222 module m { const unsigned long C = -01; };
225 EXPECT FAILURE "constant.tests 35":
226 module m { const unsigned long C = -0x1; };
229 EXPECT FAILURE "constant.tests 36":
230 module m { const unsigned long C = 4294967296; };
233 EXPECT FAILURE "constant.tests 37":
234 module m { const unsigned long C = 040000000000; };
237 EXPECT FAILURE "constant.tests 38":
238 module m { const unsigned long C = 0x100000000; };
241 EXPECT FAILURE "constant.tests 39":
242 module m { const hyper C = -9223372036854775809; };
245 EXPECT FAILURE "constant.tests 40":
246 module m { const hyper C = -01000000000000000000001; };
249 EXPECT FAILURE "constant.tests 41":
250 module m { const hyper C = -0x8000000000000001; };
253 EXPECT FAILURE "constant.tests 42":
254 module m { const hyper C = 9223372036854775808; };
257 EXPECT FAILURE "constant.tests 43":
258 module m { const hyper C = 01000000000000000000000; };
261 EXPECT FAILURE "constant.tests 44":
262 module m { const hyper C = 0x8000000000000000; };
265 EXPECT FAILURE "constant.tests 45":
266 module m { const unsigned hyper C = -1; };
269 EXPECT FAILURE "constant.tests 46":
270 module m { const unsigned hyper C = -01; };
273 EXPECT FAILURE "constant.tests 47":
274 module m { const unsigned hyper C = -0x1; };
277 EXPECT FAILURE "constant.tests 48":
278 module m { const unsigned hyper C = 18446744073709551616; };
281 EXPECT FAILURE "constant.tests 49":
282 module m { const unsigned hyper C = 02000000000000000000000; };
285 EXPECT FAILURE "constant.tests 50":
286 module m { const unsigned hyper C = 0x10000000000000000; };