DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦766263894⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Cvt_094, seg_0054ab

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Test_Io;  
with Cvt_Test_Utilities;

with Xlbt_Arithmetic;

with Xlbp_U_Char_Generics;

--/ if Record_Rep_Clauses then
--// with Xlbmt_Parameters;
--// use Xlbmt_Parameters;
--/ end if;

procedure Cvt_094 is
------------------------------------------------------------------------------
-- Tests for Xlbp_U_Char_Generics
------------------------------------------------------------------------------
-- ****************************************************************************
-- * Date      - /Name/ Comment
-- *
-- * 25-SEP-90 - /DRK/ Created.
-- * 14-NOV-90 - /GEB/ Separate cvt_090 into four parts.
-- ****************************************************************************
------------------------------------------------------------------------------


    ---------------------------------
    -- Handy constants and renames --
    ---------------------------------

    package Utils renames Cvt_Test_Utilities;  
    package Tests renames Utils.U_Char_Tests;  
    use Utils.U_Char_Constants;

    ----------------------------------------------------------------------

    -----------------
    -- Local types --
    -----------------

    type Discrete_S32 is new Xlbt_Arithmetic.S_Long;  
    type Discrete_S16 is new Xlbt_Arithmetic.S_Short;  
    type Discrete_U16 is new Xlbt_Arithmetic.U_Short;  
    type Discrete_S8  is new Xlbt_Arithmetic.S_Char;  
    type Discrete_U8  is new Xlbt_Arithmetic.U_Char;


    type Array_S8_Of_U16 is array (Discrete_S8 range <>) of Discrete_U16;
--/ if Pack then
--//    pragma Pack (Array_S8_Of_U16);
--/ end if;
    type Array_U16_Of_S8 is array (Discrete_U16 range <>) of Discrete_S8;
--/ if Pack then
--//    pragma Pack (Array_U16_Of_S8);
--/ end if;

    ----------------------------------------------------------------------

    -------------------------
    -- Major test sections --
    -------------------------

    procedure Test_Array_Conversions is  
        procedure To_Uca is new Xlbp_U_Char_Generics.Convert_Array_To_Uca  
                                   (Discrete_U16, Discrete_S8, Array_S8_Of_U16);  
        procedure From_Uca is  
           new Xlbp_U_Char_Generics.Convert_Uca_To_Array  
                  (Discrete_U16, Discrete_S8, Array_S8_Of_U16);  
        procedure Test_Array_S8_Of_U16 is  
           new Tests.Tester_1d (Discrete_U16, Discrete_S8, Array_S8_Of_U16,  
                                "Array_S8_Of_U16", To_Uca, From_Uca);

        procedure To_Uca is new Xlbp_U_Char_Generics.Convert_Array_To_Uca  
                                   (Discrete_S8, Discrete_U16, Array_U16_Of_S8);  
        procedure From_Uca is  
           new Xlbp_U_Char_Generics.Convert_Uca_To_Array  
                  (Discrete_S8, Discrete_U16, Array_U16_Of_S8);  
        procedure Test_Array_U16_Of_S8 is  
           new Tests.Tester_1d (Discrete_S8, Discrete_U16, Array_U16_Of_S8,  
                                "Array_U16_Of_S8", To_Uca, From_Uca);  
    begin  
        Test_Io.Section ("Converting array types");

        Test_Array_S8_Of_U16  
           ("1..0 => 0", (1 .. 0 => 16#0000#), (1 .. 0 => 16#00#));  
        Test_Array_S8_Of_U16  
           ("9..-4 => 0", (9 .. -4 => 16#0000#), (1 .. 0 => 16#00#));  
        Test_Array_S8_Of_U16  
           ("1..1 => 16#0000#", (1 => 16#0000#), (1 .. 2 => 16#00#));  
        Test_Array_S8_Of_U16 ("0..0 => 16#0001#", (0 => 16#0001#), Swab_00_01);  
        Test_Array_S8_Of_U16 ("16#0123#, 16#4567#", (16#0123#, 16#4567#),  
                              Swab_01_23 & Swab_45_67);  
        Test_Array_S8_Of_U16 ("127 => 16#FFFF#", (127 => 16#FFFF#), Swab_Ff_Ff);  
        Test_Array_S8_Of_U16 ("-5..-3 => 16#5555#",  
                              (-5 .. -3 => 16#5555#), (1 .. 6 => 16#55#));  
        Test_Io.New_Line;

        Test_Array_U16_Of_S8  
           ("1..0 => 0", (1 .. 0 => 16#00#), (1 .. 0 => 16#00#));  
        Test_Array_U16_Of_S8  
           ("9..-4 => 0", (9 .. -4 => 16#00#), (1 .. 0 => 16#00#));  
        Test_Array_U16_Of_S8 ("1..1 => 16#00#", (1 => 16#00#), (1 => 16#00#));  
        Test_Array_U16_Of_S8 ("0..0 => 16#01#", (0 => 16#01#), (1 => 16#01#));  
        Test_Array_U16_Of_S8 ("16#01#, 16#23#, 16#45#, 16#67#",  
                              (16#01#, 16#23#, 16#45#, 16#67#),  
                              (16#01#, 16#23#, 16#45#, 16#67#));  
        Test_Array_U16_Of_S8 ("65535 => 16#FF#", (65535 => -1), (1 => Uca_Ff));  
        Test_Io.New_Line;  
    end Test_Array_Conversions;

begin  
    Test_Array_Conversions;  
end Cvt_094;  

E3 Meta Data

    nblk1=6
    nid=0
    hdr6=c
        [0x00] rec0=20 rec1=00 rec2=01 rec3=026
        [0x01] rec0=1f rec1=00 rec2=02 rec3=02a
        [0x02] rec0=00 rec1=00 rec2=06 rec3=004
        [0x03] rec0=11 rec1=00 rec2=03 rec3=022
        [0x04] rec0=13 rec1=00 rec2=04 rec3=080
        [0x05] rec0=0f rec1=00 rec2=05 rec3=000
    tail 0x21500a16681978a4e7395 0x42a00088462063203