OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [ada/] [acats/] [tests/] [c3/] [c393001.a] - Diff between revs 294 and 384

Only display areas with differences | Details | Blame | View Log

Rev 294 Rev 384
-- C393001.A
-- C393001.A
--
--
--                             Grant of Unlimited Rights
--                             Grant of Unlimited Rights
--
--
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
--     unlimited rights in the software and documentation contained herein.
--     unlimited rights in the software and documentation contained herein.
--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making
--     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making
--     this public release, the Government intends to confer upon all
--     this public release, the Government intends to confer upon all
--     recipients unlimited rights  equal to those held by the Government.
--     recipients unlimited rights  equal to those held by the Government.
--     These rights include rights to use, duplicate, release or disclose the
--     These rights include rights to use, duplicate, release or disclose the
--     released technical data and computer software in whole or in part, in
--     released technical data and computer software in whole or in part, in
--     any manner and for any purpose whatsoever, and to have or permit others
--     any manner and for any purpose whatsoever, and to have or permit others
--     to do so.
--     to do so.
--
--
--                                    DISCLAIMER
--                                    DISCLAIMER
--
--
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
--     PARTICULAR PURPOSE OF SAID MATERIAL.
--     PARTICULAR PURPOSE OF SAID MATERIAL.
--*
--*
--
--
-- OBJECTIVE:
-- OBJECTIVE:
--      Check that an abstract type can be declared, and in turn concrete
--      Check that an abstract type can be declared, and in turn concrete
--      types can be derived from it.  Check that the definition of
--      types can be derived from it.  Check that the definition of
--      actual subprograms associated with the derived types dispatch
--      actual subprograms associated with the derived types dispatch
--      correctly.
--      correctly.
--
--
-- TEST DESCRIPTION:
-- TEST DESCRIPTION:
--      This test declares an abstract type Breaker in a package, and
--      This test declares an abstract type Breaker in a package, and
--      then derives from it.  The type Basic_Breaker defines the least
--      then derives from it.  The type Basic_Breaker defines the least
--      possible in order to not be abstract.  The type Ground_Fault is
--      possible in order to not be abstract.  The type Ground_Fault is
--      defined to inherit as much as possible, whereas type Special_Breaker
--      defined to inherit as much as possible, whereas type Special_Breaker
--      overrides everything it can.  The type Special_Breaker also includes
--      overrides everything it can.  The type Special_Breaker also includes
--      an embedded Basic_Breaker object.  The main program then utilizes
--      an embedded Basic_Breaker object.  The main program then utilizes
--      each of the three types of breaker, and to ascertain that the
--      each of the three types of breaker, and to ascertain that the
--      overloading and tagging resolution are correct, each "Create"
--      overloading and tagging resolution are correct, each "Create"
--      procedure is called with a unique value.  The diagram below
--      procedure is called with a unique value.  The diagram below
--      illustrates the relationships.  This test is derived from C3A2001.
--      illustrates the relationships.  This test is derived from C3A2001.
--
--
--              Abstract type:           Breaker
--              Abstract type:           Breaker
--                                           |
--                                           |
--                                    Basic_Breaker (Short)
--                                    Basic_Breaker (Short)
--                                    /           \
--                                    /           \
--                     (Sharp) Ground_Fault    Special_Breaker (Shock)
--                     (Sharp) Ground_Fault    Special_Breaker (Shock)
--
--
--      Test structure is an array of class-wide objects, modeling a circuit
--      Test structure is an array of class-wide objects, modeling a circuit
--      as a list of components.  The test then creates some values, and
--      as a list of components.  The test then creates some values, and
--      traverses the list to determine correct operation.
--      traverses the list to determine correct operation.
--
--
--
--
-- CHANGE HISTORY:
-- CHANGE HISTORY:
--      06 Dec 94   SAIC    ACVC 2.0
--      06 Dec 94   SAIC    ACVC 2.0
--      13 Nov 95   SAIC    Revised for 2.0.1
--      13 Nov 95   SAIC    Revised for 2.0.1
--
--
--!
--!
----------------------------------------------------------------- C393001_1
----------------------------------------------------------------- C393001_1
with Report;
with Report;
package C393001_1 is
package C393001_1 is
  type Breaker is abstract tagged private;
  type Breaker is abstract tagged private;
  type Status  is ( Power_Off, Power_On, Tripped, Failed );
  type Status  is ( Power_Off, Power_On, Tripped, Failed );
  procedure Flip ( The_Breaker : in out Breaker ) is abstract;
  procedure Flip ( The_Breaker : in out Breaker ) is abstract;
  procedure Trip ( The_Breaker : in out Breaker ) is abstract;
  procedure Trip ( The_Breaker : in out Breaker ) is abstract;
  procedure Reset( The_Breaker : in out Breaker ) is abstract;
  procedure Reset( The_Breaker : in out Breaker ) is abstract;
  procedure Fail ( The_Breaker : in out Breaker );
  procedure Fail ( The_Breaker : in out Breaker );
  procedure Set ( The_Breaker : in out Breaker'Class; To_State : Status );
  procedure Set ( The_Breaker : in out Breaker'Class; To_State : Status );
  function  Status_Of( The_Breaker : Breaker ) return Status;
  function  Status_Of( The_Breaker : Breaker ) return Status;
private
private
  type Breaker is abstract tagged record
  type Breaker is abstract tagged record
    State : Status := Power_Off;
    State : Status := Power_Off;
  end record;
  end record;
end C393001_1;
end C393001_1;
with TCTouch;
with TCTouch;
package body C393001_1 is
package body C393001_1 is
  procedure Fail( The_Breaker : in out Breaker ) is ------------------- a
  procedure Fail( The_Breaker : in out Breaker ) is ------------------- a
  begin
  begin
    TCTouch.Touch( 'a' );
    TCTouch.Touch( 'a' );
    The_Breaker.State := Failed;
    The_Breaker.State := Failed;
  end Fail;
  end Fail;
  procedure Set( The_Breaker : in out Breaker'Class; To_State : Status ) is
  procedure Set( The_Breaker : in out Breaker'Class; To_State : Status ) is
  begin
  begin
    The_Breaker.State := To_State;
    The_Breaker.State := To_State;
  end Set;
  end Set;
  function  Status_Of( The_Breaker : Breaker ) return Status is ------- b
  function  Status_Of( The_Breaker : Breaker ) return Status is ------- b
  begin
  begin
    TCTouch.Touch( 'b' );
    TCTouch.Touch( 'b' );
    return The_Breaker.State;
    return The_Breaker.State;
  end Status_Of;
  end Status_Of;
end C393001_1;
end C393001_1;
----------------------------------------------------------------- C393001_2
----------------------------------------------------------------- C393001_2
with C393001_1;
with C393001_1;
package C393001_2 is
package C393001_2 is
  type Basic_Breaker is new C393001_1.Breaker with private;
  type Basic_Breaker is new C393001_1.Breaker with private;
  type Voltages is ( V12, V110, V220, V440 );
  type Voltages is ( V12, V110, V220, V440 );
  type Amps     is ( A1, A5, A10, A25, A100 );
  type Amps     is ( A1, A5, A10, A25, A100 );
  function Construct( Voltage : Voltages; Amperage : Amps )
  function Construct( Voltage : Voltages; Amperage : Amps )
    return Basic_Breaker;
    return Basic_Breaker;
  procedure Flip ( The_Breaker : in out Basic_Breaker );
  procedure Flip ( The_Breaker : in out Basic_Breaker );
  procedure Trip ( The_Breaker : in out Basic_Breaker );
  procedure Trip ( The_Breaker : in out Basic_Breaker );
  procedure Reset( The_Breaker : in out Basic_Breaker );
  procedure Reset( The_Breaker : in out Basic_Breaker );
private
private
  type Basic_Breaker is new C393001_1.Breaker with record
  type Basic_Breaker is new C393001_1.Breaker with record
    Voltage_Level : Voltages := V110;
    Voltage_Level : Voltages := V110;
    Amperage      : Amps;
    Amperage      : Amps;
  end record;
  end record;
end C393001_2;
end C393001_2;
with TCTouch;
with TCTouch;
package body C393001_2 is
package body C393001_2 is
  function Construct( Voltage : Voltages; Amperage : Amps ) ----------- c
  function Construct( Voltage : Voltages; Amperage : Amps ) ----------- c
    return Basic_Breaker is
    return Basic_Breaker is
    It : Basic_Breaker;
    It : Basic_Breaker;
  begin
  begin
    TCTouch.Touch( 'c' );
    TCTouch.Touch( 'c' );
    It.Amperage := Amperage;
    It.Amperage := Amperage;
    It.Voltage_Level := Voltage;
    It.Voltage_Level := Voltage;
    C393001_1.Set( It, C393001_1.Power_Off );
    C393001_1.Set( It, C393001_1.Power_Off );
    return It;
    return It;
  end Construct;
  end Construct;
  procedure Flip ( The_Breaker : in out Basic_Breaker ) is ------------ d
  procedure Flip ( The_Breaker : in out Basic_Breaker ) is ------------ d
  begin
  begin
    TCTouch.Touch( 'd' );
    TCTouch.Touch( 'd' );
    case Status_Of( The_Breaker ) is
    case Status_Of( The_Breaker ) is
      when C393001_1.Power_Off =>
      when C393001_1.Power_Off =>
        C393001_1.Set( The_Breaker, C393001_1.Power_On );
        C393001_1.Set( The_Breaker, C393001_1.Power_On );
      when C393001_1.Power_On =>
      when C393001_1.Power_On =>
        C393001_1.Set( The_Breaker, C393001_1.Power_Off );
        C393001_1.Set( The_Breaker, C393001_1.Power_Off );
      when C393001_1.Tripped | C393001_1.Failed  => null;
      when C393001_1.Tripped | C393001_1.Failed  => null;
    end case;
    end case;
  end Flip;
  end Flip;
  procedure Trip ( The_Breaker : in out Basic_Breaker ) is ------------ e
  procedure Trip ( The_Breaker : in out Basic_Breaker ) is ------------ e
  begin
  begin
    TCTouch.Touch( 'e' );
    TCTouch.Touch( 'e' );
    C393001_1.Set( The_Breaker, C393001_1.Tripped );
    C393001_1.Set( The_Breaker, C393001_1.Tripped );
  end Trip;
  end Trip;
  procedure Reset( The_Breaker : in out Basic_Breaker ) is ------------ f
  procedure Reset( The_Breaker : in out Basic_Breaker ) is ------------ f
  begin
  begin
    TCTouch.Touch( 'f' );
    TCTouch.Touch( 'f' );
    case Status_Of( The_Breaker ) is
    case Status_Of( The_Breaker ) is
      when C393001_1.Power_Off | C393001_1.Tripped =>
      when C393001_1.Power_Off | C393001_1.Tripped =>
        C393001_1.Set( The_Breaker, C393001_1.Power_On );
        C393001_1.Set( The_Breaker, C393001_1.Power_On );
      when C393001_1.Power_On  | C393001_1.Failed  => null;
      when C393001_1.Power_On  | C393001_1.Failed  => null;
    end case;
    end case;
  end Reset;
  end Reset;
end C393001_2;
end C393001_2;
with C393001_1,C393001_2;
with C393001_1,C393001_2;
package C393001_3 is
package C393001_3 is
  type Ground_Fault is new C393001_2.Basic_Breaker with private;
  type Ground_Fault is new C393001_2.Basic_Breaker with private;
  function Construct( Voltage : C393001_2.Voltages; Amperage : C393001_2.Amps
  function Construct( Voltage : C393001_2.Voltages; Amperage : C393001_2.Amps
)
)
    return Ground_Fault;
    return Ground_Fault;
  procedure Set_Trip( The_Breaker : in out Ground_Fault;
  procedure Set_Trip( The_Breaker : in out Ground_Fault;
                      Capacitance : in     Integer );
                      Capacitance : in     Integer );
private
private
  type Ground_Fault is new C393001_2.Basic_Breaker with record
  type Ground_Fault is new C393001_2.Basic_Breaker with record
    Capacitance : Integer;
    Capacitance : Integer;
  end record;
  end record;
end C393001_3;
end C393001_3;
----------------------------------------------------------------- C393001_3
----------------------------------------------------------------- C393001_3
with TCTouch;
with TCTouch;
package body C393001_3 is
package body C393001_3 is
  function Construct( Voltage  : C393001_2.Voltages; ------------------ g
  function Construct( Voltage  : C393001_2.Voltages; ------------------ g
                      Amperage : C393001_2.Amps )
                      Amperage : C393001_2.Amps )
    return Ground_Fault is
    return Ground_Fault is
    It : Ground_Fault;
    It : Ground_Fault;
    procedure Set_Root( It: in out C393001_2.Basic_Breaker ) is
    procedure Set_Root( It: in out C393001_2.Basic_Breaker ) is
    begin
    begin
      It := C393001_2.Construct( Voltage, Amperage );
      It := C393001_2.Construct( Voltage, Amperage );
    end Set_Root;
    end Set_Root;
  begin
  begin
    TCTouch.Touch( 'g' );
    TCTouch.Touch( 'g' );
    Set_Root( C393001_2.Basic_Breaker( It ) );
    Set_Root( C393001_2.Basic_Breaker( It ) );
    It.Capacitance := 0;
    It.Capacitance := 0;
    return It;
    return It;
  end Construct;
  end Construct;
  procedure Set_Trip( The_Breaker : in out Ground_Fault; -------------- h
  procedure Set_Trip( The_Breaker : in out Ground_Fault; -------------- h
                      Capacitance : in     Integer ) is
                      Capacitance : in     Integer ) is
  begin
  begin
    TCTouch.Touch( 'h' );
    TCTouch.Touch( 'h' );
    The_Breaker.Capacitance := Capacitance;
    The_Breaker.Capacitance := Capacitance;
  end Set_Trip;
  end Set_Trip;
end C393001_3;
end C393001_3;
----------------------------------------------------------------- C393001_4
----------------------------------------------------------------- C393001_4
with C393001_1, C393001_2;
with C393001_1, C393001_2;
package C393001_4 is
package C393001_4 is
  type Special_Breaker is new C393001_2.Basic_Breaker with private;
  type Special_Breaker is new C393001_2.Basic_Breaker with private;
  function Construct( Voltage     : C393001_2.Voltages;
  function Construct( Voltage     : C393001_2.Voltages;
                      Amperage    : C393001_2.Amps )
                      Amperage    : C393001_2.Amps )
    return Special_Breaker;
    return Special_Breaker;
  procedure Flip ( The_Breaker : in out Special_Breaker );
  procedure Flip ( The_Breaker : in out Special_Breaker );
  procedure Trip ( The_Breaker : in out Special_Breaker );
  procedure Trip ( The_Breaker : in out Special_Breaker );
  procedure Reset( The_Breaker : in out Special_Breaker );
  procedure Reset( The_Breaker : in out Special_Breaker );
  procedure Fail ( The_Breaker : in out Special_Breaker );
  procedure Fail ( The_Breaker : in out Special_Breaker );
  function Status_Of( The_Breaker : Special_Breaker ) return C393001_1.Status;
  function Status_Of( The_Breaker : Special_Breaker ) return C393001_1.Status;
  function On_Backup( The_Breaker : Special_Breaker ) return Boolean;
  function On_Backup( The_Breaker : Special_Breaker ) return Boolean;
private
private
  type Special_Breaker is new C393001_2.Basic_Breaker with record
  type Special_Breaker is new C393001_2.Basic_Breaker with record
    Backup : C393001_2.Basic_Breaker;
    Backup : C393001_2.Basic_Breaker;
  end record;
  end record;
end C393001_4;
end C393001_4;
with TCTouch;
with TCTouch;
package body C393001_4 is
package body C393001_4 is
  function Construct( Voltage     : C393001_2.Voltages; --------------- i
  function Construct( Voltage     : C393001_2.Voltages; --------------- i
                      Amperage    : C393001_2.Amps )
                      Amperage    : C393001_2.Amps )
    return Special_Breaker is
    return Special_Breaker is
    It: Special_Breaker;
    It: Special_Breaker;
    procedure Set_Root( It: in out C393001_2.Basic_Breaker ) is
    procedure Set_Root( It: in out C393001_2.Basic_Breaker ) is
    begin
    begin
      It := C393001_2.Construct( Voltage, Amperage );
      It := C393001_2.Construct( Voltage, Amperage );
    end Set_Root;
    end Set_Root;
  begin
  begin
    TCTouch.Touch( 'i' );
    TCTouch.Touch( 'i' );
    Set_Root( C393001_2.Basic_Breaker( It ) );
    Set_Root( C393001_2.Basic_Breaker( It ) );
    Set_Root( It.Backup );
    Set_Root( It.Backup );
    return It;
    return It;
  end Construct;
  end Construct;
  function Status_Of( It: C393001_1.Breaker ) return C393001_1.Status
  function Status_Of( It: C393001_1.Breaker ) return C393001_1.Status
    renames C393001_1.Status_Of;
    renames C393001_1.Status_Of;
  procedure Flip ( The_Breaker : in out Special_Breaker ) is ---------- j
  procedure Flip ( The_Breaker : in out Special_Breaker ) is ---------- j
  begin
  begin
    TCTouch.Touch( 'j' );
    TCTouch.Touch( 'j' );
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
      when C393001_1.Power_Off | C393001_1.Power_On =>
      when C393001_1.Power_Off | C393001_1.Power_On =>
        C393001_2.Flip( C393001_2.Basic_Breaker( The_Breaker ) );
        C393001_2.Flip( C393001_2.Basic_Breaker( The_Breaker ) );
      when others =>
      when others =>
        C393001_2.Flip( The_Breaker.Backup );
        C393001_2.Flip( The_Breaker.Backup );
    end case;
    end case;
  end Flip;
  end Flip;
  procedure Trip ( The_Breaker : in out Special_Breaker ) is ---------- k
  procedure Trip ( The_Breaker : in out Special_Breaker ) is ---------- k
  begin
  begin
    TCTouch.Touch( 'k' );
    TCTouch.Touch( 'k' );
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
      when C393001_1.Power_Off => null;
      when C393001_1.Power_Off => null;
      when C393001_1.Power_On  =>
      when C393001_1.Power_On  =>
        C393001_2.Reset( The_Breaker.Backup );
        C393001_2.Reset( The_Breaker.Backup );
        C393001_2.Trip( C393001_2.Basic_Breaker( The_Breaker ) );
        C393001_2.Trip( C393001_2.Basic_Breaker( The_Breaker ) );
      when others =>
      when others =>
        C393001_2.Trip( The_Breaker.Backup );
        C393001_2.Trip( The_Breaker.Backup );
    end case;
    end case;
  end Trip;
  end Trip;
  procedure Reset( The_Breaker : in out Special_Breaker ) is ---------- l
  procedure Reset( The_Breaker : in out Special_Breaker ) is ---------- l
  begin
  begin
    TCTouch.Touch( 'l' );
    TCTouch.Touch( 'l' );
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
      when C393001_1.Tripped  =>
      when C393001_1.Tripped  =>
        C393001_2.Reset( C393001_2.Basic_Breaker( The_Breaker ));
        C393001_2.Reset( C393001_2.Basic_Breaker( The_Breaker ));
      when C393001_1.Failed  =>
      when C393001_1.Failed  =>
        C393001_2.Reset( The_Breaker.Backup );
        C393001_2.Reset( The_Breaker.Backup );
      when C393001_1.Power_On | C393001_1.Power_Off =>
      when C393001_1.Power_On | C393001_1.Power_Off =>
        null;
        null;
    end case;
    end case;
  end Reset;
  end Reset;
  procedure Fail ( The_Breaker : in out Special_Breaker ) is ---------- m
  procedure Fail ( The_Breaker : in out Special_Breaker ) is ---------- m
  begin
  begin
    TCTouch.Touch( 'm' );
    TCTouch.Touch( 'm' );
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
      when C393001_1.Failed  =>
      when C393001_1.Failed  =>
        C393001_2.Fail( The_Breaker.Backup );
        C393001_2.Fail( The_Breaker.Backup );
      when others =>
      when others =>
        C393001_2.Fail( C393001_2.Basic_Breaker( The_Breaker ));
        C393001_2.Fail( C393001_2.Basic_Breaker( The_Breaker ));
        C393001_2.Reset( The_Breaker.Backup );
        C393001_2.Reset( The_Breaker.Backup );
    end case;
    end case;
  end Fail;
  end Fail;
  function Status_Of( The_Breaker : Special_Breaker ) ----------------- n
  function Status_Of( The_Breaker : Special_Breaker ) ----------------- n
    return C393001_1.Status is
    return C393001_1.Status is
  begin
  begin
    TCTouch.Touch( 'n' );
    TCTouch.Touch( 'n' );
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
    case Status_Of( C393001_1.Breaker( The_Breaker )) is
      when C393001_1.Power_On  => return C393001_1.Power_On;
      when C393001_1.Power_On  => return C393001_1.Power_On;
      when C393001_1.Power_Off => return C393001_1.Power_Off;
      when C393001_1.Power_Off => return C393001_1.Power_Off;
      when others =>
      when others =>
        return C393001_2.Status_Of( The_Breaker.Backup );
        return C393001_2.Status_Of( The_Breaker.Backup );
    end case;
    end case;
  end Status_Of;
  end Status_Of;
  function On_Backup( The_Breaker : Special_Breaker ) return Boolean is
  function On_Backup( The_Breaker : Special_Breaker ) return Boolean is
    use C393001_2;
    use C393001_2;
    use type C393001_1.Status;
    use type C393001_1.Status;
  begin
  begin
    return Status_Of(Basic_Breaker(The_Breaker)) = C393001_1.Tripped
    return Status_Of(Basic_Breaker(The_Breaker)) = C393001_1.Tripped
        or Status_Of(Basic_Breaker(The_Breaker)) = C393001_1.Failed;
        or Status_Of(Basic_Breaker(The_Breaker)) = C393001_1.Failed;
  end On_Backup;
  end On_Backup;
end C393001_4;
end C393001_4;
------------------------------------------------------------------- C393001
------------------------------------------------------------------- C393001
with Report, TCTouch;
with Report, TCTouch;
with C393001_1, C393001_2, C393001_3, C393001_4;
with C393001_1, C393001_2, C393001_3, C393001_4;
procedure C393001 is
procedure C393001 is
  procedure Flipper( The_Circuit : in out C393001_1.Breaker'Class ) is
  procedure Flipper( The_Circuit : in out C393001_1.Breaker'Class ) is
  begin
  begin
      C393001_1.Flip( The_Circuit );
      C393001_1.Flip( The_Circuit );
  end Flipper;
  end Flipper;
  procedure Tripper( The_Circuit : in out C393001_1.Breaker'Class ) is
  procedure Tripper( The_Circuit : in out C393001_1.Breaker'Class ) is
  begin
  begin
      C393001_1.Trip( The_Circuit );
      C393001_1.Trip( The_Circuit );
  end Tripper;
  end Tripper;
  procedure Restore( The_Circuit : in out C393001_1.Breaker'Class ) is
  procedure Restore( The_Circuit : in out C393001_1.Breaker'Class ) is
  begin
  begin
      C393001_1.Reset( The_Circuit );
      C393001_1.Reset( The_Circuit );
  end Restore;
  end Restore;
  procedure Failure( The_Circuit : in out C393001_1.Breaker'Class ) is
  procedure Failure( The_Circuit : in out C393001_1.Breaker'Class ) is
  begin
  begin
      C393001_1.Fail( The_Circuit );
      C393001_1.Fail( The_Circuit );
  end Failure;
  end Failure;
  Short : C393001_1.Breaker'Class -- Basic_Breaker
  Short : C393001_1.Breaker'Class -- Basic_Breaker
          := C393001_2.Construct( C393001_2.V440, C393001_2.A5 );
          := C393001_2.Construct( C393001_2.V440, C393001_2.A5 );
  Sharp : C393001_1.Breaker'Class -- Ground_Fault
  Sharp : C393001_1.Breaker'Class -- Ground_Fault
          := C393001_3.Construct( C393001_2.V110, C393001_2.A1 );
          := C393001_3.Construct( C393001_2.V110, C393001_2.A1 );
  Shock : C393001_1.Breaker'Class -- Special_Breaker
  Shock : C393001_1.Breaker'Class -- Special_Breaker
          := C393001_4.Construct( C393001_2.V12,  C393001_2.A100 );
          := C393001_4.Construct( C393001_2.V12,  C393001_2.A100 );
begin  -- Main test procedure.
begin  -- Main test procedure.
  Report.Test ("C393001", "Check that an abstract type can be declared " &
  Report.Test ("C393001", "Check that an abstract type can be declared " &
               "and used.  Check actual subprograms dispatch correctly" );
               "and used.  Check actual subprograms dispatch correctly" );
  TCTouch.Validate( "cgcicc", "Declaration" );
  TCTouch.Validate( "cgcicc", "Declaration" );
  Flipper( Short );
  Flipper( Short );
  TCTouch.Validate( "db", "Flipping Short" );
  TCTouch.Validate( "db", "Flipping Short" );
  Flipper( Sharp );
  Flipper( Sharp );
  TCTouch.Validate( "db", "Flipping Sharp" );
  TCTouch.Validate( "db", "Flipping Sharp" );
  Flipper( Shock );
  Flipper( Shock );
  TCTouch.Validate( "jbdb", "Flipping Shock" );
  TCTouch.Validate( "jbdb", "Flipping Shock" );
  Tripper( Short );
  Tripper( Short );
  TCTouch.Validate( "e", "Tripping Short" );
  TCTouch.Validate( "e", "Tripping Short" );
  Tripper( Sharp );
  Tripper( Sharp );
  TCTouch.Validate( "e", "Tripping Sharp" );
  TCTouch.Validate( "e", "Tripping Sharp" );
  Tripper( Shock );
  Tripper( Shock );
  TCTouch.Validate( "kbfbe", "Tripping Shock" );
  TCTouch.Validate( "kbfbe", "Tripping Shock" );
  Restore( Short );
  Restore( Short );
  TCTouch.Validate( "fb", "Restoring Short" );
  TCTouch.Validate( "fb", "Restoring Short" );
  Restore( Sharp );
  Restore( Sharp );
  TCTouch.Validate( "fb", "Restoring Sharp" );
  TCTouch.Validate( "fb", "Restoring Sharp" );
  Restore( Shock );
  Restore( Shock );
  TCTouch.Validate( "lbfb", "Restoring Shock" );
  TCTouch.Validate( "lbfb", "Restoring Shock" );
  Failure( Short );
  Failure( Short );
  TCTouch.Validate( "a", "Shock Failing" );
  TCTouch.Validate( "a", "Shock Failing" );
  Failure( Sharp );
  Failure( Sharp );
  TCTouch.Validate( "a", "Shock Failing" );
  TCTouch.Validate( "a", "Shock Failing" );
  Failure( Shock );
  Failure( Shock );
  TCTouch.Validate( "mbafb", "Shock Failing" );
  TCTouch.Validate( "mbafb", "Shock Failing" );
  Report.Result;
  Report.Result;
end C393001;
end C393001;
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.