Natools

Check-in [bc33d2a603]
Login
Overview
Comment:smaz_tests: add dictionary validity tests
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bc33d2a60300f9a9f3f39b8c4ac4c368e837b1b6
User & Date: nat on 2016-12-25 21:39:49
Other Links: manifest | tags
Context
2016-12-26
20:00
smaz_tests: add tests to fully cover non-variable-verbatim code check-in: c0e42e8031 user: nat tags: trunk
2016-12-25
21:39
smaz_tests: add dictionary validity tests check-in: bc33d2a603 user: nat tags: trunk
2016-12-24
15:51
smaz_tests: output base-64 stream directly, for more legibility check-in: 80ce774782 user: nat tags: trunk
Changes

Modified tests/natools-smaz_tests.adb from [38d86e40d3] to [627384dccb].

191
192
193
194
195
196
197

198
199
200
201
202
203

204
205
206
207
208
209
210
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212







+






+








   ------------------------------
   -- Test Suite for Each Base --
   ------------------------------

   procedure All_Tests_256 (Report : in out NT.Reporter'Class) is
   begin
      Test_Validity_256 (Report);
      Sample_Strings_256 (Report);
   end All_Tests_256;


   procedure All_Tests_64 (Report : in out NT.Reporter'Class) is
   begin
      Test_Validity_64 (Report);
      Sample_Strings_64 (Report);
   end All_Tests_64;



   -------------------------------
   -- Individual Base-256 Tests --
249
250
251
252
253
254
255











256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271











272
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296







+
+
+
+
+
+
+
+
+
+
+
















+
+
+
+
+
+
+
+
+
+
+

         ": : : :",
         (255, 6, 58, 32, 58, 32, 58, 32, 58));
   exception
      when Error : others => Test.Report_Exception (Error);
   end Sample_Strings_256;


   procedure Test_Validity_256 (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Test dictionary validity");
   begin
      if not Natools.Smaz_256.Is_Valid (Smaz_Original.Dictionary) then
         Test.Fail;
      end if;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Test_Validity_256;



   ------------------------------
   -- Individual Base-64 Tests --
   ------------------------------

   procedure Sample_Strings_64 (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Roundtrip on sample strings");
   begin
      Roundtrip_Test (Test, Dict_64,
         "Simple Test",
         To_SEA ("+TBGSVYA+UBQE"));
         --       <S>imp* <T>*t
   exception
      when Error : others => Test.Report_Exception (Error);
   end Sample_Strings_64;


   procedure Test_Validity_64 (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Test dictionary validity");
   begin
      if not Natools.Smaz_64.Is_Valid (Dict_64) then
         Test.Fail;
      end if;
   exception
      when Error : others => Test.Report_Exception (Error);
   end Test_Validity_64;

end Natools.Smaz_Tests;

Modified tests/natools-smaz_tests.ads from [440361cf9b] to [2879f6cc4e].

22
23
24
25
26
27
28

29
30

31
32
22
23
24
25
26
27
28
29
30
31
32
33
34







+


+



   procedure All_Tests (Report : in out NT.Reporter'Class);

   procedure All_Tests_256 (Report : in out NT.Reporter'Class);
   procedure All_Tests_64 (Report : in out NT.Reporter'Class);

   procedure Sample_Strings_256 (Report : in out NT.Reporter'Class);
   procedure Test_Validity_256 (Report : in out NT.Reporter'Class);

   procedure Sample_Strings_64 (Report : in out NT.Reporter'Class);
   procedure Test_Validity_64 (Report : in out NT.Reporter'Class);

end Natools.Smaz_Tests;