xref: /trunk/main/idlc/test/parser/constructor.tests (revision 57f04c0e)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22EXPECT SUCCESS "constructor.tests 1":
23interface X {};
24service S: X;
25
26
27EXPECT SUCCESS "constructor.tests 2":
28interface X {};
29service S: X {};
30
31
32EXPECT SUCCESS "constructor.tests 3":
33interface X {};
34service S: X {
35    f();
36};
37
38
39EXPECT FAILURE "constructor.tests 4":
40interface X {};
41service S: X {
42    f();
43    f();
44};
45
46
47EXPECT FAILURE "constructor.tests 5":
48interface X {
49    void f([in] any... p);
50};
51
52
53EXPECT FAILURE "constructor.tests 6":
54interface X {
55    void f([out] any... p);
56};
57
58
59EXPECT SUCCESS "constructor.tests 7":
60interface X {};
61service S: X {
62    f([in] any... p);
63};
64
65
66EXPECT SUCCESS "constructor.tests 8":
67interface X {};
68typedef any some;
69service S: X {
70    f([in] some... p);
71};
72
73
74EXPECT FAILURE "constructor.tests 9":
75interface X {};
76service S: X {
77    f([in] long p1, [in] any... p2);
78};
79
80
81EXPECT FAILURE "constructor.tests 10":
82interface X {};
83service S: X {
84    f([in] any... p2, [in] long p1);
85};
86
87
88EXPECT FAILURE "constructor.tests 11":
89interface X {};
90service S: X {
91    f([in] long p1, [in] long... p2);
92};
93
94
95EXPECT FAILURE "constructor.tests 12":
96interface X {};
97service S: X {
98    f([out] long p);
99};
100
101
102EXPECT FAILURE "constructor.tests 13":
103interface X {};
104service S: X {
105    f([out] any... p);
106};
107
108
109EXPECT FAILURE "constructor.tests 14":
110interface X {};
111singleton S: X {
112    f();
113};
114
115
116EXPECT FAILURE "constructor.tests 15":
117module com { module sun { module star { module test {
118    interface X {};
119service S: com::sun::star::test::X {
120    c1([in] long a, [in] com::sun::star::test::X b);
121    c2([in] long c, [in] X d);
122};
123}; }; }; };
124
125
126EXPECT FAILURE "constructor.tests 16":
127module com { module sun { module star { module test {
128    interface X {};
129}; }; }; };
130typedef long T;
131service S: com::sun::star::test::X {
132    c1([in] sequence<long> a);
133    c2([in] sequence<T> b);
134};
135
136
137EXPECT FAILURE "constructor.tests 17":
138module com { module sun { module star { module test {
139    interface X {};
140}; }; }; };
141service S: com::sun::star::test::X {
142    c1([in] any... a);
143    c2([in] any... b);
144};
145
146
147EXPECT SUCCESS "constructor.tests 18":
148module com { module sun { module star { module test {
149    interface X {};
150}; }; }; };
151service S: com::sun::star::test::X {
152    c1([in] any... a);
153    c2([in] sequence<any> b);
154};
155
156
157EXPECT SUCCESS "constructor.tests 19":
158module com { module sun { module star { module test {
159    interface X { void m(); };
160}; }; }; };
161service S: com::sun::star::test::X {
162    c([in] any... a);
163};
164
165
166EXPECT SUCCESS "constructor.tests 20":
167module com { module sun { module star { module uno {
168    interface XInterface { void m(); };
169}; }; }; };
170service S: com::sun::star::uno::XInterface {
171    c1([in] long a, [in] long b);
172    c2([in] long a);
173};
174
175
176EXPECT SUCCESS "constructor.tests 21":
177module com { module sun { module star { module uno {
178    interface XInterface { void m(); };
179}; }; }; };
180service S: com::sun::star::uno::XInterface {
181    c1([in] long a);
182    c2([in] long a, [in] long b);
183};
184
185
186EXPECT SUCCESS "constructor.tests 22":
187module com { module sun { module star { module uno {
188    interface XInterface { void m(); };
189}; }; }; };
190service S: com::sun::star::uno::XInterface {
191    c1([in] long a, [in] short b);
192    c2([in] long a, [in] long b);
193};
194