RTL custom interface types as records
This commit is contained in:
@@ -23,8 +23,6 @@ type
|
||||
[TestCase('Float_Negative', '-3.1415926535,Float')]
|
||||
procedure TestScalarCreation(const AValueStr: string; AExpectedKind: TScalar.TKind);
|
||||
|
||||
[Test]
|
||||
procedure TestScalarTuple;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -56,25 +54,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTestPOD.TestScalarTuple;
|
||||
var
|
||||
tuple: TScalarTuple;
|
||||
begin
|
||||
// A tuple is a heterogeneous array of TScalar
|
||||
SetLength(tuple, 3);
|
||||
tuple[0] := TScalar.FromInt64(123);
|
||||
tuple[1] := TScalar.FromDouble(3.14);
|
||||
tuple[2] := TScalar.FromInt64(-456);
|
||||
|
||||
Assert.AreEqual(Int64(3), Length(tuple), 'Tuple length mismatch');
|
||||
Assert.AreEqual(TScalar.TKind.Ordinal, tuple[0].Kind, 'Tuple item 0 kind mismatch');
|
||||
Assert.AreEqual(Int64(123), tuple[0].Value.AsInt64, 'Tuple item 0 value mismatch');
|
||||
Assert.AreEqual(TScalar.TKind.Float, tuple[1].Kind, 'Tuple item 1 kind mismatch');
|
||||
Assert.AreEqual(3.14, tuple[1].Value.AsDouble, 1E-12, 'Tuple item 1 value mismatch');
|
||||
Assert.AreEqual(TScalar.TKind.Ordinal, tuple[2].Kind, 'Tuple item 2 kind mismatch');
|
||||
Assert.AreEqual(Int64(-456), tuple[2].Value.AsInt64, 'Tuple item 2 value mismatch');
|
||||
end;
|
||||
|
||||
initialization
|
||||
FormatSettings.DecimalSeparator := '.';
|
||||
TDUnitX.RegisterTestFixture(TTestPOD);
|
||||
|
||||
Reference in New Issue
Block a user