-- CXG1004.A
|
-- CXG1004.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 the specified exceptions are raised by the subprograms
|
-- Check that the specified exceptions are raised by the subprograms
|
-- defined in package Ada.Numerics.Generic_Complex_Elementary_Functions
|
-- defined in package Ada.Numerics.Generic_Complex_Elementary_Functions
|
-- given the prescribed input parameter values.
|
-- given the prescribed input parameter values.
|
--
|
--
|
-- TEST DESCRIPTION:
|
-- TEST DESCRIPTION:
|
-- This test checks that specific subprograms defined in the
|
-- This test checks that specific subprograms defined in the
|
-- package Ada.Numerics.Generic_Complex_Elementary_Functions raise the
|
-- package Ada.Numerics.Generic_Complex_Elementary_Functions raise the
|
-- exceptions Argument_Error and Constraint_Error when their input
|
-- exceptions Argument_Error and Constraint_Error when their input
|
-- parameter value are those specified as causing each exception.
|
-- parameter value are those specified as causing each exception.
|
-- In the case of Constraint_Error, the exception will be raised in
|
-- In the case of Constraint_Error, the exception will be raised in
|
-- each test case, provided that the value of the attribute
|
-- each test case, provided that the value of the attribute
|
-- 'Machine_Overflows (for the actual type of package
|
-- 'Machine_Overflows (for the actual type of package
|
-- Generic_Complex_Type) is True.
|
-- Generic_Complex_Type) is True.
|
--
|
--
|
-- APPLICABILITY CRITERIA:
|
-- APPLICABILITY CRITERIA:
|
-- This test only applies to implementations supporting the
|
-- This test only applies to implementations supporting the
|
-- numerics annex.
|
-- numerics annex.
|
--
|
--
|
--
|
--
|
-- CHANGE HISTORY:
|
-- CHANGE HISTORY:
|
-- 06 Dec 94 SAIC ACVC 2.0
|
-- 06 Dec 94 SAIC ACVC 2.0
|
-- 16 Nov 95 SAIC Corrected visibility problems for ACVC 2.0.1.
|
-- 16 Nov 95 SAIC Corrected visibility problems for ACVC 2.0.1.
|
-- 29 Sep 96 SAIC Incorporated reviewer comments.
|
-- 29 Sep 96 SAIC Incorporated reviewer comments.
|
-- 02 Jun 98 EDS Replace "_i" with "_One".
|
-- 02 Jun 98 EDS Replace "_i" with "_One".
|
--!
|
--!
|
|
|
with Ada.Numerics.Generic_Complex_Types;
|
with Ada.Numerics.Generic_Complex_Types;
|
with Ada.Numerics.Generic_Complex_Elementary_Functions;
|
with Ada.Numerics.Generic_Complex_Elementary_Functions;
|
with Report;
|
with Report;
|
|
|
procedure CXG1004 is
|
procedure CXG1004 is
|
begin
|
begin
|
|
|
Report.Test ("CXG1004", "Check that the specified exceptions are " &
|
Report.Test ("CXG1004", "Check that the specified exceptions are " &
|
"raised by the subprograms defined in package " &
|
"raised by the subprograms defined in package " &
|
"Ada.Numerics.Generic_Complex_Elementary_" &
|
"Ada.Numerics.Generic_Complex_Elementary_" &
|
"Functions given the prescribed input " &
|
"Functions given the prescribed input " &
|
"parameter values");
|
"parameter values");
|
|
|
Test_Block:
|
Test_Block:
|
declare
|
declare
|
|
|
type Real_Type is new Float;
|
type Real_Type is new Float;
|
|
|
TC_Overflows : Boolean := Real_Type'Machine_Overflows;
|
TC_Overflows : Boolean := Real_Type'Machine_Overflows;
|
|
|
package Complex_Pack is
|
package Complex_Pack is
|
new Ada.Numerics.Generic_Complex_Types(Real_Type);
|
new Ada.Numerics.Generic_Complex_Types(Real_Type);
|
|
|
package CEF is
|
package CEF is
|
new Ada.Numerics.Generic_Complex_Elementary_Functions(Complex_Pack);
|
new Ada.Numerics.Generic_Complex_Elementary_Functions(Complex_Pack);
|
|
|
use Ada.Numerics, Complex_Pack, CEF;
|
use Ada.Numerics, Complex_Pack, CEF;
|
|
|
Complex_Zero : constant Complex := Compose_From_Cartesian(0.0, 0.0);
|
Complex_Zero : constant Complex := Compose_From_Cartesian(0.0, 0.0);
|
Plus_One : constant Complex := Compose_From_Cartesian(1.0, 0.0);
|
Plus_One : constant Complex := Compose_From_Cartesian(1.0, 0.0);
|
Minus_One : constant Complex := Compose_From_Cartesian(-1.0, 0.0);
|
Minus_One : constant Complex := Compose_From_Cartesian(-1.0, 0.0);
|
Plus_i : constant Complex := Compose_From_Cartesian(i);
|
Plus_i : constant Complex := Compose_From_Cartesian(i);
|
Minus_i : constant Complex := Compose_From_Cartesian(-i);
|
Minus_i : constant Complex := Compose_From_Cartesian(-i);
|
|
|
Complex_Negative_Real : constant Complex :=
|
Complex_Negative_Real : constant Complex :=
|
Compose_From_Cartesian(-4.0, 2.0);
|
Compose_From_Cartesian(-4.0, 2.0);
|
Complex_Negative_Imaginary : constant Complex :=
|
Complex_Negative_Imaginary : constant Complex :=
|
Compose_From_Cartesian(3.0, -5.0);
|
Compose_From_Cartesian(3.0, -5.0);
|
|
|
TC_Complex : Complex;
|
TC_Complex : Complex;
|
|
|
|
|
-- This procedure is used in "Exception Raising" calls below in an
|
-- This procedure is used in "Exception Raising" calls below in an
|
-- attempt to avoid elimination of the subtest through optimization.
|
-- attempt to avoid elimination of the subtest through optimization.
|
|
|
procedure No_Optimize (The_Complex_Number : Complex) is
|
procedure No_Optimize (The_Complex_Number : Complex) is
|
begin
|
begin
|
Report.Comment("No Optimize: Should never be printed " &
|
Report.Comment("No Optimize: Should never be printed " &
|
Integer'Image(Integer(The_Complex_Number.Im)));
|
Integer'Image(Integer(The_Complex_Number.Im)));
|
end No_Optimize;
|
end No_Optimize;
|
|
|
|
|
begin
|
begin
|
|
|
-- Check that the exception Numerics.Argument_Error is raised by the
|
-- Check that the exception Numerics.Argument_Error is raised by the
|
-- exponentiation operator when the value of the left operand is zero,
|
-- exponentiation operator when the value of the left operand is zero,
|
-- and the real component of the exponent (or the exponent itself) is
|
-- and the real component of the exponent (or the exponent itself) is
|
-- zero.
|
-- zero.
|
|
|
begin
|
begin
|
TC_Complex := "**"(Left => Complex_Zero, Right => Complex_Zero);
|
TC_Complex := "**"(Left => Complex_Zero, Right => Complex_Zero);
|
Report.Failed("Argument_Error not raised by exponentiation " &
|
Report.Failed("Argument_Error not raised by exponentiation " &
|
"operator, left operand = complex zero, right " &
|
"operator, left operand = complex zero, right " &
|
"operand = complex zero");
|
"operand = complex zero");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Argument_Error => null; -- OK, expected exception.
|
when Argument_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised by exponentiation " &
|
Report.Failed("Incorrect exception raised by exponentiation " &
|
"operator, left operand = complex zero, right " &
|
"operator, left operand = complex zero, right " &
|
"operand = complex zero");
|
"operand = complex zero");
|
end;
|
end;
|
|
|
begin
|
begin
|
TC_Complex := Complex_Zero**0.0;
|
TC_Complex := Complex_Zero**0.0;
|
Report.Failed("Argument_Error not raised by exponentiation " &
|
Report.Failed("Argument_Error not raised by exponentiation " &
|
"operator, left operand = complex zero, right " &
|
"operator, left operand = complex zero, right " &
|
"operand = real zero");
|
"operand = real zero");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Argument_Error => null; -- OK, expected exception.
|
when Argument_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised by exponentiation " &
|
Report.Failed("Incorrect exception raised by exponentiation " &
|
"operator, left operand = complex zero, right " &
|
"operator, left operand = complex zero, right " &
|
"operand = real zero");
|
"operand = real zero");
|
end;
|
end;
|
|
|
|
|
begin
|
begin
|
TC_Complex := "**"(Left => 0.0, Right => Complex_Zero);
|
TC_Complex := "**"(Left => 0.0, Right => Complex_Zero);
|
Report.Failed("Argument_Error not raised by exponentiation " &
|
Report.Failed("Argument_Error not raised by exponentiation " &
|
"operator, left operand = real zero, right " &
|
"operator, left operand = real zero, right " &
|
"operand = complex zero");
|
"operand = complex zero");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Argument_Error => null; -- OK, expected exception.
|
when Argument_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised by exponentiation " &
|
Report.Failed("Incorrect exception raised by exponentiation " &
|
"operator, left operand = real zero, right " &
|
"operator, left operand = real zero, right " &
|
"operand = complex zero");
|
"operand = complex zero");
|
end;
|
end;
|
|
|
|
|
-- Check that the exception Constraint_Error is raised under the
|
-- Check that the exception Constraint_Error is raised under the
|
-- specified circumstances, provided that
|
-- specified circumstances, provided that
|
-- Complex_Types.Real'Machine_Overflows is True.
|
-- Complex_Types.Real'Machine_Overflows is True.
|
|
|
if TC_Overflows then
|
if TC_Overflows then
|
|
|
-- Raised by Log, when the value of the parameter X is zero.
|
-- Raised by Log, when the value of the parameter X is zero.
|
begin
|
begin
|
TC_Complex := Log (X => Complex_Zero);
|
TC_Complex := Log (X => Complex_Zero);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Log given parameter value of complex zero");
|
"Log given parameter value of complex zero");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Log given parameter value of complex zero");
|
"Log given parameter value of complex zero");
|
end;
|
end;
|
|
|
-- Raised by Cot, when the value of the parameter X is zero.
|
-- Raised by Cot, when the value of the parameter X is zero.
|
begin
|
begin
|
TC_Complex := Cot (X => Complex_Zero);
|
TC_Complex := Cot (X => Complex_Zero);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Cot given parameter value of complex zero");
|
"Cot given parameter value of complex zero");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Cot given parameter value of complex zero");
|
"Cot given parameter value of complex zero");
|
end;
|
end;
|
|
|
-- Raised by Coth, when the value of the parameter X is zero.
|
-- Raised by Coth, when the value of the parameter X is zero.
|
begin
|
begin
|
TC_Complex := Coth (Complex_Zero);
|
TC_Complex := Coth (Complex_Zero);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Coth given parameter value of complex zero");
|
"Coth given parameter value of complex zero");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Coth given parameter value of complex zero");
|
"Coth given parameter value of complex zero");
|
end;
|
end;
|
|
|
-- Raised by the exponentiation operator, when the value of the
|
-- Raised by the exponentiation operator, when the value of the
|
-- left operand is zero and the real component of the exponent
|
-- left operand is zero and the real component of the exponent
|
-- is negative.
|
-- is negative.
|
begin
|
begin
|
TC_Complex := Complex_Zero**Complex_Negative_Real;
|
TC_Complex := Complex_Zero**Complex_Negative_Real;
|
Report.Failed("Constraint_Error not raised when the " &
|
Report.Failed("Constraint_Error not raised when the " &
|
"exponentiation operator left operand is " &
|
"exponentiation operator left operand is " &
|
"complex zero, and the real component of " &
|
"complex zero, and the real component of " &
|
"the exponent is negative");
|
"the exponent is negative");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when the " &
|
Report.Failed("Incorrect exception raised when the " &
|
"exponentiation operator left operand is " &
|
"exponentiation operator left operand is " &
|
"complex zero, and the real component of " &
|
"complex zero, and the real component of " &
|
"the exponent is negative");
|
"the exponent is negative");
|
end;
|
end;
|
|
|
-- Raised by the exponentiation operator, when the value of the
|
-- Raised by the exponentiation operator, when the value of the
|
-- left operand is zero and the exponent itself (when it is of
|
-- left operand is zero and the exponent itself (when it is of
|
-- type real) is negative.
|
-- type real) is negative.
|
declare
|
declare
|
Negative_Exponent : constant Real_Type := -4.0;
|
Negative_Exponent : constant Real_Type := -4.0;
|
begin
|
begin
|
TC_Complex := Complex_Zero**Negative_Exponent;
|
TC_Complex := Complex_Zero**Negative_Exponent;
|
Report.Failed("Constraint_Error not raised when the " &
|
Report.Failed("Constraint_Error not raised when the " &
|
"exponentiation operator left operand is " &
|
"exponentiation operator left operand is " &
|
"complex zero, and the real exponent is " &
|
"complex zero, and the real exponent is " &
|
"negative");
|
"negative");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when the " &
|
Report.Failed("Incorrect exception raised when the " &
|
"exponentiation operator left operand is " &
|
"exponentiation operator left operand is " &
|
"complex zero, and the real exponent is " &
|
"complex zero, and the real exponent is " &
|
"negative");
|
"negative");
|
end;
|
end;
|
|
|
-- Raised by Arctan, when the value of the parameter is +i.
|
-- Raised by Arctan, when the value of the parameter is +i.
|
begin
|
begin
|
TC_Complex := Arctan (Plus_i);
|
TC_Complex := Arctan (Plus_i);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Arctan is given parameter value +i");
|
"Arctan is given parameter value +i");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Arctan is given parameter value +i");
|
"Arctan is given parameter value +i");
|
end;
|
end;
|
|
|
-- Raised by Arctan, when the value of the parameter is -i.
|
-- Raised by Arctan, when the value of the parameter is -i.
|
begin
|
begin
|
TC_Complex := Arctan (Minus_i);
|
TC_Complex := Arctan (Minus_i);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Arctan is given parameter value -i");
|
"Arctan is given parameter value -i");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Arctan is given parameter value -i");
|
"Arctan is given parameter value -i");
|
end;
|
end;
|
|
|
-- Raised by Arccot, when the value of the parameter is +i.
|
-- Raised by Arccot, when the value of the parameter is +i.
|
begin
|
begin
|
TC_Complex := Arccot (Plus_i);
|
TC_Complex := Arccot (Plus_i);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Arccot is given parameter value +i");
|
"Arccot is given parameter value +i");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Arccot is given parameter value +i");
|
"Arccot is given parameter value +i");
|
end;
|
end;
|
|
|
-- Raised by Arccot, when the value of the parameter is -i.
|
-- Raised by Arccot, when the value of the parameter is -i.
|
begin
|
begin
|
TC_Complex := Arccot (Minus_i);
|
TC_Complex := Arccot (Minus_i);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Arccot is given parameter value -i");
|
"Arccot is given parameter value -i");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Arccot is given parameter value -i");
|
"Arccot is given parameter value -i");
|
end;
|
end;
|
|
|
-- Raised by Arctanh, when the value of the parameter is +1.
|
-- Raised by Arctanh, when the value of the parameter is +1.
|
begin
|
begin
|
TC_Complex := Arctanh (Plus_One);
|
TC_Complex := Arctanh (Plus_One);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Arctanh is given parameter value +1");
|
"Arctanh is given parameter value +1");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Arctanh is given parameter value +1");
|
"Arctanh is given parameter value +1");
|
end;
|
end;
|
|
|
-- Raised by Arctanh, when the value of the parameter is -1.
|
-- Raised by Arctanh, when the value of the parameter is -1.
|
begin
|
begin
|
TC_Complex := Arctanh (Minus_One);
|
TC_Complex := Arctanh (Minus_One);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Arctanh is given parameter value -1");
|
"Arctanh is given parameter value -1");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Arctanh is given parameter value -1");
|
"Arctanh is given parameter value -1");
|
end;
|
end;
|
|
|
-- Raised by Arccoth, when the value of the parameter is +1.
|
-- Raised by Arccoth, when the value of the parameter is +1.
|
begin
|
begin
|
TC_Complex := Arccoth (Plus_One);
|
TC_Complex := Arccoth (Plus_One);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Arccoth is given parameter value +1");
|
"Arccoth is given parameter value +1");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Arccoth is given parameter value +1");
|
"Arccoth is given parameter value +1");
|
end;
|
end;
|
|
|
-- Raised by Arccoth, when the value of the parameter is -1.
|
-- Raised by Arccoth, when the value of the parameter is -1.
|
begin
|
begin
|
TC_Complex := Arccoth (Minus_One);
|
TC_Complex := Arccoth (Minus_One);
|
Report.Failed("Constraint_Error not raised when Function " &
|
Report.Failed("Constraint_Error not raised when Function " &
|
"Arccoth is given parameter value -1");
|
"Arccoth is given parameter value -1");
|
No_Optimize(TC_Complex);
|
No_Optimize(TC_Complex);
|
exception
|
exception
|
when Constraint_Error => null; -- OK, expected exception.
|
when Constraint_Error => null; -- OK, expected exception.
|
when others =>
|
when others =>
|
Report.Failed("Incorrect exception raised when Function " &
|
Report.Failed("Incorrect exception raised when Function " &
|
"Arccoth is given parameter value -1");
|
"Arccoth is given parameter value -1");
|
end;
|
end;
|
|
|
else
|
else
|
Report.Comment
|
Report.Comment
|
("Attribute Complex_Pack.Real'Machine_Overflows is False; " &
|
("Attribute Complex_Pack.Real'Machine_Overflows is False; " &
|
"evaluation of the complex elementary functions under " &
|
"evaluation of the complex elementary functions under " &
|
"specified circumstances was not performed");
|
"specified circumstances was not performed");
|
end if;
|
end if;
|
|
|
|
|
exception
|
exception
|
when others =>
|
when others =>
|
Report.Failed ("Unexpected exception raised in Test_Block");
|
Report.Failed ("Unexpected exception raised in Test_Block");
|
end Test_Block;
|
end Test_Block;
|
|
|
Report.Result;
|
Report.Result;
|
|
|
end CXG1004;
|
end CXG1004;
|
|
|