|
From: Веселин Г. <us...@ab...> - 2015-06-28 08:11:28
|
Hi,
I am using DUnit 9.3.0 for a legacy Delphi 7 application. I use primarily TextTestRunner to run the tests. I also use FastMM4 and I noticed memory leaks. These leaks do not happen when I use GUITestRunner.
I am not sure if this is due to a bug in DUnit or maybe it is some configuration problem.
To reproduce this behavior I created a very simple Delphi 7 project with just one unit:
program FFLeak;
{$APPTYPE CONSOLE}
uses
FastMM4,
TestFramework,
TextTestRunner,
uBasicTest in 'uBasicTest.pas';
begin
TextTestRunner.RunTest(TBasicTest.Suite);
end.
{****}
unit uBasicTest;
interface
uses
TestFramework;
type
TBasicTest = class (TTestCase)
published
procedure BasicTestProc;
end;
implementation
{ TBasicTest }
procedure TBasicTest.BasicTestProc;
begin
// dummy procedure
end;
end.
When I run this program, FastMM reports the following:
This application has leaked memory. The small block leaks are (excluding expected leaks registered by pointer):
13 - 20 bytes: TStatusToResultAdapter x 1, TList x 4, TInterfaceList x 2, AnsiString x 1, Unknown x 2
21 - 36 bytes: TThreadList x 2, AnsiString x 1
37 - 52 bytes: TTextTestListener x 1
53 - 68 bytes: TTestResult x 1
85 - 100 bytes: TTestSuite x 1
101 - 116 bytes: TBasicTest x 1
What can be the reason for this? Where should I look for a problem? Or is it a known behavior?
It doesn't seem to be a problem with how FastMM is configured, because I also ran my tests without it and I could see the test program indeed started to consume more and more memory.
|