17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
with Ada.Exceptions;
with Ada.Strings.Fixed;
procedure Natools.Chunked_Strings.Tests.Coverage
(Report : in out Natools.Tests.Reporter'Class)
is
package NT renames Natools.Tests;
begin
NT.Section (Report, "Extra tests for complete coverage");
declare
Name : constant String := "Index_Error raised in Element";
C : Character;
begin
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
with Ada.Exceptions;
with Ada.Strings.Fixed;
procedure Natools.Chunked_Strings.Tests.Coverage
(Report : in out Natools.Tests.Reporter'Class)
is
package NT renames Natools.Tests;
procedure Report_Result
(Name : in String;
Reported : in out Boolean;
Result : in NT.Result := NT.Fail);
-- Report Result unless already reported
procedure Report_Result
(Name : in String;
Reported : in out Boolean;
Result : in NT.Result := NT.Fail) is
begin
if not Reported then
NT.Item (Report, Name, Result);
Reported := True;
end if;
end Report_Result;
begin
NT.Section (Report, "Extra tests for complete coverage");
declare
Name : constant String := "Index_Error raised in Element";
C : Character;
begin
|
267
268
269
270
271
272
273
274
275
276
277
278
279
|
NT.Info (Report,
"Final interval:" & Natural'Image (First)
& " .." & Natural'Image (Last));
NT.Info (Report, "Expected: 3 .. 5");
else
NT.Item (Report, Name, NT.Success);
end if;
exception
when Error : others => NT.Report_Exception (Report, Name, Error);
end;
Natools.Tests.End_Section (Report);
end Natools.Chunked_Strings.Tests.Coverage;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
|
NT.Info (Report,
"Final interval:" & Natural'Image (First)
& " .." & Natural'Image (Last));
NT.Info (Report, "Expected: 3 .. 5");
else
NT.Item (Report, Name, NT.Success);
end if;
exception
when Error : others => NT.Report_Exception (Report, Name, Error);
end;
declare
Name : constant String := "Comparisons of Chunked_Strings";
CS_Name : constant Chunked_String := To_Chunked_String (Name);
Prefix : constant Chunked_String := To_Chunked_String ("Comparisons");
Smaller : constant Chunked_String := To_Chunked_String ("Ca");
Reported : Boolean := False;
begin
if CS_Name <= Null_Chunked_String then
Report_Result (Name, Reported);
NT.Info (Report, "CS_Name <= Null_Chunked_String");
end if;
if Null_Chunked_String >= CS_Name then
Report_Result (Name, Reported);
NT.Info (Report, "Null_Chunked_String >= CS_Name");
end if;
if Prefix >= CS_Name then
Report_Result (Name, Reported);
NT.Info (Report, "Prefix >= CS_Name");
end if;
if CS_Name <= Prefix then
Report_Result (Name, Reported);
NT.Info (Report, "CS_Name <= Prefix");
end if;
if Smaller >= CS_Name then
Report_Result (Name, Reported);
NT.Info (Report, "Smaller >= CS_Name");
end if;
if CS_Name <= Smaller then
Report_Result (Name, Reported);
NT.Info (Report, "CS_Name <= Smaller");
end if;
Report_Result (Name, Reported, NT.Success);
exception
when Error : others => NT.Report_Exception (Report, Name, Error);
end;
Natools.Tests.End_Section (Report);
end Natools.Chunked_Strings.Tests.Coverage;
|