tests: added test for issue #12216

git-svn-id: trunk@16708 -
This commit is contained in:
vincents 2008-09-24 14:24:04 +00:00
parent c2dffd1000
commit f55f9d7c68
7 changed files with 214 additions and 0 deletions

6
.gitattributes vendored
View File

@ -3713,6 +3713,12 @@ startlazarus.app/Contents/PkgInfo svneol=native#text/plain
test/bugs/12204/bug12204.lpi svneol=native#text/plain
test/bugs/12204/bug12204.pas svneol=native#text/plain
test/bugs/12204/expected.txt svneol=native#text/plain
test/bugs/12216/bug12216.lpi svneol=native#text/plain
test/bugs/12216/bug12216.lpr svneol=native#text/plain
test/bugs/12216/expected.txt svneol=native#text/plain
test/bugs/12216/unit1.lfm svneol=native#text/plain
test/bugs/12216/unit1.lrs svneol=native#text/plain
test/bugs/12216/unit1.pas svneol=native#text/plain
test/bugs/2068/bug2068.lpi svneol=native#text/plain
test/bugs/2068/bug2068.lpr svneol=native#text/plain
test/bugs/2068/expected.txt svneol=native#text/plain

View File

@ -0,0 +1,69 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="6"/>
<General>
<SessionStorage Value="InIDEConfig"/>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="3">
<Unit0>
<Filename Value="bug12216.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="bug12216"/>
</Unit0>
<Unit1>
<Filename Value="unit1.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/>
<ResourceFilename Value="unit1.lrs"/>
<UnitName Value="Unit1"/>
</Unit1>
<Unit2>
<Filename Value="expected.txt"/>
<IsPartOfProject Value="True"/>
</Unit2>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="8"/>
<PathDelim Value="\"/>
<Parsing>
<SyntaxOptions>
<CStyleOperator Value="False"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<UseHeaptrc Value="True"/>
</Debugging>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</CONFIG>

View File

@ -0,0 +1,18 @@
program bug12216;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ you can add units after this }, Unit1;
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,2 @@
Sorted: False
Insert succeeded.

31
test/bugs/12216/unit1.lfm Normal file
View File

@ -0,0 +1,31 @@
object Form1: TForm1
Left = 302
Height = 87
Top = 155
Width = 214
Caption = 'Form1'
ClientHeight = 87
ClientWidth = 214
ParentFont = False
LCLVersion = '0.9.25'
object Button1: TButton
Left = 112
Height = 25
Top = 24
Width = 75
Caption = 'Button1'
OnClick = Button1Click
TabOrder = 0
end
object ApplicationProperties1: TApplicationProperties
CaptureExceptions = True
HintColor = clInfoBk
HintHidePause = 2500
HintPause = 500
HintShortCuts = True
ShowHint = True
OnIdle = ApplicationProperties1Idle
left = 25
top = 19
end
end

13
test/bugs/12216/unit1.lrs Normal file
View File

@ -0,0 +1,13 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TForm1','FORMDATA',[
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'.'#1#6'Height'#2'W'#3'Top'#3#155#0#5'Widt'
+'h'#3#214#0#7'Caption'#6#5'Form1'#12'ClientHeight'#2'W'#11'ClientWidth'#3#214
+#0#10'ParentFont'#8#10'LCLVersion'#6#6'0.9.25'#0#7'TButton'#7'Button1'#4'Lef'
+'t'#2'p'#6'Height'#2#25#3'Top'#2#24#5'Width'#2'K'#7'Caption'#6#7'Button1'#7
+'OnClick'#7#12'Button1Click'#8'TabOrder'#2#0#0#0#22'TApplicationProperties'
+#22'ApplicationProperties1'#17'CaptureExceptions'#9#9'HintColor'#7#8'clInfoB'
+'k'#13'HintHidePause'#3#196#9#9'HintPause'#3#244#1#13'HintShortCuts'#9#8'Sho'
+'wHint'#9#6'OnIdle'#7#26'ApplicationProperties1Idle'#4'left'#2#25#3'top'#2#19
+#0#0#0
]);

75
test/bugs/12216/unit1.pas Normal file
View File

@ -0,0 +1,75 @@
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, LCLProc;
type
{ TForm1 }
TForm1 = class(TForm)
ApplicationProperties1: TApplicationProperties;
Button1: TButton;
procedure ApplicationProperties1Idle(Sender: TObject; var Done: Boolean);
procedure Button1Click(Sender: TObject);
private
{ private declarations }
procedure DoTest;
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
var
InTestRun : boolean;
{ TForm1 }
procedure TForm1.ApplicationProperties1Idle(Sender: TObject; var Done: Boolean);
begin
if InTestRun then
begin
DoTest;
Close;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
DoTest;
end;
procedure TForm1.DoTest;
var
ListBox : TListBox;
begin
ListBox := TListBox.Create(nil);
try
ListBox.Sorted := true;
ListBox.Sorted := false;
DebugLn(['Sorted: ', ListBox.Sorted]);
ListBox.Items.Insert(0, 'A new item');
DebugLn('Insert succeeded.');
except
on E: Exception do begin
DebugLn(['Exception occurred: ', E.Message]);
end;
end;
ListBox.Free;
end;
initialization
InTestRun := ParamStr(1)='--runtest';
{$I unit1.lrs}
end.