Remove the MTR_PER_CONTROLLER_STORAGE_ENABLED define. (#32956)
This is now enabled unconditionally. Also allows us to remove the wrapper
headers we had to allow us to use the per-controller storage bits internally.
diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml
index e857515..3076f04 100644
--- a/.github/workflows/darwin.yaml
+++ b/.github/workflows/darwin.yaml
@@ -75,9 +75,6 @@
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 fb8fed4..ce4e80d 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 ea2f649..2662d4b 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 @@
- (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 @@
*/
- (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 28a70bd..4c7c7c7 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceController.mm
+++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm
@@ -15,12 +15,7 @@
* limitations under the License.
*/
#import <Matter/MTRDefines.h>
-
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
#import <Matter/MTRDeviceControllerParameters.h>
-#else
-#import "MTRDeviceControllerParameters_Wrapper.h"
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
#import "MTRDeviceController_Internal.h"
@@ -169,11 +164,9 @@
}
id<MTRDeviceControllerStorageDelegate> 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 @@
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 @@
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 c49bc89..27019b0 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.h
@@ -17,12 +17,8 @@
#import <Foundation/Foundation.h>
#import <Matter/MTRDefines.h>
#import <Matter/MTRDeviceController.h>
-#import <Matter/MTRDevice_Internal.h>
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
#import <Matter/MTRDeviceControllerStorageDelegate.h>
-#else
-#import "MTRDeviceControllerStorageDelegate_Wrapper.h"
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
+#import <Matter/MTRDevice_Internal.h>
#include <lib/core/CHIPError.h>
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
index dccce24..016f1c1 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
@@ -19,13 +19,8 @@
#import <Matter/MTRDefines.h>
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
-#import <Matter/MTRDeviceControllerParameters.h>
-#else
-#import "MTRDeviceControllerParameters_Wrapper.h"
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
-
#import <Matter/MTRClusterConstants.h>
+#import <Matter/MTRDeviceControllerParameters.h>
#import <Matter/MTRServerCluster.h>
#import "MTRCertificates.h"
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h
index 4e0290b..0f157b8 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h
@@ -24,15 +24,10 @@
#import <Matter/MTRBaseDevice.h> // for MTRClusterPath
#import <Matter/MTRDefines.h>
#import <Matter/MTRDeviceController.h>
+#import <Matter/MTRDeviceControllerParameters.h>
#import <Matter/MTRDiagnosticLogsType.h>
#import <Matter/MTRServerEndpoint.h>
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
-#import <Matter/MTRDeviceControllerParameters.h>
-#else
-#import "MTRDeviceControllerParameters_Wrapper.h"
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
-
#import "MTRDeviceControllerFactory.h"
#include <lib/core/CHIPPersistentStorageDelegate.h>
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h
index 92670f1..064a4f8 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h
@@ -18,8 +18,6 @@
#import <Foundation/Foundation.h>
#import <Matter/Matter.h>
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
-
NS_ASSUME_NONNULL_BEGIN
MTR_EXTERN MTR_EXPORT @interface MTRDeviceControllerLocalTestStorage : NSObject<MTRDeviceControllerStorageDelegate>
@@ -33,5 +31,3 @@
@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 7e3eff8..9ccd651 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 @@
}
}
@end
-
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h
index 73369cd..9c07f3f 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h
@@ -16,12 +16,6 @@
#import <Matter/MTRDefines.h>
-#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 <Matter/MTRDeviceControllerStorageDelegate.h>
#import <Matter/MTROTAProviderDelegate.h>
@@ -32,9 +26,7 @@
* 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 @@
* 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 @@
@end
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
MTR_NEWLY_AVAILABLE
-#endif
@interface MTRDeviceControllerExternalCertificateParameters : MTRDeviceControllerParameters
- (instancetype)init NS_UNAVAILABLE;
@@ -142,5 +130,3 @@
@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 4f26e1a..0000000
--- 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 <Matter/MTRDefines.h>
-
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
-#error Should be including Matter/MTRDeviceControllerParameters.h
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
-
-#define MTR_INTERNAL_INCLUDE
-#import <Matter/MTRDeviceControllerParameters.h>
-#undef MTR_INTERNAL_INCLUDE
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams.mm
index 74a9681..c48c48c 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 <Matter/MTRDeviceControllerStorageDelegate.h>
-#else
-#import "MTRDeviceControllerStorageDelegate_Wrapper.h"
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
#include <controller/OperationalCredentialsDelegate.h>
#include <credentials/CHIPCert.h>
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h
index 66ced06..6b8c762 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStartupParams_Internal.h
@@ -20,11 +20,7 @@
#import <Foundation/Foundation.h>
#import <Matter/MTRDefines.h>
#import <Matter/MTRDeviceController.h>
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
#import <Matter/MTRDeviceControllerParameters.h>
-#else
-#import "MTRDeviceControllerParameters_Wrapper.h"
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
#include <crypto/CHIPCryptoPAL.h>
#include <lib/core/DataModelTypes.h>
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h
index dd8bdd0..bdf9bdb 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerStorageDelegate.h
@@ -18,12 +18,6 @@
#import <Matter/MTRDefines.h>
#import <Matter/MTRDeviceController.h>
-#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 @@
* stored and calling MTRDeviceControllerStorageClasses(), is likely to lead
* to deadlocks.
*/
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
MTR_NEWLY_AVAILABLE
-#endif
@protocol MTRDeviceControllerStorageDelegate <NSObject>
@required
/**
@@ -113,13 +105,8 @@
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<Class> *
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 774fff9..0000000
--- 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 <Matter/MTRDefines.h>
-
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
-#error Should be including Matter/MTRDeviceControllerStorageDelegate.h
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
-
-#define MTR_INTERNAL_INCLUDE
-#import <Matter/MTRDeviceControllerStorageDelegate.h>
-#undef MTR_INTERNAL_INCLUDE
diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h
index b55d41b..aa9c8c1 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h
+++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h
@@ -35,12 +35,8 @@
#import <Matter/MTRDefines.h>
#import <Matter/MTRDeviceControllerStartupParams.h>
-#import <Matter/MTRDiagnosticLogsType.h>
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
#import <Matter/MTRDeviceControllerStorageDelegate.h>
-#else
-#import "MTRDeviceControllerStorageDelegate_Wrapper.h"
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
+#import <Matter/MTRDiagnosticLogsType.h>
#import <Matter/MTROTAProviderDelegate.h>
@class MTRDeviceControllerStartupParamsInternal;
@@ -59,13 +55,6 @@
@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 638b6f5..ba8eb55 100644
--- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.mm
+++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerAttribute.mm
@@ -173,12 +173,8 @@
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 7439c0f..df66ebf 100644
--- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm
+++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerCluster.mm
@@ -250,12 +250,8 @@
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 1d7b466..44da6a6 100644
--- a/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.mm
+++ b/src/darwin/Framework/CHIP/ServerEndpoint/MTRServerEndpoint.mm
@@ -187,12 +187,8 @@
{
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 b7fa9a1..4092a38 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 @@
}
@end
-
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED
diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m
index 34d3928..777fb58 100644
--- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m
+++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m
@@ -119,18 +119,14 @@
@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 @@
{
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 @@
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 @@
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 fce1ff1..3355790 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 @@
}
@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 427d537..b3052a9 100644
--- a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h
+++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestPerControllerStorage.h
@@ -17,8 +17,6 @@
#import <Foundation/Foundation.h>
#import <Matter/Matter.h>
-#if MTR_PER_CONTROLLER_STORAGE_ENABLED
-
NS_ASSUME_NONNULL_BEGIN
@interface MTRTestPerControllerStorage : NSObject <MTRDeviceControllerStorageDelegate>
@@ -43,5 +41,3 @@
@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 1a453d5..1898bd1 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<NSString *, NSData *> * storage;
@end
@@ -85,5 +83,3 @@
}
@end
-
-#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED