Natools

Check-in [ec0159cb57]
Login
Overview
Comment:smaz_tests: check constraint error in hash-to-code conversion
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ec0159cb5790c8f21ac6fe8d25267747b4b6c583
User & Date: nat on 2017-02-24 20:21:28
Other Links: manifest | tags
Context
2017-02-25
20:45
smaz_generic: update semantics of Read_Code to signal end-of-input check-in: b9f0155723 user: nat tags: trunk
2017-02-24
20:21
smaz_tests: check constraint error in hash-to-code conversion check-in: ec0159cb57 user: nat tags: trunk
2017-02-23
22:37
smaz_tests: test base-256 multi-block verbatim sequence check-in: c707170a93 user: nat tags: trunk
Changes

Modified tests/natools-smaz_tests.adb from [2539e4e08e] to [35d69f7dcc].

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
339
340
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
339
340







-
+















-
+



-
+







               elsif U in 'a' .. 'z' and then V in 'A' .. 'Z' then
                  return 2032 + Rank (U) * 26 + Rank (V);
               elsif U in 'A' .. 'Z' and then V in 'a' .. 'z' then
                  return 2708 + Rank (U) * 26 + Rank (V);
               elsif U in 'A' .. 'Z' and then V in 'A' .. 'Z' then
                  return 3384 + Rank (U) * 26 + Rank (V);
               else
                  return 4095;
                  return 4096;
               end if;
            end;

         when 3 =>
            declare
               U : constant Character := S (S'First);
               V : constant Character := S (S'First + 1);
               W : constant Character := S (S'First + 2);
            begin
               if U in '0' .. '9'
                 and then V in '0' .. '9'
                 and then W in '0' .. '9'
               then
                  return 356 + Rank (U) * 100 + Rank (V) * 10 + Rank (W);
               else
                  return 4095;
                  return 4096;
               end if;
            end;
         when others =>
            return 4095;
            return 4096;
      end case;
   end Dictionary_4096_Hash;


   procedure Generic_Roundtrip_Test
     (Test : in out NT.Test;
      Dict : in Smaz.Dictionary;