Skip to content

Commit 0d4caec

Browse files
committed
tests: Do not make Parser objects a constant
Found by modern version of GNAT FSF. Signed-off-by: onox <[email protected]>
1 parent 41d58a6 commit 0d4caec

File tree

2 files changed

+50
-50
lines changed

2 files changed

+50
-50
lines changed

tests/src/test_images.adb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ package body Test_Images is
7575
procedure Test_True_Text (Object : in out Test) is
7676
Text : constant String := "true";
7777

78-
Parser : constant Parsers.Parser := Parsers.Create (Text);
78+
Parser : Parsers.Parser := Parsers.Create (Text);
7979
Value : constant JSON_Value := Parser.Parse;
8080
Image : constant String := Value.Image;
8181
begin
@@ -85,7 +85,7 @@ package body Test_Images is
8585
procedure Test_False_Text (Object : in out Test) is
8686
Text : constant String := "false";
8787

88-
Parser : constant Parsers.Parser := Parsers.Create (Text);
88+
Parser : Parsers.Parser := Parsers.Create (Text);
8989
Value : constant JSON_Value := Parser.Parse;
9090
Image : constant String := Value.Image;
9191
begin
@@ -95,7 +95,7 @@ package body Test_Images is
9595
procedure Test_Null_Text (Object : in out Test) is
9696
Text : constant String := "null";
9797

98-
Parser : constant Parsers.Parser := Parsers.Create (Text);
98+
Parser : Parsers.Parser := Parsers.Create (Text);
9999
Value : constant JSON_Value := Parser.Parse;
100100
Image : constant String := Value.Image;
101101
begin
@@ -105,7 +105,7 @@ package body Test_Images is
105105
procedure Test_Escaped_Text (Object : in out Test) is
106106
Text : constant String := """BS:\b LF:\n CR:\r \\ \/ HT:\t""";
107107

108-
Parser : constant Parsers.Parser := Parsers.Create (Text);
108+
Parser : Parsers.Parser := Parsers.Create (Text);
109109
Value : constant JSON_Value := Parser.Parse;
110110
Image : constant String := Value.Image;
111111
begin
@@ -115,7 +115,7 @@ package body Test_Images is
115115
procedure Test_Empty_String_Text (Object : in out Test) is
116116
Text : constant String := """""";
117117

118-
Parser : constant Parsers.Parser := Parsers.Create (Text);
118+
Parser : Parsers.Parser := Parsers.Create (Text);
119119
Value : constant JSON_Value := Parser.Parse;
120120
Image : constant String := Value.Image;
121121
begin
@@ -125,7 +125,7 @@ package body Test_Images is
125125
procedure Test_Non_Empty_String_Text (Object : in out Test) is
126126
Text : constant String := """test""";
127127

128-
Parser : constant Parsers.Parser := Parsers.Create (Text);
128+
Parser : Parsers.Parser := Parsers.Create (Text);
129129
Value : constant JSON_Value := Parser.Parse;
130130
Image : constant String := Value.Image;
131131
begin
@@ -135,7 +135,7 @@ package body Test_Images is
135135
procedure Test_Number_String_Text (Object : in out Test) is
136136
Text : constant String := """12.34""";
137137

138-
Parser : constant Parsers.Parser := Parsers.Create (Text);
138+
Parser : Parsers.Parser := Parsers.Create (Text);
139139
Value : constant JSON_Value := Parser.Parse;
140140
Image : constant String := Value.Image;
141141
begin
@@ -145,7 +145,7 @@ package body Test_Images is
145145
procedure Test_Integer_Number_Text (Object : in out Test) is
146146
Text : constant String := "42";
147147

148-
Parser : constant Parsers.Parser := Parsers.Create (Text);
148+
Parser : Parsers.Parser := Parsers.Create (Text);
149149
Value : constant JSON_Value := Parser.Parse;
150150
Image : constant String := Value.Image;
151151
begin
@@ -155,7 +155,7 @@ package body Test_Images is
155155
procedure Test_Empty_Array_Text (Object : in out Test) is
156156
Text : constant String := "[]";
157157

158-
Parser : constant Parsers.Parser := Parsers.Create (Text);
158+
Parser : Parsers.Parser := Parsers.Create (Text);
159159
Value : constant JSON_Value := Parser.Parse;
160160
Image : constant String := Value.Image;
161161
begin
@@ -165,7 +165,7 @@ package body Test_Images is
165165
procedure Test_One_Element_Array_Text (Object : in out Test) is
166166
Text : constant String := "[""test""]";
167167

168-
Parser : constant Parsers.Parser := Parsers.Create (Text);
168+
Parser : Parsers.Parser := Parsers.Create (Text);
169169
Value : constant JSON_Value := Parser.Parse;
170170
Image : constant String := Value.Image;
171171
begin
@@ -175,7 +175,7 @@ package body Test_Images is
175175
procedure Test_Multiple_Elements_Array_Text (Object : in out Test) is
176176
Text : constant String := "[42,true]";
177177

178-
Parser : constant Parsers.Parser := Parsers.Create (Text);
178+
Parser : Parsers.Parser := Parsers.Create (Text);
179179
Value : constant JSON_Value := Parser.Parse;
180180
Image : constant String := Value.Image;
181181
begin
@@ -185,7 +185,7 @@ package body Test_Images is
185185
procedure Test_Empty_Object_Text (Object : in out Test) is
186186
Text : constant String := "{}";
187187

188-
Parser : constant Parsers.Parser := Parsers.Create (Text);
188+
Parser : Parsers.Parser := Parsers.Create (Text);
189189
Value : constant JSON_Value := Parser.Parse;
190190
Image : constant String := Value.Image;
191191
begin
@@ -195,7 +195,7 @@ package body Test_Images is
195195
procedure Test_One_Member_Object_Text (Object : in out Test) is
196196
Text : constant String := "{""foo"":""bar""}";
197197

198-
Parser : constant Parsers.Parser := Parsers.Create (Text);
198+
Parser : Parsers.Parser := Parsers.Create (Text);
199199
Value : constant JSON_Value := Parser.Parse;
200200
Image : constant String := Value.Image;
201201
begin
@@ -206,7 +206,7 @@ package body Test_Images is
206206
Text : constant String := "{""foo"":1,""bar"":2}";
207207
Text2 : constant String := "{""bar"":2,""foo"":1}";
208208

209-
Parser : constant Parsers.Parser := Parsers.Create (Text);
209+
Parser : Parsers.Parser := Parsers.Create (Text);
210210
Value : constant JSON_Value := Parser.Parse;
211211
Image : constant String := Value.Image;
212212
begin
@@ -217,7 +217,7 @@ package body Test_Images is
217217
procedure Test_Array_Object_Array (Object : in out Test) is
218218
Text : constant String := "[{""foo"":[true,42]}]";
219219

220-
Parser : constant Parsers.Parser := Parsers.Create (Text);
220+
Parser : Parsers.Parser := Parsers.Create (Text);
221221
Value : constant JSON_Value := Parser.Parse;
222222
Image : constant String := Value.Image;
223223
begin
@@ -227,7 +227,7 @@ package body Test_Images is
227227
procedure Test_Object_Array_Object (Object : in out Test) is
228228
Text : constant String := "{""foo"":[null,{""bar"":42}]}";
229229

230-
Parser : constant Parsers.Parser := Parsers.Create (Text);
230+
Parser : Parsers.Parser := Parsers.Create (Text);
231231
Value : constant JSON_Value := Parser.Parse;
232232
Image : constant String := Value.Image;
233233
begin

0 commit comments

Comments
 (0)