From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- idlc/test/parser/attribute.tests | 232 ++++++++++ idlc/test/parser/constant.tests | 294 ++++++++++++ idlc/test/parser/constructor.tests | 190 ++++++++ idlc/test/parser/conversion.tests | 79 ++++ idlc/test/parser/interfaceinheritance.tests | 279 ++++++++++++ idlc/test/parser/methodoverload.tests | 177 ++++++++ idlc/test/parser/oldstyle.tests | 28 ++ idlc/test/parser/polystruct.tests | 251 ++++++++++ idlc/test/parser/published.tests | 681 ++++++++++++++++++++++++++++ idlc/test/parser/struct.tests | 46 ++ idlc/test/parser/typedef.tests | 63 +++ 11 files changed, 2320 insertions(+) create mode 100644 idlc/test/parser/attribute.tests create mode 100644 idlc/test/parser/constant.tests create mode 100644 idlc/test/parser/constructor.tests create mode 100644 idlc/test/parser/conversion.tests create mode 100644 idlc/test/parser/interfaceinheritance.tests create mode 100644 idlc/test/parser/methodoverload.tests create mode 100644 idlc/test/parser/oldstyle.tests create mode 100644 idlc/test/parser/polystruct.tests create mode 100644 idlc/test/parser/published.tests create mode 100644 idlc/test/parser/struct.tests create mode 100644 idlc/test/parser/typedef.tests (limited to 'idlc/test/parser') diff --git a/idlc/test/parser/attribute.tests b/idlc/test/parser/attribute.tests new file mode 100644 index 000000000..73b9d3485 --- /dev/null +++ b/idlc/test/parser/attribute.tests @@ -0,0 +1,232 @@ +# +# 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 "attribute.tests 1": +interface I1 { + [attribute] long a; +}; + + +EXPECT SUCCESS "attribute.tests 2": +interface I1 { + [attribute] long a {}; +}; + + +EXPECT FAILURE "attribute.tests 3": +interface I1 { + [attribute] long a { + get raises (); + }; +}; + + +EXPECT FAILURE "attribute.tests 3a": +interface I1 { + [attribute] long a { + set raises (); + }; +}; + + +EXPECT SUCCESS "attribute.tests 4": +exception E1 {}; +interface I1 { + [attribute] long a { + get raises (E1); + }; +}; + + +EXPECT SUCCESS "attribute.tests 5": +exception E1 {}; +interface I1 { + [attribute] long a { + set raises (E1); + }; +}; + + +EXPECT SUCCESS "attribute.tests 6": +exception E1 {}; +interface I1 { + [attribute] long a { + get raises (E1); + set raises (E1); + }; +}; + + +EXPECT SUCCESS "attribute.tests 7": +exception E1 {}; +interface I1 { + [attribute] long a { + set raises (E1); + get raises (E1); + }; +}; + + +EXPECT FAILURE "attribute.tests 8": +exception E1 {}; +interface I1 { + [attribute] long a { + get raises (E1); + get raises (E1); + }; +}; + + +EXPECT OLD-FAILURE "attribute.tests 9": +exception E1 {}; +interface I1 { + void E1(); + [attribute] long a { + get raises (E1); + }; +}; + + +EXPECT OLD-FAILURE "attribute.tests 10": +exception E1 {}; +interface I1 { + [attribute] long E1 { + get raises (E1); + }; +}; + + +EXPECT NEW-FAILURE "attribute.tests 11": +exception E1 {}; +interface I1 { + [attribute] long a { + get raises (E1,E1); + }; +}; + + +EXPECT SUCCESS "attribute.tests 12": +exception E1 {}; +interface I1 { + [attribute, readonly] long a { + get raises (E1); + }; +}; + + +EXPECT FAILURE "attribute.tests 13": +exception E1 {}; +interface I1 { + [attribute, readonly] long a { + set raises (E1); + }; +}; + + +EXPECT FAILURE "attribute.tests 14": +interface I1 { + [] long a; +}; + + +EXPECT SUCCESS "attribute.tests 15": +interface I1 { + [attribute] long a; +}; + + +EXPECT FAILURE "attribute.tests 16": +interface I1 { + [attribute, property] long a; +}; + + +EXPECT FAILURE "attribute.tests 17": +interface I1 { + [attribute, optional] long a; +}; + + +EXPECT FAILURE "attribute.tests 18": +interface I1 { + [attribute, maybevoid] long a; +}; + + +EXPECT FAILURE "attribute.tests 19": +interface I1 { + [attribute, constrained] long a; +}; + + +EXPECT FAILURE "attribute.tests 20": +interface I1 { + [attribute, transient] long a; +}; + + +EXPECT FAILURE "attribute.tests 21": +interface I1 { + [attribute, maybeambigious] long a; +}; + + +EXPECT FAILURE "attribute.tests 22": +interface I1 { + [attribute, maybedefault] long a; +}; + + +EXPECT FAILURE "attribute.tests 23": +interface I1 { + [attribute, removable] long a; +}; + + +EXPECT SUCCESS "attribute.tests 24": +interface I1 { + [attribute, bound] long a; +}; + + +EXPECT SUCCESS "attribute.tests 25": +interface I1 { + [bound, attribute] long a; +}; + + +EXPECT SUCCESS "attribute.tests 26": +interface I1 { + [attribute, readonly] long a; +}; + + +EXPECT SUCCESS "attribute.tests 27": +interface I1 { + [attribute, bound, readonly] long a; +}; + + +EXPECT SUCCESS "attribute.tests 28": +exception E1 {}; +interface I1 { + [attribute, bound] long a { + get raises (E1); + set raises (E1); + }; +}; 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; }; diff --git a/idlc/test/parser/constructor.tests b/idlc/test/parser/constructor.tests new file mode 100644 index 000000000..ce2438b98 --- /dev/null +++ b/idlc/test/parser/constructor.tests @@ -0,0 +1,190 @@ +# +# 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 "constructor.tests 1": +interface X {}; +service S: X; + + +EXPECT SUCCESS "constructor.tests 2": +interface X {}; +service S: X {}; + + +EXPECT SUCCESS "constructor.tests 3": +interface X {}; +service S: X { + f(); +}; + + +EXPECT FAILURE "constructor.tests 4": +interface X {}; +service S: X { + f(); + f(); +}; + + +EXPECT FAILURE "constructor.tests 5": +interface X { + void f([in] any... p); +}; + + +EXPECT FAILURE "constructor.tests 6": +interface X { + void f([out] any... p); +}; + + +EXPECT SUCCESS "constructor.tests 7": +interface X {}; +service S: X { + f([in] any... p); +}; + + +EXPECT SUCCESS "constructor.tests 8": +interface X {}; +typedef any some; +service S: X { + f([in] some... p); +}; + + +EXPECT FAILURE "constructor.tests 9": +interface X {}; +service S: X { + f([in] long p1, [in] any... p2); +}; + + +EXPECT FAILURE "constructor.tests 10": +interface X {}; +service S: X { + f([in] any... p2, [in] long p1); +}; + + +EXPECT FAILURE "constructor.tests 11": +interface X {}; +service S: X { + f([in] long p1, [in] long... p2); +}; + + +EXPECT FAILURE "constructor.tests 12": +interface X {}; +service S: X { + f([out] long p); +}; + + +EXPECT FAILURE "constructor.tests 13": +interface X {}; +service S: X { + f([out] any... p); +}; + + +EXPECT FAILURE "constructor.tests 14": +interface X {}; +singleton S: X { + f(); +}; + + +EXPECT FAILURE "constructor.tests 15": +module com { module sun { module star { module test { + interface X {}; +service S: com::sun::star::test::X { + c1([in] long a, [in] com::sun::star::test::X b); + c2([in] long c, [in] X d); +}; +}; }; }; }; + + +EXPECT FAILURE "constructor.tests 16": +module com { module sun { module star { module test { + interface X {}; +}; }; }; }; +typedef long T; +service S: com::sun::star::test::X { + c1([in] sequence a); + c2([in] sequence b); +}; + + +EXPECT FAILURE "constructor.tests 17": +module com { module sun { module star { module test { + interface X {}; +}; }; }; }; +service S: com::sun::star::test::X { + c1([in] any... a); + c2([in] any... b); +}; + + +EXPECT SUCCESS "constructor.tests 18": +module com { module sun { module star { module test { + interface X {}; +}; }; }; }; +service S: com::sun::star::test::X { + c1([in] any... a); + c2([in] sequence b); +}; + + +EXPECT SUCCESS "constructor.tests 19": +module com { module sun { module star { module test { + interface X { void m(); }; +}; }; }; }; +service S: com::sun::star::test::X { + c([in] any... a); +}; + + +EXPECT SUCCESS "constructor.tests 20": +module com { module sun { module star { module uno { + interface XInterface { void m(); }; +}; }; }; }; +service S: com::sun::star::uno::XInterface { + c1([in] long a, [in] long b); + c2([in] long a); +}; + + +EXPECT SUCCESS "constructor.tests 21": +module com { module sun { module star { module uno { + interface XInterface { void m(); }; +}; }; }; }; +service S: com::sun::star::uno::XInterface { + c1([in] long a); + c2([in] long a, [in] long b); +}; + + +EXPECT SUCCESS "constructor.tests 22": +module com { module sun { module star { module uno { + interface XInterface { void m(); }; +}; }; }; }; +service S: com::sun::star::uno::XInterface { + c1([in] long a, [in] short b); + c2([in] long a, [in] long b); +}; diff --git a/idlc/test/parser/conversion.tests b/idlc/test/parser/conversion.tests new file mode 100644 index 000000000..4f1d6bc7d --- /dev/null +++ b/idlc/test/parser/conversion.tests @@ -0,0 +1,79 @@ +# +# 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/. +# + +EXPECT SUCCESS "conversion.tests 1": +constants C { + const byte C1 = -128.0; + const byte C2 = -127.9; + const byte C3 = 254.9; + const byte C4 = 255.0; + const short C5 = -32768.0; + const short C6 = -32767.9; + const short C7 = 32766.9; + const short C8 = 32767.0; + const unsigned short C9 = 0.0; + const unsigned short C10 = 0.1; + const unsigned short C11 = 65534.9; + const unsigned short C12 = 65535.0; + const long C13 = -2147483648.0; + const long C14 = -2147483647.9; + const long C15 = 2147483646.9; + const long C16 = 2147483647.0; + const unsigned long C17 = 0.0; + const unsigned long C18 = 0.1; + const unsigned long C19 = 4294967294.9; + const unsigned long C20 = 4294967295.0; + const hyper C21 = -9223372036854774784.0; // -0x7FFFFFFFFFFFFC00 = -0x1.FFFFFFFFFFFFFp62 + const hyper C22 = 9223372036854774784.0; // 0x7FFFFFFFFFFFFC00 = 0x1.FFFFFFFFFFFFFp62 + const unsigned hyper C23 = 0.0; + const unsigned hyper C24 = 0.1; + const unsigned hyper C25 = 18446744073709549568.0; // 0xFFFFFFFFFFFFF800 = 0x1.FFFFFFFFFFFFFp63 +}; + +EXPECT FAILURE "conversion.tests 2": +constants C { const byte C1 = -128.1; }; + +EXPECT FAILURE "conversion.tests 3": +constants C { const byte C1 = 255.1; }; + +EXPECT FAILURE "conversion.tests 4": +constants C { const short C1 = -32768.1; }; + +EXPECT FAILURE "conversion.tests 5": +constants C { const short C1 = 32767.1; }; + +EXPECT FAILURE "conversion.tests 6": +constants C { const unsigned short C1 = -0.1; }; + +EXPECT FAILURE "conversion.tests 7": +constants C { const unsigned short C1 = 65535.1; }; + +EXPECT FAILURE "conversion.tests 8": +constants C { const long C1 = -2147483648.1; }; + +EXPECT FAILURE "conversion.tests 9": +constants C { const long C1 = 2147483647.1; }; + +EXPECT FAILURE "conversion.tests 10": +constants C { const unsigned long C1 = -0.1; }; + +EXPECT FAILURE "conversion.tests 11": +constants C { const unsigned long C1 = 4294967295.1; }; + +EXPECT FAILURE "conversion.tests 12": +constants C { const hyper C1 = -9223372036854775808.0; }; // -0x8000000000000000 = -0x1p63 + +EXPECT FAILURE "conversion.tests 13": +constants C { const hyper C1 = 9223372036854775807.0; }; // 0x7FFFFFFFFFFFFFFF rounds up to 0x1p63 + +EXPECT FAILURE "conversion.tests 14": +constants C { const unsigned hyper C1 = -0.1; }; + +EXPECT FAILURE "conversion.tests 15": +constants C { const unsigned hyper C1 = 18446744073709551615.0; }; + // 0xFFFFFFFFFFFFFFFF rounds up to 0x1p64 diff --git a/idlc/test/parser/interfaceinheritance.tests b/idlc/test/parser/interfaceinheritance.tests new file mode 100644 index 000000000..f9cac4ca2 --- /dev/null +++ b/idlc/test/parser/interfaceinheritance.tests @@ -0,0 +1,279 @@ +# +# 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 FAILURE "interfaceinheritance.tests 1": +interface Base {}; +interface Derived { + interface Base; + interface Base; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 2": +interface Base {}; +interface Derived { + interface Base; + [optional] interface Base; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 3": +interface Base {}; +interface Derived { + [optional] interface Base; + interface Base; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 4": +interface Base {}; +interface Derived { + [optional] interface Base; + [optional] interface Base; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 5": +interface Base1 {}; +interface Base2: Base1 {}; +interface Derived { + interface Base1; + interface Base2; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 6": +interface Base1 {}; +interface Base2: Base1 {}; +interface Derived { + interface Base2; + interface Base1; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 7": +interface Base1 {}; +interface Base2: Base1 {}; +interface Derived { + [optional] interface Base1; + interface Base2; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 8": +interface Base1 {}; +interface Base2: Base1 {}; +interface Derived { + interface Base2; + [optional] interface Base1; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 9": +interface Base1 {}; +interface Base2: Base1 {}; +interface Derived { + interface Base1; + [optional] interface Base2; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 10": +interface Base1 {}; +interface Base2: Base1 {}; +interface Derived { + [optional] interface Base2; + interface Base1; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 11": +interface Base1 {}; +interface Base2: Base1 {}; +interface Derived { + [optional] interface Base1; + [optional] interface Base2; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 12": +interface Base1 {}; +interface Base2: Base1 {}; +interface Derived { + [optional] interface Base2; + [optional] interface Base1; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 13": +interface Base1 {}; +interface Base2 { [optional] interface Base1; }; +interface Derived { + interface Base1; + interface Base2; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 14": +interface Base1 {}; +interface Base2 { [optional] interface Base1; }; +interface Derived { + interface Base2; + interface Base1; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 15": +interface Base1 {}; +interface Base2 { [optional] interface Base1; }; +interface Derived { + [optional] interface Base1; + interface Base2; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 16": +interface Base1 {}; +interface Base2 { [optional] interface Base1; }; +interface Derived { + interface Base2; + [optional] interface Base1; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 17": +interface Base1 {}; +interface Base2 { [optional] interface Base1; }; +interface Derived { + interface Base1; + [optional] interface Base2; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 18": +interface Base1 {}; +interface Base2 { [optional] interface Base1; }; +interface Derived { + [optional] interface Base2; + interface Base1; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 19": +interface Base1 {}; +interface Base2 { [optional] interface Base1; }; +interface Derived { + [optional] interface Base1; + [optional] interface Base2; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 20": +interface Base1 {}; +interface Base2 { [optional] interface Base1; }; +interface Derived { + [optional] interface Base2; + [optional] interface Base1; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 21": +interface Base1 {}; +interface Base2: Base1 {}; +interface Base3: Base1 {}; +interface Derived { + interface Base2; + interface Base3; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 22": +interface Base1 {}; +interface Base2: Base1 {}; +interface Base3: Base1 {}; +interface Derived { + [optional] interface Base2; + interface Base3; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 23": +interface Base1 {}; +interface Base2: Base1 {}; +interface Base3: Base1 {}; +interface Derived { + interface Base2; + [optional] interface Base3; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 24": +interface Base1 {}; +interface Base2: Base1 {}; +interface Base3: Base1 {}; +interface Derived { + [optional] interface Base2; + [optional] interface Base3; +}; + + +EXPECT SUCCESS "interfaceinheritance.tests 25": +interface Base {}; +interface Derived { + [optional] interface Base; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 26": +interface Base; +interface Derived { + interface Base; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 27": +interface Base; +interface Derived { + [optional] interface Base; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 28": +interface Base {}; +typedef Base Hidden; +interface Derived { + interface Base; + interface Hidden; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 29": +interface Base {}; +typedef Base Hidden; +interface Derived { + interface Hidden; + interface Base; +}; + + +EXPECT FAILURE "interfaceinheritance.tests 30": +interface Base {}; +interface Derived { + interface Base; + [optional] interface com::sun::star::uno::XInterface; +}; diff --git a/idlc/test/parser/methodoverload.tests b/idlc/test/parser/methodoverload.tests new file mode 100644 index 000000000..9a07a4b2c --- /dev/null +++ b/idlc/test/parser/methodoverload.tests @@ -0,0 +1,177 @@ +# +# 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 FAILURE "methodoverload.tests 1": +interface Derived { + void f(); + void f(); +}; + + +EXPECT FAILURE "methodoverload.tests 2": +interface Base { + void f(); +}; +interface Derived { + interface Base; + void f(); +}; + + +EXPECT FAILURE "methodoverload.tests 3": +interface Base { + void f(); +}; +interface Derived { + void f(); + interface Base; +}; + + +EXPECT FAILURE "methodoverload.tests 4": +interface Base { + void f(); +}; +interface Derived { + [optional] interface Base; + void f(); +}; + + +EXPECT FAILURE "methodoverload.tests 5": +interface Base { + void f(); +}; +interface Derived { + void f(); + [optional] interface Base; +}; + + +EXPECT FAILURE "methodoverload.tests 6": +interface Base1 { + void f(); +}; +interface Base2 { + void f(); +}; +interface Derived { + interface Base1; + interface Base2; +}; + + +EXPECT FAILURE "methodoverload.tests 7": +interface Base1 { + void f(); +}; +interface Base2 { + void f(); +}; +interface Derived { + [optional] interface Base1; + interface Base2; +}; + + +EXPECT FAILURE "methodoverload.tests 8": +interface Base1 { + void f(); +}; +interface Base2 { + void f(); +}; +interface Derived { + interface Base1; + [optional] interface Base2; +}; + + +EXPECT SUCCESS "methodoverload.tests 9": +interface Base1 { + void f(); +}; +interface Base2 { + void f(); +}; +interface Derived { + [optional] interface Base1; + [optional] interface Base2; +}; + + +EXPECT FAILURE "methodoverload.tests 10": +interface I { + [attribute] long a; + [attribute] short a; +}; + + +EXPECT FAILURE "methodoverload.tests 11": +interface I1 { + [attribute] long a; +}; +interface I2 { + [attribute] short a; + interface I1; +}; + + +EXPECT FAILURE "methodoverload.tests 12": +interface I { + [attribute] long a; + void a(); +}; + + +EXPECT FAILURE "methodoverload.tests 13": +interface I1 { + [attribute] long a; +} +interface I2 { + void a(); + interface I1; +}; + + +EXPECT FAILURE "methodoverload.tests 14": +interface I1 { + void a(); +} +interface I2 { + [attribute] long a; + interface I1; +}; + + +EXPECT SUCCESS "methodoverload.tests 15": +interface I { + [attribute] long a; + void geta(); + void seta(); +}; + + +EXPECT SUCCESS "methodoverload.tests 16": +interface I1 { + [attribute] long a; +}; +interface I2: I1 { + void geta(); + void seta(); +}; diff --git a/idlc/test/parser/oldstyle.tests b/idlc/test/parser/oldstyle.tests new file mode 100644 index 000000000..c6692b977 --- /dev/null +++ b/idlc/test/parser/oldstyle.tests @@ -0,0 +1,28 @@ +# +# 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/. +# + +EXPECT SUCCESS "oldstyle.tests 1": +service S1 {}; +service S2 { service S1; }; + + +EXPECT FAILURE "oldstyle.tests 2": +interface X {}; +service S1: X; +service S2 { service S1; }; + + +EXPECT SUCCESS "oldstyle.tests 3": +service S1 {}; +singleton S2 { service S1; }; + + +EXPECT FAILURE "oldstyle.tests 4": +interface X {}; +service S1: X; +singleton S2 { service S1; }; diff --git a/idlc/test/parser/polystruct.tests b/idlc/test/parser/polystruct.tests new file mode 100644 index 000000000..89b0817c9 --- /dev/null +++ b/idlc/test/parser/polystruct.tests @@ -0,0 +1,251 @@ +# +# 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 "polystruct.tests 1": +struct Struct { T member; }; + + +EXPECT FAILURE "polystruct.tests 2": +struct Struct { long member; }; + + +EXPECT FAILURE "polystruct.tests 3": +struct Struct { long member; }; +typedef Struct Typedef; + + +EXPECT FAILURE "polystruct.tests 4": +struct Struct { long member; }; +typedef Struct Typedef; + + +EXPECT SUCCESS "polystruct.tests 5": +struct Struct { long member; }; + + +EXPECT SUCCESS "polystruct.tests 6": +struct Struct1 { T member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT SUCCESS "polystruct.tests 7": +struct Struct1 { T member; }; +struct Struct2 { Struct1 > member; }; + + +EXPECT FAILURE "polystruct.tests 8": +struct Struct1 { T member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT FAILURE "polystruct.tests 9": +struct Struct1 { T member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT FAILURE "polystruct.tests 10": +struct Struct2 { Struct1 member; }; + + +EXPECT FAILURE "polystruct.tests 11": +struct Struct1 { T member; }; +struct Struct2 { Struct1<> member; }; + + +EXPECT FAILURE "polystruct.tests 12": +struct Struct1 { T member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT FAILURE "polystruct.tests 13": +exception Exception {}; +struct Struct1 { T member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT SUCCESS "polystruct.tests 14": +struct Struct { T T; }; + + +EXPECT SUCCESS "polystruct.tests 15": +struct Struct { Struct member; }; + + +EXPECT FAILURE "polystruct.tests 16": +struct Struct { Struct member; }; + + +EXPECT FAILURE "polystruct.tests 17": +struct Struct { ::Struct member; }; + + +EXPECT FAILURE "polystruct.tests 18": +struct Struct { ::Struct member; }; + + +EXPECT SUCCESS "polystruct.tests 19": +struct Struct1 { T member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT SUCCESS "polystruct.tests 20": +struct Struct1 { T member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT SUCCESS "polystruct.tests 21": +struct Struct1 { T member; }; +struct Struct2 { ::Struct1 member; }; + + +EXPECT FAILURE "polystruct.tests 22": +struct Struct1 { long member1; }; +struct Struct2: Struct1 { long member2; }; + + +EXPECT FAILURE "polystruct.tests 23": +struct Struct1 { long member1; }; +struct Struct2: Struct1 { long member2; }; + + +EXPECT FAILURE "polystruct.tests 24": +struct Struct1 { long member1; }; +struct Struct2: Struct1 { long member2; }; + + +EXPECT FAILURE "polystruct.tests 25": +struct Struct1 { long member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT SUCCESS "polystruct.tests 25a": +struct Struct { long member; }; +interface X { [attribute] Struct member; }; + + +EXPECT FAILURE "polystruct.tests 26": +struct Struct1 { long member; }; +struct Struct2 { long member; }; +struct Struct3 { Struct1 > member; }; + + +EXPECT SUCCESS "polystruct.tests 27": +struct Struct1 { long member; }; +struct Struct2 { Struct1 > member; }; + + +EXPECT SUCCESS "polystruct.tests 28": +struct Struct1 { long member; }; +struct Struct2 { Struct1 > > member; }; + + +EXPECT SUCCESS "polystruct.tests 29": +struct Struct1 { long member; }; +struct Struct2 { sequence > member; }; + + +EXPECT SUCCESS "polystruct.tests 30": +struct Struct1 { long member; }; +struct Struct2 { sequence > > member; }; + + +EXPECT SUCCESS "polystruct.tests 31": +struct Struct1 { long member; }; +struct Struct2 { sequence > > member; }; + + +EXPECT FAILURE "polystruct.tests 32": +struct Struct { Struct member; }; + + +EXPECT FAILURE "polystruct.tests 33": +struct Struct { Struct member; }; + + +EXPECT FAILURE "polystruct.tests 34": +struct Struct { Struct member; }; + + +EXPECT FAILURE "polystruct.tests 35": +struct Struct { Struct > member; }; + + +EXPECT FAILURE "polystruct.tests 36": +struct Struct1 { long member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT FAILURE "polystruct.tests 37": +struct Struct1 { long member; }; +struct Struct2 { long member; }; +struct Struct3 { Struct1 > member; }; + + +EXPECT FAILURE "polystruct.tests 38": +struct Struct1 { long member; }; +struct Struct2 { Struct1 > member; }; + + +EXPECT FAILURE "polystruct.tests 39": +struct Struct1 { long member; }; +struct Struct2 { long member; }; +struct Struct3 { Struct1 > > member; }; + + +EXPECT FAILURE "polystruct.tests 40": +struct Struct1 { long member; }; +struct Struct2 { Struct1 member; }; + + +EXPECT FAILURE "polystruct.tests 41": +struct Struct1 { long member; }; +struct Struct2 { long member; }; +struct Struct3 { Struct2 > member; }; + + +EXPECT FAILURE "polystruct.tests 42": +struct Struct { long member; }; +interface X { void f([in] Struct p); }; + + +EXPECT FAILURE "polystruct.tests 43": +struct Struct1 { long member; }; +struct Struct2 { Struct1 > member; }; + + +EXPECT SUCCESS "polystruct.tests 44": +struct Struct1 { long member; }; +struct Struct2 { Struct1 > member; }; + + +EXPECT FAILURE "polystruct.tests 45": +struct Struct1 { long member; }; +typedef unsigned short td; +struct Struct2 { Struct1 member; }; + + +EXPECT FAILURE "polystruct.tests 46": +struct Struct1 { long member; }; +typedef sequence td; +struct Struct2 { Struct1 member; }; + + +EXPECT FAILURE "polystruct.tests 47": +struct Struct1 { long member; }; +typedef unsigned short td; +struct Struct2 { Struct1 > member; }; diff --git a/idlc/test/parser/published.tests b/idlc/test/parser/published.tests new file mode 100644 index 000000000..f81ef6b41 --- /dev/null +++ b/idlc/test/parser/published.tests @@ -0,0 +1,681 @@ +# +# 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 "published.tests 1": +published enum Enum { VALUE }; +published struct Struct1 { long member; }; +published struct Struct2 { T member; }; +published exception E1 {}; +published interface I1 {}; +published typedef long Typedef; +published constants Constants { const long Constant = 1; }; +published service Service1: I1 {}; +published service Service2 { interface I1; }; +published singleton Singleton1: I1; +published singleton Singleton2 { service Service2; }; + + +EXPECT FAILURE "published.tests 2": +constants Constants { published const long C = 1; }; + + +EXPECT FAILURE "published.tests 3": +published constants Constants { published const long C = 1; }; + + +EXPECT FAILURE "published.tests 4": +published module m {}; + + +EXPECT SUCCESS "published.tests 5": +interface I1; +interface I1 {}; + + +EXPECT SUCCESS "published.tests 6": +interface I1; +published interface I1 {}; + + +EXPECT FAILURE "published.tests 7": +published interface I1; +interface I1 {}; + + +EXPECT SUCCESS "published.tests 8": +published interface I1; +published interface I1 {}; + + +EXPECT SUCCESS "published.tests 9": +struct S1 { long m1; }; +struct S2: S1 { long m2; }; + + +EXPECT FAILURE "published.tests 10": +struct S1 { long m1; }; +published struct S2: S1 { long m2; }; + + +EXPECT SUCCESS "published.tests 11": +published struct S1 { long m1; }; +struct S2: S1 { long m2; }; + + +EXPECT SUCCESS "published.tests 12": +published struct S1 { long m1; }; +published struct S2: S1 { long m2; }; + + +EXPECT SUCCESS "published.tests 13": +enum E { V }; +struct S1 { T m1; }; +struct S2 { S1 m2; }; + + +EXPECT FAILURE "published.tests 14": +enum E { V }; +struct S1 { T m1; }; +published struct S2 { S1 m2; }; + + +EXPECT SUCCESS "published.tests 15": +enum E { V }; +published struct S1 { T m1; }; +struct S2 { S1 m2; }; + + +EXPECT FAILURE "published.tests 16": +enum E { V }; +published struct S1 { T m1; }; +published struct S2 { S1 m2; }; + + +EXPECT SUCCESS "published.tests 17": +published enum E { V }; +struct S1 { T m1; }; +struct S2 { S1 m2; }; + + +EXPECT FAILURE "published.tests 18": +published enum E { V }; +struct S1 { T m1; }; +published struct S2 { S1 m2; }; + + +EXPECT SUCCESS "published.tests 19": +published enum E { V }; +published struct S1 { T m1; }; +struct S2 { S1 m2; }; + + +EXPECT SUCCESS "published.tests 20": +published enum E { V }; +published struct S1 { T m1; }; +published struct S2 { S1 m2; }; + + +EXPECT SUCCESS "published.tests 21": +module com { module sun { module star { module uno { +exception Exception {}; +exception E2: Exception {}; +}; }; }; }; + + +EXPECT FAILURE "published.tests 22": +module com { module sun { module star { module uno { +exception Exception {}; +published exception E2: Exception {}; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 23": +module com { module sun { module star { module uno { +published exception Exception {}; +exception E2: Exception {}; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 24": +module com { module sun { module star { module uno { +published exception Exception {}; +published exception E2: Exception {}; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 25": +enum E { V }; +module com { module sun { module star { module uno { +exception Exception { E m; }; +}; }; }; }; + + +EXPECT FAILURE "published.tests 26": +enum E { V }; +module com { module sun { module star { module uno { +published exception Exception { E m; }; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 27": +published enum E { V }; +module com { module sun { module star { module uno { +exception Exception { E m; }; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 28": +published enum E { V }; +module com { module sun { module star { module uno { +published exception Exception { E m; }; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 29": +interface I1 {}; +interface I2: I1 {}; + + +EXPECT FAILURE "published.tests 30": +interface I1 {}; +published interface I2: I1 {}; + + +EXPECT SUCCESS "published.tests 31": +published interface I1 {}; +interface I2: I1 {}; + + +EXPECT SUCCESS "published.tests 32": +published interface I1 {}; +published interface I2: I1 {}; + + +EXPECT SUCCESS "published.tests 33": +enum E { V }; +interface I1 { [attribute] E m; }; + + +EXPECT FAILURE "published.tests 34": +enum E { V }; +published interface I1 { [attribute] E m; }; + + +EXPECT SUCCESS "published.tests 35": +published enum E { V }; +interface I1 { [attribute] E m; }; + + +EXPECT SUCCESS "published.tests 36": +published enum E { V }; +published interface I1 { [attribute] E m; }; + + +EXPECT SUCCESS "published.tests 36a.1": +module com { module sun { module star { module uno { +exception Exception {}; +interface I1 { [attribute] long m { get raises (Exception); }; }; +}; }; }; }; + + +EXPECT FAILURE "published.tests 36a.2": +module com { module sun { module star { module uno { +exception Exception {}; +published interface I1 { + [attribute] long m { get raises (Exception); }; }; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 36a.3": +module com { module sun { module star { module uno { +published exception Exception {}; +interface I1 { [attribute] long m { get raises (Exception); }; }; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 36a.4": +module com { module sun { module star { module uno { +published exception Exception {}; +published interface I1 { + [attribute] long m { get raises (Exception); }; }; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 37": +enum E { V }; +interface I1 { E f(); }; + + +EXPECT FAILURE "published.tests 38": +enum E { V }; +published interface I1 { E f(); }; + + +EXPECT SUCCESS "published.tests 39": +published enum E { V }; +interface I1 { E f(); }; + + +EXPECT SUCCESS "published.tests 40": +published enum E { V }; +published interface I1 { E f(); }; + + +EXPECT SUCCESS "published.tests 41": +enum E { V }; +interface I1 { void f([in] E p); }; + + +EXPECT FAILURE "published.tests 42": +enum E { V }; +published interface I1 { void f([in] E p); }; + + +EXPECT SUCCESS "published.tests 43": +published enum E { V }; +interface I1 { void f([in] E p); }; + + +EXPECT SUCCESS "published.tests 44": +published enum E { V }; +published interface I1 { void f([in] E p); }; + + +EXPECT SUCCESS "published.tests 45": +module com { module sun { module star { module uno { +exception Exception {}; +interface I1 { void f() raises (Exception); }; +}; }; }; }; + + +EXPECT FAILURE "published.tests 46": +module com { module sun { module star { module uno { +exception Exception {}; +published interface I1 { void f() raises (Exception); }; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 47": +module com { module sun { module star { module uno { +published exception Exception {}; +interface I1 { void f() raises (Exception); }; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 48": +module com { module sun { module star { module uno { +published exception Exception {}; +published interface I1 { void f() raises (Exception); }; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 49": +interface I1 {}; +interface I2 { interface I1; }; + + +EXPECT FAILURE "published.tests 50": +interface I1 {}; +published interface I2 { interface I1; }; + + +EXPECT SUCCESS "published.tests 51": +published interface I1 {}; +interface I2 { interface I1; }; + + +EXPECT SUCCESS "published.tests 52": +published interface I1 {}; +published interface I2 { interface I1; }; + + +EXPECT SUCCESS "published.tests 57": +enum E { V }; +typedef E T; + + +EXPECT FAILURE "published.tests 58": +enum E { V }; +published typedef E T; + + +EXPECT SUCCESS "published.tests 59": +published enum E { V }; +typedef E T; + + +EXPECT SUCCESS "published.tests 60": +published enum E { V }; +published typedef E T; + + +EXPECT SUCCESS "published.tests 61": +enum E { V }; +typedef E T; +struct S { T m; }; + + +EXPECT FAILURE "published.tests 62": +enum E { V }; +typedef E T; +published struct S { T m; }; + + +EXPECT FAILURE "published.tests 63": +enum E { V }; +published typedef E T; +struct S { T m; }; + + +EXPECT FAILURE "published.tests 64": +enum E { V }; +published typedef E T; +published struct S { T m; }; + + +EXPECT SUCCESS "published.tests 65": +published enum E { V }; +typedef E T; +struct S { T m; }; + + +EXPECT FAILURE "published.tests 66": +published enum E { V }; +typedef E T; +published struct S { T m; }; + + +EXPECT SUCCESS "published.tests 67": +published enum E { V }; +published typedef E T; +struct S { T m; }; + + +EXPECT SUCCESS "published.tests 68": +published enum E { V }; +published typedef E T; +published struct S { T m; }; + + +EXPECT SUCCESS "published.tests 73": +constants Cs { + const long C1 = 1; + const long C2 = C1 + 1; +}; + + +EXPECT SUCCESS "published.tests 74": +published constants Cs { + const long C1 = 1; + const long C2 = C1 + 1; +}; + + +EXPECT SUCCESS "published.tests 83": +constants Cs1 { const long C1 = 1; }; +constants Cs2 { const long C2 = Cs1::C1 + 1; }; + + +EXPECT FAILURE "published.tests 84": +constants Cs1 { const long C1 = 1; }; +published constants Cs2 { const long C2 = Cs1::C1 + 1; }; + + +EXPECT SUCCESS "published.tests 85": +published constants Cs1 { const long C1 = 1; }; +constants Cs2 { const long C2 = Cs1::C1 + 1; }; + + +EXPECT SUCCESS "published.tests 86": +published constants Cs1 { const long C1 = 1; }; +published constants Cs2 { const long C2 = Cs1::C1 + 1; }; + + +EXPECT SUCCESS "published.tests 87": +typedef long T; +constants Cs { const T C = 1; }; + + +EXPECT FAILURE "published.tests 88": +typedef long T; +published constants Cs { const T C = 1; }; + + +EXPECT SUCCESS "published.tests 89": +published typedef long T; +constants Cs { const T C = 1; }; + + +EXPECT SUCCESS "published.tests 90": +published typedef long T; +published constants Cs { const T C = 1; }; + + +EXPECT SUCCESS "published.tests 91": +service S1 {}; +service S2 { service S1; }; + + +EXPECT FAILURE "published.tests 92": +service S1 {}; +published service S2 { service S1; }; + + +EXPECT SUCCESS "published.tests 93": +published service S1 {}; +service S2 { service S1; }; + + +EXPECT SUCCESS "published.tests 94": +published service S1 {}; +published service S2 { service S1; }; + + +EXPECT SUCCESS "published.tests 95": +interface I1 {}; +service S { interface I1; }; + + +EXPECT FAILURE "published.tests 96": +interface I1 {}; +published service S { interface I1; }; + + +EXPECT SUCCESS "published.tests 97": +published interface I1 {}; +service S { interface I1; }; + + +EXPECT SUCCESS "published.tests 98": +published interface I1 {}; +published service S { interface I1; }; + + +EXPECT SUCCESS "published.tests 99": +interface I1 {}; +service S: I1; + + +EXPECT FAILURE "published.tests 100": +interface I1 {}; +published service S: I1; + + +EXPECT SUCCESS "published.tests 101": +published interface I1 {}; +service S: I1; + + +EXPECT SUCCESS "published.tests 102": +published interface I1 {}; +published service S: I1; + + +EXPECT SUCCESS "published.tests 103": +enum E { V }; +interface I1 {}; +service S: I1 { + f([in] E p); +}; + + +EXPECT FAILURE "published.tests 104": +enum E { V }; +published interface I1 {}; +published service S: I1 { + f([in] E p); +}; + + +EXPECT SUCCESS "published.tests 105": +published enum E { V }; +interface I1 {}; +service S: I1 { + f([in] E p); +}; + + +EXPECT SUCCESS "published.tests 106": +published enum E { V }; +published interface I1 {}; +published service S: I1 { + f([in] E p); +}; + + +EXPECT SUCCESS "published.tests 107": +module com { module sun { module star { module uno { +exception Exception {}; +interface I1 {}; +service S: I1 { + f() raises (Exception); +}; +}; }; }; }; + + +EXPECT FAILURE "published.tests 108": +module com { module sun { module star { module uno { +exception Exception {}; +published interface I1 {}; +published service S: I1 { + f() raises (Exception); +}; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 109": +module com { module sun { module star { module uno { +published exception Exception {}; +interface I1 {}; +service S: I1 { + f() raises (Exception); +}; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 110": +module com { module sun { module star { module uno { +published exception Exception {}; +published interface I1 {}; +published service S: I1 { + f() raises (Exception); +}; +}; }; }; }; + + +EXPECT SUCCESS "published.tests 111": +service S1 {}; +singleton S2 { service S1; }; + + +EXPECT FAILURE "published.tests 112": +service S1 {}; +published singleton S2 { service S1; }; + + +EXPECT SUCCESS "published.tests 113": +published service S1 {}; +singleton S2 { service S1; }; + + +EXPECT SUCCESS "published.tests 114": +published service S1 {}; +published singleton S2 { service S1; }; + + +EXPECT SUCCESS "published.tests 115": +interface I1 {}; +singleton S: I1; + + +EXPECT FAILURE "published.tests 116": +interface I1 {}; +published singleton S: I1; + + +EXPECT SUCCESS "published.tests 117": +published interface I1 {}; +singleton S: I1; + + +EXPECT SUCCESS "published.tests 118": +published interface I1 {}; +published singleton S: I1; + + +EXPECT FAILURE "published.tests 119": +interface I1 {}; +published interface I2 { [optional] interface I1; }; + + +EXPECT FAILURE "published.tests 120": +service S1 {}; +published service S2 { [optional] service S1; }; + + +EXPECT SUCCESS "published.tests 121": +interface I {}; +published service S { [optional] interface I; }; + + +EXPECT FAILURE "published.tests 122": +interface I {}; +published service S { [optional, property] I p; }; + + +EXPECT FAILURE "published.tests 123": +interface I {}; +published service S { [optional, property] sequence p; }; + + +EXPECT FAILURE "published.tests 124": +struct P { T m; }; +interface I {}; +published service S { [optional, property] P p; }; + + +EXPECT FAILURE "published.tests 125": +published struct P { T m; }; +interface I {}; +published service S { [optional, property] P p; }; + + +EXPECT FAILURE "published.tests 126": +struct P { T m; }; +published interface I {}; +published service S { [optional, property] P p; }; diff --git a/idlc/test/parser/struct.tests b/idlc/test/parser/struct.tests new file mode 100644 index 000000000..77d500e89 --- /dev/null +++ b/idlc/test/parser/struct.tests @@ -0,0 +1,46 @@ +# +# 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 FAILURE "struct.tests 1": +struct S { void m; }; + + +EXPECT FAILURE "struct.tests 2": +struct S { sequence m; }; + + +EXPECT FAILURE "struct.tests 3": +exception E {}; +struct S { E m; }; + + +EXPECT FAILURE "struct.tests 4": +exception E {}; +struct S { sequence m; }; + + +EXPECT FAILURE "struct.tests 5": +struct S { S m; }; + + +EXPECT SUCCESS "struct.tests 6": +struct S { sequence m; }; + + +EXPECT SUCCESS "struct.tests 7": +struct S { sequence > m; }; diff --git a/idlc/test/parser/typedef.tests b/idlc/test/parser/typedef.tests new file mode 100644 index 000000000..0eaf5d634 --- /dev/null +++ b/idlc/test/parser/typedef.tests @@ -0,0 +1,63 @@ +# +# 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 "typedef.tests 1": +struct Struct1 { long member1; }; +typedef Struct1 T1; +typedef T1 T2; +struct Struct2: T2 { long member2; }; + + +EXPECT FAILURE "typedef.tests 2": +typedef long T1; +typedef T1 T2; +struct Struct: T2 { long member2; }; + + +EXPECT SUCCESS "typedef.tests 3": +interface Interface1 {}; +typedef Interface1 T1; +typedef T1 T2; +interface Interface2: T2 {}; + + +EXPECT FAILURE "typedef.tests 4": +interface Interface1; +typedef Interface1 T1; +typedef T1 T2; +interface Interface2: T2 {}; + + +EXPECT FAILURE "typedef.tests 5": +typedef long T1; +typedef T1 T2; +interface Interface: T2 {}; + + +EXPECT FAILURE "typedef.tests 6": +typedef void T; + + +EXPECT FAILURE "typedef.tests 7": +exception E {}; +typedef E T; + + +EXPECT FAILURE "typdef.tests 8": +constants C {}; +typedef C T; -- cgit v1.2.3