mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-05 14:38:34 +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
@ -1625,11 +1625,11 @@ begin
|
|||||||
ftBytes : if cross then
|
ftBytes : if cross then
|
||||||
Params.ParamByName('field1').Value := StringToByteArray(testBytesValues[i])
|
Params.ParamByName('field1').Value := StringToByteArray(testBytesValues[i])
|
||||||
else
|
else
|
||||||
Params.ParamByName('field1').AsBytes := StringToBytes(testBytesValues[i]);
|
Params.ParamByName('field1').AsBytes := BytesOf(testBytesValues[i]);
|
||||||
ftVarBytes: if cross then
|
ftVarBytes: if cross then
|
||||||
Params.ParamByName('field1').AsString := testBytesValues[i]
|
Params.ParamByName('field1').AsString := testBytesValues[i]
|
||||||
else
|
else
|
||||||
Params.ParamByName('field1').AsBytes := StringToBytes(testBytesValues[i]);
|
Params.ParamByName('field1').AsBytes := BytesOf(testBytesValues[i]);
|
||||||
else
|
else
|
||||||
AssertTrue('no test for paramtype available',False);
|
AssertTrue('no test for paramtype available',False);
|
||||||
end;
|
end;
|
||||||
|
@ -241,7 +241,6 @@ procedure FreeDBConnector;
|
|||||||
function DateTimeToTimeString(d: tdatetime) : string;
|
function DateTimeToTimeString(d: tdatetime) : string;
|
||||||
function TimeStringToDateTime(d: String): TDateTime;
|
function TimeStringToDateTime(d: String): TDateTime;
|
||||||
function StringToByteArray(const s: ansistring): Variant;
|
function StringToByteArray(const s: ansistring): Variant;
|
||||||
function StringToBytes(const s: ansistring): TBytes;
|
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -638,14 +637,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
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
|
initialization
|
||||||
ReadIniFile;
|
ReadIniFile;
|
||||||
|
Loading…
Reference in New Issue
Block a user