mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-24 09:00:12 +02:00
fcl-db: tests: use built-in function BytesOf() instead uf own implementation.
git-svn-id: trunk@39338 -
This commit is contained in:
parent
e9e9a26133
commit
c73e831633
packages/fcl-db/tests
@ -1625,11 +1625,11 @@ begin
|
||||
ftBytes : if cross then
|
||||
Params.ParamByName('field1').Value := StringToByteArray(testBytesValues[i])
|
||||
else
|
||||
Params.ParamByName('field1').AsBytes := StringToBytes(testBytesValues[i]);
|
||||
Params.ParamByName('field1').AsBytes := BytesOf(testBytesValues[i]);
|
||||
ftVarBytes: if cross then
|
||||
Params.ParamByName('field1').AsString := testBytesValues[i]
|
||||
else
|
||||
Params.ParamByName('field1').AsBytes := StringToBytes(testBytesValues[i]);
|
||||
Params.ParamByName('field1').AsBytes := BytesOf(testBytesValues[i]);
|
||||
else
|
||||
AssertTrue('no test for paramtype available',False);
|
||||
end;
|
||||
|
@ -241,7 +241,6 @@ procedure FreeDBConnector;
|
||||
function DateTimeToTimeString(d: tdatetime) : string;
|
||||
function TimeStringToDateTime(d: String): TDateTime;
|
||||
function StringToByteArray(const s: ansistring): Variant;
|
||||
function StringToBytes(const s: ansistring): TBytes;
|
||||
|
||||
|
||||
implementation
|
||||
@ -638,14 +637,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function StringToBytes(const s: ansistring): TBytes;
|
||||
var Len: integer;
|
||||
begin
|
||||
Len := Length(s) * SizeOf(AnsiChar);
|
||||
SetLength(Result, Len);
|
||||
Move(s[1], Result[0], Len);
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
ReadIniFile;
|
||||
|
Loading…
Reference in New Issue
Block a user