You've already forked lazarus-ccr
Apache module extension to be a dll/so hosting env
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@278 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -22,7 +22,8 @@ uses
|
||||
TestFrameWork,
|
||||
{$ENDIF}
|
||||
TypInfo,
|
||||
base_service_intf, server_service_intf;
|
||||
base_service_intf, server_service_intf,
|
||||
library_imp_utils;
|
||||
|
||||
type
|
||||
|
||||
@ -102,7 +103,24 @@ type
|
||||
published
|
||||
procedure POOLED_Discard();
|
||||
end;
|
||||
|
||||
{ TwstModuleNotLoad }
|
||||
|
||||
TwstModuleNotLoad = class(TwstModule,IInterface,IwstModule)
|
||||
protected
|
||||
procedure Load(const ADoLoad : Boolean);override;
|
||||
end;
|
||||
|
||||
{ TTest_TwstModuleManager }
|
||||
|
||||
TTest_TwstModuleManager = class(TTestCase)
|
||||
published
|
||||
function Get(const AFileName : string):IwstModule;
|
||||
procedure Clear();
|
||||
function GetCount() : PtrInt;
|
||||
function GetItem(const AIndex : PtrInt) : IwstModule;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TTestClass }
|
||||
@ -585,19 +603,140 @@ begin
|
||||
CheckEquals(TSimpleFactoryItem_B,b.GetItemClass());
|
||||
end;
|
||||
|
||||
{ TwstModuleNotLoad }
|
||||
|
||||
procedure TwstModuleNotLoad.Load(const ADoLoad: Boolean);
|
||||
begin
|
||||
//;
|
||||
end;
|
||||
|
||||
{ TTest_TwstModuleManager }
|
||||
|
||||
function TTest_TwstModuleManager.Get(const AFileName: string): IwstModule;
|
||||
const C = 10;
|
||||
var
|
||||
locObj : IwstModuleManager;
|
||||
locModule : IwstModule;
|
||||
i, j, k: Integer;
|
||||
ok : Boolean;
|
||||
locName : string;
|
||||
begin
|
||||
locObj := TwstModuleManager.Create(TwstModuleNotLoad);
|
||||
|
||||
for i := 0 to Pred(C) do begin
|
||||
locObj.Get(Format('lib_%d',[i]));
|
||||
end;
|
||||
|
||||
for i := 0 to Pred(C) do begin
|
||||
ok := False;
|
||||
locName := Format('lib_%d',[i]);
|
||||
for j := 0 to Pred(locObj.GetCount()) do begin
|
||||
locModule := locObj.GetItem(j);
|
||||
if AnsiSameText(locName, locModule.GetFileName()) then begin
|
||||
ok := True;
|
||||
k := j + 1;
|
||||
Break;
|
||||
end;
|
||||
end;
|
||||
Check(ok);
|
||||
for j := k to Pred(locObj.GetCount()) do begin
|
||||
locModule := locObj.GetItem(j);
|
||||
if AnsiSameText(locName, locModule.GetFileName()) then begin
|
||||
Check(False,'Duplicated items : ' + locName);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTest_TwstModuleManager.Clear();
|
||||
const C = 12;
|
||||
var
|
||||
locObj : IwstModuleManager;
|
||||
i : Integer;
|
||||
begin
|
||||
locObj := TwstModuleManager.Create(TwstModuleNotLoad);
|
||||
locObj.Clear();
|
||||
CheckEquals(0,locObj.GetCount());
|
||||
for i := 0 to Pred(C) do begin
|
||||
locObj.Get(Format('lib_%d',[i]));
|
||||
end;
|
||||
CheckEquals(C,locObj.GetCount());
|
||||
locObj.Clear();
|
||||
CheckEquals(0,locObj.GetCount());
|
||||
end;
|
||||
|
||||
function TTest_TwstModuleManager.GetCount(): PtrInt;
|
||||
const C = 10;
|
||||
var
|
||||
locObj : IwstModuleManager;
|
||||
i : Integer;
|
||||
begin
|
||||
locObj := TwstModuleManager.Create(TwstModuleNotLoad);
|
||||
CheckEquals(0,locObj.GetCount());
|
||||
CheckEquals(0,locObj.GetCount());
|
||||
for i := 0 to Pred(C) do begin
|
||||
CheckEquals(i,locObj.GetCount(),'before Add');
|
||||
locObj.Get(Format('lib_%d',[i]));
|
||||
CheckEquals(i + 1,locObj.GetCount(),'after Add');
|
||||
end;
|
||||
CheckEquals(C,locObj.GetCount());
|
||||
end;
|
||||
|
||||
function TTest_TwstModuleManager.GetItem(const AIndex: PtrInt): IwstModule;
|
||||
const C = 10;
|
||||
var
|
||||
locObj : IwstModuleManager;
|
||||
locModule : IwstModule;
|
||||
i : Integer;
|
||||
ok : Boolean;
|
||||
begin
|
||||
locObj := TwstModuleManager.Create(TwstModuleNotLoad);
|
||||
ok := False;
|
||||
try
|
||||
locObj.GetItem(0);
|
||||
except
|
||||
on e : Exception do begin
|
||||
ok := True;
|
||||
end;
|
||||
end;
|
||||
Check(ok);
|
||||
|
||||
ok := False;
|
||||
try
|
||||
locObj.GetItem(1);
|
||||
except
|
||||
on e : Exception do begin
|
||||
ok := True;
|
||||
end;
|
||||
end;
|
||||
Check(ok);
|
||||
|
||||
for i := 0 to Pred(C) do begin
|
||||
locObj.Get(Format('lib_%d',[i]));
|
||||
end;
|
||||
|
||||
for i := 0 to Pred(C) do begin
|
||||
locModule := locObj.GetItem(i);
|
||||
CheckEquals(Format('lib_%d',[i]), locModule.GetFileName());
|
||||
end;
|
||||
|
||||
ok := False;
|
||||
try
|
||||
locObj.GetItem(C + 1);
|
||||
except
|
||||
on e : Exception do begin
|
||||
ok := True;
|
||||
end;
|
||||
end;
|
||||
Check(ok);
|
||||
end;
|
||||
|
||||
initialization
|
||||
{$IFDEF FPC}
|
||||
RegisterTest(TTest_TIntfPool);
|
||||
RegisterTest(TTest_TSimpleItemFactoryEx);
|
||||
RegisterTest(TTest_TImplementationFactory);
|
||||
RegisterTest(TTest_TIntfPoolItem);
|
||||
RegisterTest(TTest_TImplementationFactory);
|
||||
{$ELSE}
|
||||
RegisterTest(TTest_TIntfPool.Suite);
|
||||
RegisterTest(TTest_TSimpleItemFactoryEx.Suite);
|
||||
RegisterTest(TTest_TImplementationFactory.Suite);
|
||||
RegisterTest(TTest_TIntfPoolItem.Suite);
|
||||
RegisterTest(TTest_TImplementationFactory.Suite);
|
||||
{$ENDIF}
|
||||
RegisterTest('Utilities',TTest_TIntfPool.Suite);
|
||||
RegisterTest('Utilities',TTest_TSimpleItemFactoryEx.Suite);
|
||||
RegisterTest('Utilities',TTest_TImplementationFactory.Suite);
|
||||
RegisterTest('Utilities',TTest_TIntfPoolItem.Suite);
|
||||
RegisterTest('Utilities',TTest_TImplementationFactory.Suite);
|
||||
RegisterTest('Utilities',TTest_TwstModuleManager.Suite);
|
||||
|
||||
end.
|
||||
|
@ -7,7 +7,7 @@
|
||||
<MainUnit Value="0"/>
|
||||
<IconPath Value="./"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
<ActiveEditorIndexAtStart Value="1"/>
|
||||
<ActiveEditorIndexAtStart Value="16"/>
|
||||
</General>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
@ -27,7 +27,7 @@
|
||||
<PackageName Value="FPCUnitTestRunner"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="72">
|
||||
<Units Count="74">
|
||||
<Unit0>
|
||||
<Filename Value="wst_test_suite.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -251,7 +251,7 @@
|
||||
<CursorPos X="3" Y="174"/>
|
||||
<TopLine Value="165"/>
|
||||
<EditorIndex Value="9"/>
|
||||
<UsageCount Value="45"/>
|
||||
<UsageCount Value="46"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit25>
|
||||
<Unit26>
|
||||
@ -318,10 +318,10 @@
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="test_utilities"/>
|
||||
<CursorPos X="40" Y="64"/>
|
||||
<TopLine Value="58"/>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<TopLine Value="49"/>
|
||||
<EditorIndex Value="15"/>
|
||||
<UsageCount Value="193"/>
|
||||
<UsageCount Value="195"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit35>
|
||||
<Unit36>
|
||||
@ -414,7 +414,7 @@
|
||||
<UnitName Value="server_service_xmlrpc"/>
|
||||
<CursorPos X="38" Y="33"/>
|
||||
<TopLine Value="27"/>
|
||||
<UsageCount Value="147"/>
|
||||
<UsageCount Value="149"/>
|
||||
</Unit46>
|
||||
<Unit47>
|
||||
<Filename Value="..\..\..\..\..\..\lazarus_23_215XX\fpc\source\packages\fcl-xml\src\xmlread.pp"/>
|
||||
@ -450,7 +450,7 @@
|
||||
<CursorPos X="50" Y="24"/>
|
||||
<TopLine Value="1"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<UsageCount Value="125"/>
|
||||
<UsageCount Value="127"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit51>
|
||||
<Unit52>
|
||||
@ -459,7 +459,7 @@
|
||||
<CursorPos X="17" Y="190"/>
|
||||
<TopLine Value="188"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<UsageCount Value="29"/>
|
||||
<UsageCount Value="30"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit52>
|
||||
<Unit53>
|
||||
@ -468,7 +468,7 @@
|
||||
<CursorPos X="98" Y="94"/>
|
||||
<TopLine Value="71"/>
|
||||
<EditorIndex Value="8"/>
|
||||
<UsageCount Value="21"/>
|
||||
<UsageCount Value="22"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit53>
|
||||
<Unit54>
|
||||
@ -504,7 +504,7 @@
|
||||
<CursorPos X="14" Y="91"/>
|
||||
<TopLine Value="77"/>
|
||||
<EditorIndex Value="7"/>
|
||||
<UsageCount Value="28"/>
|
||||
<UsageCount Value="29"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit58>
|
||||
<Unit59>
|
||||
@ -519,7 +519,7 @@
|
||||
<UnitName Value="wsdl_generator"/>
|
||||
<CursorPos X="27" Y="146"/>
|
||||
<TopLine Value="124"/>
|
||||
<UsageCount Value="105"/>
|
||||
<UsageCount Value="107"/>
|
||||
</Unit60>
|
||||
<Unit61>
|
||||
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\packages\fcl-xml\src\xmlread.pp"/>
|
||||
@ -548,7 +548,7 @@
|
||||
<CursorPos X="3" Y="81"/>
|
||||
<TopLine Value="261"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<UsageCount Value="88"/>
|
||||
<UsageCount Value="90"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit64>
|
||||
<Unit65>
|
||||
@ -557,7 +557,7 @@
|
||||
<UnitName Value="xsd_consts"/>
|
||||
<CursorPos X="8" Y="78"/>
|
||||
<TopLine Value="51"/>
|
||||
<UsageCount Value="87"/>
|
||||
<UsageCount Value="89"/>
|
||||
</Unit65>
|
||||
<Unit66>
|
||||
<Filename Value="..\..\ws_helper\wsdl_parser.pas"/>
|
||||
@ -566,7 +566,7 @@
|
||||
<CursorPos X="28" Y="845"/>
|
||||
<TopLine Value="835"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<UsageCount Value="20"/>
|
||||
<UsageCount Value="22"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit66>
|
||||
<Unit67>
|
||||
@ -576,7 +576,7 @@
|
||||
<CursorPos X="58" Y="112"/>
|
||||
<TopLine Value="99"/>
|
||||
<EditorIndex Value="11"/>
|
||||
<UsageCount Value="73"/>
|
||||
<UsageCount Value="75"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit67>
|
||||
<Unit68>
|
||||
@ -585,7 +585,7 @@
|
||||
<CursorPos X="3" Y="265"/>
|
||||
<TopLine Value="296"/>
|
||||
<EditorIndex Value="12"/>
|
||||
<UsageCount Value="37"/>
|
||||
<UsageCount Value="38"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit68>
|
||||
<Unit69>
|
||||
@ -608,16 +608,123 @@
|
||||
<TopLine Value="586"/>
|
||||
<UsageCount Value="16"/>
|
||||
</Unit71>
|
||||
<Unit72>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<UnitName Value="library_imp_utils"/>
|
||||
<CursorPos X="2" Y="31"/>
|
||||
<TopLine Value="19"/>
|
||||
<EditorIndex Value="16"/>
|
||||
<UsageCount Value="11"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit72>
|
||||
<Unit73>
|
||||
<Filename Value="..\..\..\..\..\..\lazarus_23_2.2.1\fpc\2.2.1\source\rtl\win\dynlibs.inc"/>
|
||||
<CursorPos X="1" Y="26"/>
|
||||
<TopLine Value="9"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit73>
|
||||
</Units>
|
||||
<JumpHistory Count="2" HistoryIndex="1">
|
||||
<JumpHistory Count="25" HistoryIndex="24">
|
||||
<Position1>
|
||||
<Filename Value="..\..\base_soap_formatter.pas"/>
|
||||
<Caret Line="1481" Column="23" TopLine="1470"/>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="26" Column="19" TopLine="1"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="..\..\base_soap_formatter.pas"/>
|
||||
<Caret Line="127" Column="61" TopLine="115"/>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="72" Column="52" TopLine="48"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="184" Column="38" TopLine="179"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="72" Column="24" TopLine="72"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="172" Column="23" TopLine="170"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="84" Column="1" TopLine="63"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="28" Column="1" TopLine="12"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="50" Column="25" TopLine="35"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="84" Column="15" TopLine="64"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="11" Column="5" TopLine="10"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="185" Column="21" TopLine="170"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="198" Column="56" TopLine="179"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="90" Column="25" TopLine="62"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="107" Column="35" TopLine="93"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="109" Column="3" TopLine="107"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="116" Column="3" TopLine="114"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="638" Column="1" TopLine="610"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="633" Column="26" TopLine="610"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="94" Column="62" TopLine="87"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="619" Column="1" TopLine="585"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="652" Column="5" TopLine="618"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="151" Column="4" TopLine="140"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="619" Column="1" TopLine="585"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="test_utilities.pas"/>
|
||||
<Caret Line="647" Column="9" TopLine="623"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="..\..\library_imp_utils.pas"/>
|
||||
<Caret Line="51" Column="18" TopLine="40"/>
|
||||
</Position25>
|
||||
</JumpHistory>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
|
Reference in New Issue
Block a user