|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ B T ┃
Length: 11708 (0x2dbc) Types: TextFile Names: »B«
└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00 └─ ⟦0c20f784e⟧ »DATA« └─⟦1abbe589f⟧ └─⟦49e7f20b9⟧ └─⟦this⟧
with Test_Io; with Cvt_Test_Utilities; with Xlbt_Arithmetic; with Xlbt_Basic; with Xlbt_Graphics; with Xlbmt_Network_Types; with Xlbip_Graphic_Converters; procedure Cvt_050 is ------------------------------------------------------------------------------ -- Tests for Xlbip_Graphic_Converters -- -- Xlbip_Graphic_Converters only instantiates the converters actually -- used by the protocol. The tester generics expect to have symmetric -- converters for each type. Individual tests instantiate their own -- dummy To_Raw and From_Raw converters when necessary. ------------------------------------------------------------------------------ -- **************************************************************************** -- * Date - /Name/ Comment -- * -- * 12-OCT-90 - /DRK/ Created. -- * 8-NOV-90 - /DRK/ Track updates to Xlbip_Graphic_Converters. -- **************************************************************************** ------------------------------------------------------------------------------ --------------------------------- -- Handy constants and renames -- --------------------------------- package Utils renames Cvt_Test_Utilities; package Tests renames Utils.Raw_Data_Tests; package Dummy renames Utils.Dummy_Converters; use Utils.Raw_Data_Constants; ---------------------------------------------------------------------- ------------------------- -- Major test sections -- ------------------------- procedure Test_X_Pixel is procedure From_Raw is new Dummy.Convert_To_Discrete (Xlbt_Basic.X_Pixel, Xlbmt_Network_Types.X_Raw_Data_Array); procedure Test is new Tests.Tester (Xlbt_Basic.X_Pixel, "X_Pixel", Xlbip_Graphic_Converters.To_Raw, From_Raw); begin Test_Io.Section ("X_Pixel conversions"); Test ("0", 0, (1 .. 4 => 16#00#)); Test ("1", 1, Swab_00_00_00_01); Test ("-1", Minus_1, (1 .. 4 => Raw_Ff)); Test ("16#8000_0000#", Xlbt_Basic.X_Pixel'First, Swab_80_00_00_00); Test ("16#7FFF_FFFF#", Xlbt_Basic.X_Pixel'Last, Swab_7f_Ff_Ff_Ff); Test ("16#0123_4567#", 16#0123_4567#, Swab_01_23_45_67); Test_Io.New_Line; end Test_X_Pixel; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- procedure Test_X_Arc is procedure From_Raw is new Dummy.Convert_To_Private (Xlbt_Graphics.X_Arc, Xlbmt_Network_Types.X_Raw_Data_Array); procedure Test is new Tests.Tester (Xlbt_Graphics.X_Arc, "X_Arc", Xlbip_Graphic_Converters.To_Raw, From_Raw); begin Test_Io.Section ("X_Arc conversions"); Test ("0", (0, 0, 0, 0, 0, 0), (1 .. 12 => 0)); Test ("-1", (Minus_1, Minus_1, 16#FFFF#, 16#FFFF#, Minus_1, Minus_1), (1 .. 12 => Raw_Ff)); Test ("1.2.3.4.5.6", (1, 2, 3, 4, 5, 6), Swab_00_01 & Swab_00_02 & Swab_00_03 & Swab_00_04 & Swab_00_05 & Swab_00_06); Test_Io.New_Line; end Test_X_Arc; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- procedure Test_X_Arc_Array is procedure From_Raw is new Dummy.Convert_To_Array (Xlbt_Graphics.X_Arc, Xlbt_Arithmetic.S_Natural, Xlbt_Graphics.X_Arc_Array, Xlbmt_Network_Types.X_Raw_Data_Array); procedure Test is new Tests.Tester_1d (Xlbt_Graphics.X_Arc, Xlbt_Arithmetic.S_Natural, Xlbt_Graphics.X_Arc_Array, "X_Arc_Array", Xlbip_Graphic_Converters.To_Raw, From_Raw); begin Test_Io.Section ("X_Arc_Array conversions"); Test ("1..0 => 0", (1 .. 0 => (0, 0, 0, 0, 0, 0)), (1 .. 0 => 0)); Test ("2..2 => -1", (2 => (Minus_1, Minus_1, 16#FFFF#, 16#FFFF#, Minus_1, Minus_1)), (1 .. 12 => Raw_Ff)); Test ("0..0 => 1", (0 => (0, 0, 0, 0, 0, 1)), (1 .. 10 => 0) & Swab_00_01); Test ("1.2.3.4.5.6, 7.8.9.10.11.12", ((1, 2, 3, 4, 5, 6), (7, 8, 9, 10, 11, 12)), Swab_00_01 & Swab_00_02 & Swab_00_03 & Swab_00_04 & Swab_00_05 & Swab_00_06 & Swab_00_07 & Swab_00_08 & Swab_00_09 & Swab_00_0a & Swab_00_0b & Swab_00_0c); Test_Io.New_Line; end Test_X_Arc_Array; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- procedure Test_X_Point is procedure From_Raw is new Dummy.Convert_To_Private (Xlbt_Graphics.X_Point, Xlbmt_Network_Types.X_Raw_Data_Array); procedure Test is new Tests.Tester (Xlbt_Graphics.X_Point, "X_Point", Xlbip_Graphic_Converters.To_Raw, From_Raw); begin Test_Io.Section ("X_Point conversions"); Test ("0", (0, 0), (1 .. 4 => 0)); Test ("-1", (Minus_1, Minus_1), (1 .. 4 => Raw_Ff)); Test ("1.2", (1, 2), Swab_00_01 & Swab_00_02); Test_Io.New_Line; end Test_X_Point; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- procedure Test_X_Point_Array is procedure From_Raw is new Dummy.Convert_To_Array (Xlbt_Graphics.X_Point, Xlbt_Arithmetic.S_Natural, Xlbt_Graphics.X_Point_Array, Xlbmt_Network_Types.X_Raw_Data_Array); procedure Test is new Tests.Tester_1d (Xlbt_Graphics.X_Point, Xlbt_Arithmetic.S_Natural, Xlbt_Graphics.X_Point_Array, "X_Point_Array", Xlbip_Graphic_Converters.To_Raw, From_Raw); begin Test_Io.Section ("X_Point_Array conversions"); Test ("1..0 => 0", (1 .. 0 => (0, 0)), (1 .. 0 => 0)); Test ("2..2 => -1", (2 => (Minus_1, Minus_1)), (1 .. 4 => Raw_Ff)); Test ("0..0 => 1", (0 => (0, 1)), Swab_00_00 & Swab_00_01); Test ("1.2, 3.4, 5.6", ((1, 2), (3, 4), (5, 6)), Swab_00_01 & Swab_00_02 & Swab_00_03 & Swab_00_04 & Swab_00_05 & Swab_00_06); Test_Io.New_Line; end Test_X_Point_Array; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- procedure Test_X_Rectangle is -- procedure From_Raw is new Dummy.Convert_To_Private -- (Xlbt_Graphics.X_Rectangle, -- Xlbmt_Network_Types.X_Raw_Data_Array); -- procedure Test is new Tests.Tester -- (Xlbt_Graphics.X_Rectangle, "X_Rectangle", -- Xlbip_Graphic_Converters.To_Raw, From_Raw); -- begin -- Test_Io.Section ("X_Rectangle conversions"); -- Test ("0", (0, 0, 0, 0), (1 .. 8 => 0)); -- Test ("-1", (Minus_1, Minus_1, 16#FFFF#, 16#FFFF#), (1 .. 8 => Raw_Ff)); -- Test ("1.2.3.4", (1, 2, 3, 4), -- Swab_00_01 & Swab_00_02 & Swab_00_03 & Swab_00_04); -- Test_Io.New_Line; -- end Test_X_Rectangle; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- procedure Test_X_Rectangle_Array is procedure From_Raw is new Dummy.Convert_To_Array (Xlbt_Graphics.X_Rectangle, Xlbt_Arithmetic.S_Natural, Xlbt_Graphics.X_Rectangle_Array, Xlbmt_Network_Types.X_Raw_Data_Array); procedure Test is new Tests.Tester_1d (Xlbt_Graphics.X_Rectangle, Xlbt_Arithmetic.S_Natural, Xlbt_Graphics.X_Rectangle_Array, "X_Rectangle_Array", Xlbip_Graphic_Converters.To_Raw, From_Raw); begin Test_Io.Section ("X_Rectangle_Array conversions"); Test ("1..0 => 0", (1 .. 0 => (0, 0, 0, 0)), (1 .. 0 => 0)); Test ("2..2 => -1", (2 => (Minus_1, Minus_1, 16#FFFF#, 16#FFFF#)), (1 .. 8 => Raw_Ff)); Test ("0..0 => 1", (0 => (0, 0, 0, 1)), (1 .. 6 => 0) & Swab_00_01); Test ("1.2.3.4, 5.6.7.8", ((1, 2, 3, 4), (5, 6, 7, 8)), Swab_00_01 & Swab_00_02 & Swab_00_03 & Swab_00_04 & Swab_00_05 & Swab_00_06 & Swab_00_07 & Swab_00_08); Test_Io.New_Line; end Test_X_Rectangle_Array; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- procedure Test_X_Segment is -- procedure From_Raw is new Dummy.Convert_To_Private -- (Xlbt_Graphics.X_Segment, -- Xlbmt_Network_Types.X_Raw_Data_Array); -- procedure Test is new Tests.Tester -- (Xlbt_Graphics.X_Segment, "X_Segment", -- Xlbip_Graphic_Converters.To_Raw, From_Raw); -- begin -- Test_Io.Section ("X_Segment conversions"); -- Test ("0", (0, 0, 0, 0), (1 .. 8 => 0)); -- Test ("-1", (Minus_1, Minus_1, Minus_1, Minus_1), (1 .. 8 => Raw_Ff)); -- Test ("1.2.3.4", (1, 2, 3, 4), -- Swab_00_01 & Swab_00_02 & Swab_00_03 & Swab_00_04); -- Test_Io.New_Line; -- end Test_X_Segment; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- procedure Test_X_Segment_Array is procedure From_Raw is new Dummy.Convert_To_Array (Xlbt_Graphics.X_Segment, Xlbt_Arithmetic.S_Natural, Xlbt_Graphics.X_Segment_Array, Xlbmt_Network_Types.X_Raw_Data_Array); procedure Test is new Tests.Tester_1d (Xlbt_Graphics.X_Segment, Xlbt_Arithmetic.S_Natural, Xlbt_Graphics.X_Segment_Array, "X_Segment_Array", Xlbip_Graphic_Converters.To_Raw, From_Raw); begin Test_Io.Section ("X_Segment_Array conversions"); Test ("1..0 => 0", (1 .. 0 => (0, 0, 0, 0)), (1 .. 0 => 0)); Test ("2..2 => -1", (2 => (Minus_1, Minus_1, Minus_1, Minus_1)), (1 .. 8 => Raw_Ff)); Test ("0..0 => 1", (0 => (0, 0, 0, 1)), (1 .. 6 => 0) & Swab_00_01); Test ("1.2.3.4, 5.6.7.8", ((1, 2, 3, 4), (5, 6, 7, 8)), Swab_00_01 & Swab_00_02 & Swab_00_03 & Swab_00_04 & Swab_00_05 & Swab_00_06 & Swab_00_07 & Swab_00_08); Test_Io.New_Line; end Test_X_Segment_Array; begin Test_X_Pixel; Test_X_Arc; Test_X_Arc_Array; Test_X_Point; Test_X_Point_Array; -- Test_X_Rectangle; Test_X_Rectangle_Array; -- Test_X_Segment; Test_X_Segment_Array; end Cvt_050;