From 52a89ee91b63427ba93860a376ecb37aa5c40e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Seweryn=20Plaz=CC=87uk?= Date: Mon, 18 Nov 2024 14:17:13 +0100 Subject: [PATCH 1/2] Fix noop code in DTXIPCConnection when assertions are turned off. --- Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m b/Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m index c05677d..00e4996 100644 --- a/Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m +++ b/Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m @@ -235,7 +235,8 @@ - (instancetype)initWithServiceName:(NSString *)serviceName _slave = YES; //Attempt becoming the slave - NSAssert([self _commonInit] == YES, @"The service “%@” already has two endpoints connected.", _serviceName); + BOOL initResult = [self _commonInit]; + NSAssert(initResult == YES, @"The service “%@” already has two endpoints connected.", _serviceName); _otherConnection = [NSConnection connectionWithRegisteredName:_serviceName host:nil]; [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_otherConnectionDidDie:) name:NSConnectionDidDieNotification object:_otherConnection]; From 2c0942b12eae80208e977a2bfe3fb0cabf547b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Seweryn=20Plaz=CC=87uk?= Date: Mon, 18 Nov 2024 15:17:44 +0100 Subject: [PATCH 2/2] Fix indentation --- Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m b/Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m index 00e4996..ebe3604 100644 --- a/Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m +++ b/Sources/SBTUITestTunnelCommon/DetoxIPC/DTXIPCConnection.m @@ -235,7 +235,7 @@ - (instancetype)initWithServiceName:(NSString *)serviceName _slave = YES; //Attempt becoming the slave - BOOL initResult = [self _commonInit]; + BOOL initResult = [self _commonInit]; NSAssert(initResult == YES, @"The service “%@” already has two endpoints connected.", _serviceName); _otherConnection = [NSConnection connectionWithRegisteredName:_serviceName host:nil];