|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 38912 (0x9800) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Cvt_Test_Utilities, seg_005510
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
with Swap_Raw_Data; with Swap_U_Char; with Xlbmt_Network_Types; with Xlbt_Arithmetic; with Xlbt_String; pragma Elaborate (Swap_Raw_Data); pragma Elaborate (Swap_U_Char); package Cvt_Test_Utilities is ------------------------------------------------------------------------------ -- Cvt_Test_Utilities - test generics and support routines useful for -- testing data conversions. ------------------------------------------------------------------------------ package Raw_Data_Tests is -------------------------------------------------------------------- -- The test generics in this section will perform a series of -- standard tests with a given pair of converter subprograms. The -- test generics below require both To_Raw and From_Raw converters. -- If a particular conversion is not used by the protocol, the -- standard converter packages will not supply a converter -- subprogram. Instantiate an appropriate Dummy_Converter -- to handle these cases. The test generics below all accept and -- handle the Dummy_Converters.Unimplemented exception. -- -- Logging information is produced via Test_Io calls. -------------------------------------------------------------------- generic type Original is private; Original_Name : String; with procedure To_Raw (Raw : out Xlbmt_Network_Types.X_Raw_Data_Array; Orig : Original); with procedure From_Raw (Orig : out Original; Raw : Xlbmt_Network_Types.X_Raw_Data_Array); procedure Tester (Image : String; Orig : Original; Raw : Xlbmt_Network_Types.X_Raw_Data_Array); -- -- Image - Specifies a text representation for Orig. -- Orig - Specifies the original value to be converted. -- Raw - Specifies the equivalent converted value. -- -- Called to exercise various conversions of private values. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- generic type Original is private; type Index is (<>); type Original_Array is array (Index range <>) of Original; Original_Name : String; with procedure To_Raw (Raw : out Xlbmt_Network_Types.X_Raw_Data_Array; Orig : Original_Array); with procedure From_Raw (Orig : out Original_Array; Raw : Xlbmt_Network_Types.X_Raw_Data_Array); procedure Tester_1d (Image : String; Orig : Original_Array; Raw : Xlbmt_Network_Types.X_Raw_Data_Array); -- -- Image - Specifies a text representation for Orig. -- Orig - Specifies the original value to be converted. -- Raw - Specifies the equivalent converted value. -- -- Called to exercise various conversions of array values. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- generic type Original is private; type Index1 is (<>); type Index2 is (<>); type Original_Array is array (Index1 range <>, Index2 range <>) of Original; Original_Name : String; with procedure To_Raw (Raw : out Xlbmt_Network_Types.X_Raw_Data_Array; Orig : Original_Array); with procedure From_Raw (Orig : out Original_Array; Raw : Xlbmt_Network_Types.X_Raw_Data_Array); procedure Tester_2d (Image : String; Orig : Original_Array; Raw : Xlbmt_Network_Types.X_Raw_Data_Array); -- -- Image - Specifies a text representation for Orig. -- Orig - Specifies the original value to be converted. -- Raw - Specifies the equivalent converted value. -- -- Called to exercise various conversions of 2d array values. end Raw_Data_Tests; ---------------------------------------------------------------------- package U_Char_Tests is -------------------------------------------------------------------- -- The test generics in this section will perform a series of -- standard tests with a given pair of converter subprograms. The -- test generics below require both To_Uca and From_Uca converters. -- If a particular conversion is not used by the protocol, the -- standard converter packages will not supply a converter -- subprogram. Instantiate an appropriate Dummy_Converter -- to handle these cases. The test generics below all accept and -- handle the Dummy_Converters.Unimplemented exception. -- -- Logging information is produced via Test_Io calls. -------------------------------------------------------------------- generic type Original is private; Original_Name : String; with procedure To_Uca (Uca : out Xlbt_Arithmetic.U_Char_Array; Orig : Original); with procedure From_Uca (Orig : out Original; Uca : Xlbt_Arithmetic.U_Char_Array); procedure Tester (Image : String; Orig : Original; Uca : Xlbt_Arithmetic.U_Char_Array); -- -- Image - Specifies a text representation for Orig. -- Orig - Specifies the original value to be converted. -- Uca - Specifies the equivalent converted value. -- -- Called to exercise various conversions of private values. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- generic type Original is private; type Index is (<>); type Original_Array is array (Index range <>) of Original; Original_Name : String; with procedure To_Uca (Uca : out Xlbt_Arithmetic.U_Char_Array; Orig : Original_Array); with procedure From_Uca (Orig : out Original_Array; Uca : Xlbt_Arithmetic.U_Char_Array); procedure Tester_1d (Image : String; Orig : Original_Array; Uca : Xlbt_Arithmetic.U_Char_Array); -- -- Image - Specifies a text representation for Orig. -- Orig - Specifies the original value to be converted. -- Uca - Specifies the equivalent converted value. -- -- Called to exercise various conversions of array values. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- generic type Original is private; type Index1 is (<>); type Index2 is (<>); type Original_Array is array (Index1 range <>, Index2 range <>) of Original; Original_Name : String; with procedure To_Uca (Uca : out Xlbt_Arithmetic.U_Char_Array; Orig : Original_Array); with procedure From_Uca (Orig : out Original_Array; Uca : Xlbt_Arithmetic.U_Char_Array); procedure Tester_2d (Image : String; Orig : Original_Array; Uca : Xlbt_Arithmetic.U_Char_Array); -- -- Image - Specifies a text representation for Orig. -- Orig - Specifies the original value to be converted. -- Uca - Specifies the equivalent converted value. -- -- Called to exercise various conversions of 2d array values. end U_Char_Tests; ---------------------------------------------------------------------- package X_String_Tests is -------------------------------------------------------------------- -- The test generics in this section will perform a series of -- standard tests with a given pair of converter subprograms. The -- test generics below require both To_Str8 and From_Str8 converters. -- If a particular conversion is not used by the protocol, the -- standard converter packages will not supply a converter -- subprogram. Instantiate an appropriate Dummy_Converter -- to handle these cases. The test generics below all accept and -- handle the Dummy_Converters.Unimplemented exception. -- -- Logging information is produced via Test_Io calls. -------------------------------------------------------------------- generic type Original is private; Original_Name : String; with procedure To_Str8 (Str8 : out Xlbt_String.X_String; Orig : Original); with procedure From_Str8 (Orig : out Original; Str8 : Xlbt_String.X_String); procedure Tester (Image : String; Orig : Original; Str8 : Xlbt_String.X_String); -- -- Image - Specifies a text representation for Orig. -- Orig - Specifies the original value to be converted. -- Str8 - Specifies the equivalent converted value. -- -- Called to exercise various conversions of private values. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- generic type Original is private; type Index is (<>); type Original_Array is array (Index range <>) of Original; Original_Name : String; with procedure To_Str8 (Str8 : out Xlbt_String.X_String; Orig : Original_Array); with procedure From_Str8 (Orig : out Original_Array; Str8 : Xlbt_String.X_String); procedure Tester_1d (Image : String; Orig : Original_Array; Str8 : Xlbt_String.X_String); -- -- Image - Specifies a text representation for Orig. -- Orig - Specifies the original value to be converted. -- Str8 - Specifies the equivalent converted value. -- -- Called to exercise various conversions of array values. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- generic type Original is private; type Index1 is (<>); type Index2 is (<>); type Original_Array is array (Index1 range <>, Index2 range <>) of Original; Original_Name : String; with procedure To_Str8 (Str8 : out Xlbt_String.X_String; Orig : Original_Array); with procedure From_Str8 (Orig : out Original_Array; Str8 : Xlbt_String.X_String); procedure Tester_2d (Image : String; Orig : Original_Array; Str8 : Xlbt_String.X_String); -- -- Image - Specifies a text representation for Orig. -- Orig - Specifies the original value to be converted. -- Str8 - Specifies the equivalent converted value. -- -- Called to exercise various conversions of 2d array values. end X_String_Tests; ---------------------------------------------------------------------- package Raw_Data_Constants is ------------------------------------------------------------------ -- This package contains common constants used to construct -- X_Raw_Data_Arrays corresponding to various converted values. ------------------------------------------------------------------ subtype Bytes is Xlbmt_Network_Types.X_Raw_Data_Array; function "&" (L, R : Bytes) return Bytes renames Xlbmt_Network_Types."&"; function Swab (Data : Bytes) return Bytes renames Swap_Raw_Data; -- Generic constants Minus_1 : constant := -1; -- Single byte constants --/ if Raw_Is_Unsigned then Raw_80 : constant Xlbmt_Network_Types.X_Raw_Data := 128; Raw_Ab : constant Xlbmt_Network_Types.X_Raw_Data := 171; Raw_Ff : constant Xlbmt_Network_Types.X_Raw_Data := 255; --/ else --// Raw_80 : constant X_Raw_Data := -128; --// Raw_Ab : constant X_Raw_Data := -85; --// Raw_Ff : constant X_Raw_Data := -1; --/ end if; -- Two byte constants Swab_00_00 : constant Bytes := Swab ((0, 0)); Swab_00_01 : constant Bytes := Swab ((0, 1)); Swab_00_02 : contant Bytes := Swab ((0, 2)); Swab_00_03 : constant Bytes := Swab ((0, 3)); Swab_00_04 : constant Bytes := Swab ((0, 4)); Swab_00_05 : constant Bytes := Swab ((0, 5)); Swab_00_06 : constant Bytes := Swab ((0, 6)); Swab_00_07 : constant Bytes := Swab ((0, 7)); Swab_00_08 : constant Bytes := Swab ((0, 8)); Swab_00_09 : constant Bytes := Swab ((0, 9)); Swab_00_0a : constant Bytes := Swab ((0, 10)); Swab_00_0b : constant Bytes := Swab ((0, 11)); Swab_00_0c : constant Bytes := Swab ((0, 12)); Swab_00_0d : constant Bytes := Swab ((0, 13)); Swab_00_0e : constant Bytes := Swab ((0, 14)); Swab_00_0f : constant Bytes := Swab ((0, 15)); Swab_00_10 : constant Bytes := Swab ((0, 16)); Swab_00_12 : constant Bytes := Swab ((0, 18)); Swab_01_00 : constant Bytes := Swab ((1, 0)); Swab_01_02 : constant Bytes := Swab ((1, 2)); Swab_01_23 : constant Bytes := Swab ((16#01#, 16#23#)); Swab_03_04 : constant Bytes := Swab ((3, 4)); Swab_05_06 : constant Bytes := Swab ((5, 6)); Swab_45_67 : constant Bytes := Swab ((16#45#, 16#67#)); Swab_7f_Ff : constant Bytes := Swab ((16#7F#, Raw_Ff)); Swab_80_00 : constant Bytes := Swab ((Raw_80, 0)); Swab_89_Ab : constant Bytes := Swab ((16#89#, Raw_Ab)); Swab_Ff_Ff : constant Bytes := Swab ((Raw_Ff, Raw_Ff)); -- Four byte constants Swab_00_00_00_00 : constant Bytes := Swab ((0, 0, 0, 0)); Swab_00_00_00_01 : constant Bytes := Swab ((0, 0, 0, 1)); Swab_00_00_00_02 : constant Bytes := Swab ((0, 0, 0, 2)); Swab_00_00_00_03 : constant Bytes := Swab ((0, 0, 0, 3)); Swab_00_00_00_04 : constant Bytes := Swab ((0, 0, 0, 4)); Swab_00_00_00_05 : constant Bytes := Swab ((0, 0, 0, 5)); Swab_00_00_00_06 : constant Bytes := Swab ((0, 0, 0, 6)); Swab_00_00_00_07 : constant Bytes := Swab ((0, 0, 0, 7)); Swab_00_00_00_08 : constant Bytes := Swab ((0, 0, 0, 8)); Swab_00_00_00_09 : constant Bytes := Swab ((0, 0, 0, 9)); Swab_00_00_00_0a : constant Bytes := Swab ((0, 0, 0, 10)); Swab_00_00_00_0b : constant Bytes := Swab ((0, 0, 0, 11)); Swab_00_00_00_0c : constant Bytes := Swab ((0, 0, 0, 12)); Swab_00_00_00_0d : constant Bytes := Swab ((0, 0, 0, 13)); Swab_00_00_00_0e : constant Bytes := Swab ((0, 0, 0, 14)); Swab_00_00_00_0f : constant Bytes := Swab ((0, 0, 0, 15)); Swab_00_00_00_10 : constant Bytes := Swab ((0, 0, 0, 16)); Swab_00_00_00_11 : constant Bytes := Swab ((0, 0, 0, 17)); Swab_01_23_45_67 : constant Bytes := Swab ((16#01#, 16#23#, 16#45#, 16#67#)); Swab_7f_Ff_Ff_Ff : constant Bytes := Swab ((16#7F#, Raw_Ff, Raw_Ff, Raw_Ff)); Swab_80_00_00_00 : constant Bytes := Swab ((Raw_80, 0, 0, 0)); Swab_Ff_Ff_Ff_Ff : constant Bytes := Swab ((Raw_Ff, Raw_Ff, Raw_Ff, Raw_Ff)); end Raw_Data_Constants; ---------------------------------------------------------------------- package U_Char_Constants is ------------------------------------------------------------------ -- This package contains common constants used to construct -- U_Char_Arrays corresponding to various converted values. ------------------------------------------------------------------ subtype Bytes is Xlbt_Arithmetic.U_Char_Array; function "&" (L, R : Bytes) return Bytes renames Xlbt_Arithmetic."&"; function Swab (Data : Bytes) return Bytes renames Swap_U_Char; -- Generic constants Minus_1 : constant := -1; -- Single byte constants Uca_80 : constant Xlbt_Arithmetic.U_Char := 128; Uca_Ab : constant Xlbt_Arithmetic.U_Char := 171; Uca_Ff : constant Xlbt_Arithmetic.U_Char := 255; -- Two byte constants Swab_00_00 : constant Bytes := Swab ((0, 0)); Swab_00_01 : constant Bytes := Swab ((0, 1)); Swab_00_02 : constant Bytes := Swab ((0, 2)); Swab_00_03 : constant Bytes := Swab ((0, 3)); Swab_00_04 : constant Bytes := Swab ((0, 4)); Swab_00_05 : constant Bytes := Swab ((0, 5)); Swab_00_06 : constant Bytes := Swab ((0, 6)); Swab_00_07 : constant Bytes := Swab ((0, 7)); Swab_00_08 : constant Bytes := Swab ((0, 8)); Swab_00_09 : constant Bytes := Swab ((0, 9)); Swab_00_0a : constant Bytes := Swab ((0, 10)); Swab_00_0b : constant Bytes := Swab ((0, 11)); Swab_00_0c : constant Bytes := Swab ((0, 12)); Swab_00_0d : constant Bytes := Swab ((0, 13)); Swab_00_0e : constant Bytes := Swab ((0, 14)); Swab_00_0f : constant Bytes := Swab ((0, 15)); Swab_00_10 : constant Bytes := Swab ((0, 16)); Swab_00_12 : constant Bytes := Swab ((0, 18)); Swab_01_00 : constant Bytes := Swab ((1, 0)); Swab_01_02 : constant Bytes := Swab ((1, 2)); Swab_01_23 : constant Bytes := Swab ((16#01#, 16#23#)); Swab_03_04 : constant Bytes := Swab ((3, 4)); Swab_05_06 : constant Bytes := Swab ((5, 6)); Swab_45_67 : constant Bytes := Swab ((16#45#, 16#67#)); Swab_7f_Ff : constant Bytes := Swab ((16#7F#, Uca_Ff)); Swab_80_00 : constant Bytes := Swab ((Uca_80, 0)); Swab_89_Ab : constant Bytes := Swab ((16#89#, Uca_Ab)); Swab_Ff_Ff : constant Bytes := Swab ((Uca_Ff, Uca_Ff)); -- Four byte constants Swab_00_00_00_00 : constant Bytes := Swab ((0, 0, 0, 0)); Swab_00_00_00_01 : constant Bytes := Swab ((0, 0, 0, 1)); Swab_00_00_00_02 : constant Bytes := Swab ((0, 0, 0, 2)); Swab_00_00_00_03 : constant Bytes := Swab ((0, 0, 0, 3)); Swab_00_00_00_04 : constant Bytes := Swab ((0, 0, 0, 4)); Swab_00_00_00_05 : constant Bytes := Swab ((0, 0, 0, 5)); Swab_00_00_00_06 : constant Bytes := Swab ((0, 0, 0, 6)); Swab_00_00_00_07 : constant Bytes := Swab ((0, 0, 0, 7)); Swab_00_00_00_08 : constant Bytes := Swab ((0, 0, 0, 8)); Swab_00_00_00_09 : constant Bytes := Swab ((0, 0, 0, 9)); Swab_00_00_00_0a : constant Bytes := Swab ((0, 0, 0, 10)); Swab_00_00_00_0b : constant Bytes := Swab ((0, 0, 0, 11)); Swab_00_00_00_0c : constant Bytes := Swab ((0, 0, 0, 12)); Swab_00_00_00_0d : constant Bytes := Swab ((0, 0, 0, 13)); Swab_00_00_00_0e : constant Bytes := Swab ((0, 0, 0, 14)); Swab_00_00_00_0f : constant Bytes := Swab ((0, 0, 0, 15)); Swab_00_00_00_10 : constant Bytes := Swab ((0, 0, 0, 16)); Swab_00_00_00_11 : constant Bytes := Swab ((0, 0, 0, 17)); Swab_01_23_45_67 : constant Bytes := Swab ((16#01#, 16#23#, 16#45#, 16#67#)); Swab_7f_Ff_Ff_Ff : constant Bytes := Swab ((16#7F#, Uca_Ff, Uca_Ff, Uca_Ff)); Swab_80_00_00_00 : constant Bytes := Swab ((Uca_80, 0, 0, 0)); Swab_Ff_Ff_Ff_Ff : constant Bytes := Swab ((Uca_Ff, Uca_Ff, Uca_Ff, Uca_Ff)); end U_Char_Constants; ---------------------------------------------------------------------- package Dummy_Converters is ------------------------------------------------------------------ -- This package is a dummy version of Xlbmp_Generic_Converters -- and Xlbp_U_Char_Generics. It is used by tests that want to -- use converters which aren't normally required by the -- protocol, and thus aren't provided by any of the standard -- converter packages. The conversion generics here perform no -- actual work - they just raise Unimplemented so that the test -- generics will know to ignore this test. ------------------------------------------------------------------ Unimplemented : exception; -- -- Raised by these conversion routines to signify inapplicable -- tests. ------------------------------------------------------------------ generic type Original is (<>); type Converted is private; procedure Convert_From_Discrete (Conv : out Converted; Orig : Original); generic type Original is private; type Converted is private; procedure Convert_From_Private (Conv : out Converted; Orig : Original); generic type Original is private; type Index is (<>); type Original_Array is array (Index range <>) of Original; type Converted is private; procedure Convert_From_Array (Conv : out Converted; Orig : Original_Array); generic type Original is private; type Index1 is (<>); type Index2 is (<>); type Original_Array is array (Index1 range <>, Index2 range <>) of Original; type Converted is private; procedure Convert_From_2d_Array (Conv : out Converted; Orig : Original_Array); ------------------------------------------------------------------ generic type Original is (<>); type Converted is private; procedure Convert_To_Discrete (Orig : out Original; Conv : Converted); generic type Original is private; type Converted is private; procedure Convert_To_Private (Orig : out Original; Conv : Converted); generic type Original is private; type Index is (<>); type Original_Array is array (Index range <>) of Original; type Converted is private; procedure Convert_To_Array (Orig : out Original_Array; Conv : Converted); generic type Original is private; type Index1 is (<>); type Index2 is (<>); type Original_Array is array (Index1 range <>, Index2 range <>) of Original; type Converted is private; procedure Convert_To_2d_Array (Orig : out Original_Array; Conv : Converted); end Dummy_Converters; ---------------------------------------------------------------------- end Cvt_Test_Utilities;
nblk1=25 nid=0 hdr6=4a [0x00] rec0=1a rec1=00 rec2=01 rec3=03c [0x01] rec0=14 rec1=00 rec2=02 rec3=042 [0x02] rec0=14 rec1=00 rec2=03 rec3=016 [0x03] rec0=00 rec1=00 rec2=25 rec3=01e [0x04] rec0=14 rec1=00 rec2=04 rec3=060 [0x05] rec0=01 rec1=00 rec2=24 rec3=00e [0x06] rec0=15 rec1=00 rec2=05 rec3=05a [0x07] rec0=12 rec1=00 rec2=06 rec3=006 [0x08] rec0=00 rec1=00 rec2=23 rec3=008 [0x09] rec0=14 rec1=00 rec2=07 rec3=02c [0x0a] rec0=00 rec1=00 rec2=22 rec3=026 [0x0b] rec0=14 rec1=00 rec2=08 rec3=08c [0x0c] rec0=01 rec1=00 rec2=21 rec3=01c [0x0d] rec0=15 rec1=00 rec2=09 rec3=036 [0x0e] rec0=11 rec1=00 rec2=0a rec3=08e [0x0f] rec0=00 rec1=00 rec2=20 rec3=004 [0x10] rec0=15 rec1=00 rec2=0b rec3=038 [0x11] rec0=00 rec1=00 rec2=1f rec3=026 [0x12] rec0=15 rec1=00 rec2=0c rec3=020 [0x13] rec0=00 rec1=00 rec2=1e rec3=034 [0x14] rec0=15 rec1=00 rec2=0d rec3=084 [0x15] rec0=19 rec1=00 rec2=0e rec3=030 [0x16] rec0=00 rec1=00 rec2=1d rec3=002 [0x17] rec0=11 rec1=00 rec2=0f rec3=060 [0x18] rec0=11 rec1=00 rec2=10 rec3=044 [0x19] rec0=0f rec1=00 rec2=11 rec3=062 [0x1a] rec0=18 rec1=00 rec2=12 rec3=074 [0x1b] rec0=13 rec1=00 rec2=13 rec3=05c [0x1c] rec0=12 rec1=00 rec2=14 rec3=024 [0x1d] rec0=0e rec1=00 rec2=15 rec3=062 [0x1e] rec0=15 rec1=00 rec2=16 rec3=032 [0x1f] rec0=17 rec1=00 rec2=17 rec3=050 [0x20] rec0=00 rec1=00 rec2=1c rec3=00a [0x21] rec0=15 rec1=00 rec2=18 rec3=05c [0x22] rec0=01 rec1=00 rec2=1b rec3=030 [0x23] rec0=14 rec1=00 rec2=19 rec3=03c [0x24] rec0=08 rec1=00 rec2=1a rec3=000 tail 0x21700969681978b429be9 0x42a00088462063203