mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 05:29:22 +02:00
+ with the randseed set as in the test, the test fails on x86_64-linux, added so it won't be forgotten
git-svn-id: trunk@44599 -
This commit is contained in:
parent
0f06a7205b
commit
2f5d51436e
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -16835,6 +16835,7 @@ tests/webtbs/tw14236.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw1430.pp svneol=native#text/plain
|
tests/webtbs/tw1430.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw14307.pp svneol=native#text/plain
|
tests/webtbs/tw14307.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw14315.pp svneol=native#text/plain
|
tests/webtbs/tw14315.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw14315b.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw1433.pp svneol=native#text/plain
|
tests/webtbs/tw1433.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw14347.pp svneol=native#text/pascal
|
tests/webtbs/tw14347.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw14363.pp svneol=native#text/plain
|
tests/webtbs/tw14363.pp svneol=native#text/plain
|
||||||
|
46
tests/webtbs/tw14315b.pp
Normal file
46
tests/webtbs/tw14315b.pp
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
program Project1;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils;
|
||||||
|
|
||||||
|
function RandomRange(const low : longint;
|
||||||
|
const high : longint) : longint;
|
||||||
|
begin
|
||||||
|
if (high < low) then
|
||||||
|
result := high + random(low - high + 1)
|
||||||
|
else
|
||||||
|
Result := low + random(high - low + 1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure GetStats(out used: ptruint);
|
||||||
|
var
|
||||||
|
fpcHeapStatus : TFPCHeapStatus;
|
||||||
|
begin
|
||||||
|
fpcHeapStatus := GetFPCHeapStatus();
|
||||||
|
used:=fpcHeapStatus.CurrHeapUsed;
|
||||||
|
writeln(' heap status: cu=' +
|
||||||
|
IntToStr(fpcHeapStatus.CurrHeapUsed) + ', cs=' +
|
||||||
|
IntToStr(fpcHeapStatus.CurrHeapSize) + ', cf=' +
|
||||||
|
IntToStr(fpcHeapStatus.CurrHeapFree) + ', mu=' +
|
||||||
|
IntToStr(fpcHeapStatus.MaxHeapUsed) + ', ms=' +
|
||||||
|
IntToStr(fpcHeapStatus.MaxHeapSize));
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
i : integer;
|
||||||
|
a : array of byte;
|
||||||
|
u1, u2: ptruint;
|
||||||
|
begin
|
||||||
|
randseed:=1586103426;
|
||||||
|
writeln('randseed: ',randseed);
|
||||||
|
GetStats(u1);
|
||||||
|
for i := 0 to 50 do begin
|
||||||
|
SetLength(a, RandomRange(1024,1024*1024*15));
|
||||||
|
end;
|
||||||
|
SetLength(a, 0);
|
||||||
|
GetStats(u2);
|
||||||
|
if u1<>u2 then
|
||||||
|
halt(1);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user