@@ -57,6 +57,7 @@ TTestRttiAccess = class
5757 property Fruits: TFruits read FFruits write FFruits;
5858 function SetStringField (var Value : Integer): string; overload;
5959 function SetStringField (const Value : string): string; overload;
60+ procedure PassVariantArray (const Value : Variant);
6061 end ;
6162
6263 TTestInterfaceImpl = class (TInterfacedObject, ITestInterface)
@@ -118,7 +119,9 @@ TTestWrapDelphi = class(TObject)
118119 [Test]
119120 procedure TestMethodWithVarAndOverload ;
120121 [Test]
121- procedure FreeReturnedObject ;
122+ procedure TestFreeReturnedObject ;
123+ [Test]
124+ procedure TestPassVariantArray ;
122125 end ;
123126
124127implementation
@@ -142,7 +145,7 @@ procedure TTestRttiAccess.BuyFruits(AFruits: TFruits);
142145
143146{ TTestVarPyth }
144147
145- procedure TTestWrapDelphi.FreeReturnedObject ;
148+ procedure TTestWrapDelphi.TestFreeReturnedObject ;
146149begin
147150 PythonEngine.ExecString(
148151 ' from delphi import rtti_var' + sLineBreak +
@@ -333,6 +336,15 @@ procedure TTestWrapDelphi.TestObjectField;
333336 Assert.IsTrue(rtti_var.ObjectField = None);
334337end ;
335338
339+ procedure TTestWrapDelphi.TestPassVariantArray ;
340+ begin
341+ PythonEngine.ExecString(
342+ ' from delphi import rtti_var' + sLineBreak +
343+ ' rtti_var.PassVariantArray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])'
344+ );
345+ Assert.Pass;
346+ end ;
347+
336348procedure TTestWrapDelphi.TestRecord ;
337349begin
338350 Rtti_rec.StringField := ' abcd' ;
@@ -452,6 +464,11 @@ function TTestRttiAccess.GetStaticArray: TStaticArray;
452464 Result[I] := I;
453465end ;
454466
467+ procedure TTestRttiAccess.PassVariantArray (const Value : Variant);
468+ begin
469+ Assert.IsTrue(VarIsArray(Value ) and (VarArrayHighBound(Value , 1 ) = 9 ));
470+ end ;
471+
455472procedure TTestRttiAccess.SellFruits (const AFruits: TFruitDynArray);
456473var
457474 Fruit: TFruit;
0 commit comments