126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
Report.Info (Label & ": """ & To_String (Data) & '"');
else
Report.Info ('"' & To_String (Data) & '"');
end if;
else
if Label'Length > 0 then
Report.Info
(Label & ": " & Natural'Image (Data'Length) & " octets");
end if;
while I < Data'Length loop
Length := Offset'Min (16, Data'Length - I);
Report.Info (Hex_Slice
(I, 8,
Data (Data'First + I .. Data'First + I + Length - 1), 16));
I := I + 16;
end loop;
end if;
end Dump_Atom;
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
Report.Info (Label & ": """ & To_String (Data) & '"');
else
Report.Info ('"' & To_String (Data) & '"');
end if;
else
if Label'Length > 0 then
Report.Info
(Label & ":" & Natural'Image (Data'Length) & " octets");
end if;
while I < Data'Length loop
Length := Offset'Min (16, Data'Length - I);
Report.Info (Hex_Slice
(I, 8,
Data (Data'First + I .. Data'First + I + Length - 1), 16));
I := I + 16;
end loop;
end if;
end Dump_Atom;
procedure Dump_Atom -- Cut and pasted code because generics crash gnat
(Test : in out NT.Test;
Data : in Atom;
Label : in String := "")
is
I, Length : Offset := 0;
begin
if Is_Printable (Data) then
if Label'Length > 0 then
Test.Info (Label & ": """ & To_String (Data) & '"');
else
Test.Info ('"' & To_String (Data) & '"');
end if;
else
if Label'Length > 0 then
Test.Info
(Label & ":" & Natural'Image (Data'Length) & " octets");
end if;
while I < Data'Length loop
Length := Offset'Min (16, Data'Length - I);
Test.Info (Hex_Slice
(I, 8,
Data (Data'First + I .. Data'First + I + Length - 1), 16));
I := I + 16;
end loop;
end if;
end Dump_Atom;
|
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
else
Report.Item (Test_Name, NT.Fail);
Dump_Atom (Report, Found, "Found");
Dump_Atom (Report, Expected, "Expected");
end if;
end Test_Atom;
-------------------
-- Memory Stream --
-------------------
overriding procedure Read
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
else
Report.Item (Test_Name, NT.Fail);
Dump_Atom (Report, Found, "Found");
Dump_Atom (Report, Expected, "Expected");
end if;
end Test_Atom;
procedure Test_Atom
(Test : in out NT.Test;
Expected : in Atom;
Found : in Atom) is
begin
if Found /= Expected then
Test.Fail;
Dump_Atom (Test, Found, "Found");
Dump_Atom (Test, Expected, "Expected");
end if;
end Test_Atom;
-------------------
-- Memory Stream --
-------------------
overriding procedure Read
|