@@ -1574,10 +1574,11 @@ - (void)test017_TestMTRDeviceBasics
1574
1574
[resubscriptionGotReportsExpectation fulfill];
1575
1575
};
1576
1576
1577
- // Set the onDeviceConfigurationChanged callback but do nothing. We shouldn't be called.
1578
- __block BOOL wasOnDeviceConfigurationChangedCallbackCalled = false;
1577
+ // Make sure there are no device configuration changed notifications during this test.
1578
+ // There is nothing changing about the server that would lead to those.
1579
+ __block BOOL wasOnDeviceConfigurationChangedCallbackCalled = NO;
1579
1580
delegate.onDeviceConfigurationChanged = ^() {
1580
- wasOnDeviceConfigurationChangedCallbackCalled = true ;
1581
+ wasOnDeviceConfigurationChangedCallbackCalled = YES ;
1581
1582
};
1582
1583
1583
1584
// reset the onAttributeDataReceived to validate the following resubscribe test
@@ -3052,8 +3053,8 @@ - (void)test032_MTRPathClassesEncoding
3052
3053
XCTAssertEqualObjects(originalCommandPath, decodedCommandPath);
3053
3054
}
3054
3055
3055
- // Helper API to test if changes in an attribute with a path specified by endpointId, clusterId and attributeId affect
3056
- // device configuration changed for a given MTRDevice. This API creates a fake attribute report for the given attribute path
3056
+ // Helper API to test if changes in an attribute with a path specified by endpointId, clusterId and attributeId trigger
3057
+ // device configuration changed callbacks for a given MTRDevice. This API creates a fake attribute report for the given attribute path
3057
3058
// and injects it into MTRDevice to exercise and test the delegate's device configuration changed callback.
3058
3059
+ (void)runTestDeviceConfigurationChangedForAttribute:(MTRAttributeIDType)attributeId
3059
3060
clusterId:(MTRClusterIDType)clusterId
@@ -3093,17 +3094,17 @@ + (void)runTestDeviceConfigurationChangedForAttribute:(MTRAttributeIDType)attrib
3093
3094
MTRAttributePath * attributePath = attributeDict[MTRAttributePathKey];
3094
3095
XCTAssertNotNil(attributePath);
3095
3096
3096
- XCTAssert (attributePath.cluster.unsignedLongValue == clusterId);
3097
- XCTAssert (attributePath.attribute.unsignedLongValue == attributeId);
3097
+ XCTAssertEqualObjects (attributePath.cluster, @( clusterId) );
3098
+ XCTAssertEqualObjects (attributePath.attribute, @( attributeId) );
3098
3099
3099
3100
NSDictionary * data = attributeDict[MTRDataKey];
3100
3101
XCTAssertNotNil(data);
3101
- XCTAssert([ data[MTRDataVersionKey] isEqualToNumber: dataVersion] );
3102
+ XCTAssertEqualObjects( data[MTRDataVersionKey], dataVersion);
3102
3103
3103
3104
NSArray<NSNumber *> * dataValue = data[MTRValueKey];
3104
3105
XCTAssertNotNil(dataValue);
3105
3106
XCTAssertNotNil(testDataValue);
3106
- XCTAssert([ dataValue isEqual: testDataValue] );
3107
+ XCTAssertEqualObjects( dataValue, testDataValue);
3107
3108
[gotAttributeReportExpectation fulfill];
3108
3109
}
3109
3110
};
@@ -3187,13 +3188,11 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged
3187
3188
switch (attributePath.attribute.unsignedLongValue) {
3188
3189
case MTRAttributeIDTypeGlobalAttributeAttributeListID: {
3189
3190
dataVersionForAttributeList = data[MTRDataVersionKey];
3190
- ;
3191
3191
XCTAssertNotNil(dataVersionForAttributeList);
3192
3192
break;
3193
3193
}
3194
3194
case MTRAttributeIDTypeGlobalAttributeClusterRevisionID: {
3195
3195
dataVersionForClusterRevision = data[MTRDataVersionKey];
3196
- ;
3197
3196
XCTAssertNotNil(dataVersionForClusterRevision);
3198
3197
break;
3199
3198
}
@@ -3202,7 +3201,6 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged
3202
3201
NSDictionary * data = attributeDict[MTRDataKey];
3203
3202
XCTAssertNotNil(data);
3204
3203
dataVersionForAcceptedCommandList = data[MTRDataVersionKey];
3205
- ;
3206
3204
XCTAssertNotNil(dataVersionForAcceptedCommandList);
3207
3205
} else if (attributePath.cluster.unsignedLongValue == MTRClusterIDTypeGroupsID && attributePath.attribute.unsignedLongValue == MTRAttributeIDTypeGlobalAttributeFeatureMapID) {
3208
3206
NSDictionary * data = attributeDict[MTRDataKey];
0 commit comments