xref: /trunk/main/idlc/test/parser/attribute.tests (revision 57f04c0e)
1*57f04c0eSAndrew Rist#**************************************************************
2*57f04c0eSAndrew Rist#
3*57f04c0eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
4*57f04c0eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
5*57f04c0eSAndrew Rist#  distributed with this work for additional information
6*57f04c0eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
7*57f04c0eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
8*57f04c0eSAndrew Rist#  "License"); you may not use this file except in compliance
9*57f04c0eSAndrew Rist#  with the License.  You may obtain a copy of the License at
10*57f04c0eSAndrew Rist#
11*57f04c0eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
12*57f04c0eSAndrew Rist#
13*57f04c0eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
14*57f04c0eSAndrew Rist#  software distributed under the License is distributed on an
15*57f04c0eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*57f04c0eSAndrew Rist#  KIND, either express or implied.  See the License for the
17*57f04c0eSAndrew Rist#  specific language governing permissions and limitations
18*57f04c0eSAndrew Rist#  under the License.
19*57f04c0eSAndrew Rist#
20*57f04c0eSAndrew Rist#**************************************************************
21cdf0e10cSrcweir
22cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 1":
23cdf0e10cSrcweirinterface I1 {
24cdf0e10cSrcweir    [attribute] long a;
25cdf0e10cSrcweir};
26cdf0e10cSrcweir
27cdf0e10cSrcweir
28cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 2":
29cdf0e10cSrcweirinterface I1 {
30cdf0e10cSrcweir    [attribute] long a {};
31cdf0e10cSrcweir};
32cdf0e10cSrcweir
33cdf0e10cSrcweir
34cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 3":
35cdf0e10cSrcweirinterface I1 {
36cdf0e10cSrcweir    [attribute] long a {
37cdf0e10cSrcweir        get raises ();
38cdf0e10cSrcweir    };
39cdf0e10cSrcweir};
40cdf0e10cSrcweir
41cdf0e10cSrcweir
42cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 4":
43cdf0e10cSrcweirexception E1 {};
44cdf0e10cSrcweirinterface I1 {
45cdf0e10cSrcweir    [attribute] long a {
46cdf0e10cSrcweir        get raises (E1);
47cdf0e10cSrcweir    };
48cdf0e10cSrcweir};
49cdf0e10cSrcweir
50cdf0e10cSrcweir
51cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 5":
52cdf0e10cSrcweirexception E1 {};
53cdf0e10cSrcweirinterface I1 {
54cdf0e10cSrcweir    [attribute] long a {
55cdf0e10cSrcweir        set raises (E1);
56cdf0e10cSrcweir    };
57cdf0e10cSrcweir};
58cdf0e10cSrcweir
59cdf0e10cSrcweir
60cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 6":
61cdf0e10cSrcweirexception E1 {};
62cdf0e10cSrcweirinterface I1 {
63cdf0e10cSrcweir    [attribute] long a {
64cdf0e10cSrcweir        get raises (E1);
65cdf0e10cSrcweir        set raises (E1);
66cdf0e10cSrcweir    };
67cdf0e10cSrcweir};
68cdf0e10cSrcweir
69cdf0e10cSrcweir
70cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 7":
71cdf0e10cSrcweirexception E1 {};
72cdf0e10cSrcweirinterface I1 {
73cdf0e10cSrcweir    [attribute] long a {
74cdf0e10cSrcweir        set raises (E1);
75cdf0e10cSrcweir        get raises (E1);
76cdf0e10cSrcweir    };
77cdf0e10cSrcweir};
78cdf0e10cSrcweir
79cdf0e10cSrcweir
80cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 8":
81cdf0e10cSrcweirexception E1 {};
82cdf0e10cSrcweirinterface I1 {
83cdf0e10cSrcweir    [attribute] long a {
84cdf0e10cSrcweir        get raises (E1);
85cdf0e10cSrcweir        get raises (E1);
86cdf0e10cSrcweir    };
87cdf0e10cSrcweir};
88cdf0e10cSrcweir
89cdf0e10cSrcweir
90cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 9":
91cdf0e10cSrcweirexception E1 {};
92cdf0e10cSrcweirinterface I1 {
93cdf0e10cSrcweir    void E1();
94cdf0e10cSrcweir    [attribute] long a {
95cdf0e10cSrcweir        get raises (E1);
96cdf0e10cSrcweir    };
97cdf0e10cSrcweir};
98cdf0e10cSrcweir
99cdf0e10cSrcweir
100cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 10":
101cdf0e10cSrcweirexception E1 {};
102cdf0e10cSrcweirinterface I1 {
103cdf0e10cSrcweir    [attribute] long E1 {
104cdf0e10cSrcweir        get raises (E1);
105cdf0e10cSrcweir    };
106cdf0e10cSrcweir};
107cdf0e10cSrcweir
108cdf0e10cSrcweir
109cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 11":
110cdf0e10cSrcweirexception E1 {};
111cdf0e10cSrcweirinterface I1 {
112cdf0e10cSrcweir    [attribute] long a {
113cdf0e10cSrcweir        get raises (E1,E1);
114cdf0e10cSrcweir    };
115cdf0e10cSrcweir};
116cdf0e10cSrcweir
117cdf0e10cSrcweir
118cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 12":
119cdf0e10cSrcweirexception E1 {};
120cdf0e10cSrcweirinterface I1 {
121cdf0e10cSrcweir    [attribute, readonly] long a {
122cdf0e10cSrcweir        get raises (E1);
123cdf0e10cSrcweir    };
124cdf0e10cSrcweir};
125cdf0e10cSrcweir
126cdf0e10cSrcweir
127cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 13":
128cdf0e10cSrcweirexception E1 {};
129cdf0e10cSrcweirinterface I1 {
130cdf0e10cSrcweir    [attribute, readonly] long a {
131cdf0e10cSrcweir        set raises (E1);
132cdf0e10cSrcweir    };
133cdf0e10cSrcweir};
134cdf0e10cSrcweir
135cdf0e10cSrcweir
136cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 14":
137cdf0e10cSrcweirinterface I1 {
138cdf0e10cSrcweir    [] long a;
139cdf0e10cSrcweir};
140cdf0e10cSrcweir
141cdf0e10cSrcweir
142cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 15":
143cdf0e10cSrcweirinterface I1 {
144cdf0e10cSrcweir    [attribute] long a;
145cdf0e10cSrcweir};
146cdf0e10cSrcweir
147cdf0e10cSrcweir
148cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 16":
149cdf0e10cSrcweirinterface I1 {
150cdf0e10cSrcweir    [attribute, property] long a;
151cdf0e10cSrcweir};
152cdf0e10cSrcweir
153cdf0e10cSrcweir
154cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 17":
155cdf0e10cSrcweirinterface I1 {
156cdf0e10cSrcweir    [attribute, optional] long a;
157cdf0e10cSrcweir};
158cdf0e10cSrcweir
159cdf0e10cSrcweir
160cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 18":
161cdf0e10cSrcweirinterface I1 {
162cdf0e10cSrcweir    [attribute, maybevoid] long a;
163cdf0e10cSrcweir};
164cdf0e10cSrcweir
165cdf0e10cSrcweir
166cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 19":
167cdf0e10cSrcweirinterface I1 {
168cdf0e10cSrcweir    [attribute, constrained] long a;
169cdf0e10cSrcweir};
170cdf0e10cSrcweir
171cdf0e10cSrcweir
172cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 20":
173cdf0e10cSrcweirinterface I1 {
174cdf0e10cSrcweir    [attribute, transient] long a;
175cdf0e10cSrcweir};
176cdf0e10cSrcweir
177cdf0e10cSrcweir
178cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 21":
179cdf0e10cSrcweirinterface I1 {
180cdf0e10cSrcweir    [attribute, maybeambigious] long a;
181cdf0e10cSrcweir};
182cdf0e10cSrcweir
183cdf0e10cSrcweir
184cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 22":
185cdf0e10cSrcweirinterface I1 {
186cdf0e10cSrcweir    [attribute, maybedefault] long a;
187cdf0e10cSrcweir};
188cdf0e10cSrcweir
189cdf0e10cSrcweir
190cdf0e10cSrcweirEXPECT FAILURE "attribute.tests 23":
191cdf0e10cSrcweirinterface I1 {
192cdf0e10cSrcweir    [attribute, removeable] long a;
193cdf0e10cSrcweir};
194cdf0e10cSrcweir
195cdf0e10cSrcweir
196cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 24":
197cdf0e10cSrcweirinterface I1 {
198cdf0e10cSrcweir    [attribute, bound] long a;
199cdf0e10cSrcweir};
200cdf0e10cSrcweir
201cdf0e10cSrcweir
202cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 25":
203cdf0e10cSrcweirinterface I1 {
204cdf0e10cSrcweir    [bound, attribute] long a;
205cdf0e10cSrcweir};
206cdf0e10cSrcweir
207cdf0e10cSrcweir
208cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 26":
209cdf0e10cSrcweirinterface I1 {
210cdf0e10cSrcweir    [attribute, readonly] long a;
211cdf0e10cSrcweir};
212cdf0e10cSrcweir
213cdf0e10cSrcweir
214cdf0e10cSrcweirEXPECT SUCCESS "attribute.tests 27":
215cdf0e10cSrcweirinterface I1 {
216cdf0e10cSrcweir    [attribute, bound, readonly] long a;
217cdf0e10cSrcweir};
218