Browse Source

* fcl-db/dbase: fix test for large strings for (visual) foxpro

git-svn-id: trunk@24353 -
reiniero 12 years ago
parent
commit
a2bb01a313

+ 1 - 2
packages/fcl-db/src/dbase/dbf_dbffile.pas

@@ -2800,7 +2800,6 @@ begin
   // error occurred while writing?
   if WriteError then
   begin
-    // -- Tobias --
     // The record couldn't be written, so
     // the written index records and the
     // change to the header have to be
@@ -2810,7 +2809,7 @@ begin
     Dec(PDbfHdr(Header)^.RecordCount);
     WriteHeader;
     UnlockPage(0);
-    // roll back indexes too
+    // roll back indexes, too
     RollbackIndexesAndRaise(FIndexFiles.Count, ecWriteDbf);
   end else
     Result := newRecord;

+ 4 - 2
packages/fcl-db/tests/testspecifictdbf.pas

@@ -53,7 +53,9 @@ type
     procedure TestFindPrior;
     // Tests writing and reading a memo field
     procedure TestMemo;
-    // Tests string field with 254 characters (max for DBase IV)
+    // Tests string field with
+    // 254 characters (max for DBase IV)
+    // 32767 characters (FoxPro, Visual FoxPro)
     procedure TestLargeString;
     // Tests codepage in created dbf
     procedure TestCodePage;
@@ -388,7 +390,7 @@ begin
   TestValue:=StringOfChar('a',MaxStringSize);
 
   DS.FieldDefs.Add('ID',ftInteger);
-  DS.FieldDefs.Add('NAME',ftString,254);
+  DS.FieldDefs.Add('NAME',ftString,MaxStringSize);
   DS.CreateTable;
   DS.Open;