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 FAILURE "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 NEW-FAILURE "constant.tests 8a":
124 const byte C5 = 0377;
125 const byte C6 = 0xFF;
129 EXPECT FAILURE "constant.tests 9":
130 constants C { const byte C1 = -129; };
133 EXPECT FAILURE "constant.tests 10":
134 constants C { const byte C1 = -0201; };
137 EXPECT FAILURE "constant.tests 11":
138 constants C { const byte C1 = -0x81; };
141 EXPECT FAILURE "constant.tests 12":
142 constants C { const byte C1 = 256; };
145 EXPECT FAILURE "constant.tests 13":
146 constants C { const byte C1 = 0400; };
149 EXPECT FAILURE "constant.tests 14":
150 constants C { const byte C1 = 0x100; };
153 EXPECT FAILURE "constant.tests 15":
154 constants C { const short C1 = -32769; };
157 EXPECT FAILURE "constant.tests 16":
158 constants C { const short C1 = -0100001; };
161 EXPECT FAILURE "constant.tests 17":
162 constants C { const short C1 = -0x8001; };
165 EXPECT FAILURE "constant.tests 18":
166 constants C { const short C1 = 32768; };
169 EXPECT FAILURE "constant.tests 19":
170 constants C { const short C1 = 0100000; };
173 EXPECT FAILURE "constant.tests 20":
174 constants C { const short C1 = 0x8000; };
177 EXPECT FAILURE "constant.tests 21":
178 constants C { const unsigned short C1 = -1; };
181 EXPECT FAILURE "constant.tests 22":
182 constants C { const unsigned short C1 = -01; };
185 EXPECT FAILURE "constant.tests 23":
186 constants C { const unsigned short C1 = -0x1; };
189 EXPECT FAILURE "constant.tests 24":
190 constants C { const unsigned short C1 = 65536; };
193 EXPECT FAILURE "constant.tests 25":
194 constants C { const unsigned short C1 = 0200000; };
197 EXPECT FAILURE "constant.tests 26":
198 constants C { const unsigned short C1 = 0x10000; };
201 EXPECT FAILURE "constant.tests 27":
202 constants C { const long C1 = -2147483649; };
205 EXPECT FAILURE "constant.tests 28":
206 constants C { const long C1 = -020000000001; };
209 EXPECT FAILURE "constant.tests 29":
210 constants C { const long C1 = -0x80000001; };
213 EXPECT FAILURE "constant.tests 30":
214 constants C { const long C1 = 2147483648; };
217 EXPECT FAILURE "constant.tests 31":
218 constants C { const long C1 = 020000000000; };
221 EXPECT FAILURE "constant.tests 32":
222 constants C { const long C1 = 0x80000000; };
225 EXPECT FAILURE "constant.tests 33":
226 constants C { const unsigned long C1 = -1; };
229 EXPECT FAILURE "constant.tests 34":
230 constants C { const unsigned long C1 = -01; };
233 EXPECT FAILURE "constant.tests 35":
234 constants C { const unsigned long C1 = -0x1; };
237 EXPECT FAILURE "constant.tests 36":
238 constants C { const unsigned long C1 = 4294967296; };
241 EXPECT FAILURE "constant.tests 37":
242 constants C { const unsigned long C1 = 040000000000; };
245 EXPECT FAILURE "constant.tests 38":
246 constants C { const unsigned long C1 = 0x100000000; };
249 EXPECT FAILURE "constant.tests 39":
250 constants C { const hyper C1 = -9223372036854775809; };
253 EXPECT FAILURE "constant.tests 40":
254 constants C { const hyper C1 = -01000000000000000000001; };
257 EXPECT FAILURE "constant.tests 41":
258 constants C { const hyper C1 = -0x8000000000000001; };
261 EXPECT FAILURE "constant.tests 42":
262 constants C { const hyper C1 = 9223372036854775808; };
265 EXPECT FAILURE "constant.tests 43":
266 constants C { const hyper C1 = 01000000000000000000000; };
269 EXPECT FAILURE "constant.tests 44":
270 constants C { const hyper C1 = 0x8000000000000000; };
273 EXPECT FAILURE "constant.tests 45":
274 constants C { const unsigned hyper C1 = -1; };
277 EXPECT FAILURE "constant.tests 46":
278 constants C { const unsigned hyper C1 = -01; };
281 EXPECT FAILURE "constant.tests 47":
282 constants C { const unsigned hyper C1 = -0x1; };
285 EXPECT FAILURE "constant.tests 48":
286 constants C { const unsigned hyper C1 = 18446744073709551616; };
289 EXPECT FAILURE "constant.tests 49":
290 constants C { const unsigned hyper C1 = 02000000000000000000000; };
293 EXPECT FAILURE "constant.tests 50":
294 constants C { const unsigned hyper C1 = 0x10000000000000000; };