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

⟦fa7fdb77b⟧ TextFile

    Length: 4511 (0x119f)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Umps_Defs;
with Request;
with Set;
with Slot;  
with Text_Io;

package body Package_Request is

    procedure Test_Creation is
        Rq    : Request.Element;
        Param : Set.Object := Set.Null_Object;
        function Rq_Image is new Request.Image
                                    (Separator => Umps_Defs.Separator);
        use Text_Io;
    begin
        Put_Line ("-- Creation d'une Requete :");
        Put_Line
           ("-- Requete : 2, 3, Open, 2, File, string, toto.c, Rights, string, rw.");
        Request.Add_Sender (2, Rq);
        Request.Add_Handler (3, Rq);
        Request.Add_Method ("Open", Rq);
        Param :=
           Set.Add
              (Slot.Make (The_Variable => "Rights", With_Value => "rw"), Param);
        Param :=
           Set.Add (Slot.Make (The_Variable => "File", With_Value => "toto.c"),
                    Param);
        Request.Add_Params (Param, Rq);
        Put_Line ("ENTEXTE : " & Rq_Image (Rq));
        Set.Free (Param);
        New_Line;  
        Request.Display (Rq);

        New_Line;
        Put_Line ("-- Affichage des differents champs :");
        Put_Line ("-- Requete");
        Put_Line (Umps_Defs.Behavior_Number'Image (Request.Sender (Rq)));
        Put_Line (Umps_Defs.Behavior_Number'Image (Request.Handler (Rq)));
        Put_Line (Request.Method (Rq));
    end Test_Creation;


    procedure Test_Comparaison is
        Rq    : Request.Element;
        Rq2   : Request.Element;
        Param : Set.Object := Set.Null_Object;
        function Is_Name_Equal  is new Request.Is_Equal (Field => Slot.On_Name);
        function Is_Kind_Equal  is new Request.Is_Equal (Field => Slot.On_Kind);
        function Is_Value_Equal is
           new Request.Is_Equal (Field => Slot.On_Value);
        function Rq_Image       is new Request.Image
                                          (Separator => Umps_Defs.Separator);
        use Text_Io;
    begin
        Put_Line ("-- Creation d'une Requete :");
        Put_Line
           ("-- Requete : 2, 3, Date, 3, Day, integer, 5, Mounth, integer, 4, Year, integer, 1993");
        Request.Add_Sender (2, Rq);
        Request.Add_Handler (3, Rq);
        Request.Add_Method ("Date", Rq);
        Param :=
           Set.Add
              (Slot.Make (The_Variable => "Mounth", With_Value => 4), Param);
        Param := Set.Add
                    (Slot.Make (The_Variable => "Day", With_Value => 5), Param);
        Param :=
           Set.Add
              (Slot.Make (The_Variable => "Year", With_Value => 1993), Param);
        Request.Add_Params (Param, Rq);
        Put_Line ("ENTEXTE : " & Rq_Image (Rq));
        Set.Free (Param);
        New_Line;  
        Put_Line ("-- Copie de la requete");
        Rq2 := Rq;
        Put_Line ("-- Test egalite sur noms (TRUE)" &
                  Boolean'Image (Is_Name_Equal (Rq, Rq2)));
        Put_Line ("-- Test egalite sur kinds (TRUE)" &
                  Boolean'Image (Is_Kind_Equal (Rq, Rq2)));
        Put_Line ("-- Test egalite sur values (TRUE)" &
                  Boolean'Image (Is_Value_Equal (Rq, Rq2)));

        Put_Line ("-- Creation d'une 2eme requete avec une valeur vide");
        Request.Add_Sender (2, Rq2);
        Request.Add_Handler (3, Rq2);
        Request.Add_Method ("Date", Rq2);
        Param :=
           Set.Add
              (Slot.Make (The_Variable => "Mounth", With_Value => 4), Param);
        Param := Set.Add
                    (Slot.Make (The_Variable => "Day", With_Value => 5), Param);
        Param :=
           Set.Add
              (Slot.Make (The_Variable => "Year", With_Kind => Slot.Integer),
               Param);
        Request.Add_Params (Param, Rq2);
        Put_Line ("ENTEXTE : " & Rq_Image (Rq2));
        Set.Free (Param);
        Put_Line ("-- Test egalite sur noms (TRUE)" &
                  Boolean'Image (Is_Name_Equal (Rq, Rq2)));
        Put_Line ("-- Test egalite sur kinds (TRUE)" &
                  Boolean'Image (Is_Kind_Equal (Rq, Rq2)));
        Put_Line ("-- Test egalite sur values (FALSE)" &
                  Boolean'Image (Is_Value_Equal (Rq, Rq2)));
        New_Line;  
    end Test_Comparaison;


    procedure Test is
        use Text_Io;
    begin  
        New_Line;
        Put_Line ("---> Test Package Request");
        New_Line;

        Put_Line ("-- Test de creation et affichage");
        Test_Creation;
        New_Line;

        Put_Line ("-- Test de comparaison");
        Test_Comparaison;
        New_Line;

    end Test;


end Package_Request;