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