Browse Source

* Refactored test-values, removed duplicate and re-enabled a string-testvalue containing quotes

git-svn-id: trunk@10786 -
joost 17 years ago
parent
commit
0820353b71

+ 1 - 1
packages/fcl-db/tests/sqldbtoolsunit.pas

@@ -217,7 +217,7 @@ begin
           begin
           begin
           sql := sql + ',F' + Fieldtypenames[FType];
           sql := sql + ',F' + Fieldtypenames[FType];
           if testValues[FType,CountID] <> '' then
           if testValues[FType,CountID] <> '' then
-            sql1 := sql1 + ',''' + testValues[FType,CountID] + ''''
+            sql1 := sql1 + ',''' + StringReplace(testValues[FType,CountID],'''','''''',[rfReplaceAll]) + ''''
           else
           else
             sql1 := sql1 + ',NULL';
             sql1 := sql1 + ',NULL';
           end;
           end;

+ 1 - 25
packages/fcl-db/tests/testfieldtypes.pas

@@ -88,30 +88,6 @@ const
   testIntValuesCount = 17;
   testIntValuesCount = 17;
   testIntValues : Array[0..testIntValuesCount-1] of integer = (-maxInt,-maxSmallint-1,-maxSmallint,-256,-255,-128,-127,-1,0,1,127,128,255,256,maxSmallint,maxSmallint+1,MaxInt);
   testIntValues : Array[0..testIntValuesCount-1] of integer = (-maxInt,-maxSmallint-1,-maxSmallint,-256,-255,-128,-127,-1,0,1,127,128,255,256,maxSmallint,maxSmallint+1,MaxInt);
 
 
-  testStringValuesCount = 20;
-  testStringValues : Array[0..testStringValuesCount-1] of string = (
-    '',
-    'a',
-    'ab',
-    'abc',
-    'abcd',
-    'abcde',
-    'abcdef',
-    'abcdefg',
-    'abcdefgh',
-    'abcdefghi',
-    'abcdefghij',
-    'lMnOpQrStU',
-    '1234567890',
-    '_!@#$%^&*(',
-    ' ''quotes'' ',
-    ')-;:/?.<>',
-    '~`|{}- =',    // note that there's no \  (backslash) since some db's uses that as escape-character
-    '  WRaP  ',
-    'wRaP  ',
-    ' wRAP'
-  );
-
   testDateValuesCount = 18;
   testDateValuesCount = 18;
   testDateValues : Array[0..testDateValuesCount-1] of string = (
   testDateValues : Array[0..testDateValuesCount-1] of string = (
     '2000-01-01',
     '2000-01-01',
@@ -708,7 +684,7 @@ end;
 procedure TTestFieldTypes.TestStringParamQuery;
 procedure TTestFieldTypes.TestStringParamQuery;
 
 
 begin
 begin
-  TestXXParamQuery(ftString,'VARCHAR(10)',testStringValuesCount);
+  TestXXParamQuery(ftString,'VARCHAR(10)',testValuesCount);
 end;
 end;
 
 
 procedure TTestFieldTypes.TestDateParamQuery;
 procedure TTestFieldTypes.TestDateParamQuery;

+ 2 - 2
packages/fcl-db/tests/toolsunit.pas

@@ -104,14 +104,14 @@ const
     '1234567890',
     '1234567890',
     '_!@#$%^&*(',
     '_!@#$%^&*(',
     '_!@#$%^&*(',
     '_!@#$%^&*(',
-//    ' ''quotes'' ',
+    ' ''quotes'' ',
     ')-;:/?.<>',
     ')-;:/?.<>',
     '~`|{}- =',    // note that there's no \  (backslash) since some db's uses that as escape-character
     '~`|{}- =',    // note that there's no \  (backslash) since some db's uses that as escape-character
     '  WRaP  ',
     '  WRaP  ',
     'wRaP  ',
     'wRaP  ',
     ' wRAP',
     ' wRAP',
     'this',
     'this',
-    'is',
+//    'is',
     'fun',
     'fun',
     'VB7^',
     'VB7^',
     'vdfbst'
     'vdfbst'