diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index e857515b11f952..3076f046e3f38f 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -75,9 +75,6 @@ jobs: options: # We don't need a full matrix - flavor: asan arguments: -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES - - flavor: asan-global-storage - arguments: -enableAddressSanitizer YES -enableUndefinedBehaviorSanitizer YES - defines: MTR_PER_CONTROLLER_STORAGE_ENABLED=0 - flavor: tsan arguments: -enableThreadSanitizer YES steps: diff --git a/src/darwin/Framework/CHIP/MTRDefines.h b/src/darwin/Framework/CHIP/MTRDefines.h index fb8fed4f678ab8..ce4e80de8b1a6b 100644 --- a/src/darwin/Framework/CHIP/MTRDefines.h +++ b/src/darwin/Framework/CHIP/MTRDefines.h @@ -102,10 +102,6 @@ #define MTR_UNSTABLE_API _MTR_UNAVAILABLE #endif -#ifndef MTR_PER_CONTROLLER_STORAGE_ENABLED -#define MTR_PER_CONTROLLER_STORAGE_ENABLED 1 -#endif - #pragma mark - Types typedef NSData * MTRTLVBytes; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.h b/src/darwin/Framework/CHIP/MTRDeviceController.h index ea2f6497a45edb..2662d4b54e0f6d 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController.h @@ -24,9 +24,7 @@ @class MTRBaseDevice; @class MTRServerEndpoint; // Defined in MTRServerEndpoint.h, which imports MTRAccessGrant.h, which imports MTRBaseClusters.h, which imports this file, so we can't import it. -#if MTR_PER_CONTROLLER_STORAGE_ENABLED @class MTRDeviceControllerAbstractParameters; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED NS_ASSUME_NONNULL_BEGIN @@ -49,7 +47,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; -#if MTR_PER_CONTROLLER_STORAGE_ENABLED /** * Initialize a device controller with the provided parameters. This will: * @@ -62,19 +59,16 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) */ - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error MTR_NEWLY_AVAILABLE; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED /** * If true, the controller has not been shut down yet. */ @property (readonly, nonatomic, getter=isRunning) BOOL running; -#if MTR_PER_CONTROLLER_STORAGE_ENABLED /** * The ID assigned to this controller at creation time. */ @property (readonly, nonatomic) NSUUID * uniqueIdentifier MTR_NEWLY_AVAILABLE; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED /** * Return the Node ID assigned to the controller. Will return nil if the diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 28a70bd347caf8..4c7c7c7c964659 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -15,12 +15,7 @@ * limitations under the License. */ #import - -#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import -#else -#import "MTRDeviceControllerParameters_Wrapper.h" -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #import "MTRDeviceController_Internal.h" @@ -169,11 +164,9 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory } id storageDelegateToUse = storageDelegate; -#if MTR_PER_CONTROLLER_STORAGE_ENABLED if (MTRDeviceControllerLocalTestStorage.localTestStorageEnabled) { storageDelegateToUse = [[MTRDeviceControllerLocalTestStorage alloc] initWithPassThroughStorage:storageDelegate]; } -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED _controllerDataStore = [[MTRDeviceControllerDataStore alloc] initWithController:self storageDelegate:storageDelegateToUse storageDelegateQueue:storageDelegateQueue]; @@ -181,7 +174,6 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory return nil; } } else { -#if MTR_PER_CONTROLLER_STORAGE_ENABLED if (MTRDeviceControllerLocalTestStorage.localTestStorageEnabled) { dispatch_queue_t localTestStorageQueue = dispatch_queue_create("org.csa-iot.matter.framework.devicecontroller.localteststorage", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); MTRDeviceControllerLocalTestStorage * localTestStorage = [[MTRDeviceControllerLocalTestStorage alloc] initWithPassThroughStorage:nil]; @@ -192,7 +184,6 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory return nil; } } -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED } // Ensure the otaProviderDelegate, if any, is valid. diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h index c49bc897f6b4c0..27019b06df1acb 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h @@ -17,12 +17,8 @@ #import #import #import -#import -#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import -#else -#import "MTRDeviceControllerStorageDelegate_Wrapper.h" -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED +#import #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index dccce24e892531..016f1c1d630d72 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -19,13 +19,8 @@ #import -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -#import -#else -#import "MTRDeviceControllerParameters_Wrapper.h" -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - #import +#import #import #import "MTRCertificates.h" diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h index 4e0290bc041860..0f157b8f89092f 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h @@ -24,15 +24,10 @@ #import // for MTRClusterPath #import #import +#import #import #import -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -#import -#else -#import "MTRDeviceControllerParameters_Wrapper.h" -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - #import "MTRDeviceControllerFactory.h" #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h index 92670f1721c3e2..064a4f866c5cc0 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h @@ -18,8 +18,6 @@ #import #import -#if MTR_PER_CONTROLLER_STORAGE_ENABLED - NS_ASSUME_NONNULL_BEGIN MTR_EXTERN MTR_EXPORT @interface MTRDeviceControllerLocalTestStorage : NSObject @@ -33,5 +31,3 @@ MTR_EXTERN MTR_EXPORT @interface MTRDeviceControllerLocalTestStorage : NSObject< @end NS_ASSUME_NONNULL_END - -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.mm index 7e3eff8e368567..9ccd651760a47d 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.mm @@ -18,8 +18,6 @@ #import "MTRDeviceControllerLocalTestStorage.h" #import "MTRLogging_Internal.h" -#if MTR_PER_CONTROLLER_STORAGE_ENABLED - static NSString * const kLocalTestUserDefaultDomain = @"org.csa-iot.matter.darwintest"; static NSString * const kLocalTestUserDefaultEnabledKey = @"enableTestStorage"; @@ -115,5 +113,3 @@ - (BOOL)controller:(MTRDeviceController *)controller } } @end - -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h index 73369cdf0d1361..9c07f3f82dfced 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h @@ -16,12 +16,6 @@ #import -#if defined(MTR_INTERNAL_INCLUDE) && defined(MTR_INCLUDED_FROM_UMBRELLA_HEADER) -#error Internal includes should not happen from the umbrella header -#endif - -#if MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) - #import #import @@ -32,9 +26,7 @@ NS_ASSUME_NONNULL_BEGIN * interfaces inheriting from this one should be used to actually do the * initialization. */ -#if MTR_PER_CONTROLLER_STORAGE_ENABLED MTR_NEWLY_AVAILABLE -#endif @interface MTRDeviceControllerAbstractParameters : NSObject - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; @@ -44,9 +36,7 @@ MTR_NEWLY_AVAILABLE * Parameters that can be used to initialize an MTRDeviceController which * has a node identity. */ -#if MTR_PER_CONTROLLER_STORAGE_ENABLED MTR_NEWLY_AVAILABLE -#endif @interface MTRDeviceControllerParameters : MTRDeviceControllerAbstractParameters /** @@ -89,9 +79,7 @@ MTR_NEWLY_AVAILABLE @end -#if MTR_PER_CONTROLLER_STORAGE_ENABLED MTR_NEWLY_AVAILABLE -#endif @interface MTRDeviceControllerExternalCertificateParameters : MTRDeviceControllerParameters - (instancetype)init NS_UNAVAILABLE; @@ -142,5 +130,3 @@ MTR_NEWLY_AVAILABLE @end NS_ASSUME_NONNULL_END - -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters_Wrapper.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters_Wrapper.h deleted file mode 100644 index 4f26e1a49c9d18..00000000000000 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters_Wrapper.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2023 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -#error Should be including Matter/MTRDeviceControllerParameters.h -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - -#define MTR_INTERNAL_INCLUDE -#import -#undef MTR_INTERNAL_INCLUDE diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm index 74a9681ca3e619..c48c48c4a424d2 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm @@ -23,11 +23,7 @@ #import "MTRP256KeypairBridge.h" #import "NSDataSpanConversion.h" -#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import -#else -#import "MTRDeviceControllerStorageDelegate_Wrapper.h" -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h index 66ced06e8e1673..6b8c762633578a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h @@ -20,11 +20,7 @@ #import #import #import -#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import -#else -#import "MTRDeviceControllerParameters_Wrapper.h" -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED #include #include diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h index dd8bdd07366498..bdf9bdb1a44c56 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h @@ -18,12 +18,6 @@ #import #import -#if defined(MTR_INTERNAL_INCLUDE) && defined(MTR_INCLUDED_FROM_UMBRELLA_HEADER) -#error Internal includes should not happen from the umbrella header -#endif - -#if MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) - NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSUInteger, MTRStorageSecurityLevel) { @@ -67,9 +61,7 @@ typedef NS_ENUM(NSUInteger, MTRStorageSharingType) { * stored and calling MTRDeviceControllerStorageClasses(), is likely to lead * to deadlocks. */ -#if MTR_PER_CONTROLLER_STORAGE_ENABLED MTR_NEWLY_AVAILABLE -#endif @protocol MTRDeviceControllerStorageDelegate @required /** @@ -113,13 +105,8 @@ MTR_NEWLY_AVAILABLE sharingType:(MTRStorageSharingType)sharingType; @end -// TODO: FIXME: Is this a sane place to put this API? -#if MTR_PER_CONTROLLER_STORAGE_ENABLED MTR_EXTERN MTR_NEWLY_AVAILABLE -#endif NSSet * MTRDeviceControllerStorageClasses(void); NS_ASSUME_NONNULL_END - -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED || defined(MTR_INTERNAL_INCLUDE) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h deleted file mode 100644 index 774fff9f48a179..00000000000000 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate_Wrapper.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2023 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#if MTR_PER_CONTROLLER_STORAGE_ENABLED -#error Should be including Matter/MTRDeviceControllerStorageDelegate.h -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - -#define MTR_INTERNAL_INCLUDE -#import -#undef MTR_INTERNAL_INCLUDE diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index b55d41b8d8a59e..aa9c8c1e906ee3 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -35,12 +35,8 @@ #import #import -#import -#if MTR_PER_CONTROLLER_STORAGE_ENABLED #import -#else -#import "MTRDeviceControllerStorageDelegate_Wrapper.h" -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED +#import #import @class MTRDeviceControllerStartupParamsInternal; @@ -59,13 +55,6 @@ NS_ASSUME_NONNULL_BEGIN @interface MTRDeviceController () -#if !MTR_PER_CONTROLLER_STORAGE_ENABLED -/** - * The ID assigned to this controller at creation time. - */ -@property (readonly, nonatomic) NSUUID * uniqueIdentifier; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - #pragma mark - MTRDeviceControllerFactory methods /** diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.mm index 638b6f5ea48e28..ba8eb555cc4214 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.mm +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.mm @@ -173,12 +173,8 @@ - (BOOL)associateWithController:(nullable MTRDeviceController *)controller MTRDeviceController * existingController = _deviceController; if (existingController != nil) { -#if MTR_PER_CONTROLLER_STORAGE_ENABLED MTR_LOG_ERROR("Cannot associate MTRServerAttribute with controller %@; already associated with controller %@", controller.uniqueIdentifier, existingController.uniqueIdentifier); -#else - MTR_LOG_ERROR("Cannot associate MTRServerAttribute with controller; already associated with a different controller"); -#endif return NO; } diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm index 7439c0ff6a453a..df66ebfe0a5d70 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm @@ -250,12 +250,8 @@ - (BOOL)associateWithController:(nullable MTRDeviceController *)controller MTRDeviceController * existingController = _deviceController; if (existingController != nil) { -#if MTR_PER_CONTROLLER_STORAGE_ENABLED MTR_LOG_ERROR("Cannot associate MTRServerCluster with controller %@; already associated with controller %@", controller.uniqueIdentifier, existingController.uniqueIdentifier); -#else - MTR_LOG_ERROR("Cannot associate MTRServerCluster with controller; already associated with a different controller"); -#endif return NO; } diff --git a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.mm b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.mm index 1d7b466d92d2d9..44da6a6cb6016a 100644 --- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.mm +++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.mm @@ -187,12 +187,8 @@ - (BOOL)associateWithController:(nullable MTRDeviceController *)controller { MTRDeviceController * existingController = _deviceController; if (existingController != nil) { -#if MTR_PER_CONTROLLER_STORAGE_ENABLED MTR_LOG_ERROR("Cannot associate MTRServerEndpoint with controller %@; already associated with controller %@", controller.uniqueIdentifier, existingController.uniqueIdentifier); -#else - MTR_LOG_ERROR("Cannot associate MTRServerEndpoint with controller; already associated with a different controller"); -#endif return NO; } diff --git a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m index b7fa9a1cfa574f..4092a38b56f84e 100644 --- a/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m +++ b/src/darwin/Framework/CHIPTests/MTRControllerAdvertisingTests.m @@ -24,8 +24,6 @@ #import "MTRTestKeys.h" #import "MTRTestPerControllerStorage.h" -#if MTR_PER_CONTROLLER_STORAGE_ENABLED - static const uint16_t kTestVendorId = 0xFFF1u; static const uint16_t kTimeoutInSeconds = 3; @@ -275,5 +273,3 @@ - (void)test001_CheckAdvertisingAsExpected } @end - -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 34d39289cd5772..777fb584d24419 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -119,18 +119,14 @@ @interface MTRDeviceTests : XCTestCase @implementation MTRDeviceTests -#if MTR_PER_CONTROLLER_STORAGE_ENABLED static BOOL slocalTestStorageEnabledBeforeUnitTest; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + (void)setUp { XCTestExpectation * pairingExpectation = [[XCTestExpectation alloc] initWithDescription:@"Pairing Complete"]; -#if MTR_PER_CONTROLLER_STORAGE_ENABLED slocalTestStorageEnabledBeforeUnitTest = MTRDeviceControllerLocalTestStorage.localTestStorageEnabled; MTRDeviceControllerLocalTestStorage.localTestStorageEnabled = YES; -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED __auto_type * factory = [MTRDeviceControllerFactory sharedInstance]; XCTAssertNotNil(factory); @@ -181,13 +177,11 @@ + (void)tearDown { ResetCommissionee(GetConnectedDevice(), dispatch_get_main_queue(), nil, kTimeoutInSeconds); -#if MTR_PER_CONTROLLER_STORAGE_ENABLED // Restore testing setting to previous state, and remove all persisted attributes MTRDeviceControllerLocalTestStorage.localTestStorageEnabled = slocalTestStorageEnabledBeforeUnitTest; [sController.controllerDataStore clearAllStoredAttributes]; NSArray * storedAttributesAfterClear = [sController.controllerDataStore getStoredAttributesForNodeID:@(kDeviceId)]; XCTAssertEqual(storedAttributesAfterClear.count, 0); -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED MTRDeviceController * controller = sController; XCTAssertNotNil(controller); @@ -2839,7 +2833,6 @@ - (void)test030_DeviceAndClusterProperties XCTAssertEqualObjects(cluster.endpointID, @(0)); } -#if MTR_PER_CONTROLLER_STORAGE_ENABLED - (void)test031_MTRDeviceAttributeCacheLocalTestStorage { dispatch_queue_t queue = dispatch_get_main_queue(); @@ -2912,7 +2905,6 @@ - (void)test031_MTRDeviceAttributeCacheLocalTestStorage NSUInteger storedAttributeCountDifferenceFromMTRDeviceReport = dataStoreValuesAfterSecondSubscription.count - attributesReportedWithSecondSubscription; XCTAssertTrue(storedAttributeCountDifferenceFromMTRDeviceReport > 300); } -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED - (void)test032_MTRPathClassesEncoding { diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index fce1ff18b03cf1..3355790c584e83 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -28,8 +28,6 @@ #import "MTRTestPerControllerStorage.h" #import "MTRTestResetCommissioneeHelper.h" -#if MTR_PER_CONTROLLER_STORAGE_ENABLED - static const uint16_t kPairingTimeoutInSeconds = 10; static const uint16_t kTimeoutInSeconds = 3; static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00"; @@ -1808,5 +1806,3 @@ - (void)testControllerServer } @end - -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h index 427d537e07b485..b3052a9929a1af 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h @@ -17,8 +17,6 @@ #import #import -#if MTR_PER_CONTROLLER_STORAGE_ENABLED - NS_ASSUME_NONNULL_BEGIN @interface MTRTestPerControllerStorage : NSObject @@ -43,5 +41,3 @@ NS_ASSUME_NONNULL_BEGIN @end NS_ASSUME_NONNULL_END - -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m index 1a453d5eaec281..1898bd14832cf9 100644 --- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.m @@ -18,8 +18,6 @@ #import "MTRTestPerControllerStorage.h" -#if MTR_PER_CONTROLLER_STORAGE_ENABLED - @interface MTRTestPerControllerStorage () @property (nonatomic, readonly) NSMutableDictionary * storage; @end @@ -85,5 +83,3 @@ - (BOOL)controller:(MTRDeviceController *)controller } @end - -#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED