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

Comparing ibx/trunk/fbintf/testsuite/Test15.pas (file contents):
Revision 45 by tony, Tue Dec 6 10:33:46 2016 UTC vs.
Revision 380 by tony, Mon Jan 10 10:13:17 2022 UTC

# Line 1 | Line 1
1 + (*
2 + *  Firebird Interface (fbintf) Test suite. This program is used to
3 + *  test the Firebird Pascal Interface and provide a semi-automated
4 + *  pass/fail check for each test.
5 + *
6 + *  The contents of this file are subject to the Initial Developer's
7 + *  Public License Version 1.0 (the "License"); you may not use this
8 + *  file except in compliance with the License. You may obtain a copy
9 + *  of the License here:
10 + *
11 + *    http://www.firebirdsql.org/index.php?op=doc&id=idpl
12 + *
13 + *  Software distributed under the License is distributed on an "AS
14 + *  IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
15 + *  implied. See the License for the specific language governing rights
16 + *  and limitations under the License.
17 + *
18 + *  The Initial Developer of the Original Code is Tony Whyman.
19 + *
20 + *  The Original Code is (C) 2016 Tony Whyman, MWA Software
21 + *  (http://www.mwasoftware.co.uk).
22 + *
23 + *  All Rights Reserved.
24 + *
25 + *  Contributor(s): ______________________________________.
26 + *
27 + *)
28 +
29   unit Test15;
30 + {$IFDEF MSWINDOWS}
31 + {$DEFINE WINDOWS}
32 + {$ENDIF}
33  
34 < {$mode objfpc}{$H+}
34 > {$IFDEF FPC}
35 > {$mode delphi}
36   {$codepage UTF8}
37 + {$ENDIF}
38  
39   {Test 15: Blob Handling and BPBs}
40  
# Line 19 | Line 52 | unit Test15;
52   interface
53  
54   uses
55 <  Classes, SysUtils, TestManager, IB;
55 >  Classes, SysUtils, TestApplication, FBTestApp, IB;
56  
57   type
58        { TTest15 }
59  
60 <  TTest15 = class(TTestBase)
60 >  TTest15 = class(TFBTestBase)
61    private
62      procedure UpdateDatabase(Attachment: IAttachment);
63      procedure QueryDatabase(Attachment: IAttachment);
64    public
65 <    function TestTitle: string; override;
66 <    procedure RunTest(CharSet: string; SQLDialect: integer); override;
65 >    function TestTitle: AnsiString; override;
66 >    procedure RunTest(CharSet: AnsiString; SQLDialect: integer); override;
67    end;
68  
69  
# Line 76 | Line 109 | begin
109    end;
110    Statement.Execute;
111  
112 +  Statement := Attachment.PrepareWithNamedParameters(Transaction,sqlInsert);
113 +  with Statement.GetSQLParams do
114 +  begin
115 +    ByName('rowid').AsInteger := 2;
116 +    ByName('title').AsString := 'Blob Test with binary string';
117 +    aText := #$0#$09#$0a {random digits} +
118 +             #$C9#$63#$6F#$75#$74#$65#$20#$6D#$6F#$69;  {Écoute moi' encoded in Win1252}
119 +    ByName('BlobData').AsString := aText;
120 +  end;
121 +  Statement.Execute;
122 +
123    BPB := Attachment.AllocateBPB;
124    BPB.Add(isc_bpb_target_type).AsInteger := 1;
125    BPB.Add(isc_bpb_target_interp).AsInteger := 4; {utf8}
# Line 98 | Line 142 | var Transaction: ITransaction;
142      Statement: IStatement;
143   begin
144    Transaction := Attachment.StartTransaction([isc_tpb_read,isc_tpb_nowait,isc_tpb_concurrency],taCommit);
145 <  Statement := Attachment.Prepare(Transaction,'Select * from TestData ');
145 >  Statement := Attachment.Prepare(Transaction,'Select * from TestData Where RowID = 1');
146    writeln(OutFile);
147    writeln(OutFile,'Testdata');
148    writeln(OutFile);
149    ReportResults(Statement);
150 +  FShowBinaryBlob := true;
151 +  Statement := Attachment.Prepare(Transaction,'Select * from TestData Where RowID = 2');
152 +  ReportResults(Statement);
153 +  FShowBinaryBlob := false;
154 +
155    Statement := Attachment.Prepare(Transaction,'Select * from TestData2 ');
156    writeln(OutFile);
157    writeln(OutFile,'Testdata 2');
# Line 110 | Line 159 | begin
159    ReportResults(Statement);
160   end;
161  
162 < function TTest15.TestTitle: string;
162 > function TTest15.TestTitle: AnsiString;
163   begin
164    Result := 'Test 15: Blob Handling and BPBs';
165   end;
166  
167 < procedure TTest15.RunTest(CharSet: string; SQLDialect: integer);
167 > procedure TTest15.RunTest(CharSet: AnsiString; SQLDialect: integer);
168   var DPB: IDPB;
169      Attachment: IAttachment;
170   begin

Comparing ibx/trunk/fbintf/testsuite/Test15.pas (property svn:eol-style):
Revision 45 by tony, Tue Dec 6 10:33:46 2016 UTC vs.
Revision 380 by tony, Mon Jan 10 10:13:17 2022 UTC

# Line 0 | Line 1
1 + native

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines