Browse Source

+ new test for lineinfo functionality

git-svn-id: trunk@20152 -
Tomas Hajny 13 years ago
parent
commit
b19d53a609
2 changed files with 31 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 30 0
      tests/test/units/lineinfo/tlininfo.pp

+ 1 - 0
.gitattributes

@@ -10936,6 +10936,7 @@ tests/test/units/fpcunit/testclasses.lpr svneol=native#text/plain
 tests/test/units/fpcunit/testcomps.pp svneol=native#text/plain
 tests/test/units/fpcunit/tstrutils.lpi svneol=native#text/plain
 tests/test/units/fpcunit/tstrutils.lpr svneol=native#text/plain
+tests/test/units/lineinfo/tlininfo.pp svneol=native#text/plain
 tests/test/units/math/tdivmod.pp svneol=native#text/plain
 tests/test/units/math/tmask.inc svneol=native#text/plain
 tests/test/units/math/tmask.pp svneol=native#text/plain

+ 30 - 0
tests/test/units/lineinfo/tlininfo.pp

@@ -0,0 +1,30 @@
+{%OPT=-gl -o}
+{%TARGET=os2,go32v2,win32}
+program tlininfo;
+
+{ $DEFINE DEBUG}
+
+procedure TESTPROC;
+begin
+ WriteLn ('TestProc running...');
+end;
+
+var
+ Success: boolean;
+ Func, Src: string;
+ Line: longint;
+
+begin
+ TestProc;
+ Success := GetLineInfo (PtrUInt (@TestProc) + 4, Func, Src, Line);
+{$IFDEF DEBUG}
+ WriteLn ('Source address = ', HexStr (@TestProc));
+ WriteLn ('Success = ', Success);
+ WriteLn ('Func = ', Func);
+ WriteLn ('Src = ', Src);
+ WriteLn ('Line = ', Line);
+{$ENDIF DEBUG}
+ if not (Success and (Copy (Src, Length (Src) - 11, 12) = 'tlininfo.pas') and
+                                       (Func = 'TESTPROC') and (Line = 8)) then
+  Halt (1)
+end.