xref: /aoo41x/main/idlc/test/parser/constructor.tests (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28EXPECT SUCCESS "constructor.tests 1":
29interface X {};
30service S: X;
31
32
33EXPECT SUCCESS "constructor.tests 2":
34interface X {};
35service S: X {};
36
37
38EXPECT SUCCESS "constructor.tests 3":
39interface X {};
40service S: X {
41    f();
42};
43
44
45EXPECT FAILURE "constructor.tests 4":
46interface X {};
47service S: X {
48    f();
49    f();
50};
51
52
53EXPECT FAILURE "constructor.tests 5":
54interface X {
55    void f([in] any... p);
56};
57
58
59EXPECT FAILURE "constructor.tests 6":
60interface X {
61    void f([out] any... p);
62};
63
64
65EXPECT SUCCESS "constructor.tests 7":
66interface X {};
67service S: X {
68    f([in] any... p);
69};
70
71
72EXPECT SUCCESS "constructor.tests 8":
73interface X {};
74typedef any some;
75service S: X {
76    f([in] some... p);
77};
78
79
80EXPECT FAILURE "constructor.tests 9":
81interface X {};
82service S: X {
83    f([in] long p1, [in] any... p2);
84};
85
86
87EXPECT FAILURE "constructor.tests 10":
88interface X {};
89service S: X {
90    f([in] any... p2, [in] long p1);
91};
92
93
94EXPECT FAILURE "constructor.tests 11":
95interface X {};
96service S: X {
97    f([in] long p1, [in] long... p2);
98};
99
100
101EXPECT FAILURE "constructor.tests 12":
102interface X {};
103service S: X {
104    f([out] long p);
105};
106
107
108EXPECT FAILURE "constructor.tests 13":
109interface X {};
110service S: X {
111    f([out] any... p);
112};
113
114
115EXPECT FAILURE "constructor.tests 14":
116interface X {};
117singleton S: X {
118    f();
119};
120
121
122EXPECT FAILURE "constructor.tests 15":
123module com { module sun { module star { module test {
124    interface X {};
125service S: com::sun::star::test::X {
126    c1([in] long a, [in] com::sun::star::test::X b);
127    c2([in] long c, [in] X d);
128};
129}; }; }; };
130
131
132EXPECT FAILURE "constructor.tests 16":
133module com { module sun { module star { module test {
134    interface X {};
135}; }; }; };
136typedef long T;
137service S: com::sun::star::test::X {
138    c1([in] sequence<long> a);
139    c2([in] sequence<T> b);
140};
141
142
143EXPECT FAILURE "constructor.tests 17":
144module com { module sun { module star { module test {
145    interface X {};
146}; }; }; };
147service S: com::sun::star::test::X {
148    c1([in] any... a);
149    c2([in] any... b);
150};
151
152
153EXPECT SUCCESS "constructor.tests 18":
154module com { module sun { module star { module test {
155    interface X {};
156}; }; }; };
157service S: com::sun::star::test::X {
158    c1([in] any... a);
159    c2([in] sequence<any> b);
160};
161
162
163EXPECT SUCCESS "constructor.tests 19":
164module com { module sun { module star { module test {
165    interface X { void m(); };
166}; }; }; };
167service S: com::sun::star::test::X {
168    c([in] any... a);
169};
170
171
172EXPECT SUCCESS "constructor.tests 20":
173module com { module sun { module star { module uno {
174    interface XInterface { void m(); };
175}; }; }; };
176service S: com::sun::star::uno::XInterface {
177    c1([in] long a, [in] long b);
178    c2([in] long a);
179};
180
181
182EXPECT SUCCESS "constructor.tests 21":
183module com { module sun { module star { module uno {
184    interface XInterface { void m(); };
185}; }; }; };
186service S: com::sun::star::uno::XInterface {
187    c1([in] long a);
188    c2([in] long a, [in] long b);
189};
190
191
192EXPECT SUCCESS "constructor.tests 22":
193module com { module sun { module star { module uno {
194    interface XInterface { void m(); };
195}; }; }; };
196service S: com::sun::star::uno::XInterface {
197    c1([in] long a, [in] short b);
198    c2([in] long a, [in] long b);
199};
200