* set HaltOnNotReleased to true in all testss using heaptrc so

they'll exit with an error code in case of a memory leak

git-svn-id: trunk@8350 -
This commit is contained in:
Jonas Maebe 2007-09-01 20:36:04 +00:00
parent 21abdd2f4e
commit 31550b0153
10 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,7 @@
{ %OPT=-gh } { %OPT=-gh }
{ The only problem is that we don't really get a { The only problem is that we don't really get a
non zero exitcode if some memory is not freed PM } non zero exitcode if some memory is not freed PM }
{ now we do, thanks to a patch of yours several years later :) }
{ Source provided for Free Pascal Bug Report 1433 } { Source provided for Free Pascal Bug Report 1433 }
{ Submitted by "Aleksey V. Vaneev" on 2001-03-10 } { Submitted by "Aleksey V. Vaneev" on 2001-03-10 }
{ e-mail: picoder@sbis.komi.ru } { e-mail: picoder@sbis.komi.ru }
@ -29,6 +30,7 @@ begin
end; end;
begin begin
HaltOnNotReleased := true;
ExitTest1; ExitTest1;
ExitTest2; ExitTest2;
end. end.

View File

@ -19,6 +19,7 @@ end;
var var
ar1: integerarty; ar1: integerarty;
begin begin
HaltOnNotReleased := true;
ar1:= nil; ar1:= nil;
proc(ar1); // checkpointer error (nil!) proc(ar1); // checkpointer error (nil!)
end. end.

View File

@ -51,5 +51,6 @@ begin
end; end;
begin begin
HaltOnNotReleased := true;
TestLeak; TestLeak;
end. end.

View File

@ -9,5 +9,6 @@ uses
Classes; Classes;
begin begin
HaltOnNotReleased := true;
writeln('abc'); writeln('abc');
end. end.

View File

@ -5,6 +5,7 @@ uses sysutils;
var ps : pstring; var ps : pstring;
begin begin
HaltOnNotReleased := true;
ps:=newstr('TEST'); ps:=newstr('TEST');
writeln(ps^); writeln(ps^);
disposestr(ps); disposestr(ps);

View File

@ -37,6 +37,7 @@ begin
end; end;
begin begin
HaltOnNotReleased := true;
testproc; testproc;
writeln('refcount b 0: ',pinteger(pchar(pointer(ar2[0].stack)-8))^); writeln('refcount b 0: ',pinteger(pchar(pointer(ar2[0].stack)-8))^);
writeln('refcount b 1: ',pinteger(pchar(pointer(ar2[1].stack)-8))^); writeln('refcount b 1: ',pinteger(pchar(pointer(ar2[1].stack)-8))^);

View File

@ -7,6 +7,7 @@ program project1;
var var
po1,po2: pointer; po1,po2: pointer;
begin begin
HaltOnNotReleased := true;
getmem(po1,500); getmem(po1,500);
getmem(po2,500); getmem(po2,500);
reallocmem(po1,400); reallocmem(po1,400);

View File

@ -11,6 +11,7 @@ uses
var var
CheckThread : TCheckConnThread; CheckThread : TCheckConnThread;
begin begin
HaltOnNotReleased := true;
CheckThread := TCheckConnThread.Create(false); CheckThread := TCheckConnThread.Create(false);
CheckThread.Terminate; CheckThread.Terminate;
CheckThread.Waitfor; CheckThread.Waitfor;

View File

@ -9,5 +9,6 @@ end;
begin begin
HaltOnNotReleased := true;
TLResourceListAdd(['Value1']); TLResourceListAdd(['Value1']);
end. end.

View File

@ -9,6 +9,7 @@ constructor o.init; begin end;
var o1 : ^o; var o1 : ^o;
begin begin
HaltOnNotReleased := true;;
New(o1,init); New(o1,init);
// New(o1); o1^.init; <- no error // New(o1); o1^.init; <- no error
dispose(o1); dispose(o1);