cxa5a07.a

来自「用于进行gcc测试」· A 代码 · 共 414 行 · 第 1/2 页

A
414
字号
      if GEF.Arctan(Y => 0.0)                     /= 0.0 or -- Default X value          EF.Arctan(Y => 0.0, X => FXA5A00.Large) /= 0.0 or--pwb-math: Next line: changed 2.0*Pi to 360.0         GEF.Arctan(0.0, 360.0)                  /= 0.0 or          EF.Arctan(0.0, FXA5A00.Small)           /= 0.0      then          Report.Failed("Incorrect results from the Arctan function when " &                       "provided a Y parameter value of 0.0 and various " &                       "positive X parameter values");      end if;      -- Check that the Arctan function provides correct results when provided      -- a variety of Y parameter values.        if not FXA5A00.Result_Within_Range(EF.Arctan(Pi),    1.26,  0.01)  or         not FXA5A00.Result_Within_Range(EF.Arctan(-Pi),  -1.26,  0.01)  or         not FXA5A00.Result_Within_Range(GEF.Arctan(1.0),  0.785, 0.001) or         not FXA5A00.Result_Within_Range(EF.Arctan(-1.0), -0.785, 0.001) or         not FXA5A00.Result_Within_Range(GEF.Arctan(0.25), 0.245, 0.001) or         not FXA5A00.Result_Within_Range(EF.Arctan(0.92),  0.744, 0.001)       then         Report.Failed("Incorrect results from the Arctan function when " &                       "provided a variety of Y parameter values");      end if;      -- Check the results of the Arctan function with specified cycle      -- parameter.      -- Check that the Arctan function with specified Cycle parameter       -- raises Argument_Error when the value of the Cycle parameter is zero      -- or negative.      begin         Float_Result := EF.Arctan(Y => Pi, Cycle => 0.0);  -- Default X value         Report.Failed("Argument_Error not raised by the Arctan function " &                       "with default X parameter value, when the Cycle "   &                       "parameter is 0.0");         Dont_Optimize_Float(Float_Result, 10);      exception         when Argument_Error => null;  -- OK, expected exception.         when others         =>            Report.Failed("Incorrect exception raised by the Arctan "      &                          "function with default X parameter value, when " &                          "provided a 0.0 cycle parameter value");      end;      begin         New_Float_Result := GEF.Arctan(Y => Pi, X => 1.0, Cycle => 0.0);         Report.Failed("Argument_Error not raised by the Arctan function " &                       "when the Cycle parameter is 0.0");         Dont_Optimize_New_Float(New_Float_Result, 11);      exception         when Argument_Error => null;  -- OK, expected exception.         when others         =>            Report.Failed("Incorrect exception raised by the Arctan "     &                          "function when provided a 0.0 cycle parameter " &                          "value");      end;      begin         Float_Result := EF.Arctan(Y => Pi, Cycle => -360.0);          Report.Failed("Argument_Error not raised by the Arctan function " &                       "with a default X parameter value, when the Cycle " &                       "parameter is -360.0");         Dont_Optimize_Float(Float_Result, 12);      exception         when Argument_Error => null;  -- OK, expected exception.         when others         =>            Report.Failed("Incorrect exception raised by the Arctan "        &                          "function with a default X parameter value, when " &                           "provided a -360.0 cycle parameter value");      end;      begin         New_Float_Result := GEF.Arctan(Y => Pi, X => 1.0, Cycle => -Pi);         Report.Failed("Argument_Error not raised by the Arctan function " &                       "when the Cycle parameter is -Pi");         Dont_Optimize_New_Float(New_Float_Result, 13);      exception         when Argument_Error => null;  -- OK, expected exception.         when others         =>            Report.Failed("Incorrect exception raised by the Arctan "     &                          "function when provided a -Pi cycle parameter " &                          "value");      end;      -- Check that no exception is raised by the Arctan function with       -- specified Cycle parameter, when provided large and small positive      -- or negative parameter values for both Y and X input parameters.       begin         Float_Result := EF.Arctan(Y     => -FXA5A00.Large,                                    X     => -FXA5A00.Large,--pwb-math: Next line: changed 2.0*Pi to 360.0                                   Cycle => 360.0);         Dont_Optimize_Float(Float_Result, 14);      exception         when others =>              Report.Failed("Exception raised when the Arctan function with " &                          "specified Cycle parameter, when provided large " &                           "negative X and Y parameter values");      end;      begin         New_Float_Result := GEF.Arctan(New_Float(FXA5A00.Large),                                         X     => New_Float(-FXA5A00.Small),--pwb-math: Next line: changed 2.0*Pi to 360.0                                        Cycle => 360.0);         Dont_Optimize_New_Float(New_Float_Result, 15);      exception         when others =>             Report.Failed("Exception raised when the Arctan function with "  &                          "specified Cycle parameter, when provided large "  &                           "positive Y parameter value and a small negative " &                          "X parameter value");      end;      begin         Float_Result := EF.Arctan(Y     => -FXA5A00.Small,                                    X     => -FXA5A00.Large,--pwb-math: Next line: changed 2.0*Pi to 360.0                                   Cycle => 360.0);         Dont_Optimize_Float(Float_Result, 16);      exception         when others =>             Report.Failed("Exception raised when the Arctan function with "  &                          "specified Cycle parameter, when provided large "  &                           "negative Y parameter value and a large negative " &                          "X parameter value");      end;      begin         New_Float_Result := GEF.Arctan(New_Float(FXA5A00.Small),                                         New_Float(FXA5A00.Large), --pwb-math: Next line: changed 2.0*Pi to 360.0                                        360.0);         Dont_Optimize_New_Float(New_Float_Result, 17);      exception         when others =>             Report.Failed("Exception raised when the Arctan function with " &                          "specified Cycle parameter, when provided a "     &                           "small negative Y parameter value and a large "   &                          "positive X parameter value");      end;      -- Check that the Arctan function with specified Cycle parameter       -- provides correct results when provided a variety of Y parameter      -- input values.--pwb-math      if not FXA5A00.Result_Within_Range(EF.Arctan(Pi,    Cycle => 2.0*Pi),--pwb-math                                         1.26, --pwb-math                                         0.01)                            or--pwb-math         not FXA5A00.Result_Within_Range(EF.Arctan(-Pi,   Cycle => 2.0*Pi),--pwb-math                                         -1.26,--pwb-math                                         0.01)                            or--pwb-math         not FXA5A00.Result_Within_Range(GEF.Arctan(1.0,  Cycle => 2.0*Pi),--pwb-math                                         0.785,--pwb-math                                         0.001)                           or--pwb-math         not FXA5A00.Result_Within_Range(EF.Arctan(-1.0,  Cycle => 2.0*Pi),--pwb-math                                         -0.785, --pwb-math                                         0.001)                           or--pwb-math         not FXA5A00.Result_Within_Range(GEF.Arctan(0.16, Cycle => 2.0*Pi),--pwb-math                                         0.159,--pwb-math                                         0.001)                           or--pwb-math         not FXA5A00.Result_Within_Range(EF.Arctan(1.0,   Cycle => 360.0),--pwb-math                                         45.0,--pwb-math                                         0.1)                             or--pwb-math         not FXA5A00.Result_Within_Range(GEF.Arctan(1.0,  Cycle => 100.0),--pwb-math                                         12.5,--pwb-math                                         0.1) --pwb-math  Next 12 lines are replacements for 21 commented lines above      if not FXA5A00.Result_Within_Range(GEF.Arctan(1.0,  Cycle => 2.0*180.0),                                         45.0,                                         0.001)                           or         not FXA5A00.Result_Within_Range(EF.Arctan(-1.0,  Cycle => 2.0*180.0),                                         -45.0,                                          0.001)                           or         not FXA5A00.Result_Within_Range(EF.Arctan(1.0,   Cycle => 360.0),                                         45.0,                                         0.1)                             or         not FXA5A00.Result_Within_Range(GEF.Arctan(1.0,  Cycle => 100.0),                                         12.5,                                         0.1)       then         Report.Failed("Incorrect results from the Arctan function with "   &                       "specified Cycle parameter when provided a variety " &                       "of Y parameter values");      end if;   exception      when others => Report.Failed ("Exception raised in Test_Block");   end Test_Block;   Report.Result;end CXA5A07;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?