git-svn-id: trunk@19642 -
This commit is contained in:
pierre 2011-11-16 13:17:42 +00:00
parent 7f7c665e64
commit b19cab9802
2 changed files with 44 additions and 0 deletions

1
.gitattributes vendored
View File

@ -11846,6 +11846,7 @@ tests/webtbs/tw1932.pp svneol=native#text/plain
tests/webtbs/tw19325.pp svneol=native#text/pascal
tests/webtbs/tw1935.pp svneol=native#text/plain
tests/webtbs/tw1936.pp svneol=native#text/plain
tests/webtbs/tw19368.pp svneol=native#text/pascal
tests/webtbs/tw1938.pp svneol=native#text/plain
tests/webtbs/tw1948.pp svneol=native#text/plain
tests/webtbs/tw1950.pp svneol=native#text/plain

43
tests/webtbs/tw19368.pp Normal file
View File

@ -0,0 +1,43 @@
program Test5_FloatToStr_2Times;
{$mode objfpc}{$H+}
uses
SysUtils, Math;
const
first_passed : boolean = false;
second_passed : boolean = false;
Procedure ExitProg;
begin
if first_passed <> second_passed then
begin
Writeln('Error ',ExitCode,' after first passed!');
end
else if (ExitCode<>0) then
begin
Writeln('Exit code: ',ExitCode);
if (ExitCode=217) and not first_passed then
begin
Writeln('FPU error appeared at first call to FloatToStr(NaN)');
Writeln('This is OK, it just means that sysutils.FloatToStr');
Writeln('doesn''t support NaNs.');
Writeln('Test considered successful.');
ExitCode:=0;
end;
end;
end;
var
s,s1: string;
begin
ExitProc:=@ExitProg;
Writeln('1: ',NaN);
Writeln('2: ',NaN);
Writeln('1 with FloatToStr: ',FloatToStr(NaN));
first_passed:=true;
Writeln('2 with FloatToStr: ',FloatToStr(NaN));
second_passed:=true;
end.