summaryrefslogtreecommitdiffstats
path: root/idlc/test/parser/constant.tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /idlc/test/parser/constant.tests
parentInitial commit. (diff)
downloadlibreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz
libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'idlc/test/parser/constant.tests')
-rw-r--r--idlc/test/parser/constant.tests294
1 files changed, 294 insertions, 0 deletions
diff --git a/idlc/test/parser/constant.tests b/idlc/test/parser/constant.tests
new file mode 100644
index 000000000..49183d4d1
--- /dev/null
+++ b/idlc/test/parser/constant.tests
@@ -0,0 +1,294 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership. The ASF licenses this file to you under the Apache
+# License, Version 2.0 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+
+EXPECT SUCCESS "constant.tests 1":
+constants C {
+ const boolean C1 = FALSE;
+ const byte C2 = 0;
+ const short C3 = 0;
+ const unsigned short C4 = 0;
+ const long C5 = 0;
+ const unsigned long C6 = 0;
+ const hyper C7 = 0;
+ const unsigned hyper C8 = 0;
+ const float C9 = 0.0;
+ const double C10 = 0.0;
+};
+
+
+EXPECT FAILURE "constant.tests 2":
+module m {
+ const boolean C1 = FALSE;
+ const byte C2 = 0;
+ const short C3 = 0;
+ const unsigned short C4 = 0;
+ const long C5 = 0;
+ const unsigned long C6 = 0;
+ const hyper C7 = 0;
+ const unsigned hyper C8 = 0;
+ const float C9 = 0.0;
+ const double C10 = 0.0;
+};
+
+
+EXPECT FAILURE "constant.tests 3":
+constants C {
+ const char C1 = 'A';
+};
+
+
+EXPECT FAILURE "constant.tests 4":
+module m {
+ const char C1 = 'A';
+};
+
+
+EXPECT FAILURE "constant.tests 5":
+constants C {
+ const string C1 = "";
+};
+
+
+EXPECT FAILURE "constant.tests 6":
+module m {
+ const string C1 = "";
+};
+
+
+EXPECT SUCCESS "constant.tests 7":
+constants C {};
+
+
+EXPECT SUCCESS "constant.tests 8":
+constants C {
+ const byte C1 = -128;
+ const byte C2 = -0200;
+ const byte C3 = -0x80;
+ const byte C4 = 127;
+ const byte C5 = 0177;
+ const byte C6 = 0x7F;
+ const short C7 = -32768;
+ const short C8 = -0100000;
+ const short C9 = -0x8000;
+ const short C10 = 32767;
+ const short C11 = 077777;
+ const short C12 = 0x7FFF;
+ const unsigned short C13 = 0;
+ const unsigned short C14 = 0x0;
+ const unsigned short C15 = 65535;
+ const unsigned short C16 = 0177777;
+ const unsigned short C17 = 0xFFFF;
+ const long C18 = -2147483648;
+ const long C19 = -020000000000;
+ const long C20 = -0x80000000;
+ const long C21 = 2147483647;
+ const long C22 = 017777777777;
+ const long C23 = 0x7FFFFFFF;
+ const unsigned long C24 = 0;
+ const unsigned long C25 = 0x0;
+ const unsigned long C26 = 4294967295;
+ const unsigned long C27 = 037777777777;
+ const unsigned long C28 = 0xFFFFFFFF;
+ const hyper C29 = -9223372036854775808;
+ const hyper C30 = -01000000000000000000000;
+ const hyper C31 = -0x8000000000000000;
+ const hyper C32 = 9223372036854775807;
+ const hyper C33 = 0777777777777777777777;
+ const hyper C34 = 0x7FFFFFFFFFFFFFFF;
+ const unsigned hyper C35 = 0;
+ const unsigned hyper C36 = 0x0;
+ const unsigned hyper C37 = 18446744073709551615;
+ const unsigned hyper C38 = 01777777777777777777777;
+ const unsigned hyper C39 = 0xFFFFFFFFFFFFFFFF;
+};
+
+
+EXPECT NEW-FAILURE "constant.tests 8a":
+constants C {
+ const byte C4 = 255;
+ const byte C5 = 0377;
+ const byte C6 = 0xFF;
+};
+
+
+EXPECT FAILURE "constant.tests 9":
+constants C { const byte C1 = -129; };
+
+
+EXPECT FAILURE "constant.tests 10":
+constants C { const byte C1 = -0201; };
+
+
+EXPECT FAILURE "constant.tests 11":
+constants C { const byte C1 = -0x81; };
+
+
+EXPECT FAILURE "constant.tests 12":
+constants C { const byte C1 = 256; };
+
+
+EXPECT FAILURE "constant.tests 13":
+constants C { const byte C1 = 0400; };
+
+
+EXPECT FAILURE "constant.tests 14":
+constants C { const byte C1 = 0x100; };
+
+
+EXPECT FAILURE "constant.tests 15":
+constants C { const short C1 = -32769; };
+
+
+EXPECT FAILURE "constant.tests 16":
+constants C { const short C1 = -0100001; };
+
+
+EXPECT FAILURE "constant.tests 17":
+constants C { const short C1 = -0x8001; };
+
+
+EXPECT FAILURE "constant.tests 18":
+constants C { const short C1 = 32768; };
+
+
+EXPECT FAILURE "constant.tests 19":
+constants C { const short C1 = 0100000; };
+
+
+EXPECT FAILURE "constant.tests 20":
+constants C { const short C1 = 0x8000; };
+
+
+EXPECT FAILURE "constant.tests 21":
+constants C { const unsigned short C1 = -1; };
+
+
+EXPECT FAILURE "constant.tests 22":
+constants C { const unsigned short C1 = -01; };
+
+
+EXPECT FAILURE "constant.tests 23":
+constants C { const unsigned short C1 = -0x1; };
+
+
+EXPECT FAILURE "constant.tests 24":
+constants C { const unsigned short C1 = 65536; };
+
+
+EXPECT FAILURE "constant.tests 25":
+constants C { const unsigned short C1 = 0200000; };
+
+
+EXPECT FAILURE "constant.tests 26":
+constants C { const unsigned short C1 = 0x10000; };
+
+
+EXPECT FAILURE "constant.tests 27":
+constants C { const long C1 = -2147483649; };
+
+
+EXPECT FAILURE "constant.tests 28":
+constants C { const long C1 = -020000000001; };
+
+
+EXPECT FAILURE "constant.tests 29":
+constants C { const long C1 = -0x80000001; };
+
+
+EXPECT FAILURE "constant.tests 30":
+constants C { const long C1 = 2147483648; };
+
+
+EXPECT FAILURE "constant.tests 31":
+constants C { const long C1 = 020000000000; };
+
+
+EXPECT FAILURE "constant.tests 32":
+constants C { const long C1 = 0x80000000; };
+
+
+EXPECT FAILURE "constant.tests 33":
+constants C { const unsigned long C1 = -1; };
+
+
+EXPECT FAILURE "constant.tests 34":
+constants C { const unsigned long C1 = -01; };
+
+
+EXPECT FAILURE "constant.tests 35":
+constants C { const unsigned long C1 = -0x1; };
+
+
+EXPECT FAILURE "constant.tests 36":
+constants C { const unsigned long C1 = 4294967296; };
+
+
+EXPECT FAILURE "constant.tests 37":
+constants C { const unsigned long C1 = 040000000000; };
+
+
+EXPECT FAILURE "constant.tests 38":
+constants C { const unsigned long C1 = 0x100000000; };
+
+
+EXPECT FAILURE "constant.tests 39":
+constants C { const hyper C1 = -9223372036854775809; };
+
+
+EXPECT FAILURE "constant.tests 40":
+constants C { const hyper C1 = -01000000000000000000001; };
+
+
+EXPECT FAILURE "constant.tests 41":
+constants C { const hyper C1 = -0x8000000000000001; };
+
+
+EXPECT FAILURE "constant.tests 42":
+constants C { const hyper C1 = 9223372036854775808; };
+
+
+EXPECT FAILURE "constant.tests 43":
+constants C { const hyper C1 = 01000000000000000000000; };
+
+
+EXPECT FAILURE "constant.tests 44":
+constants C { const hyper C1 = 0x8000000000000000; };
+
+
+EXPECT FAILURE "constant.tests 45":
+constants C { const unsigned hyper C1 = -1; };
+
+
+EXPECT FAILURE "constant.tests 46":
+constants C { const unsigned hyper C1 = -01; };
+
+
+EXPECT FAILURE "constant.tests 47":
+constants C { const unsigned hyper C1 = -0x1; };
+
+
+EXPECT FAILURE "constant.tests 48":
+constants C { const unsigned hyper C1 = 18446744073709551616; };
+
+
+EXPECT FAILURE "constant.tests 49":
+constants C { const unsigned hyper C1 = 02000000000000000000000; };
+
+
+EXPECT FAILURE "constant.tests 50":
+constants C { const unsigned hyper C1 = 0x10000000000000000; };