Skip to content

Commit 87253b8

Browse files
author
Grahame Grieve
committed
troubleshooting failing tests on build
1 parent 12d3998 commit 87253b8

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

library/fdb/tests/fdb_tests.pas

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ procedure TFDBTests.test(manager: TFDBManager);
104104
i64: Int64;
105105
md: TFDBMetaData;
106106
fn : string;
107+
s : String;
107108
begin
109+
s := '1';
108110
d := TFslDateTime.makeLocal(dtpSec);
109111
fn := TestSettings.serverTestFile(['library', 'fdb', 'tests', 'fdb_tests.pas']);
110112
b := FileToBytes(fn);
@@ -120,6 +122,7 @@ procedure TFDBTests.test(manager: TFDBManager);
120122
//finally
121123
// md.free;
122124
//end;
125+
s := '2';
123126

124127
conn.ExecSQL('CREATE TABLE TestTable ( ' + #13#10 + ' TestKey ' + DBKeyType(conn.owner.platform) + ' ' + ColCanBeNull(conn.owner.platform, false) + ', ' +
125128
#13#10 + ' Name nchar(255) ' + ColCanBeNull(conn.owner.platform, false) + ', ' + #13#10 + ' Number int ' + ColCanBeNull(conn.owner.platform, true) + ', '
@@ -128,6 +131,7 @@ procedure TFDBTests.test(manager: TFDBManager);
128131
DBBlobType(conn.owner.platform) + ' ' + ColCanBeNull(conn.owner.platform, true) + ', ' + #13#10 + PrimaryKeyType(conn.owner.platform, 'PK_TestTable',
129132
'TestKey') + ') ' + CreateTableInfo(conn.owner.platform));
130133
conn.ExecSQL('Create Unique INDEX SK_TestTable_Index ON TestTable (Name, Number)');
134+
s := '3';
131135

132136
try
133137
md := conn.FetchMetaData;
@@ -136,10 +140,12 @@ procedure TFDBTests.test(manager: TFDBManager);
136140
finally
137141
md.free;
138142
end;
143+
s := '4';
139144
assertTrue(conn.CountSQL('Select count(*) from TestTable') = 0, 'dbt.0');
140145

141146
conn.ExecSQL('Insert into TestTable (TestKey, Name, BigString, Number, BigNumber, FloatNumber, Instant) values (1, ''a name'', '''', 2, ' + IntToStr(i64) + ', 3.2, ' +
142147
DBGetDate(manager.platform) + ')');
148+
s := '5';
143149
conn.sql := 'Insert into TestTable (TestKey, Name, BigString, Number, BigNumber, FloatNumber, Instant, Content) values (:k, :n, :bs, :i, :bi, :d, :ts, :c)';
144150
conn.Prepare;
145151
conn.BindKey('k', 2);
@@ -151,10 +157,13 @@ procedure TFDBTests.test(manager: TFDBManager);
151157
conn.BindDateTimeEx('ts', d);
152158
conn.BindBlob('c', b);
153159
conn.Execute;
160+
s := '6';
154161
conn.Terminate;
162+
s := '7';
155163

156164
assertTrue(conn.CountSQL('Select count(*) from TestTable where TestKey = 1') = 1, 'dbt.1');
157165
assertTrue(conn.CountSQL('Select count(*) from TestTable where TestKey = 0') = 0, 'dbt.2');
166+
s := '8';
158167

159168
dn := TFslDateTime.makeLocal;
160169

@@ -184,6 +193,7 @@ procedure TFDBTests.test(manager: TFDBManager);
184193
assertTrue(conn.ColDateTimeExByName['Instant'].equal(d, dtpSec), 'dbt.19');
185194
assertTrue(BlobIsSame(conn.ColBlobByName['Content'], b), 'dbt.20');
186195
conn.Terminate;
196+
s := '9';
187197

188198
sleep(1000);
189199

@@ -200,6 +210,7 @@ procedure TFDBTests.test(manager: TFDBManager);
200210
conn.BindNull('c');
201211
conn.Execute;
202212
conn.Terminate;
213+
s := '10';
203214

204215
conn.sql := 'Select * from TestTable';
205216
conn.Prepare;
@@ -213,6 +224,7 @@ procedure TFDBTests.test(manager: TFDBManager);
213224
assertTrue(conn.ColDateTimeExByName['Instant'].after(od, false), 'dbt.26');
214225
assertTrue(length(conn.ColBlobByName['Content']) = 0, 'dbt.27');
215226
assertTrue(conn.ColNullByName['Content'], 'dbt.28');
227+
s := '11';
216228

217229
conn.FetchNext;
218230
assertTrue(conn.ColIntegerByName['TestKey'] = 2, 'dbt.29');
@@ -224,33 +236,43 @@ procedure TFDBTests.test(manager: TFDBManager);
224236
assertTrue(length(conn.ColBlobByName['Content']) = 0, 'dbt.35');
225237
assertTrue(conn.ColNullByName['Content'], 'dbt.36');
226238
conn.Terminate;
239+
s := '12';
227240

228241
conn.ExecSQL('Delete from TestTable where TestKey = 1');
229242
conn.sql := 'Delete from TestTable where TestKey = :k';
230243
conn.Prepare;
231244
conn.BindKey('k', 2);
232245
conn.Execute;
233246
conn.Terminate;
247+
s := '13';
234248

235249
assertTrue(conn.CountSQL('Select count(*) from TestTable') = 0, 'dbt.37');
236250

237251
finally
238252
conn.terminate;
253+
s := '14';
239254
conn.DropTable('TestTable');
255+
s := '15';
240256
end;
241257
md := conn.FetchMetaData;
242258
try
243259
assertFalse(md.HasTable('TestTable'), 'dbt.38')
244260
finally
245261
md.free;
246262
end;
263+
s := '16';
247264

265+
raise EFslException.create('test1');
248266
conn.Release;
267+
raise EFslException.create('test1');
249268
except
250269
on e: Exception do
251270
begin
252-
assertTrue(false, e.message);
271+
raise EFslException.create('test2: '+e.message+' ('+s+')');
253272
conn.Error(e);
273+
raise EFslException.create('test3: '+e.message+' ('+s+')');
274+
assertTrue(false, e.message);
275+
raise EFslException.create('test4: '+e.message+' ('+s+')');
254276
end;
255277
end;
256278
end;

0 commit comments

Comments
 (0)