unit Test.System;
interface
uses
TestFramework;
type
Test_System_Routines =
class( TTestCase )
strict private
public
procedure SetUp;
override;
procedure TearDown;
override;
published
procedure Test_CopyArray_Integer;
procedure Test_CopyArray_Int64;
procedure Test_CopyArray_String;
procedure Test_CopyArray_Variant;
end;
implementation
procedure Test_System_Routines.SetUp;
begin
inherited;
end;
procedure Test_System_Routines.TearDown;
begin
inherited;
end;
procedure Test_System_Routines.Test_CopyArray_Integer;
var
LSource : TArray<Integer>;
LDest: TArray<Integer>;
LLength : Integer;
begin
LLength := 5;
SetLength( LSource, LLength );
SetLength( LDest, LLength );
CopyArray( @LDest[0], @LSource[0], TypeInfo( Integer ), LLength );
end;
procedure Test_System_Routines.Test_CopyArray_Int64;
var
LSource : TArray<Int64>;
LDest: TArray<Int64>;
LLength : Integer;
begin
LLength := 5;
SetLength( LSource, LLength );
SetLength( LDest, LLength );
CopyArray( @LDest[0], @LSource[0], TypeInfo( Int64 ), LLength );
end;
procedure Test_System_Routines.Test_CopyArray_String;
var
LSource : TArray<
string>;
LDest: TArray<
string>;
LLength : Integer;
begin
LLength := 5;
SetLength( LSource, LLength );
SetLength( LDest, LLength );
CopyArray( @LDest[0], @LSource[0], TypeInfo(
string ), LLength );
end;
procedure Test_System_Routines.Test_CopyArray_Variant;
var
LSource : TArray<Variant>;
LDest: TArray<Variant>;
LLength : Integer;
begin
LLength := 5;
SetLength( LSource, LLength );
SetLength( LDest, LLength );
CopyArray( @LDest[0], @LSource[0], TypeInfo( Variant ), LLength );
end;
initialization
RegisterTest( Test_System_Routines.Suite );
end.