mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 19:49:23 +02:00
+ new test for lineinfo functionality
git-svn-id: trunk@20152 -
This commit is contained in:
parent
aacc62fa0a
commit
b19d53a609
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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/testcomps.pp svneol=native#text/plain
|
||||||
tests/test/units/fpcunit/tstrutils.lpi 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/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/tdivmod.pp svneol=native#text/plain
|
||||||
tests/test/units/math/tmask.inc svneol=native#text/plain
|
tests/test/units/math/tmask.inc svneol=native#text/plain
|
||||||
tests/test/units/math/tmask.pp svneol=native#text/plain
|
tests/test/units/math/tmask.pp svneol=native#text/plain
|
||||||
|
30
tests/test/units/lineinfo/tlininfo.pp
Normal file
30
tests/test/units/lineinfo/tlininfo.pp
Normal file
@ -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.
|
Loading…
Reference in New Issue
Block a user