-- (C) Copyright 2000, by John Halleck, All Rights Reserved. -- Test the Braille.Printers package. with Ada.Text_IO; use Ada.Text_IO; with Ada.Command_Line; use Ada.Command_Line; with Braille; use Braille; with Braille.ASCII; use Braille.ASCII; procedure Braille_ASCII_TEST is Test_Status : Exit_Status := Success; Overall_Status : Exit_Status := Success; Maps_To : Character; Final : Cell; begin Put_Line ("Braille.ASCII tests starting ..."); Put (" Table Self Consistancy test ..."); Test_Status := Success; for Given in Cell'Range loop Maps_To := Braille_ASCII_From_Cell (Given); Final := Cell_From_Braille_ASCII (Maps_To); if Given /= Final then if Test_Status = Success then Put_Line (" *** FAILED ***"); Test_Status := Failure; Overall_Status := Failure; end if; Put (" Processed "); Put (Cell'Image (Given)); New_Line; Put (" Expected: "); Put (Maps_To); New_Line; Put (" Got: "); Put (Cell'Image (Final)); New_Line; end if; end loop; if Test_Status = Success then Put_Line (" Passed!"); end if; Put ("Braille.ASCII tests complete: "); if Overall_Status = Failure then Put ("****** FAILED ******"); else Put ("--- Passed! ---"); end if; New_Line; Set_Exit_Status (Overall_Status); end Braille_ASCII_TEST;