-- C371003.A
|
-- C371003.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 if a discriminant constraint depends on a discriminant,
|
-- Check that if a discriminant constraint depends on a discriminant,
|
-- the evaluation of the expressions in the constraint is deferred
|
-- the evaluation of the expressions in the constraint is deferred
|
-- until an object of the subtype is created. Check for cases of
|
-- until an object of the subtype is created. Check for cases of
|
-- records where the component containing the constraint is present
|
-- records where the component containing the constraint is present
|
-- in the subtype.
|
-- in the subtype.
|
--
|
--
|
-- TEST DESCRIPTION:
|
-- TEST DESCRIPTION:
|
-- This transition test defines record types with discriminant components
|
-- This transition test defines record types with discriminant components
|
-- which depend on the discriminants. The discriminants are calculated
|
-- which depend on the discriminants. The discriminants are calculated
|
-- by function calls. The test verifies that Constraint_Error is raised
|
-- by function calls. The test verifies that Constraint_Error is raised
|
-- during the object creations when values of discriminants are
|
-- during the object creations when values of discriminants are
|
-- incompatible with the subtypes. Also check for cases, where the
|
-- incompatible with the subtypes. Also check for cases, where the
|
-- component is absent.
|
-- component is absent.
|
--
|
--
|
-- Inspired by C37213E.ADA, C37213G.ADA, C37215E.ADA, and C37215G.ADA.
|
-- Inspired by C37213E.ADA, C37213G.ADA, C37215E.ADA, and C37215G.ADA.
|
--
|
--
|
--
|
--
|
-- CHANGE HISTORY:
|
-- CHANGE HISTORY:
|
-- 10 Apr 96 SAIC Initial version for ACVC 2.1.
|
-- 10 Apr 96 SAIC Initial version for ACVC 2.1.
|
-- 14 Jul 96 SAIC Modified test description. Added exception handler
|
-- 14 Jul 96 SAIC Modified test description. Added exception handler
|
-- for VObj_10 assignment.
|
-- for VObj_10 assignment.
|
-- 26 Oct 96 SAIC Added LM references.
|
-- 26 Oct 96 SAIC Added LM references.
|
--
|
--
|
--!
|
--!
|
|
|
with Report;
|
with Report;
|
|
|
procedure C371003 is
|
procedure C371003 is
|
|
|
subtype Small_Int is Integer range 1..10;
|
subtype Small_Int is Integer range 1..10;
|
|
|
type Rec_W_Disc (Disc1, Disc2 : Small_Int) is
|
type Rec_W_Disc (Disc1, Disc2 : Small_Int) is
|
record
|
record
|
Str1 : String (1 .. Disc1) := (others => '*');
|
Str1 : String (1 .. Disc1) := (others => '*');
|
Str2 : String (1 .. Disc2) := (others => '*');
|
Str2 : String (1 .. Disc2) := (others => '*');
|
end record;
|
end record;
|
|
|
type My_Array is array (Small_Int range <>) of Integer;
|
type My_Array is array (Small_Int range <>) of Integer;
|
|
|
Func1_Cons : Integer := 0;
|
Func1_Cons : Integer := 0;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
function Chk (Cons : Integer;
|
function Chk (Cons : Integer;
|
Value : Integer;
|
Value : Integer;
|
Message : String) return Boolean is
|
Message : String) return Boolean is
|
begin
|
begin
|
if Cons /= Value then
|
if Cons /= Value then
|
Report.Failed (Message & ": Func1_Cons is " &
|
Report.Failed (Message & ": Func1_Cons is " &
|
Integer'Image(Func1_Cons));
|
Integer'Image(Func1_Cons));
|
end if;
|
end if;
|
return True;
|
return True;
|
end Chk;
|
end Chk;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
function Func1 return Integer is
|
function Func1 return Integer is
|
begin
|
begin
|
Func1_Cons := Func1_Cons + Report.Ident_Int(1);
|
Func1_Cons := Func1_Cons + Report.Ident_Int(1);
|
return Func1_Cons;
|
return Func1_Cons;
|
end Func1;
|
end Func1;
|
|
|
|
|
begin
|
begin
|
Report.Test ("C371003", "Check that if a discriminant constraint " &
|
Report.Test ("C371003", "Check that if a discriminant constraint " &
|
"depends on a discriminant, the evaluation of the " &
|
"depends on a discriminant, the evaluation of the " &
|
"expressions in the constraint is deferred until " &
|
"expressions in the constraint is deferred until " &
|
"object declarations");
|
"object declarations");
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
declare
|
declare
|
type VRec_01 (D3 : Integer) is
|
type VRec_01 (D3 : Integer) is
|
record
|
record
|
case D3 is
|
case D3 is
|
when -5..10 =>
|
when -5..10 =>
|
C1 : Rec_W_Disc (D3, Func1); -- Func1 evaluated, value 1.
|
C1 : Rec_W_Disc (D3, Func1); -- Func1 evaluated, value 1.
|
when others =>
|
when others =>
|
C2 : Integer := Report.Ident_Int(0);
|
C2 : Integer := Report.Ident_Int(0);
|
end case;
|
end case;
|
end record;
|
end record;
|
|
|
Chk1 : Boolean := Chk (Func1_Cons, 1,
|
Chk1 : Boolean := Chk (Func1_Cons, 1,
|
"Func1 not evaluated for VRec_01");
|
"Func1 not evaluated for VRec_01");
|
|
|
VObj_1 : VRec_01(1); -- Func1 not evaluated again
|
VObj_1 : VRec_01(1); -- Func1 not evaluated again
|
VObj_2 : VRec_01(2); -- Func1 not evaluated again
|
VObj_2 : VRec_01(2); -- Func1 not evaluated again
|
|
|
Chk2 : Boolean := Chk (Func1_Cons, 1,
|
Chk2 : Boolean := Chk (Func1_Cons, 1,
|
"Func1 evaluated too many times");
|
"Func1 evaluated too many times");
|
|
|
begin
|
begin
|
if VObj_1 /= (D3 => 1,
|
if VObj_1 /= (D3 => 1,
|
C1 => (Disc1 => 1,
|
C1 => (Disc1 => 1,
|
Disc2 => 1,
|
Disc2 => 1,
|
Str1 => (others => '*'),
|
Str1 => (others => '*'),
|
Str2 => (others => '*'))) or
|
Str2 => (others => '*'))) or
|
VObj_2 /= (D3 => 2,
|
VObj_2 /= (D3 => 2,
|
C1 => (Disc1 => 2,
|
C1 => (Disc1 => 2,
|
Disc2 => 1,
|
Disc2 => 1,
|
Str1 => (others => '*'),
|
Str1 => (others => '*'),
|
Str2 => (others => '*'))) then
|
Str2 => (others => '*'))) then
|
Report.Failed ("VObj_1 & VObj_2 - Discriminant values not correct");
|
Report.Failed ("VObj_1 & VObj_2 - Discriminant values not correct");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
Func1_Cons := -11;
|
Func1_Cons := -11;
|
|
|
declare
|
declare
|
type VRec_Of_VRec_01 (D3 : Integer) is
|
type VRec_Of_VRec_01 (D3 : Integer) is
|
record
|
record
|
case D3 is
|
case D3 is
|
when -5..10 =>
|
when -5..10 =>
|
C1 : Rec_W_Disc (Func1, D3); -- Func1 evaluated, value -10.
|
C1 : Rec_W_Disc (Func1, D3); -- Func1 evaluated, value -10.
|
when others => -- Constraint_Error not raised.
|
when others => -- Constraint_Error not raised.
|
C2 : Integer := Report.Ident_Int(0);
|
C2 : Integer := Report.Ident_Int(0);
|
end case;
|
end case;
|
end record;
|
end record;
|
|
|
type VRec_Of_VRec_02 (D3 : Integer) is
|
type VRec_Of_VRec_02 (D3 : Integer) is
|
record
|
record
|
case D3 is
|
case D3 is
|
when -5..10 =>
|
when -5..10 =>
|
C1 : Rec_W_Disc (1, D3);
|
C1 : Rec_W_Disc (1, D3);
|
when others =>
|
when others =>
|
C2 : Integer := Report.Ident_Int(0);
|
C2 : Integer := Report.Ident_Int(0);
|
end case;
|
end case;
|
end record;
|
end record;
|
|
|
type VRec_Of_MyArr_01 (D3 : Integer) is
|
type VRec_Of_MyArr_01 (D3 : Integer) is
|
record
|
record
|
case D3 is
|
case D3 is
|
when -5..10 =>
|
when -5..10 =>
|
C1 : My_Array (Func1..D3); -- Func1 evaluated, value -9.
|
C1 : My_Array (Func1..D3); -- Func1 evaluated, value -9.
|
when others => -- Constraint_Error not raised.
|
when others => -- Constraint_Error not raised.
|
C2 : Integer := Report.Ident_Int(0);
|
C2 : Integer := Report.Ident_Int(0);
|
end case;
|
end case;
|
end record;
|
end record;
|
|
|
type VRec_Of_MyArr_02 (D3 : Integer) is
|
type VRec_Of_MyArr_02 (D3 : Integer) is
|
record
|
record
|
case D3 is
|
case D3 is
|
when -5..10 =>
|
when -5..10 =>
|
C1 : My_Array (D3..1);
|
C1 : My_Array (D3..1);
|
when others =>
|
when others =>
|
C2 : Integer := Report.Ident_Int(0);
|
C2 : Integer := Report.Ident_Int(0);
|
end case;
|
end case;
|
end record;
|
end record;
|
|
|
begin
|
begin
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is present.
|
-- Component containing the constraint is present.
|
begin
|
begin
|
declare
|
declare
|
VObj_3 : VRec_Of_VRec_01(1); -- Constraint_Error raised.
|
VObj_3 : VRec_Of_VRec_01(1); -- Constraint_Error raised.
|
begin
|
begin
|
Report.Failed ("VObj_3 - Constraint_Error should be raised");
|
Report.Failed ("VObj_3 - Constraint_Error should be raised");
|
if VObj_3 /= (1, (1, 1, others => (others => '*'))) then
|
if VObj_3 /= (1, (1, 1, others => (others => '*'))) then
|
Report.Comment ("VObj_3 - Shouldn't get here");
|
Report.Comment ("VObj_3 - Shouldn't get here");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error => -- Exception expected.
|
when Constraint_Error => -- Exception expected.
|
null;
|
null;
|
when others =>
|
when others =>
|
Report.Failed ("VObj_3 - unexpected exception raised");
|
Report.Failed ("VObj_3 - unexpected exception raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is present.
|
-- Component containing the constraint is present.
|
begin
|
begin
|
declare
|
declare
|
subtype Subtype_VRec is -- No Constraint_Error raised.
|
subtype Subtype_VRec is -- No Constraint_Error raised.
|
VRec_Of_VRec_01(Report.Ident_Int(1));
|
VRec_Of_VRec_01(Report.Ident_Int(1));
|
begin
|
begin
|
declare
|
declare
|
VObj_4 : Subtype_VRec; -- Constraint_Error raised.
|
VObj_4 : Subtype_VRec; -- Constraint_Error raised.
|
begin
|
begin
|
Report.Failed ("VObj_4 - Constraint_Error should be raised");
|
Report.Failed ("VObj_4 - Constraint_Error should be raised");
|
if VObj_4 /= (D3 => 1,
|
if VObj_4 /= (D3 => 1,
|
C1 => (Disc1 => 1,
|
C1 => (Disc1 => 1,
|
Disc2 => 1,
|
Disc2 => 1,
|
Str1 => (others => '*'),
|
Str1 => (others => '*'),
|
Str2 => (others => '*'))) then
|
Str2 => (others => '*'))) then
|
Report.Comment ("VObj_4 - Shouldn't get here");
|
Report.Comment ("VObj_4 - Shouldn't get here");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error => -- Exception expected.
|
when Constraint_Error => -- Exception expected.
|
null;
|
null;
|
when others =>
|
when others =>
|
Report.Failed ("VObj_4 - unexpected exception raised");
|
Report.Failed ("VObj_4 - unexpected exception raised");
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
Report.Failed ("Subtype_VRec - Constraint_Error raised");
|
Report.Failed ("Subtype_VRec - Constraint_Error raised");
|
when others =>
|
when others =>
|
Report.Failed ("Subtype_VRec - unexpected exception raised");
|
Report.Failed ("Subtype_VRec - unexpected exception raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is absent.
|
-- Component containing the constraint is absent.
|
begin
|
begin
|
declare
|
declare
|
type Arr is array (1..5) of
|
type Arr is array (1..5) of
|
VRec_Of_VRec_01(Report.Ident_Int(-6)); -- No Constraint_Error
|
VRec_Of_VRec_01(Report.Ident_Int(-6)); -- No Constraint_Error
|
VObj_5 : Arr; -- for either declaration.
|
VObj_5 : Arr; -- for either declaration.
|
|
|
begin
|
begin
|
if VObj_5 /= (1 .. 5 => (-6, 0)) then
|
if VObj_5 /= (1 .. 5 => (-6, 0)) then
|
Report.Comment ("VObj_5 - wrong values");
|
Report.Comment ("VObj_5 - wrong values");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
exception
|
exception
|
when others =>
|
when others =>
|
Report.Failed ("Arr - unexpected exception raised");
|
Report.Failed ("Arr - unexpected exception raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is present.
|
-- Component containing the constraint is present.
|
begin
|
begin
|
declare
|
declare
|
type Rec_Of_Rec_Of_MyArr is
|
type Rec_Of_Rec_Of_MyArr is
|
record
|
record
|
C1 : VRec_Of_MyArr_01(1); -- No Constraint_Error raised.
|
C1 : VRec_Of_MyArr_01(1); -- No Constraint_Error raised.
|
end record;
|
end record;
|
begin
|
begin
|
declare
|
declare
|
Obj_6 : Rec_Of_Rec_Of_MyArr; -- Constraint_Error raised.
|
Obj_6 : Rec_Of_Rec_Of_MyArr; -- Constraint_Error raised.
|
begin
|
begin
|
Report.Failed ("Obj_6 - Constraint_Error should be raised");
|
Report.Failed ("Obj_6 - Constraint_Error should be raised");
|
if Obj_6 /= (C1 => (1, (1, 1))) then
|
if Obj_6 /= (C1 => (1, (1, 1))) then
|
Report.Comment ("Obj_6 - Shouldn't get here");
|
Report.Comment ("Obj_6 - Shouldn't get here");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error => -- Exception expected.
|
when Constraint_Error => -- Exception expected.
|
null;
|
null;
|
when others =>
|
when others =>
|
Report.Failed ("Obj_6 - unexpected exception raised");
|
Report.Failed ("Obj_6 - unexpected exception raised");
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
Report.Failed ("Rec_Of_Rec_Of_MyArr - Constraint_Error raised");
|
Report.Failed ("Rec_Of_Rec_Of_MyArr - Constraint_Error raised");
|
when others =>
|
when others =>
|
Report.Failed ("Rec_Of_Rec_Of_MyArr - unexpected exception " &
|
Report.Failed ("Rec_Of_Rec_Of_MyArr - unexpected exception " &
|
"raised");
|
"raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is absent.
|
-- Component containing the constraint is absent.
|
begin
|
begin
|
declare
|
declare
|
type New_VRec_Arr is
|
type New_VRec_Arr is
|
new VRec_Of_MyArr_01(11); -- No Constraint_Error raised
|
new VRec_Of_MyArr_01(11); -- No Constraint_Error raised
|
Obj_7 : New_VRec_Arr; -- for either declaration.
|
Obj_7 : New_VRec_Arr; -- for either declaration.
|
|
|
begin
|
begin
|
if Obj_7 /= (11, 0) then
|
if Obj_7 /= (11, 0) then
|
Report.Failed ("Obj_7 - value incorrect");
|
Report.Failed ("Obj_7 - value incorrect");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
exception
|
exception
|
when others =>
|
when others =>
|
Report.Failed ("New_VRec_Arr - unexpected exception raised");
|
Report.Failed ("New_VRec_Arr - unexpected exception raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is present.
|
-- Component containing the constraint is present.
|
begin
|
begin
|
declare
|
declare
|
type New_VRec is new
|
type New_VRec is new
|
VRec_Of_VRec_02(Report.Ident_Int(0)); -- No Constraint_Error
|
VRec_Of_VRec_02(Report.Ident_Int(0)); -- No Constraint_Error
|
-- raised.
|
-- raised.
|
begin
|
begin
|
declare
|
declare
|
VObj_8 : New_VRec; -- Constraint_Error raised.
|
VObj_8 : New_VRec; -- Constraint_Error raised.
|
begin
|
begin
|
Report.Failed ("VObj_8 - Constraint_Error should be raised");
|
Report.Failed ("VObj_8 - Constraint_Error should be raised");
|
if VObj_8 /= (1, (1, 1, others => (others => '*'))) then
|
if VObj_8 /= (1, (1, 1, others => (others => '*'))) then
|
Report.Comment ("VObj_8 - Shouldn't get here");
|
Report.Comment ("VObj_8 - Shouldn't get here");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error => -- Exception expected.
|
when Constraint_Error => -- Exception expected.
|
null;
|
null;
|
when others =>
|
when others =>
|
Report.Failed ("VObj_8 - unexpected exception raised");
|
Report.Failed ("VObj_8 - unexpected exception raised");
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
Report.Failed ("New_VRec - Constraint_Error raised");
|
Report.Failed ("New_VRec - Constraint_Error raised");
|
when others =>
|
when others =>
|
Report.Failed ("New_VRec - unexpected exception raised");
|
Report.Failed ("New_VRec - unexpected exception raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is absent.
|
-- Component containing the constraint is absent.
|
begin
|
begin
|
declare
|
declare
|
subtype Sub_VRec is
|
subtype Sub_VRec is
|
VRec_Of_VRec_02(Report.Ident_Int(11)); -- No Constraint_Error
|
VRec_Of_VRec_02(Report.Ident_Int(11)); -- No Constraint_Error
|
VObj_9 : Sub_VRec; -- raised for either
|
VObj_9 : Sub_VRec; -- raised for either
|
-- declaration.
|
-- declaration.
|
begin
|
begin
|
if VObj_9 /= (11, 0) then
|
if VObj_9 /= (11, 0) then
|
Report.Comment ("VObj_9 - wrong values");
|
Report.Comment ("VObj_9 - wrong values");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
exception
|
exception
|
when others =>
|
when others =>
|
Report.Failed ("Sub_VRec - unexpected exception raised");
|
Report.Failed ("Sub_VRec - unexpected exception raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is present.
|
-- Component containing the constraint is present.
|
begin
|
begin
|
declare
|
declare
|
type Acc_VRec_01 is access
|
type Acc_VRec_01 is access
|
VRec_Of_VRec_02(Report.Ident_Int(0)); -- No Constraint_Error
|
VRec_Of_VRec_02(Report.Ident_Int(0)); -- No Constraint_Error
|
-- raised.
|
-- raised.
|
begin
|
begin
|
declare
|
declare
|
VObj_10 : Acc_VRec_01; -- No Constraint_Error
|
VObj_10 : Acc_VRec_01; -- No Constraint_Error
|
-- raised.
|
-- raised.
|
begin
|
begin
|
VObj_10 := new VRec_Of_VRec_02
|
VObj_10 := new VRec_Of_VRec_02
|
(Report.Ident_Int(0)); -- Constraint_Error
|
(Report.Ident_Int(0)); -- Constraint_Error
|
-- raised.
|
-- raised.
|
Report.Failed ("VObj_10 - Constraint_Error should be raised");
|
Report.Failed ("VObj_10 - Constraint_Error should be raised");
|
if VObj_10.all /= (1, (1, 1, others => (others => '*'))) then
|
if VObj_10.all /= (1, (1, 1, others => (others => '*'))) then
|
Report.Comment ("VObj_10 - Shouldn't get here");
|
Report.Comment ("VObj_10 - Shouldn't get here");
|
end if;
|
end if;
|
|
|
exception
|
exception
|
when Constraint_Error => -- Exception expected.
|
when Constraint_Error => -- Exception expected.
|
null;
|
null;
|
when others =>
|
when others =>
|
Report.Failed ("VObj_10 - unexpected exception raised");
|
Report.Failed ("VObj_10 - unexpected exception raised");
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
Report.Failed ("VObj_10 - Constraint_Error exception raised");
|
Report.Failed ("VObj_10 - Constraint_Error exception raised");
|
when others =>
|
when others =>
|
Report.Failed ("VObj_10 - unexpected exception raised at " &
|
Report.Failed ("VObj_10 - unexpected exception raised at " &
|
"declaration");
|
"declaration");
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
Report.Failed ("Acc_VRec_01 - Constraint_Error raised");
|
Report.Failed ("Acc_VRec_01 - Constraint_Error raised");
|
when others =>
|
when others =>
|
Report.Failed ("Acc_VRec_01 - unexpected exception raised");
|
Report.Failed ("Acc_VRec_01 - unexpected exception raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is absent.
|
-- Component containing the constraint is absent.
|
begin
|
begin
|
declare
|
declare
|
type Acc_VRec_02 is access
|
type Acc_VRec_02 is access
|
VRec_Of_VRec_02(11); -- No Constraint_Error
|
VRec_Of_VRec_02(11); -- No Constraint_Error
|
-- raised for either
|
-- raised for either
|
VObj_11 : Acc_VRec_02; -- declaration.
|
VObj_11 : Acc_VRec_02; -- declaration.
|
|
|
begin
|
begin
|
VObj_11 := new VRec_Of_VRec_02(11);
|
VObj_11 := new VRec_Of_VRec_02(11);
|
if VObj_11.all /= (11, 0) then
|
if VObj_11.all /= (11, 0) then
|
Report.Comment ("VObj_11 - wrong values");
|
Report.Comment ("VObj_11 - wrong values");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
exception
|
exception
|
when others =>
|
when others =>
|
Report.Failed ("Acc_VRec_02 - unexpected exception raised");
|
Report.Failed ("Acc_VRec_02 - unexpected exception raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is present.
|
-- Component containing the constraint is present.
|
begin
|
begin
|
declare
|
declare
|
type Acc_VRec_03 is access
|
type Acc_VRec_03 is access
|
VRec_Of_MyArr_02; -- No Constraint_Error
|
VRec_Of_MyArr_02; -- No Constraint_Error
|
-- raised for either
|
-- raised for either
|
VObj_12 : Acc_VRec_03; -- declaration.
|
VObj_12 : Acc_VRec_03; -- declaration.
|
begin
|
begin
|
VObj_12 := new VRec_Of_MyArr_02
|
VObj_12 := new VRec_Of_MyArr_02
|
(Report.Ident_Int(0)); -- Constraint_Error raised.
|
(Report.Ident_Int(0)); -- Constraint_Error raised.
|
|
|
Report.Failed ("VObj_12 - Constraint_Error should be raised");
|
Report.Failed ("VObj_12 - Constraint_Error should be raised");
|
if VObj_12.all /= (1, (1, 1)) then
|
if VObj_12.all /= (1, (1, 1)) then
|
Report.Comment ("VObj_12 - Shouldn't get here");
|
Report.Comment ("VObj_12 - Shouldn't get here");
|
end if;
|
end if;
|
|
|
exception
|
exception
|
when Constraint_Error => -- Exception expected.
|
when Constraint_Error => -- Exception expected.
|
null;
|
null;
|
when others =>
|
when others =>
|
Report.Failed ("VObj_12 - unexpected exception raised");
|
Report.Failed ("VObj_12 - unexpected exception raised");
|
end;
|
end;
|
|
|
exception
|
exception
|
when Constraint_Error =>
|
when Constraint_Error =>
|
Report.Failed ("Acc_VRec_03 - Constraint_Error raised");
|
Report.Failed ("Acc_VRec_03 - Constraint_Error raised");
|
when others =>
|
when others =>
|
Report.Failed ("Acc_VRec_03 - unexpected exception raised");
|
Report.Failed ("Acc_VRec_03 - unexpected exception raised");
|
end;
|
end;
|
|
|
---------------------------------------------------------
|
---------------------------------------------------------
|
-- Component containing the constraint is absent.
|
-- Component containing the constraint is absent.
|
begin
|
begin
|
declare
|
declare
|
type Acc_VRec_04 is access
|
type Acc_VRec_04 is access
|
VRec_Of_MyArr_02(11); -- No Constraint_Error
|
VRec_Of_MyArr_02(11); -- No Constraint_Error
|
-- raised for either
|
-- raised for either
|
VObj_13 : Acc_VRec_04; -- declaration.
|
VObj_13 : Acc_VRec_04; -- declaration.
|
|
|
begin
|
begin
|
VObj_13 := new VRec_Of_MyArr_02(11);
|
VObj_13 := new VRec_Of_MyArr_02(11);
|
if VObj_13.all /= (11, 0) then
|
if VObj_13.all /= (11, 0) then
|
Report.Comment ("VObj_13 - wrong values");
|
Report.Comment ("VObj_13 - wrong values");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
exception
|
exception
|
when others =>
|
when others =>
|
Report.Failed ("Acc_VRec_04 - unexpected exception raised");
|
Report.Failed ("Acc_VRec_04 - unexpected exception raised");
|
end;
|
end;
|
|
|
end;
|
end;
|
|
|
Report.Result;
|
Report.Result;
|
|
|
exception
|
exception
|
when others =>
|
when others =>
|
Report.Failed ("Discriminant value checked too soon");
|
Report.Failed ("Discriminant value checked too soon");
|
Report.Result;
|
Report.Result;
|
|
|
end C371003;
|
end C371003;
|
|
|