summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-07-11 21:51:53 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-07-11 21:51:53 +0000
commit3a10ff2a85448881863e8d6f729c1abebdc8297a (patch)
treef64baf95757722d14ea0092c8ab9b5becfe4be4d /examples
parent3309f5b6227559456b25bb9e5c4051ccb72b6a13 (diff)
downloadfpGUI-3a10ff2a85448881863e8d6f729c1abebdc8297a.tar.xz
* Fixed the recusion bug in Treeview when searching for a node.
* Minor improvements to the GUI Test Runner. * Extended the treeview unit tests.
Diffstat (limited to 'examples')
-rw-r--r--examples/apps/fpcunit/fpg_guitestrunner.pas23
1 files changed, 16 insertions, 7 deletions
diff --git a/examples/apps/fpcunit/fpg_guitestrunner.pas b/examples/apps/fpcunit/fpg_guitestrunner.pas
index dab2e5fd..15c24869 100644
--- a/examples/apps/fpcunit/fpg_guitestrunner.pas
+++ b/examples/apps/fpcunit/fpg_guitestrunner.pas
@@ -99,13 +99,15 @@ procedure TGUITestRunnerForm.AddFailure(ATest: TTest; AFailure: TTestFailure);
var
FailureNode, node: TfpgTreeNode;
begin
- MemoLog('failed - ' + ATest.TestName);
+// MemoLog('failed - ' + ATest.TestName);
FailureNode := FindNode(ATest);
- FailureNode.ImageIndex := 3;
if not Assigned(FailureNode) then
- memolog(' Failed to find node');
- if Assigned(FailureNode) then
begin
+ memolog('BUG: Failed to find node for <' + ATest.TestName + '>');
+ end
+ else
+ begin
+ FailureNode.ImageIndex := 3;
node := FailureNode.AppendText('Message: ' + AFailure.ExceptionMessage);
node.ImageIndex := 4;
node.TextColor := clFuchsia;
@@ -125,11 +127,15 @@ procedure TGUITestRunnerForm.AddError(ATest: TTest; AError: TTestFailure);
var
ErrorNode, node: TfpgTreeNode;
begin
- MemoLog('error - ' + ATest.TestName);
+// MemoLog('error - ' + ATest.TestName);
ErrorNode := FindNode(ATest);
- ErrorNode.ImageIndex := 2;
- if Assigned(ErrorNode) then
+ if not Assigned(ErrorNode) then
begin
+ memolog('BUG: Failed to find node for <' + ATest.TestName + '>');
+ end
+ else
+ begin
+ ErrorNode.ImageIndex := 2;
node := ErrorNode.AppendText('Exception message: ' + AError.ExceptionMessage);
node.TextColor := clRed;
node.ImageIndex := 4;
@@ -263,6 +269,9 @@ begin
// Popup Menu support is still experimental
// CreatePopupMenu;
+
+ // Focus on first node
+ tvTests.Selection := n;
end;
procedure TGUITestRunnerForm.btnQuitClicked(Sender: TObject);