mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 22:29:28 +02:00
parent
3be394061e
commit
ac077797cd
@ -2676,7 +2676,10 @@ end;
|
||||
|
||||
function TCustomBufDataset.GetRecordCount: Longint;
|
||||
begin
|
||||
Result := FBRecordCount;
|
||||
if Active then
|
||||
Result := FBRecordCount
|
||||
else
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
function TCustomBufDataset.UpdateStatus: TUpdateStatus;
|
||||
|
@ -39,6 +39,7 @@ type
|
||||
procedure TestAutoIncField;
|
||||
procedure TestAutoIncFieldStreaming;
|
||||
procedure TestAutoIncFieldStreamingXML;
|
||||
Procedure TestRecordCount;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -248,6 +249,22 @@ begin
|
||||
IntTestAutoIncFieldStreaming(true);
|
||||
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
|
||||
{$ifdef fpc}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user