Browse Source

fcl-db: tests: formatting

git-svn-id: trunk@25326 -
lacak 12 years ago
parent
commit
62857c565e

+ 1 - 2
packages/fcl-db/tests/bufdatasettoolsunit.pas

@@ -6,8 +6,8 @@ A closed BufDataset normally has no data, so these tests won't work.
 
 
 To circumvent this, this unit saves the dataset contents to file and reloads them on opening
 To circumvent this, this unit saves the dataset contents to file and reloads them on opening
 using the BufDataset persistence mechanism.
 using the BufDataset persistence mechanism.
-
 }
 }
+
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
 
 
 interface
 interface
@@ -18,7 +18,6 @@ uses
   BufDataset;
   BufDataset;
 
 
 type
 type
-{ TbufdatasetConnector }
 
 
   { TbufdatasetDBConnector }
   { TbufdatasetDBConnector }
 
 

+ 9 - 10
packages/fcl-db/tests/testdbbasics.pas

@@ -324,11 +324,11 @@ begin
     begin
     begin
     aDatasource.DataSet := ds;
     aDatasource.DataSet := ds;
     DataEvents := '';
     DataEvents := '';
-    open;
-    Fields.add(tfield.Create(DBConnector.GetNDataset(1)));
+    Open;
+    Fields.Add(TField.Create(ds));
     CheckEquals('deUpdateState:0;deFieldListChange:0;',DataEvents);
     CheckEquals('deUpdateState:0;deFieldListChange:0;',DataEvents);
     DataEvents := '';
     DataEvents := '';
-    fields.Clear;
+    Fields.Clear;
     CheckEquals('deFieldListChange:0;',DataEvents)
     CheckEquals('deFieldListChange:0;',DataEvents)
     end;
     end;
   aDatasource.Free;
   aDatasource.Free;
@@ -1319,7 +1319,6 @@ begin
     first;
     first;
     CheckTrue(EOF);
     CheckTrue(EOF);
 
 
-
     Close;
     Close;
     end;
     end;
 end;
 end;
@@ -1327,14 +1326,13 @@ end;
 {$ifdef fpc}
 {$ifdef fpc}
 procedure TTestBufDatasetDBBasics.TestIsEmpty;
 procedure TTestBufDatasetDBBasics.TestIsEmpty;
 begin
 begin
-  with tCustombufdataset(DBConnector.GetNDataset(True,1)) do
+  with DBConnector.GetNDataset(True,1) as TCustomBufDataset do
     begin
     begin
     open;
     open;
     delete;
     delete;
     Resync([]);
     Resync([]);
-    applyupdates;
+    ApplyUpdates;
     CheckTrue(IsEmpty);
     CheckTrue(IsEmpty);
-
     end;
     end;
 end;
 end;
 
 
@@ -2333,7 +2331,6 @@ var i          : byte;
     DbfTableLevel: integer;
     DbfTableLevel: integer;
 
 
 begin
 begin
-  DbfTableLevel:=4;
   if (uppercase(dbconnectorname)='DBF') then
   if (uppercase(dbconnectorname)='DBF') then
   begin
   begin
     DbfTableLevel:=strtointdef(dbconnectorparams,4);
     DbfTableLevel:=strtointdef(dbconnectorparams,4);
@@ -2359,7 +2356,8 @@ var i          : byte;
 
 
 begin
 begin
   if (uppercase(dbconnectorname)='DBF') then
   if (uppercase(dbconnectorname)='DBF') then
-    Ignore('TDBF Smallint support only from -999 to 9999');
+    Ignore('TDBF: Smallint support only from -999 to 9999');
+
   TestfieldDefinition(ftSmallint,2,ds,Fld);
   TestfieldDefinition(ftSmallint,2,ds,Fld);
 
 
   for i := 0 to testValuesCount-1 do
   for i := 0 to testValuesCount-1 do
@@ -2498,7 +2496,8 @@ var i          : byte;
 
 
 begin
 begin
   if (uppercase(dbconnectorname)='DBF') then
   if (uppercase(dbconnectorname)='DBF') then
-    Ignore('This test does not apply to TDDBF as they store currency in BCD fields.');
+    Ignore('This test does not apply to TDBF as they store currency in BCD fields.');
+
   TestfieldDefinition(ftCurrency,8,ds,Fld);
   TestfieldDefinition(ftCurrency,8,ds,Fld);
 
 
   for i := 0 to testValuesCount-1 do
   for i := 0 to testValuesCount-1 do