Natools

Check-in [b2360c3935]
Login
Overview
Comment:smaz_tests: remove unneeded exception caused by byte-4096 hash function
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b2360c39354425824b45db9d2e35e28a566206d4
User & Date: nat on 2017-02-08 22:23:46
Other Links: manifest | tags
Context
2017-02-09
22:57
smat_tests: add 256 digraphs to the base-4096 dictionaries check-in: 26569a2ae1 user: nat tags: trunk
2017-02-08
22:23
smaz_tests: remove unneeded exception caused by byte-4096 hash function check-in: b2360c3935 user: nat tags: trunk
2017-02-07
20:48
smaz_tests: remove 1-byte entries from 4096 dictionaries check-in: 61cc0370b5 user: nat tags: trunk
Changes

Modified tests/natools-smaz_tests.adb from [30d6233919] to [b4a1d57d65].

237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
               elsif U in 'a' .. 'z' and then V in 'A' .. 'Z' then
                  return 1776 + Rank (U) * 26 + Rank (V);
               elsif U in 'A' .. 'Z' and then V in 'a' .. 'z' then
                  return 2452 + Rank (U) * 26 + Rank (V);
               elsif U in 'A' .. 'Z' and then V in 'A' .. 'Z' then
                  return 3128 + Rank (U) * 26 + Rank (V);
               else
                  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 100 + Rank (U) * 100 + Rank (V) * 10 + Rank (W);
               else
                  return 4096;
               end if;
            end;
         when others =>
            return 4096;
      end case;
   end Dictionary_4096_Hash;


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







|















|



|







237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
               elsif U in 'a' .. 'z' and then V in 'A' .. 'Z' then
                  return 1776 + Rank (U) * 26 + Rank (V);
               elsif U in 'A' .. 'Z' and then V in 'a' .. 'z' then
                  return 2452 + Rank (U) * 26 + Rank (V);
               elsif U in 'A' .. 'Z' and then V in 'A' .. 'Z' then
                  return 3128 + Rank (U) * 26 + Rank (V);
               else
                  return 4095;
               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 100 + Rank (U) * 100 + Rank (V) * 10 + Rank (W);
               else
                  return 4095;
               end if;
            end;
         when others =>
            return 4095;
      end case;
   end Dictionary_4096_Hash;


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