Skip to content

Commit 8bb9b70

Browse files
committed
Added class reference field test to WrapDelphiTest.pas.
1 parent a1ae2f4 commit 8bb9b70

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Tests/WrapDelphiTest.pas

+10
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ TTestRttiAccess = class
4949
ObjectField: TObject;
5050
RecordField: TTestRecord;
5151
InterfaceField: ITestInterface;
52+
ClassRef: TClass;
5253
function GetData: TObject;
5354
procedure BuyFruits(AFruits: TFruits);
5455
procedure SellFruits(const AFruits: TFruitDynArray);
@@ -61,6 +62,7 @@ TTestRttiAccess = class
6162
function SetStringField(const Value: string): string; overload;
6263
procedure PassVariantArray(const Value: Variant);
6364
function ClassRefParam(ClassRef: TPersistentClass): string;
65+
class var ClassField: string;
6466
class function DoubleString(S: string): string;
6567
class function Square(I: Integer): Integer; static;
6668
end;
@@ -133,6 +135,8 @@ TTestWrapDelphi = class(TObject)
133135
[Test]
134136
procedure TestClassRefParam;
135137
[Test]
138+
procedure TestClassRefField;
139+
[Test]
136140
procedure TestInheritance;
137141
[Test]
138142
procedure TestClassMethods;
@@ -248,6 +252,12 @@ procedure TTestWrapDelphi.TestClassMethods;
248252
Assert.AreEqual<string>(MainModule.TestSubclass.DoubleString('B'), 'BB');
249253
end;
250254

255+
procedure TTestWrapDelphi.TestClassRefField;
256+
begin
257+
Rtti_Var.ClassRef := MainModule.TestRttiAccess;
258+
Assert.AreEqual(TestRttiAccess.ClassRef, TTestRttiAccess);
259+
end;
260+
251261
procedure TTestWrapDelphi.TestClassRefParam;
252262
begin
253263
Assert.AreEqual<string>(Rtti_Var.ClassRefParam(MainModule.Collection), 'TCollection');

0 commit comments

Comments
 (0)