From 0a702951cb5f708feef2402a8cda5dd299c08432 Mon Sep 17 00:00:00 2001 From: Thom McGrath Date: Fri, 1 Dec 2023 11:40:01 -0500 Subject: [PATCH] Corrected delegate test --- Project/Modules/Tests.xojo_code | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Project/Modules/Tests.xojo_code b/Project/Modules/Tests.xojo_code index a392eb55b..1bbf9f8f4 100644 --- a/Project/Modules/Tests.xojo_code +++ b/Project/Modules/Tests.xojo_code @@ -189,16 +189,17 @@ Protected Module Tests Var ClassTarget As Variant = GetDelegateTargetMBS(ClassDelegate) Var ClassWeak As Boolean = GetDelegateWeakMBS(ClassDelegate) - ClassInstance = Nil - Var UnsafeClassTarget As Variant = GetDelegateTargetMBS(ClassDelegate) - Var UnsafeClassWeak As Boolean = GetDelegateWeakMBS(ClassDelegate) - Call Assert(ModuleTarget.IsNull = True, "Module method delegate has a target when it should not.") Call Assert(ModuleWeak = False, "Module method delegate is weak but that should not be possible.") Call Assert(ClassTarget.IsNull = False, "Instance method delegate does not have a target.") Call Assert(ClassWeak = True, "Instance method delegate is not weak.") + ClassInstance = Nil + ClassTarget = Nil + Var UnsafeClassTarget As Variant = GetDelegateTargetMBS(ClassDelegate) + Var UnsafeClassWeak As Boolean = GetDelegateWeakMBS(ClassDelegate) + Call Assert(UnsafeClassTarget.IsNull = True, "Unsafe instance method delegate has a target.") Call Assert(UnsafeClassWeak = True, "Unsafe instance method delegate is not weak.") End Sub