mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 03:39:33 +02:00
* fcl-db: tests: fix negative integer filter test from r25754; add subtest with integer constants
git-svn-id: trunk@25782 -
This commit is contained in:
parent
aea281f4cc
commit
16f157d6db
@ -1246,7 +1246,8 @@ var
|
|||||||
begin
|
begin
|
||||||
with DBConnector.GetNDataset(15) do
|
with DBConnector.GetNDataset(15) do
|
||||||
begin
|
begin
|
||||||
// Change ID values to be negative instead of positive
|
// Change ID values to -1..-15 instead of positive
|
||||||
|
Open;
|
||||||
while not(EOF) do
|
while not(EOF) do
|
||||||
begin
|
begin
|
||||||
Edit;
|
Edit;
|
||||||
@ -1257,12 +1258,25 @@ begin
|
|||||||
end;
|
end;
|
||||||
Close;
|
Close;
|
||||||
|
|
||||||
|
// Regular filter with negative integer values
|
||||||
Filtered := True;
|
Filtered := True;
|
||||||
Filter := '(id>-9) and (id<-4)';
|
Filter := '(id>-9) and (id<-4)';
|
||||||
Open;
|
Open;
|
||||||
for Counter := -5 downto -8 do
|
for Counter := -5 downto -8 do
|
||||||
begin
|
begin
|
||||||
CheckEquals(Counter,FieldByName('ID').asinteger);
|
CheckEquals(Counter,FieldByName('ID').AsInteger);
|
||||||
|
next;
|
||||||
|
end;
|
||||||
|
CheckTrue(EOF);
|
||||||
|
Close;
|
||||||
|
|
||||||
|
// Filter with negative integer values and subtraction calculations
|
||||||
|
Filtered := True;
|
||||||
|
Filter := '(id>(-8-1)) and (id<(-3-1))';
|
||||||
|
Open;
|
||||||
|
for Counter := -5 downto -8 do
|
||||||
|
begin
|
||||||
|
CheckEquals(Counter,FieldByName('ID').AsInteger);
|
||||||
next;
|
next;
|
||||||
end;
|
end;
|
||||||
CheckTrue(EOF);
|
CheckTrue(EOF);
|
||||||
|
Loading…
Reference in New Issue
Block a user