Skip to content

Commit 0f76b5f

Browse files
nivi-applewoody-apple
authored andcommitted
Add few more strong types for data structures
1 parent 700496c commit 0f76b5f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m

+5-6
Original file line numberDiff line numberDiff line change
@@ -2297,7 +2297,6 @@ - (void)testSubscriptionPool
22972297
[self doTestSubscriptionPoolWithSize:1 deviceOnboardingPayloads:deviceOnboardingPayloads];
22982298
[self doTestSubscriptionPoolWithSize:2 deviceOnboardingPayloads:deviceOnboardingPayloads];
22992299
}
2300-
}
23012300

23022301
- (MTRDevice *)getMTRDevice:(NSNumber *)deviceID
23032302
{
@@ -2489,7 +2488,7 @@ - (void)testDataStorageUpdatesWhenRemovingEndpoints
24892488
[self waitForExpectations:@[ attributeDataReceivedExpectation, reportEndExpectation ] timeout:60];
24902489

24912490
[controller.controllerDataStore clearAllStoredClusterData];
2492-
NSDictionary * storedClusterDataAfterClear = [controller.controllerDataStore getStoredClusterDataForNodeID:deviceID];
2491+
NSDictionary<MTRClusterPath *, MTRDeviceClusterData *> * storedClusterDataAfterClear = [controller.controllerDataStore getStoredClusterDataForNodeID:deviceID];
24932492
XCTAssertEqual(storedClusterDataAfterClear.count, 0);
24942493

24952494
[controller removeDevice:device];
@@ -2614,7 +2613,7 @@ - (void)testDataStorageUpdatesWhenRemovingClusters
26142613
[self waitForExpectations:@[ attributeDataReceivedExpectation, reportEndExpectation ] timeout:60];
26152614

26162615
[controller.controllerDataStore clearAllStoredClusterData];
2617-
NSDictionary * storedClusterDataAfterClear = [controller.controllerDataStore getStoredClusterDataForNodeID:deviceID];
2616+
NSDictionary<MTRClusterPath *, MTRDeviceClusterData *> * storedClusterDataAfterClear = [controller.controllerDataStore getStoredClusterDataForNodeID:deviceID];
26182617
XCTAssertEqual(storedClusterDataAfterClear.count, 0);
26192618

26202619
[controller removeDevice:device];
@@ -2683,10 +2682,10 @@ - (void)testDataStorageUpdatesWhenRemovingAttributes
26832682
XCTAssertNotNil(data);
26842683
XCTAssertNotNil(data.attributes);
26852684

2686-
NSDictionary * dict = [data.attributes objectForKey:@(MTRAttributeIDTypeGlobalAttributeAttributeListID)];
2685+
MTRDeviceDataValueDictionary dict = [data.attributes objectForKey:@(MTRAttributeIDTypeGlobalAttributeAttributeListID)];
26872686
XCTAssertNotNil(dict);
26882687

2689-
NSMutableArray * persistedAttributes = [device arrayOfNumbersFromAttributeValue:dict];
2688+
NSMutableArray<NSNumber *> * persistedAttributes = [device arrayOfNumbersFromAttributeValue:dict];
26902689
initialTestAttributes = [device arrayOfNumbersFromAttributeValue:@ { MTRTypeKey : MTRArrayValueType, MTRValueKey : testClusterDataValue }];
26912690
XCTAssertNotNil(persistedAttributes);
26922691
for (NSNumber * attribute in initialTestAttributes) {
@@ -2770,7 +2769,7 @@ - (void)testDataStorageUpdatesWhenRemovingAttributes
27702769
[self waitForExpectations:@[ attributeDataReceivedExpectation, reportEndExpectation ] timeout:60];
27712770

27722771
[controller.controllerDataStore clearAllStoredClusterData];
2773-
NSDictionary * storedClusterDataAfterClear = [controller.controllerDataStore getStoredClusterDataForNodeID:deviceID];
2772+
NSDictionary<MTRClusterPath *, MTRDeviceClusterData *> * storedClusterDataAfterClear = [controller.controllerDataStore getStoredClusterDataForNodeID:deviceID];
27742773
XCTAssertEqual(storedClusterDataAfterClear.count, 0);
27752774

27762775
[controller removeDevice:device];

0 commit comments

Comments
 (0)