From 64c824cd866b32fcf62623bf78f5e09907ac4a17 Mon Sep 17 00:00:00 2001 From: joost Date: Thu, 1 Jul 2010 15:44:21 +0000 Subject: [PATCH] * Make sure that fixed width parameters are really ftFixedChar git-svn-id: trunk@15506 - --- packages/fcl-db/tests/testfieldtypes.pas | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/fcl-db/tests/testfieldtypes.pas b/packages/fcl-db/tests/testfieldtypes.pas index f4a95fafc9..7538fddc44 100644 --- a/packages/fcl-db/tests/testfieldtypes.pas +++ b/packages/fcl-db/tests/testfieldtypes.pas @@ -770,6 +770,10 @@ begin ShortDateFormat := 'yyyy-mm-dd'; + // There is no Param.AsFixedChar, so the datatype has to be set manually + if ADatatype=ftFixedChar then + Params.ParamByName('field1').DataType := ftFixedChar; + for i := 0 to testValuesCount -1 do begin Params.ParamByName('id').AsInteger := i; @@ -801,13 +805,7 @@ begin ftInteger: AssertEquals(testIntValues[i],FieldByName('FIELD1').AsInteger); ftFloat : AssertEquals(testFloatValues[i],FieldByName('FIELD1').AsFloat); ftBCD : AssertEquals(testBCDValues[i],FieldByName('FIELD1').AsCurrency); - ftFixedChar : - begin - if FieldByName('FIELD1').isnull then - AssertEquals(testStringValues[i],FieldByName('FIELD1').AsString) - else - AssertEquals(PadRight(testStringValues[i],10),FieldByName('FIELD1').AsString); - end; + ftFixedChar : AssertEquals(PadRight(testStringValues[i],10),FieldByName('FIELD1').AsString); ftString : AssertEquals(testStringValues[i],FieldByName('FIELD1').AsString); ftdate : AssertEquals(testDateValues[i],FormatDateTime('yyyy/mm/dd',FieldByName('FIELD1').AsDateTime)); else