Skip to content

Commit

Permalink
Uncomment subscription pool tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nivi-apple committed May 30, 2024
1 parent e00746c commit 24a4581
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIP/MTRDevice.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3075,7 +3075,7 @@ - (void)_pruneEndpointsIn:(MTRDeviceDataValueDictionary)previousPartsListValue
// If the parts list changed and one or more endpoints were removed, remove all the
// clusters for all those endpoints from our data structures.
// Also remove those endpoints from the data store.
NSMutableSet<NSNumber*> * toBeRemovedEndpoints = [NSMutableSet setWithArray:[self arrayOfNumbersFromAttributeValue:previousPartsListValue]];
NSMutableSet<NSNumber *> * toBeRemovedEndpoints = [NSMutableSet setWithArray:[self arrayOfNumbersFromAttributeValue:previousPartsListValue]];
NSSet<NSNumber *> * endpointsOnDevice = [NSSet setWithArray:[self arrayOfNumbersFromAttributeValue:newPartsListValue]];
[toBeRemovedEndpoints minusSet:endpointsOnDevice];

Expand All @@ -3093,7 +3093,7 @@ - (void)_pruneEndpointsIn:(MTRDeviceDataValueDictionary)previousPartsListValue

- (void)_pruneClustersIn:(MTRDeviceDataValueDictionary)previousServerListValue
missingFrom:(MTRDeviceDataValueDictionary)newServerListValue
forEndpoint:(NSNumber *)endpointID
forEndpoint:(NSNumber *)endpointID
{
// If the server list changed and clusters were removed, remove those clusters from our data structures.
// Also remove it from the data store.
Expand Down
3 changes: 1 addition & 2 deletions src/darwin/Framework/CHIP/MTRDeviceControllerDataStore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,7 @@ - (void)clearStoredClusterDataForNodeID:(NSNumber *)nodeID endpointID:(NSNumber

NSArray<NSNumber *> * clusterIndex = [self _fetchClusterIndexForNodeID:nodeID endpointID:endpointID];

for (NSNumber * cluster in clusterIndex)
{
for (NSNumber * cluster in clusterIndex) {
success = [self _deleteClusterDataForNodeID:nodeID endpointID:endpointID clusterID:cluster];
if (!success) {
MTR_LOG_ERROR("Delete failed for clusterData for node 0x%016llX endpoint %u cluster 0x%08lX", nodeID.unsignedLongLongValue, endpointID.unsignedShortValue, cluster.unsignedLongValue);
Expand Down
8 changes: 3 additions & 5 deletions src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
static const uint16_t kTimeoutInSeconds = 3;
static NSString * kOnboardingPayload = @"MT:-24J0AFN00KA0648G00";
static const uint16_t kTestVendorId = 0xFFF1u;
//static const uint16_t kSubscriptionPoolBaseTimeoutInSeconds = 10;
static const uint16_t kSubscriptionPoolBaseTimeoutInSeconds = 10;

@interface MTRPerControllerStorageTestsControllerDelegate : NSObject <MTRDeviceControllerDelegate>
@property (nonatomic, strong) XCTestExpectation * expectation;
Expand Down Expand Up @@ -2157,7 +2157,7 @@ - (void)testSetMRPParametersWithRunningController
MTRSetMessageReliabilityParameters(nil, nil, nil, nil);
}

/*static NSString * const kLocalTestUserDefaultDomain = @"org.csa-iot.matter.darwintest";
static NSString * const kLocalTestUserDefaultDomain = @"org.csa-iot.matter.darwintest";
static NSString * const kLocalTestUserDefaultSubscriptionPoolSizeOverrideKey = @"subscriptionPoolSizeOverride";

// TODO: This might also want to go in a separate test file, with some shared setup for commissioning devices per test
Expand Down Expand Up @@ -2300,7 +2300,7 @@ - (void)testSubscriptionPool
[self doTestSubscriptionPoolWithSize:1 deviceOnboardingPayloads:deviceOnboardingPayloads];
[self doTestSubscriptionPoolWithSize:2 deviceOnboardingPayloads:deviceOnboardingPayloads];
}
}*/
}

- (MTRDevice *)getMTRDevice:(NSNumber *)deviceID
{
Expand Down Expand Up @@ -2674,7 +2674,6 @@ - (void)testDataStorageUpdatesWhenRemovingAttributes
XCTAssertNotNil(testClusterDataValue);

dispatch_sync(self->_storageQueue, ^{

for (NSNumber * cluster in [controller.controllerDataStore _fetchClusterIndexForNodeID:deviceID endpointID:testEndpoint]) {

// Make sure that the cluster data in the data storage is populated with cluster data for MTRClusterIDTypeIdentifyID cluster
Expand Down Expand Up @@ -2740,7 +2739,6 @@ - (void)testDataStorageUpdatesWhenRemovingAttributes
// and has all attributes except attribute 1 which was deleted.
// We will page in the cluster data from storage to check the above.
dispatch_sync(self->_storageQueue, ^{

for (NSNumber * cluster in [controller.controllerDataStore _fetchClusterIndexForNodeID:deviceID endpointID:testEndpoint]) {
MTRDeviceClusterData * clusterData = [controller.controllerDataStore _fetchClusterDataForNodeID:deviceID endpointID:testEndpoint clusterID:cluster];
XCTAssertNotNil(clusterData);
Expand Down

0 comments on commit 24a4581

Please sign in to comment.