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

⟦69e16436f⟧ TextFile

    Length: 3794 (0xed2)
    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_096 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_U8_Of_S8 is  
       array (Discrete_S8 range <>, Discrete_U8 range <>) of Discrete_S8;
--/ if Pack then
--//    pragma Pack (Array_S8_U8_Of_S8);
--/ end if;

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

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

    procedure Test_2d_Array_Conversions is  
        procedure To_Uca is new Xlbp_U_Char_Generics.Convert_2d_Array_To_Uca  
                                   (Discrete_S8, Discrete_S8,  
                                    Discrete_U8, Array_S8_U8_Of_S8);  
        procedure From_Uca is new Xlbp_U_Char_Generics.Convert_Uca_To_2d_Array  
                                     (Discrete_S8, Discrete_S8,  
                                      Discrete_U8, Array_S8_U8_Of_S8);  
        procedure Test_Array_S8_U8_Of_S8 is  
           new Tests.Tester_2d (Discrete_S8, Discrete_S8,  
                                Discrete_U8, Array_S8_U8_Of_S8,  
                                "Array_S8_U8_Of_S8", To_Uca, From_Uca);  
    begin  
        Test_Io.Section ("Converting 2d array types");

        Test_Array_S8_U8_Of_S8 ("1..0 => (1..0 => 0)",  
                                (1 .. 0 => (1 .. 0 => 0)), (1 .. 0 => 16#00#));  
        Test_Array_S8_U8_Of_S8 ("9..-4 => (1..1 => 0)",  
                                (9 .. -4 => (1 .. 1 => 0)), (1 .. 0 => 16#00#));  
        Test_Array_S8_U8_Of_S8 ("1..1 => (9..-4 => 0)",  
                                (1 .. 1 => (9 .. -4 => 0)), (1 .. 0 => 16#00#));  
        Test_Array_S8_U8_Of_S8 ("1..1 => (1..1 => 16#01#)",  
                                (1 => (1 => 16#01#)), (1 => 16#01#));  
        Test_Array_S8_U8_Of_S8 ("0..0 => (0..0 => 16#02#)",  
                                (0 => (0 => 16#02#)), (1 => 16#02#));  
        Test_Array_S8_U8_Of_S8 ("(1, 2, 3), (4, 5, 6)",  
                                ((1, 2, 3), (4, 5, 6)), (1, 2, 3, 4, 5, 6));  
        Test_Array_S8_U8_Of_S8 ("127 => (255 => 16#FF#)",  
                                (127 => (255 => -1)), (1 => Uca_Ff));  
        Test_Array_S8_U8_Of_S8  
           ("-5..-3 => (0..1 => 16#80#)",  
            (-5 .. -3 => (0 .. 1 => -128)), (1 .. 6 => Uca_80));  
        Test_Io.New_Line;  
    end Test_2d_Array_Conversions;

begin  
    Test_2d_Array_Conversions;  
end Cvt_096;