DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦bf74c33d1⟧ TextFile

    Length: 4534 (0x11b6)
    Types: TextFile
    Names: »B«

Derivation

└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
    └─ ⟦0c20f784e⟧ »DATA« 
        └─⟦1abbe589f⟧ 
            └─⟦49e7f20b9⟧ 
                └─⟦this⟧ 

TextFile

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;