Skip to content

Commit 6428c58

Browse files
Apply suggestions from code review
Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent e98778c commit 6428c58

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/darwin/Framework/CHIPTests/MTRDeviceTests.m

+6-7
Original file line numberDiff line numberDiff line change
@@ -3011,7 +3011,7 @@ - (void)test031_MTRDeviceAttributeCacheLocalTestStorage
30113011
// We need to remove the device here since the MTRDevice retains its reachable state. So if the next test needs to start with a clean state,
30123012
// it can't do that since the MTRDevice becomes reachable in the previous test. Since there are no changes detected in reachability,
30133013
// the onReachable callback to the delegate is not called.
3014-
// TODO: #33205 Ensure we have a clean slate w.r.t MTRDevice bfeore running each test.
3014+
// TODO: #33205 Ensure we have a clean slate w.r.t MTRDevice before running each test.
30153015
[sController removeDevice:device];
30163016
}
30173017

@@ -3111,7 +3111,7 @@ + (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)att
31113111
XCTAssertNotNil(data);
31123112
XCTAssertEqualObjects(data[MTRDataVersionKey], dataVersion);
31133113

3114-
NSArray<NSNumber *> * dataValue = data[MTRValueKey];
3114+
id dataValue = data[MTRValueKey];
31153115
XCTAssertNotNil(dataValue);
31163116
XCTAssertNotNil(testDataValue);
31173117
XCTAssertEqualObjects(dataValue, testDataValue);
@@ -3320,9 +3320,9 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged
33203320
}
33213321
} ];
33223322

3323-
// Test attribute path - endpointId = 0, clusterId = descriptor, attributeId = server list.
33243323
[MTRDeviceTests checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID clusterId:MTRClusterIDTypeDescriptorID endpointId:@(0) device:device delegate:delegate dataVersion:dataVersionForDeviceTypesList attributeReport:attributeReport testcase:self expectConfigurationChanged:YES];
33253324

3325+
// Test attribute path - endpointId = 0, clusterId = descriptor, attributeId = server list.
33263326
dataVersionForServerList = [NSNumber numberWithUnsignedLongLong:(dataVersionForServerList.unsignedLongLongValue + 1)];
33273327
attributeReport = @[ @{
33283328
MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributeServerListID)],
@@ -3466,10 +3466,9 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged
34663466
[device unitTestInjectAttributeReport:attributeReport];
34673467
[self waitForExpectations:@[ gotAttributeReportWithMultipleAttributesExpectation, gotAttributeReportWithMultipleAttributesEndExpectation, deviceConfigurationChangedExpectationForAttributeReportWithMultipleAttributes ] timeout:kTimeoutInSeconds];
34683468

3469-
// We need to remove the device here since the MTRDevice retains its reachable state. So if the next test needs to start with a clean state,
3470-
// it can't do that since the MTRDevice becomes reachable in the previous test. Since there are no changes detected in reachability,
3471-
// the onReachable callback to the delegate is not called.
3472-
// TODO: #33205 Ensure we have a clean slate w.r.t MTRDevice bfeore running each test.
3469+
// We need to remove the device here, because we injected data into its attribute cache
3470+
// that does not match the actual server.
3471+
// TODO: #33205 Ensure we have a clean slate w.r.t MTRDevice before running each test.
34733472
[sController removeDevice:device];
34743473
}
34753474

0 commit comments

Comments
 (0)