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

Comparing ibx/trunk/fbintf/testsuite/Test3.pas (file contents):
Revision 45 by tony, Tue Dec 6 10:33:46 2016 UTC vs.
Revision 56 by tony, Mon Mar 6 10:20:02 2017 UTC

# Line 1 | Line 1
1   unit Test3;
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 3: ad hoc queries}
12  
# Line 34 | Line 39 | type
39    private
40      procedure DoQuery(Attachment: IAttachment);
41    public
42 <    function TestTitle: string; override;
43 <    procedure RunTest(CharSet: string; SQLDialect: integer); override;
42 >    function TestTitle: AnsiString; override;
43 >    procedure RunTest(CharSet: AnsiString; SQLDialect: integer); override;
44    end;
45  
46  
# Line 69 | Line 74 | begin
74    ResultSet := Attachment.OpenCursorAtStart('Select count(*) from EMPLOYEE');
75    writeln(OutFile,'Employee Count = ',ResultSet[0].AsInteger);
76  
77 +  {$IFNDEF FPC}
78 +  Transaction.Rollback; {Delphi does not dispose of interfaces until the end of the function
79 +                         so we need to explicitly rollback here. FPC will dispose of the
80 +                         interface as soon as it is overwritten - hence this is not needed.}
81 +  {$ENDIF}
82    Transaction := Attachment.StartTransaction([isc_tpb_write,isc_tpb_nowait,isc_tpb_concurrency],taRollback);
83    Statement := Attachment.PrepareWithNamedParameters(Transaction,'Execute Procedure DELETE_EMPLOYEE :EMP_NO',3);
84    Statement.GetSQLParams.ByName('EMP_NO').AsInteger := 8;
# Line 93 | Line 103 | begin
103  
104   end;
105  
106 < function TTest3.TestTitle: string;
106 > function TTest3.TestTitle: AnsiString;
107   begin
108    Result := 'Test 3: ad hoc queries';
109   end;
110  
111 < procedure TTest3.RunTest(CharSet: string; SQLDialect: integer);
111 > procedure TTest3.RunTest(CharSet: AnsiString; SQLDialect: integer);
112   var Attachment: IAttachment;
113      DPB: IDPB;
114   begin

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines