cxa5a04.a
来自「linux下编程用 编译软件」· A 代码 · 共 435 行 · 第 1/2 页
A
435 行
Report.Failed("Unexpected exception raised by Function Cot " & "with specified cycle, when value of parameter " & "X is 0.0"); end; end if; -- Check that Constraint_Error is raised by the Cot Function with -- specified cycle, when the value of the parameter X is a multiple -- of the half cycle. if New_Float'Machine_Overflows = True then begin New_Float_Result := GEF.Cot (180.0, 360.0); Report.Failed("Constraint_Error not raised by Function Cot " & "with specified cycle, when value of parameter " & "X is a multiple of the half cycle (180.0, 360.0)"); Dont_Optimize_New_Float(New_Float_Result, 7); exception when Constraint_Error => null; -- OK, expected exception. when others => Report.Failed("Unexpected exception raised by Function Cot " & "with specified cycle, when value of parameter " & "X is a multiple of the half cycle" & " (180.0, 360.0)"); end; end if; if Float'Machine_Overflows = True then begin The_Result := EF.Cot (540.0, 360.0); Report.Failed("Constraint_Error not raised by Function Cot " & "with specified cycle, when value of parameter " & "X is a multiple of the half cycle (540.0, 360.0)"); Dont_Optimize_Float(The_Result, 8); exception when Constraint_Error => null; -- OK, expected exception. when others => Report.Failed("Unexpected exception raised by Function Cot " & "with specified cycle, when value of parameter " & "X is a multiple of the half cycle (540.0, 360.0)"); end; end if; --pwb-math -- Check that no exception occurs on computing the Cot with very--pwb-math -- large (positive and negative) input values.--pwb-math--pwb-math begin --pwb-math New_Float_Result := GEF.Cot (New_Float(FXA5A00.Large), 2.0*Pi);--pwb-math Dont_Optimize_New_Float(New_Float_Result, 9);--pwb-math exception--pwb-math when others =>--pwb-math Report.Failed("Unexpected exception on GEF.Cot with large " &--pwb-math "positive value");--pwb-math end;--pwb-math--pwb-math begin --pwb-math The_Result := EF.Cot (FXA5A00.Minus_Large, Cycle => 2.0*Pi);--pwb-math Dont_Optimize_Float(The_Result, 10);--pwb-math exception--pwb-math when others =>--pwb-math Report.Failed("Unexpected exception on EF.Cot with large " &--pwb-math "negative value");--pwb-math end;--pwb-math--pwb-math--pwb-math -- Check prescribed result from Cot function with Cycle parameter. --pwb-math--pwb-math if not FXA5A00.Result_Within_Range--pwb-math (GEF.Cot(New_Float(FXA5A00.Half_Pi), 2.0*Pi), 0.0, 0.001) or--pwb-math not FXA5A00.Result_Within_Range--pwb-math (EF.Cot(3.0*Pi/2.0, Cycle => 2.0*Pi), 0.0, 0.001)--pwb-math then--pwb-math Report.Failed("Incorrect result from Cot function with cycle " &--pwb-math "parameter, using a multiple of Pi/2 as the " &--pwb-math "input parameter");--pwb-math end if; -- Testing of Coth Function, both instantiated and pre-instantiated -- version. -- Check that no exception occurs on computing the Coth with very -- large (positive and negative) input values. begin The_Result := EF.Coth (FXA5A00.Large); if The_Result > 1.0 then Report.Failed("Result of Coth function with large positive " & "value greater than 1.0"); end if; exception when others => Report.Failed("Unexpected exception on EF.Coth with large " & "positive value"); end; begin The_Result := EF.Coth (FXA5A00.Minus_Large); if The_Result < -1.0 then Report.Failed("Result of Coth function with large negative " & "value less than -1.0"); end if; exception when others => Report.Failed("Unexpected exception on EF.Coth with large " & "negative value"); end; -- Check that Constraint_Error is raised by the Coth function, when -- the value of the parameter X is 0.0. if New_Float'Machine_Overflows = True then begin New_Float_Result := GEF.Coth (X => 0.0); Report.Failed("Constraint_Error not raised by the Coth function " & "when the value of parameter X is 0.0"); Dont_Optimize_New_Float(New_Float_Result, 11); exception when Constraint_Error => null; -- OK, expected exception. when others => Report.Failed("Unexpected exception raised by the Coth " & "function when the value of parameter X is 0.0"); end; end if; -- Testing of Arccoth Function, both instantiated and pre-instantiated -- version. -- Check that Constraint_Error is raised by the Arccoth function -- when the absolute value of the parameter X is 1.0. if New_Float'Machine_Overflows = True then begin New_Float_Result := GEF.Arccoth (X => 1.0); Report.Failed("Constraint_Error not raised by the Arccoth " & "function when the value of parameter X is 1.0"); Dont_Optimize_New_Float(New_Float_Result, 12); exception when Constraint_Error => null; -- OK, expected exception. when others => Report.Failed("Unexpected exception raised by the Arccoth " & "function when the value of parameter X is 1.0"); end; end if; if Float'Machine_Overflows = True then begin The_Result := EF.Arccoth (-1.0); Report.Failed("Constraint_Error not raised by the Arccoth " & "function when the value of parameter X is -1.0"); Dont_Optimize_Float(The_Result, 13); exception when Constraint_Error => null; -- OK, expected exception. when others => Report.Failed("Unexpected exception raised by the Arccoth " & "function when the value of parameter X is -1.0"); end; end if; -- Check that Argument_Error is raised by the Arccoth function when -- the absolute value of the parameter X is less than 1.0. begin New_Float_Result := GEF.Arccoth (X => New_Float(One_Minus_Delta)); Report.Failed("Argument_Error not raised by the Arccoth " & "function with parameter value less than 1.0"); Dont_Optimize_New_Float(New_Float_Result, 14); exception when Argument_Error => null; -- OK, expected exception. when others => Report.Failed("Unexpected exception raised by the Arccoth " & "function with parameter value less than 1.0"); end; begin The_Result := EF.Arccoth (X => FXA5A00.Minus_One_Plus_Delta); Report.Failed("Argument_Error not raised by the Arccoth function " & "with parameter value between 0.0 and -1.0"); Dont_Optimize_Float(The_Result, 15); exception when Argument_Error => null; -- OK, expected exception. when others => Report.Failed("Unexpected exception raised by the Arccoth " & "function with parameter value between 0.0 " & "and -1.0"); end; -- Check the results of the Arccoth function with various input -- parameters. if not (Result_Within_Range(GEF.Arccoth(1.01), 2.652, 0.01) and Result_Within_Range( EF.Arccoth(1.25), 1.099, 0.01) and Result_Within_Range(GEF.Arccoth(1.56), 0.760, 0.001) and Result_Within_Range( EF.Arccoth(1.97), 0.560, 0.001) and Result_Within_Range(GEF.Arccoth(2.40), 0.444, 0.001) and Result_Within_Range( EF.Arccoth(4.30), 0.237, 0.001) and Result_Within_Range(GEF.Arccoth(5.80), 0.174, 0.001) and Result_Within_Range( EF.Arccoth(7.00), 0.144, 0.001)) then Report.Failed("Incorrect result from Arccoth function with various " & "input parameters"); end if; exception when The_Error : others => Report.Failed ("The following exception was raised in the " & "Test_Block: " & Exception_Name(The_Error)); end Test_Block; Report.Result;end CXA5A04;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?