Skip to content

Commit 009c814

Browse files
committed
Test for protected entry family body
1 parent 718e903 commit 009c814

File tree

5 files changed

+162
-28
lines changed

5 files changed

+162
-28
lines changed

testsuite/drivers/test_extractor.adb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ procedure Test_Extractor is
141141
| Ada_Concrete_Type_Decl
142142
| Ada_Exception_Decl
143143
| Ada_Entry_Decl
144+
| Ada_Entry_Body
144145
=>
145146
Extract_And_Dump;
146147

testsuite/extractor/protecteds.adb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,29 @@ package body Protecteds is
5353

5454
end P_Private_Components_Subprograms;
5555

56+
protected body P_Entry_Family is
57+
-- Protected object body with entry family.
58+
59+
entry E1 (for V in Positive range 1 .. 10) (X : Float) when True is
60+
-- Entry family body
61+
-- @param V Description of the entry family index
62+
-- @param X Description of the parameter
63+
begin
64+
null;
65+
end E1;
66+
67+
entry E2
68+
(for V in Positive range 1 .. 10) -- Index of the entry family
69+
(X : Float) -- Parameter of the entry family
70+
-- Entry family body
71+
-- @param V Description of the entry family index
72+
-- @param X Description of the parameter
73+
with SPARK_Mode => Off
74+
when True is
75+
begin
76+
null;
77+
end E2;
78+
79+
end P_Entry_Family;
80+
5681
end Protecteds;

testsuite/extractor/protecteds.adb.out

Lines changed: 75 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
<CompilationUnit protecteds.adb:6:1-56:16>
1+
<CompilationUnit protecteds.adb:6:1-81:16>
22
<AdaNodeList protecteds.adb:6:1-6:1>
3-
<LibraryItem protecteds.adb:6:1-56:16>
3+
<LibraryItem protecteds.adb:6:1-81:16>
44
<PrivateAbsent protecteds.adb:6:1-6:1>
5-
<PackageBody ["Protecteds"] protecteds.adb:6:1-56:16>
5+
<PackageBody ["Protecteds"] protecteds.adb:6:1-81:16>
66
<DefiningName protecteds.adb:6:14-6:24>
77
<Id "Protecteds" protecteds.adb:6:14-6:24>
8-
<DeclarativePart protecteds.adb:6:27-56:1>
9-
<AdaNodeList protecteds.adb:15:4-54:41>
8+
<DeclarativePart protecteds.adb:6:27-81:1>
9+
<AdaNodeList protecteds.adb:15:4-79:23>
1010
<ProtectedBody ["P_Leading"] protecteds.adb:15:4-16:18>
1111
**************************
1212
\/ RAW <<LEADING>> () 0 0 0 0
@@ -137,20 +137,75 @@ function F return Integer
137137
Description of the function F body
138138
**************************
139139
<EntryBody ["E"] protecteds.adb:48:7-52:13>
140-
<DefiningName protecteds.adb:48:13-48:14>
141-
<Id "E" protecteds.adb:48:13-48:14>
142-
<EntryCompletionFormalParams protecteds.adb:48:14-48:14>
143-
<Id "False" protecteds.adb:48:20-48:25>
144-
<DeclarativePart protecteds.adb:48:28-50:7>
145-
<AdaNodeList protecteds.adb:48:28-48:28>
146-
<HandledStmts protecteds.adb:50:12-52:7>
147-
<StmtList protecteds.adb:51:10-51:15>
148-
<NullStmt protecteds.adb:51:10-51:15>
149-
<AdaNodeList protecteds.adb:51:14-51:14>
150-
<EndName protecteds.adb:52:11-52:12>
151-
<Id "E" protecteds.adb:52:11-52:12>
140+
**************************
141+
\/ RAW <<INTERMEDIATE UPPER>> () 49 47 0 0
142+
\/ RAW <<INTERMEDIATE LOWER>> () 49 52 0 0
143+
Description of the entry E body
144+
\/ RAW <<LEADING>> () 0 0 0 0
145+
\/ RAW <<TRAILING>> () 0 0 0 0
146+
\/ SNIPPET ada () 0 0 0 0
147+
entry E
148+
\/ DESCRIPTION () 0 0 0 0
149+
Description of the entry E body
150+
**************************
152151
<EndName protecteds.adb:54:8-54:40>
153152
<Id "P_Private_Components_Subprograms" protecteds.adb:54:8-54:40>
154-
<EndName protecteds.adb:56:5-56:15>
155-
<Id "Protecteds" protecteds.adb:56:5-56:15>
156-
<PragmaNodeList protecteds.adb:56:16-56:16>
153+
<ProtectedBody ["P_Entry_Family"] protecteds.adb:56:4-79:23>
154+
**************************
155+
\/ RAW <<LEADING>> () 0 0 0 0
156+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
157+
Protected object body with entry family.
158+
\/ DESCRIPTION () 0 0 0 0
159+
Protected object body with entry family.
160+
**************************
161+
<DefiningName protecteds.adb:56:19-56:33>
162+
<Id "P_Entry_Family" protecteds.adb:56:19-56:33>
163+
<DeclarativePart protecteds.adb:56:36-79:4>
164+
<AdaNodeList protecteds.adb:59:7-77:14>
165+
<EntryBody ["E1"] protecteds.adb:59:7-65:14>
166+
**************************
167+
\/ RAW <<INTERMEDIATE UPPER>> () 60 58 0 0
168+
\/ RAW <<INTERMEDIATE LOWER>> () 60 65 0 0
169+
Entry family body
170+
@param V Description of the entry family index
171+
@param X Description of the parameter
172+
\/ PARAMETER v (V) 59 59 60 58
173+
Description of the entry family index
174+
\/ PARAMETER x (X) 59 59 0 0
175+
Description of the parameter
176+
\/ RAW <<LEADING>> () 0 0 0 0
177+
\/ RAW <<TRAILING>> () 0 0 0 0
178+
\/ SNIPPET ada () 0 0 0 0
179+
entry E1 (for V in Positive range 1 .. 10) (X : Float)
180+
\/ DESCRIPTION () 0 0 0 0
181+
Entry family body
182+
**************************
183+
<EntryBody ["E2"] protecteds.adb:67:7-77:14>
184+
**************************
185+
\/ RAW <<INTERMEDIATE UPPER>> () 70 72 0 0
186+
Entry family body
187+
@param V Description of the entry family index
188+
@param X Description of the parameter
189+
\/ RAW <<INTERMEDIATE LOWER>> () 75 77 0 0
190+
\/ PARAMETER v (V) 68 68 69 68
191+
Index of the entry family
192+
193+
Description of the entry family index
194+
\/ PARAMETER x (X) 69 69 0 0
195+
Parameter of the entry family
196+
197+
Description of the parameter
198+
\/ RAW <<LEADING>> () 0 0 0 0
199+
\/ RAW <<TRAILING>> () 0 0 0 0
200+
\/ SNIPPET ada () 0 0 0 0
201+
entry E2
202+
(for V in Positive range 1 .. 10)
203+
(X : Float)
204+
\/ DESCRIPTION () 0 0 0 0
205+
Entry family body
206+
**************************
207+
<EndName protecteds.adb:79:8-79:22>
208+
<Id "P_Entry_Family" protecteds.adb:79:8-79:22>
209+
<EndName protecteds.adb:81:5-81:15>
210+
<Id "Protecteds" protecteds.adb:81:5-81:15>
211+
<PragmaNodeList protecteds.adb:81:16-81:16>

testsuite/extractor/protecteds.ads

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,15 @@ package Protecteds is
7474

7575
end P_Private_Components_Subprograms;
7676

77+
protected P_Entry_Family is
78+
-- Protected object with entry family.
79+
80+
entry E1 (Positive range 1 .. 10) (X : Float);
81+
-- First entry family.
82+
83+
entry E2 (Positive range 1 .. 10) (X : Float)
84+
with SPARK_Mode => Off;
85+
-- Second entry family.
86+
end P_Entry_Family;
87+
7788
end Protecteds;

testsuite/extractor/protecteds.ads.out

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<CompilationUnit protecteds.ads:6:1-77:16>
1+
<CompilationUnit protecteds.ads:6:1-88:16>
22
<AdaNodeList protecteds.ads:6:1-6:1>
3-
<LibraryItem protecteds.ads:6:1-77:16>
3+
<LibraryItem protecteds.ads:6:1-88:16>
44
<PrivateAbsent protecteds.ads:6:1-6:1>
5-
<PackageDecl ["Protecteds"] protecteds.ads:6:1-77:16>
5+
<PackageDecl ["Protecteds"] protecteds.ads:6:1-88:16>
66
**************************
77
\/ RAW <<LEADING>> () 0 0 0 0
88
This package contains test cases of documentation extraction for protected
@@ -16,8 +16,8 @@ cases only (this code is tested by subprograms tests).
1616
**************************
1717
<DefiningName protecteds.ads:6:9-6:19>
1818
<Id "Protecteds" protecteds.ads:6:9-6:19>
19-
<PublicPart protecteds.ads:6:22-77:1>
20-
<AdaNodeList protecteds.ads:8:4-75:41>
19+
<PublicPart protecteds.ads:6:22-88:1>
20+
<AdaNodeList protecteds.ads:8:4-86:23>
2121
<ConcreteTypeDecl ["IE"] protecteds.ads:8:4-8:38>
2222
**************************
2323
\/ RAW <<LEADING>> () 0 0 0 0
@@ -303,6 +303,48 @@ Description of the entry E
303303
**************************
304304
<EndName protecteds.ads:75:8-75:40>
305305
<Id "P_Private_Components_Subprograms" protecteds.ads:75:8-75:40>
306-
<EndName protecteds.ads:77:5-77:15>
307-
<Id "Protecteds" protecteds.ads:77:5-77:15>
308-
<PragmaNodeList protecteds.ads:77:16-77:16>
306+
<SingleProtectedDecl ["P_Entry_Family"] protecteds.ads:77:4-86:23>
307+
**************************
308+
\/ RAW <<LEADING>> () 0 0 0 0
309+
\/ RAW <<INTERMEDIATE UPPER>> () 0 0 0 0
310+
Protected object with entry family.
311+
\/ DESCRIPTION () 0 0 0 0
312+
Protected object with entry family.
313+
**************************
314+
<DefiningName protecteds.ads:77:14-77:28>
315+
<Id "P_Entry_Family" protecteds.ads:77:14-77:28>
316+
<ParentList protecteds.ads:77:28-77:28>
317+
<ProtectedDef protecteds.ads:80:7-86:22>
318+
<PublicPart protecteds.ads:77:31-86:4>
319+
<DeclList protecteds.ads:80:7-84:32>
320+
<EntryDecl ["E1"] protecteds.ads:80:7-80:53>
321+
**************************
322+
\/ RAW <<INTERMEDIATE UPPER>> () 81 0 0 0
323+
\/ RAW <<INTERMEDIATE LOWER>> () 0 0 0 0
324+
\/ PARAMETER x (X) 80 80 0 0
325+
\/ RAW <<LEADING>> () 0 0 0 0
326+
\/ RAW <<TRAILING>> () 0 0 0 0
327+
First entry family.
328+
\/ SNIPPET ada () 0 0 0 0
329+
entry E1 (Positive range 1 .. 10) (X : Float)
330+
\/ DESCRIPTION () 0 0 0 0
331+
First entry family.
332+
**************************
333+
<EntryDecl ["E2"] protecteds.ads:83:7-84:32>
334+
**************************
335+
\/ RAW <<INTERMEDIATE UPPER>> () 84 0 0 0
336+
\/ RAW <<INTERMEDIATE LOWER>> () 0 0 0 0
337+
\/ PARAMETER x (X) 83 83 0 0
338+
\/ RAW <<LEADING>> () 0 0 0 0
339+
\/ RAW <<TRAILING>> () 0 0 0 0
340+
Second entry family.
341+
\/ SNIPPET ada () 0 0 0 0
342+
entry E2 (Positive range 1 .. 10) (X : Float)
343+
\/ DESCRIPTION () 0 0 0 0
344+
Second entry family.
345+
**************************
346+
<EndName protecteds.ads:86:8-86:22>
347+
<Id "P_Entry_Family" protecteds.ads:86:8-86:22>
348+
<EndName protecteds.ads:88:5-88:15>
349+
<Id "Protecteds" protecteds.ads:88:5-88:15>
350+
<PragmaNodeList protecteds.ads:88:16-88:16>

0 commit comments

Comments
 (0)