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} |
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); |
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} |
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'); |