Skip to content

Commit dc99c7f

Browse files
committed
Update WrapDelphiTest to cover the previous commit.
1 parent 0eeecdc commit dc99c7f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Tests/WrapDelphiTest.pas

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,16 +225,12 @@ procedure TTestWrapDelphi.SetupFixture;
225225
// is destroyed, so we need to set its Owned property to True;
226226
TestRttiAccess := TTestRTTIAccess.Create;
227227
TestRttiAccess.InterfaceField := TTestInterfaceImpl.Create;
228-
Py := PyDelphiWrapper.Wrap(TestRttiAccess, TObjectOwnership.soReference);
229-
DelphiModule.SetVar('rtti_var', Py);
230-
PythonEngine.Py_DecRef(Py);
228+
PyDelphiWrapper.DefineVar('rtti_var', TestRttiAccess, TObjectOwnership.soReference);
231229
Py := PyDelphiWrapper.WrapRecord(@Rec, TRttiContext.Create.GetType(TypeInfo(TTestRecord)) as TRttiStructuredType);
232230
DelphiModule.SetVar('rtti_rec', Py);
233231
PythonEngine.Py_DecRef(Py);
234232
FTestInterface := TTestInterfaceImpl.Create;
235-
Py := PyDelphiWrapper.WrapInterface(TValue.From(FTestInterface));
236-
DelphiModule.SetVar('rtti_interface', Py);
237-
PythonEngine.Py_DecRef(Py);
233+
PyDelphiWrapper.DefineVar('rtti_interface', TValue.From(FTestInterface));
238234
PythonEngine.ExecString('from delphi import rtti_var, rtti_rec, rtti_interface, Object, Persistent, Collection, Strings, TestRttiAccess, TestSubclass');
239235
Rtti_Var := MainModule.rtti_var;
240236
Rtti_Rec := MainModule.rtti_rec;

0 commit comments

Comments
 (0)