Browse Source

* added testcase for bugrepport 14019 submitted by hennymcc

git-svn-id: trunk@13305 -
ivost 16 years ago
parent
commit
7772f8ccbf
2 changed files with 44 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 43 0
      tests/webtbs/tw14019.pp

+ 1 - 0
.gitattributes

@@ -9165,6 +9165,7 @@ tests/webtbs/tw1398.pp svneol=native#text/plain
 tests/webtbs/tw13984.pp svneol=native#text/plain
 tests/webtbs/tw13992a.pp svneol=native#text/plain
 tests/webtbs/tw1401.pp svneol=native#text/plain
+tests/webtbs/tw14019.pp svneol=native#text/plain
 tests/webtbs/tw1407.pp svneol=native#text/plain
 tests/webtbs/tw1408.pp svneol=native#text/plain
 tests/webtbs/tw1409.pp svneol=native#text/plain

+ 43 - 0
tests/webtbs/tw14019.pp

@@ -0,0 +1,43 @@
+{ Source provided for Free Pascal Bug Report 14019 }
+{ Submitted by "hennymcc" on  2009-06-21 }
+
+program tw14019;
+
+{$mode objfpc}
+
+type
+  ITest = interface
+    function SomeMethod(): ITest;
+    function GetValue(): Integer;
+  end;
+
+  TTest = class(TInterfacedObject, ITest)
+  public
+    procedure FreeInstance; override;
+    function SomeMethod(): ITest;
+    function GetValue(): Integer;
+  end;
+
+procedure TTest.FreeInstance;
+begin
+  FillChar(Pointer(Self)^, InstanceSize, 0);
+  inherited FreeInstance;
+end;
+
+function TTest.SomeMethod(): ITest;
+begin
+  Result := TTest.Create();
+end;
+
+function TTest.GetValue(): Integer;
+begin
+  Result := 0;
+end;
+
+var
+  t: ITest;
+begin
+  t := TTest.Create();
+  t.SomeMethod().SomeMethod().GetValue();
+end.
+