* 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:
reiniero 2013-10-14 17:07:14 +00:00
parent aea281f4cc
commit 16f157d6db

View File

@ -1246,23 +1246,37 @@ var
begin
with DBConnector.GetNDataset(15) do
begin
// Change ID values to be negative instead of positive
// Change ID values to -1..-15 instead of positive
Open;
while not(EOF) do
begin
begin
Edit;
FieldByName('ID').AsInteger:=
-1*(FieldByname('ID').AsInteger);
Post;
Next;
end;
end;
Close;
// Regular filter with negative integer values
Filtered := True;
Filter := '(id>-9) and (id<-4)';
Open;
for Counter := -5 downto -8 do
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;
end;
CheckTrue(EOF);