Natools

Diff
Login

Differences From Artifact [325d236ad6]:

To Artifact [aba30e7eed]:


441
442
443
444
445
446
447
448

449
450
451
452
453
454
455
441
442
443
444
445
446
447

448
449
450
451
452
453
454
455







-
+







   ------------------------------
   -- 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);
      Sample_Strings_VLV_256 (Report);
   end All_Tests_256;


   procedure All_Tests_4096 (Report : in out NT.Reporter'Class) is
   begin
      declare
         Dict : constant Smaz_4096.Dictionary := Dictionary_4096 (False);
480
481
482
483
484
485
486
487
488



489
490
491
492
493
494
495
480
481
482
483
484
485
486


487
488
489
490
491
492
493
494
495
496







-
-
+
+
+










   -------------------------------
   -- Individual Base-256 Tests --
   -------------------------------

   procedure Sample_Strings_256 (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item ("Roundtrip on sample strings");
   procedure Sample_Strings_VLV_256 (Report : in out NT.Reporter'Class) is
      Test : NT.Test := Report.Item
        ("Roundtrip on sample strings with variable-length verbatim");
   begin
      Roundtrip_Test (Test, Smaz_Original.Dictionary,
         "This is a small string",
         (254, 84, 76, 56, 172, 62, 173, 152, 62, 195, 70));
      Roundtrip_Test (Test, Smaz_Original.Dictionary,
         "foobar",
         (220, 6, 90, 79));
520
521
522
523
524
525
526
527

528
529
530
531
532
533
534
521
522
523
524
525
526
527

528
529
530
531
532
533
534
535







-
+







           48, 243, 152, 0, 255, 7, 49, 48, 32, 50, 48, 32, 51,
           48, 161, 45, 60, 33, 166, 0, 231, 71, 151, 3, 3, 87));
      Roundtrip_Test (Test, Smaz_Original.Dictionary,
         ": : : :",
         (255, 6, 58, 32, 58, 32, 58, 32, 58));
   exception
      when Error : others => Test.Report_Exception (Error);
   end Sample_Strings_256;
   end Sample_Strings_VLV_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;