FPC fix
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="4">
|
||||
<Exceptions Count="5">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
@@ -79,6 +79,9 @@
|
||||
<Item4>
|
||||
<Name Value="EReadError"/>
|
||||
</Item4>
|
||||
<Item5>
|
||||
<Name Value="RunError(101)"/>
|
||||
</Item5>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
<Filename Value="fpcunitproject1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<EditorIndex Value="-1"/>
|
||||
<CursorPos X="44" Y="21"/>
|
||||
<UsageCount Value="192"/>
|
||||
<CursorPos Y="23"/>
|
||||
<UsageCount Value="194"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="TestCase1"/>
|
||||
<TopLine Value="21"/>
|
||||
<CursorPos Y="42"/>
|
||||
<UsageCount Value="192"/>
|
||||
<TopLine Value="15"/>
|
||||
<CursorPos X="50" Y="28"/>
|
||||
<UsageCount Value="194"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
@@ -26,8 +26,9 @@
|
||||
<IsPartOfProject Value="True"/>
|
||||
<IsVisibleTab Value="True"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<CursorPos X="3" Y="6"/>
|
||||
<UsageCount Value="192"/>
|
||||
<TopLine Value="7"/>
|
||||
<CursorPos X="35" Y="19"/>
|
||||
<UsageCount Value="194"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
@@ -40,124 +41,124 @@
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="41" TopLine="21"/>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="35" Column="11" TopLine="21"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="42" TopLine="21"/>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="214" Column="38" TopLine="200"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="43" TopLine="21"/>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="21" Column="7" TopLine="7"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="402" TopLine="381"/>
|
||||
<Caret Line="182" Column="40" TopLine="178"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="34" Column="37" TopLine="27"/>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="53" Column="35" TopLine="40"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="292" TopLine="278"/>
|
||||
<Caret Line="214" Column="38" TopLine="191"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="39" TopLine="27"/>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="13" Column="15"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="40" TopLine="27"/>
|
||||
<Caret Line="8" Column="31"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="41" TopLine="27"/>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="19" Column="38"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="402" TopLine="381"/>
|
||||
<Caret Line="319" Column="28" TopLine="298"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="28" Column="85" TopLine="27"/>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="13" Column="49"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="292" TopLine="278"/>
|
||||
<Caret Line="34" Column="38" TopLine="10"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="39" TopLine="27"/>
|
||||
<Caret Line="29" TopLine="4"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="40" TopLine="27"/>
|
||||
<Caret Line="41" Column="51" TopLine="28"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="41" TopLine="27"/>
|
||||
<Caret Line="48" Column="53" TopLine="9"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="402" TopLine="381"/>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="19" Column="11" TopLine="5"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="37" Column="31" TopLine="27"/>
|
||||
<Caret Line="48" Column="58" TopLine="34"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="292" TopLine="278"/>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="17" Column="26" TopLine="5"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="39" TopLine="27"/>
|
||||
<Caret Line="50" Column="58" TopLine="35"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="40" TopLine="27"/>
|
||||
<Caret Line="48" Column="63" TopLine="24"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="41" TopLine="27"/>
|
||||
<Caret Line="19" Column="11" TopLine="5"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="402" TopLine="381"/>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="48" Column="59" TopLine="33"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="212" Column="33" TopLine="196"/>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="21" TopLine="6"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="216" TopLine="196"/>
|
||||
<Caret Line="25" Column="27" TopLine="13"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="217" TopLine="196"/>
|
||||
<Caret Line="32" Column="57" TopLine="11"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="390" Column="79" TopLine="381"/>
|
||||
<Caret Line="328" Column="7" TopLine="305"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="216" TopLine="203"/>
|
||||
<Caret Line="317" Column="25" TopLine="315"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="217" TopLine="203"/>
|
||||
<Filename Value="testcase1.pas"/>
|
||||
<Caret Line="28" Column="50" TopLine="15"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="390" Column="81" TopLine="381"/>
|
||||
<Caret Line="21" Column="7" TopLine="7"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="..\AG.Logs.pas"/>
|
||||
<Caret Line="217" TopLine="203"/>
|
||||
<Caret Line="64" Column="35" TopLine="50"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
</ProjectSession>
|
||||
|
||||
@@ -5,7 +5,7 @@ unit TestCase1;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, fpcunit, testutils, testregistry, AG.Logs;
|
||||
Classes, SysUtils, fpcunit, testutils, testregistry, AG.Logs{$IFDEF MSWINDOWS},Windows{$ENDIF};
|
||||
|
||||
type
|
||||
|
||||
@@ -16,6 +16,11 @@ type
|
||||
|
||||
implementation
|
||||
|
||||
procedure Test(s:string);
|
||||
begin
|
||||
Write(s);
|
||||
end;
|
||||
|
||||
procedure TTestCase1.TestHookUp;
|
||||
var
|
||||
MultiLog:TAGLog;
|
||||
@@ -26,10 +31,10 @@ MultiLog:=TAGMultiLog.Create(nil);
|
||||
(MultiLog as TAGMultiLog).Logs.Add(TAGNullLog.Create());
|
||||
(MultiLog as TAGMultiLog).Logs.Add(TAGDiskLog.Create('test.log'));
|
||||
(MultiLog as TAGMultiLog).Logs.Add(TAGRamLog.Create());
|
||||
{$IFNDEF MSWINDOWS}(MultiLog as TAGMultiLog).Logs.Add(TAGCommandLineLog.Create(GetStdHandle(STD_OUTPUT_HANDLE))){$ENDIF};
|
||||
{$IFDEF MSWINDOWS}(MultiLog as TAGMultiLog).Logs.Add(TAGCommandLineLog.Create(GetStdHandle(STD_OUTPUT_HANDLE))){$ENDIF};
|
||||
Stream:=nil;
|
||||
try
|
||||
Stream:=TFileStream.Create('test2.log',fmOpenRead);
|
||||
Stream:=TFileStream.Create('test2.log',fmOpenRead+fmShareDenyNone);
|
||||
SetLength(s,Stream.Size);
|
||||
Stream.Read(s[0],Stream.Size);
|
||||
except
|
||||
@@ -40,13 +45,11 @@ Stream:=TFileStream.Create('test2.log',fmCreate+fmOpenReadWrite+fmShareDenyWrite
|
||||
Stream.Write(s[0],Length(s));
|
||||
(MultiLog as TAGMultiLog).Logs.Add(TAGStreamLog.Create(Stream));
|
||||
SetLength(s,0);
|
||||
{(MultiLog as TAGMultiLog).Logs.Add(TAGCallBackLog.Create(procedure(s:string)
|
||||
begin
|
||||
Self.WriteLn(s);
|
||||
end));}
|
||||
(MultiLog as TAGMultiLog).Logs.Add(TAGCallBackLog.Create(@Test));
|
||||
MultiLog.Write('Str Test');
|
||||
MultiLog.Write('Str+Object Test',self);
|
||||
FreeAndNil(MultiLog);
|
||||
|
||||
end;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user