From 2f2c4f1e311c9c35912e21156f816837986bc857 Mon Sep 17 00:00:00 2001 From: Jeff Tung <100387939+jtung-apple@users.noreply.github.com> Date: Fri, 16 Feb 2024 23:57:19 -0800 Subject: [PATCH] [Darwin] MTRDevice attribute cache persistent storage local test facility (#32181) * [Darwin] MTRDevice attribute cache persistent storage local test facility * Fix header scope * Fix CI compilation issue * Added MTR_PER_CONTROLLER_STORAGE_ENABLED check to fix darwin CI * Fix for the previous fix - now double tested --- src/darwin/Framework/CHIP/MTRBaseDevice.mm | 2 +- .../Framework/CHIP/MTRDeviceController.mm | 22 +++- .../MTRDeviceControllerLocalTestStorage.h | 37 +++++++ .../MTRDeviceControllerLocalTestStorage.m | 97 +++++++++++++++++ .../Framework/CHIPTests/MTRDeviceTests.m | 101 +++++++++++++++--- .../CHIPTests/MTRPerControllerStorageTests.m | 23 +--- .../TestHelpers/MTRTestDeclarations.h | 60 +++++++++++ .../Matter.xcodeproj/project.pbxproj | 17 +-- 8 files changed, 313 insertions(+), 46 deletions(-) create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h create mode 100644 src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.m create mode 100644 src/darwin/Framework/CHIPTests/TestHelpers/MTRTestDeclarations.h diff --git a/src/darwin/Framework/CHIP/MTRBaseDevice.mm b/src/darwin/Framework/CHIP/MTRBaseDevice.mm index 00f65b25dc000b..2a981cdd860fff 100644 --- a/src/darwin/Framework/CHIP/MTRBaseDevice.mm +++ b/src/darwin/Framework/CHIP/MTRBaseDevice.mm @@ -1976,7 +1976,6 @@ - (void)failSubscribers:(dispatch_queue_t)queue completion:(void (^)(void))compl MTR_LOG_DEBUG("Causing failure in subscribers on purpose"); CauseReadClientFailure(self.deviceController, self.nodeID, queue, completion); } -#endif // The following method is for unit testing purpose only + (id)CHIPEncodeAndDecodeNSObject:(id)object @@ -2018,6 +2017,7 @@ + (id)CHIPEncodeAndDecodeNSObject:(id)object } return decodedData.GetDecodedObject(); } +#endif - (void)readEventsWithEndpointID:(NSNumber * _Nullable)endpointID clusterID:(NSNumber * _Nullable)clusterID diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 64d70ce647cdb7..edd521845b2415 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -32,6 +32,7 @@ #import "MTRConversion.h" #import "MTRDeviceControllerDelegateBridge.h" #import "MTRDeviceControllerFactory_Internal.h" +#import "MTRDeviceControllerLocalTestStorage.h" #import "MTRDeviceControllerStartupParams.h" #import "MTRDeviceControllerStartupParams_Internal.h" #import "MTRDevice_Internal.h" @@ -173,12 +174,31 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory return nil; } + 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:storageDelegate + storageDelegate:storageDelegateToUse storageDelegateQueue:storageDelegateQueue]; if (_controllerDataStore == nil) { 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]; + _controllerDataStore = [[MTRDeviceControllerDataStore alloc] initWithController:self + storageDelegate:localTestStorage + storageDelegateQueue:localTestStorageQueue]; + if (_controllerDataStore == nil) { + return nil; + } + } +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED } // Ensure the otaProviderDelegate, if any, is valid. diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h new file mode 100644 index 00000000000000..915834ecabd35c --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.h @@ -0,0 +1,37 @@ +// +/** + * 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. + */ + +#import +#import + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + +NS_ASSUME_NONNULL_BEGIN + +MTR_EXTERN @interface MTRDeviceControllerLocalTestStorage : NSObject + +// Setting this variable only affects subsequent MTRDeviceController initializations +@property (class, nonatomic, assign) BOOL localTestStorageEnabled; + +// This storage persists items to NSUserDefaults for MTRStorageSharingTypeNotShared data. Items with other sharing types will be droppped, or stored/fetched with the "passthrough storage" if one is specified. +- (instancetype)initWithPassThroughStorage:(id _Nullable)passThroughStorage; + +@end + +NS_ASSUME_NONNULL_END + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.m b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.m new file mode 100644 index 00000000000000..4d52e4bf18afb6 --- /dev/null +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerLocalTestStorage.m @@ -0,0 +1,97 @@ +// +/** + * 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. + */ + +#import "MTRDeviceControllerLocalTestStorage.h" + +#if MTR_PER_CONTROLLER_STORAGE_ENABLED + +static NSString * const kLocalTestUserDefaultDomain = @"org.csa-iot.matter.darwintest"; +static NSString * const kLocalTestUserDefaultEnabledKey = @"enableTestStorage"; + +@implementation MTRDeviceControllerLocalTestStorage { + id _passThroughStorage; +} + ++ (BOOL)localTestStorageEnabled +{ + NSUserDefaults * defaults = [[NSUserDefaults alloc] initWithSuiteName:kLocalTestUserDefaultDomain]; + return [defaults boolForKey:kLocalTestUserDefaultEnabledKey]; +} + ++ (void)setLocalTestStorageEnabled:(BOOL)localTestStorageEnabled +{ + NSUserDefaults * defaults = [[NSUserDefaults alloc] initWithSuiteName:kLocalTestUserDefaultDomain]; + [defaults setBool:localTestStorageEnabled forKey:kLocalTestUserDefaultEnabledKey]; +} + +- (instancetype)initWithPassThroughStorage:(id)passThroughStorage +{ + if (self = [super init]) { + _passThroughStorage = passThroughStorage; + } + return self; +} + +- (nullable id)controller:(MTRDeviceController *)controller + valueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ + if (sharingType == MTRStorageSharingTypeNotShared) { + NSUserDefaults * defaults = [[NSUserDefaults alloc] initWithSuiteName:kLocalTestUserDefaultDomain]; + NSData * storedData = [defaults dataForKey:key]; + NSError * error; + id value = [NSKeyedUnarchiver unarchivedObjectOfClasses:MTRDeviceControllerStorageClasses() fromData:storedData error:&error]; + return value; + } else { + return [_passThroughStorage controller:controller valueForKey:key securityLevel:securityLevel sharingType:sharingType]; + } +} + +- (BOOL)controller:(MTRDeviceController *)controller + storeValue:(id)value + forKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ + if (sharingType == MTRStorageSharingTypeNotShared) { + NSError * error; + NSData * data = [NSKeyedArchiver archivedDataWithRootObject:value requiringSecureCoding:YES error:&error]; + NSUserDefaults * defaults = [[NSUserDefaults alloc] initWithSuiteName:kLocalTestUserDefaultDomain]; + [defaults setObject:data forKey:key]; + return YES; + } else { + return [_passThroughStorage controller:controller storeValue:value forKey:key securityLevel:securityLevel sharingType:sharingType]; + } +} + +- (BOOL)controller:(MTRDeviceController *)controller + removeValueForKey:(NSString *)key + securityLevel:(MTRStorageSecurityLevel)securityLevel + sharingType:(MTRStorageSharingType)sharingType +{ + if (sharingType == MTRStorageSharingTypeNotShared) { + NSUserDefaults * defaults = [[NSUserDefaults alloc] initWithSuiteName:kLocalTestUserDefaultDomain]; + [defaults removeObjectForKey:key]; + return YES; + } else { + return [_passThroughStorage controller:controller removeValueForKey:key securityLevel:securityLevel sharingType:sharingType]; + } +} +@end + +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 66bca12cc47bfd..e4628bd475b5ae 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -25,8 +25,10 @@ #import #import "MTRCommandPayloadExtensions_Internal.h" +#import "MTRDeviceControllerLocalTestStorage.h" #import "MTRDeviceTestDelegate.h" #import "MTRErrorTestUtils.h" +#import "MTRTestDeclarations.h" #import "MTRTestKeys.h" #import "MTRTestResetCommissioneeHelper.h" #import "MTRTestStorage.h" @@ -74,19 +76,6 @@ static void WaitForCommissionee(XCTestExpectation * expectation) return mConnectedDevice; } -#ifdef DEBUG -@interface MTRBaseDevice (Test) -- (void)failSubscribers:(dispatch_queue_t)queue completion:(void (^)(void))completion; - -// Test function for whitebox testing -+ (id)CHIPEncodeAndDecodeNSObject:(id)object; -@end - -@interface MTRDevice (Test) -- (void)unitTestInjectEventReport:(NSArray *> *)eventReport; -@end -#endif - @interface MTRDeviceTestDeviceControllerDelegate : NSObject @property (nonatomic, strong) XCTestExpectation * expectation; @end @@ -129,10 +118,19 @@ @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); @@ -182,6 +180,14 @@ + (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); [controller shutdown]; @@ -1236,7 +1242,7 @@ - (void)test015_FailedSubscribeWithQueueAcrossShutdown __auto_type * params = [[MTRSubscribeParams alloc] init]; params.resubscribeAutomatically = NO; params.replaceExistingSubscriptions = NO; // Not strictly needed, but checking that doing this does not - // affect this subscription erroring out correctly. + // affect this subscription erroring out correctly. [device subscribeWithQueue:queue minInterval:1 maxInterval:2 @@ -1344,6 +1350,11 @@ - (void)test016_FailedSubscribeWithCacheReadDuringFailure - (void)test017_TestMTRDeviceBasics { + // Ensure the test starts with clean slate, even with MTRDeviceControllerLocalTestStorage enabled + [sController.controllerDataStore clearAllStoredAttributes]; + NSArray * storedAttributesAfterClear = [sController.controllerDataStore getStoredAttributesForNodeID:@(kDeviceId)]; + XCTAssertEqual(storedAttributesAfterClear.count, 0); + __auto_type * device = [MTRDevice deviceWithNodeID:kDeviceId deviceController:sController]; dispatch_queue_t queue = dispatch_get_main_queue(); @@ -1526,6 +1537,7 @@ - (void)test017_TestMTRDeviceBasics // Resubscription test setup XCTestExpectation * subscriptionDroppedExpectation = [self expectationWithDescription:@"Subscription has dropped"]; + delegate.onNotReachable = ^() { [subscriptionDroppedExpectation fulfill]; }; @@ -1600,7 +1612,7 @@ - (void)test018_SubscriptionErrorWhenNotResubscribing MTRSubscribeParams * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(1) maxInterval:@(10)]; params.resubscribeAutomatically = NO; params.replaceExistingSubscriptions = NO; // Not strictly needed, but checking that doing this does not - // affect this subscription erroring out correctly. + // affect this subscription erroring out correctly. __block BOOL subscriptionEstablished = NO; [device subscribeToAttributesWithEndpointID:@1 clusterID:@6 @@ -2826,6 +2838,65 @@ - (void)test030_DeviceAndClusterProperties XCTAssertEqualObjects(cluster.endpointID, @(0)); } +#if MTR_PER_CONTROLLER_STORAGE_ENABLED +- (void)test031_MTRDeviceAttributeCacheLocalTestStorage +{ + dispatch_queue_t queue = dispatch_get_main_queue(); + + // First start with clean slate and + __auto_type * device = [MTRDevice deviceWithNodeID:@(kDeviceId) controller:sController]; + [sController removeDevice:device]; + [sController.controllerDataStore clearAllStoredAttributes]; + NSArray * storedAttributesAfterClear = [sController.controllerDataStore getStoredAttributesForNodeID:@(kDeviceId)]; + XCTAssertEqual(storedAttributesAfterClear.count, 0); + + // Now recreate device and get subscription primed + device = [MTRDevice deviceWithNodeID:@(kDeviceId) controller:sController]; + XCTestExpectation * gotReportsExpectation = [self expectationWithDescription:@"Attribute and Event reports have been received"]; + __auto_type * delegate = [[MTRDeviceTestDelegate alloc] init]; + __weak __auto_type weakDelegate = delegate; + delegate.onReportEnd = ^{ + [gotReportsExpectation fulfill]; + __strong __auto_type strongDelegate = weakDelegate; + strongDelegate.onReportEnd = nil; + }; + [device setDelegate:delegate queue:queue]; + + [self waitForExpectations:@[ gotReportsExpectation ] timeout:60]; + + NSUInteger attributesReportedWithFirstSubscription = [device unitTestAttributesReportedSinceLastCheck]; + + NSArray * dataStoreValuesAfterFirstSubscription = [sController.controllerDataStore getStoredAttributesForNodeID:@(kDeviceId)]; + XCTAssertTrue(dataStoreValuesAfterFirstSubscription.count > 0); + + // Now remove device, resubscribe, and see that it succeeds + [sController removeDevice:device]; + device = [MTRDevice deviceWithNodeID:@(kDeviceId) controller:sController]; + + XCTestExpectation * resubGotReportsExpectation = [self expectationWithDescription:@"Attribute and Event reports have been received for resubscription"]; + delegate.onReportEnd = ^{ + [resubGotReportsExpectation fulfill]; + __strong __auto_type strongDelegate = weakDelegate; + strongDelegate.onReportEnd = nil; + }; + [device setDelegate:delegate queue:queue]; + + [self waitForExpectations:@[ resubGotReportsExpectation ] timeout:60]; + + NSUInteger attributesReportedWithSecondSubscription = [device unitTestAttributesReportedSinceLastCheck]; + + XCTAssertTrue(attributesReportedWithSecondSubscription < attributesReportedWithFirstSubscription); + + // 1) MTRDevice actually gets some attributes reported more than once + // 2) Some attributes do change on resubscribe + // * With all-clusts-app as of 2024-02-10, out of 1287 persisted attributes, still 450 attributes were reported with filter + // And so conservatively, assert that data version filters save at least 300 entries. + NSArray * dataStoreValuesAfterSecondSubscription = [sController.controllerDataStore getStoredAttributesForNodeID:@(kDeviceId)]; + NSUInteger storedAttributeCountDifferenceFromMTRDeviceReport = dataStoreValuesAfterSecondSubscription.count - attributesReportedWithSecondSubscription; + XCTAssertTrue(storedAttributeCountDifferenceFromMTRDeviceReport > 300); +} +#endif // MTR_PER_CONTROLLER_STORAGE_ENABLED + @end @interface MTRDeviceEncoderTests : XCTestCase diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index 661dbadb9ac445..38795bcc8cef87 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -22,6 +22,7 @@ #import "MTRDeviceTestDelegate.h" #import "MTRErrorTestUtils.h" #import "MTRFabricInfoChecker.h" +#import "MTRTestDeclarations.h" #import "MTRTestKeys.h" #import "MTRTestPerControllerStorage.h" #import "MTRTestResetCommissioneeHelper.h" @@ -33,28 +34,6 @@ static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00"; static const uint16_t kTestVendorId = 0xFFF1u; -#ifdef DEBUG -// MTRDeviceControllerDataStore.h includes C++ header, and so we need to declare the methods separately -@protocol MTRDeviceControllerDataStoreAttributeStoreMethods -- (nullable NSArray *)getStoredAttributesForNodeID:(NSNumber *)nodeID; -- (void)storeAttributeValues:(NSArray *)dataValues forNodeID:(NSNumber *)nodeID; -- (void)clearStoredAttributesForNodeID:(NSNumber *)nodeID; -- (void)clearAllStoredAttributes; -@end - -// Declare internal methods for testing -@interface MTRDeviceController (Test) -+ (void)forceLocalhostAdvertisingOnly; -- (void)removeDevice:(MTRDevice *)device; -@property (nonatomic, readonly, nullable) id controllerDataStore; -@end - -@interface MTRDevice (Test) -- (BOOL)_attributeDataValue:(NSDictionary *)one isEqualToDataValue:(NSDictionary *)theOther; -- (NSUInteger)unitTestAttributesReportedSinceLastCheck; -@end -#endif // DEBUG - @interface MTRPerControllerStorageTestsControllerDelegate : NSObject @property (nonatomic, strong) XCTestExpectation * expectation; @property (nonatomic, strong) NSNumber * deviceID; diff --git a/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestDeclarations.h b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestDeclarations.h new file mode 100644 index 00000000000000..5b77d0ec06aad7 --- /dev/null +++ b/src/darwin/Framework/CHIPTests/TestHelpers/MTRTestDeclarations.h @@ -0,0 +1,60 @@ +// +/** + * 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. + */ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - Declarations for internal methods + +// MTRDeviceControllerDataStore.h includes C++ header, and so we need to declare the methods separately +@protocol MTRDeviceControllerDataStoreAttributeStoreMethods +- (nullable NSArray *)getStoredAttributesForNodeID:(NSNumber *)nodeID; +- (void)storeAttributeValues:(NSArray *)dataValues forNodeID:(NSNumber *)nodeID; +- (void)clearStoredAttributesForNodeID:(NSNumber *)nodeID; +- (void)clearAllStoredAttributes; +@end + +// Declare internal methods for testing +@interface MTRDeviceController (Test) ++ (void)forceLocalhostAdvertisingOnly; +- (void)removeDevice:(MTRDevice *)device; +@property (nonatomic, readonly, nullable) id controllerDataStore; +@end + +@interface MTRDevice (Test) +- (BOOL)_attributeDataValue:(NSDictionary *)one isEqualToDataValue:(NSDictionary *)theOther; +@end + +#pragma mark - Declarations for items compiled only for DEBUG configuration + +#ifdef DEBUG +@interface MTRBaseDevice (TestDebug) +- (void)failSubscribers:(dispatch_queue_t)queue completion:(void (^)(void))completion; + +// Test function for whitebox testing ++ (id)CHIPEncodeAndDecodeNSObject:(id)object; +@end + +@interface MTRDevice (TestDebug) +- (void)unitTestInjectEventReport:(NSArray *> *)eventReport; +- (NSUInteger)unitTestAttributesReportedSinceLastCheck; +@end +#endif + +NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index 5e227bc7a8d2b2..a49b33fa3a1ea4 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -240,6 +240,8 @@ 5ACDDD7D27CD16D200EFD68A /* MTRClusterStateCacheContainer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5ACDDD7C27CD16D200EFD68A /* MTRClusterStateCacheContainer.mm */; }; 5ACDDD7E27CD3F3A00EFD68A /* MTRClusterStateCacheContainer_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 5ACDDD7B27CD14AF00EFD68A /* MTRClusterStateCacheContainer_Internal.h */; }; 5AE6D4E427A99041001F2493 /* MTRDeviceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AE6D4E327A99041001F2493 /* MTRDeviceTests.m */; }; + 75139A6F2B7FE5E900E3A919 /* MTRDeviceControllerLocalTestStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 75139A6E2B7FE5E900E3A919 /* MTRDeviceControllerLocalTestStorage.m */; }; + 75139A702B7FE68C00E3A919 /* MTRDeviceControllerLocalTestStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 75139A6D2B7FE5D600E3A919 /* MTRDeviceControllerLocalTestStorage.h */; settings = {ATTRIBUTES = (Private, ); }; }; 7534F12828BFF20300390851 /* MTRDeviceAttestationDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7534F12628BFF20300390851 /* MTRDeviceAttestationDelegate.mm */; }; 7534F12928BFF20300390851 /* MTRDeviceAttestationDelegate_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7534F12728BFF20300390851 /* MTRDeviceAttestationDelegate_Internal.h */; }; 754F3DF427FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 754F3DF327FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h */; }; @@ -633,6 +635,9 @@ 5ACDDD7B27CD14AF00EFD68A /* MTRClusterStateCacheContainer_Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRClusterStateCacheContainer_Internal.h; sourceTree = ""; }; 5ACDDD7C27CD16D200EFD68A /* MTRClusterStateCacheContainer.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRClusterStateCacheContainer.mm; sourceTree = ""; }; 5AE6D4E327A99041001F2493 /* MTRDeviceTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MTRDeviceTests.m; sourceTree = ""; }; + 75139A6C2B7FE19100E3A919 /* MTRTestDeclarations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRTestDeclarations.h; sourceTree = ""; }; + 75139A6D2B7FE5D600E3A919 /* MTRDeviceControllerLocalTestStorage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MTRDeviceControllerLocalTestStorage.h; sourceTree = ""; }; + 75139A6E2B7FE5E900E3A919 /* MTRDeviceControllerLocalTestStorage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MTRDeviceControllerLocalTestStorage.m; sourceTree = ""; }; 7534F12628BFF20300390851 /* MTRDeviceAttestationDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTRDeviceAttestationDelegate.mm; sourceTree = ""; }; 7534F12728BFF20300390851 /* MTRDeviceAttestationDelegate_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTRDeviceAttestationDelegate_Internal.h; sourceTree = ""; }; 754F3DF327FBB94B00E60580 /* MTREventTLVValueDecoder_Internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTREventTLVValueDecoder_Internal.h; sourceTree = ""; }; @@ -792,9 +797,6 @@ 039145E02993102B00257B3E /* main.mm */, 03F430A52994100000166449 /* controller */, 039547092992DB02006D42A8 /* editline */, - 039546AD2991E193006D42A8 /* log */, - 039546B12991E194006D42A8 /* system */, - 039546A72991E185006D42A8 /* delay */, 039546A22991E132006D42A8 /* interaction_model */, 039546972991DFC4006D42A8 /* lib_json */, 039546872991C400006D42A8 /* chip-tool */, @@ -815,7 +817,6 @@ 03FB93DA2A46200A0048CB35 /* discover */, 037C3D7C2991BD4F00B7EEE2 /* pairing */, 037C3D852991BD4F00B7EEE2 /* clusters */, - 037C3D8B2991BD4F00B7EEE2 /* tests */, 037C3D8D2991BD4F00B7EEE2 /* provider */, 037C3D932991BD4F00B7EEE2 /* payload */, 037C3D972991BD4F00B7EEE2 /* storage */, @@ -1105,6 +1106,7 @@ 51C984602A61CE2A00B0AD9A /* MTRFabricInfoChecker.m */, 75B0D01C2B71B46F002074DD /* MTRDeviceTestDelegate.h */, 75B0D01D2B71B47F002074DD /* MTRDeviceTestDelegate.m */, + 75139A6C2B7FE19100E3A919 /* MTRTestDeclarations.h */, ); path = TestHelpers; sourceTree = ""; @@ -1238,6 +1240,8 @@ 5136661228067D550025EDAE /* MTRDeviceControllerFactory.h */, 5136661128067D540025EDAE /* MTRDeviceControllerFactory_Internal.h */, 5136661028067D540025EDAE /* MTRDeviceControllerFactory.mm */, + 75139A6D2B7FE5D600E3A919 /* MTRDeviceControllerLocalTestStorage.h */, + 75139A6E2B7FE5E900E3A919 /* MTRDeviceControllerLocalTestStorage.m */, 5A6FEC8D27B5624E00F25F42 /* MTRDeviceControllerOverXPC.h */, 5A830D6B27CFCF590053B85D /* MTRDeviceControllerOverXPC_Internal.h */, 5A6FEC8F27B563D900F25F42 /* MTRDeviceControllerOverXPC.mm */, @@ -1555,6 +1559,7 @@ 1EC4CE6425CC276600D7304F /* MTRBaseClusters.h in Headers */, 3D843712294977000070D20A /* MTRCallbackBridgeBase.h in Headers */, 3DECCB742934C21B00585AEC /* MTRDefines.h in Headers */, + 75139A702B7FE68C00E3A919 /* MTRDeviceControllerLocalTestStorage.h in Headers */, 2C5EEEF6268A85C400CAE3D3 /* MTRDeviceConnectionBridge.h in Headers */, 2C8C8FC0253E0C2100797F05 /* MTRPersistentStorageDelegateBridge.h in Headers */, 51FE72352ACDB40000437032 /* MTRCommandPayloads_Internal.h in Headers */, @@ -1753,7 +1758,6 @@ B45373EF2A9FEBFE00807602 /* ops-raw-skt.c in Sources */, 516411332B6BF77700E67C05 /* MTRServerAccessControl.mm in Sources */, 037C3DD52991C2E200B7EEE2 /* CHIPCommandBridge.mm in Sources */, - 039546BC2991E1CB006D42A8 /* LogCommands.cpp in Sources */, 516411312B6BF70300E67C05 /* DataModelHandler.cpp in Sources */, B45373E12A9FEB7F00807602 /* ops-h1.c in Sources */, B45373EB2A9FEBDB00807602 /* ops-listen.c in Sources */, @@ -1766,13 +1770,11 @@ B45373E62A9FEBA400807602 /* header.c in Sources */, B45374002A9FEC4F00807602 /* unix-init.c in Sources */, B45373DF2A9FEB6F00807602 /* system.c in Sources */, - 039546BD2991E1CB006D42A8 /* SystemCommands.cpp in Sources */, B45373FC2A9FEC4F00807602 /* unix-caps.c in Sources */, B4E262162AA0CF1C00DBA5BC /* RemoteDataModelLogger.mm in Sources */, B45373ED2A9FEBEC00807602 /* ops-pipe.c in Sources */, B45373C02A9FEA9100807602 /* output.c in Sources */, 0395470F2992DB37006D42A8 /* complete.c in Sources */, - 039546BE2991E1CB006D42A8 /* DelayCommands.cpp in Sources */, B4E2621B2AA0D02000DBA5BC /* SleepCommand.mm in Sources */, B45373FF2A9FEC4F00807602 /* unix-misc.c in Sources */, B45373D92A9FEB3800807602 /* poll.c in Sources */, @@ -1840,6 +1842,7 @@ 75B765C32A1D82D30014719B /* MTRAttributeSpecifiedCheck.mm in Sources */, AF5F90FF2878D351005503FA /* MTROTAProviderDelegateBridge.mm in Sources */, 516415FF2B6B132200D5CE11 /* DataModelHandler.cpp in Sources */, + 75139A6F2B7FE5E900E3A919 /* MTRDeviceControllerLocalTestStorage.m in Sources */, 51E95DFC2A78443C00A434F0 /* MTRSessionResumptionStorageBridge.mm in Sources */, 514C79ED2B62ADCD00DD6D7B /* ember-compatibility-functions.cpp in Sources */, 7534F12828BFF20300390851 /* MTRDeviceAttestationDelegate.mm in Sources */,