mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 01:39:27 +02:00
New test
git-svn-id: trunk@19642 -
This commit is contained in:
parent
7f7c665e64
commit
b19cab9802
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
43
tests/webtbs/tw19368.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user