ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/fbintf/testsuite/Test10.pas
(Generate patch)

Comparing ibx/trunk/fbintf/testsuite/Test10.pas (file contents):
Revision 55 by tony, Mon Jan 9 15:31:51 2017 UTC vs.
Revision 56 by tony, Mon Mar 6 10:20:02 2017 UTC

# Line 1 | Line 1
1   unit Test10;
2 + {$IFDEF MSWINDOWS}
3 + {$DEFINE WINDOWS}
4 + {$ENDIF}
5  
6 < {$mode objfpc}{$H+}
6 > {$IFDEF FPC}
7 > {$mode delphi}
8   {$codepage utf8}
9 + {$ENDIF}
10  
11   {Test 10: Event Handling}
12  
# Line 38 | Line 43 | type
43      procedure EventReport(Sender: IEvents);
44      procedure ShowEventCounts(Intf: IEvents);
45    public
46 <    function TestTitle: string; override;
47 <    procedure RunTest(CharSet: string; SQLDialect: integer); override;
46 >    function TestTitle: AnsiString; override;
47 >    procedure RunTest(CharSet: AnsiString; SQLDialect: integer); override;
48    end;
49  
50  
# Line 58 | Line 63 | begin
63    FEventSignalled := false;
64    EventHandler := Attachment.GetEventHandler('TESTEVENT');
65    writeln(OutFile,'Call Async Wait');
66 <  EventHandler.AsyncWaitForEvent(@EventReport);
66 >  EventHandler.AsyncWaitForEvent(EventReport);
67    writeln(OutFile,'Async Wait Called');
68    sleep(500);
69    if FEventSignalled then
70    begin
71      writeln(OutFile,'First Event - usually ignored');
72      FEventSignalled := false;
73 <    EventHandler.AsyncWaitForEvent(@EventReport);
73 >    EventHandler.AsyncWaitForEvent(EventReport);
74      sleep(100);
75      if FEventSignalled then
76      begin
# Line 88 | Line 93 | begin
93      FEventSignalled := false
94    end;
95    writeln(OutFile,'Call Async Wait');
96 <  EventHandler.AsyncWaitForEvent(@EventReport);
96 >  EventHandler.AsyncWaitForEvent(EventReport);
97    writeln(OutFile,'Async Wait Called');
98    sleep(500);
99    if FEventSignalled then
# Line 96 | Line 101 | begin
101      writeln(OutFile,'Deferred Events Caught');
102      ShowEventCounts(EventHandler);
103      FEventSignalled := false;
104 <    EventHandler.AsyncWaitForEvent(@EventReport);
104 >    EventHandler.AsyncWaitForEvent(EventReport);
105      sleep(100);
106      if FEventSignalled then
107        writeln(OutFile,'Unexpected Event 3');
# Line 108 | Line 113 | begin
113  
114    FEventSignalled := false;
115    writeln(OutFile,'Async Wait: Test Cancel');
116 <  EventHandler.AsyncWaitForEvent(@EventReport);
116 >  EventHandler.AsyncWaitForEvent(EventReport);
117    writeln(OutFile,'Async Wait Called');
118    EventHandler.Cancel;
119    writeln(OutFile,'Event Cancelled');
# Line 144 | Line 149 | begin
149      writeln(OutFile,'Event Counts: ',EventCounts[i].EventName,', Count = ',EventCounts[i].Count);
150   end;
151  
152 < function TTest10.TestTitle: string;
152 > function TTest10.TestTitle: AnsiString;
153   begin
154    Result := 'Test 10: Event Handling';
155   end;
156  
157 < procedure TTest10.RunTest(CharSet: string; SQLDialect: integer);
157 > procedure TTest10.RunTest(CharSet: AnsiString; SQLDialect: integer);
158   var Attachment: IAttachment;
159      DPB: IDPB;
160   begin

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines