mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 18:59:11 +02:00
parent
3be394061e
commit
ac077797cd
@ -2676,7 +2676,10 @@ end;
|
|||||||
|
|
||||||
function TCustomBufDataset.GetRecordCount: Longint;
|
function TCustomBufDataset.GetRecordCount: Longint;
|
||||||
begin
|
begin
|
||||||
Result := FBRecordCount;
|
if Active then
|
||||||
|
Result := FBRecordCount
|
||||||
|
else
|
||||||
|
Result:=0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomBufDataset.UpdateStatus: TUpdateStatus;
|
function TCustomBufDataset.UpdateStatus: TUpdateStatus;
|
||||||
|
@ -39,6 +39,7 @@ type
|
|||||||
procedure TestAutoIncField;
|
procedure TestAutoIncField;
|
||||||
procedure TestAutoIncFieldStreaming;
|
procedure TestAutoIncFieldStreaming;
|
||||||
procedure TestAutoIncFieldStreamingXML;
|
procedure TestAutoIncFieldStreamingXML;
|
||||||
|
Procedure TestRecordCount;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -248,6 +249,22 @@ begin
|
|||||||
IntTestAutoIncFieldStreaming(true);
|
IntTestAutoIncFieldStreaming(true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestSpecificTBufDataset.TestRecordCount;
|
||||||
|
var
|
||||||
|
BDS:TBufDataSet;
|
||||||
|
|
||||||
|
begin
|
||||||
|
BDS:=TBufDataSet.Create(nil);
|
||||||
|
BDS.FieldDefs.Add('ID',ftLargeint);
|
||||||
|
BDS.CreateDataSet;
|
||||||
|
BDS.AppendRecord([1]);
|
||||||
|
BDS.AppendRecord([2]);
|
||||||
|
BDS.AppendRecord([3]);
|
||||||
|
BDS.Close;
|
||||||
|
AssertEquals('IsEmpty: ',True,BDS.IsEmpty);
|
||||||
|
AssertEquals('RecordCount: ',0,BDS.RecordCount);
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
{$ifdef fpc}
|
{$ifdef fpc}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user