Skip to content

Commit bf87bcd

Browse files
restyled-commitsnivi-apple
authored andcommitted
Restyled by clang-format
1 parent aa74a1c commit bf87bcd

File tree

2 files changed

+40
-42
lines changed

2 files changed

+40
-42
lines changed

src/darwin/Framework/CHIP/MTRDevice.mm

+1-2
Original file line numberDiff line numberDiff line change
@@ -2545,8 +2545,7 @@ - (NSArray *)_getAttributesToReportWithReportedValues:(NSArray<NSDictionary<NSSt
25452545
// Now that we have grabbed previousValue, update our cache with the attribute value.
25462546
if (readCacheValueChanged) {
25472547
[self _setCachedAttributeValue:attributeDataValue forPath:attributePath];
2548-
if (!_deviceConfigurationChanged)
2549-
{
2548+
if (!_deviceConfigurationChanged) {
25502549
_deviceConfigurationChanged = [self _attributeAffectsDeviceConfiguration:attributePath];
25512550
if (_deviceConfigurationChanged) {
25522551
MTR_LOG_INFO("Device configuration changed due to changes in attribute %@", attributePath);

src/darwin/Framework/CHIPTests/MTRDeviceTests.m

+39-40
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ - (void)controller:(MTRDeviceController *)controller commissioningComplete:(NSEr
117117
@interface MTRDeviceTests : XCTestCase
118118

119119
+ (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)attributeId
120-
clusterId:(MTRClusterIDType)clusterId
121-
endpointId:(NSNumber *)endpointId
122-
device:(MTRDevice *)device
123-
delegate:(MTRDeviceTestDelegate *)delegate
124-
dataVersion:(NSNumber *)dataVersion
125-
attributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport
126-
testcase:(XCTestCase *)testcase
127-
expectConfigurationChanged:(BOOL)expectConfigurationChanged;
120+
clusterId:(MTRClusterIDType)clusterId
121+
endpointId:(NSNumber *)endpointId
122+
device:(MTRDevice *)device
123+
delegate:(MTRDeviceTestDelegate *)delegate
124+
dataVersion:(NSNumber *)dataVersion
125+
attributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport
126+
testcase:(XCTestCase *)testcase
127+
expectConfigurationChanged:(BOOL)expectConfigurationChanged;
128128

129129
@end
130130

@@ -3063,14 +3063,14 @@ - (void)test032_MTRPathClassesEncoding
30633063
// device configuration changed callbacks for a given MTRDevice. This API creates a fake attribute report for the given attribute path
30643064
// and injects it into MTRDevice to exercise and test the delegate's device configuration changed callback.
30653065
+ (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)attributeId
3066-
clusterId:(MTRClusterIDType)clusterId
3067-
endpointId:(NSNumber *)endpointId
3068-
device:(MTRDevice *)device
3069-
delegate:(MTRDeviceTestDelegate *)delegate
3070-
dataVersion:(NSNumber *)dataVersion
3071-
attributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport
3072-
testcase:(XCTestCase *)testcase
3073-
expectConfigurationChanged:(BOOL)expectConfigurationChanged
3066+
clusterId:(MTRClusterIDType)clusterId
3067+
endpointId:(NSNumber *)endpointId
3068+
device:(MTRDevice *)device
3069+
delegate:(MTRDeviceTestDelegate *)delegate
3070+
dataVersion:(NSNumber *)dataVersion
3071+
attributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport
3072+
testcase:(XCTestCase *)testcase
3073+
expectConfigurationChanged:(BOOL)expectConfigurationChanged
30743074
{
30753075
XCTAssertNotNil(endpointId);
30763076
XCTAssertNotNil(device);
@@ -3125,21 +3125,19 @@ + (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)att
31253125
__block BOOL wasOnDeviceConfigurationChangedCallbackCalled = NO;
31263126

31273127
delegate.onDeviceConfigurationChanged = ^() {
3128-
if (expectConfigurationChanged)
3129-
{
3128+
if (expectConfigurationChanged) {
31303129
[deviceConfigurationChangedExpectation fulfill];
31313130
}
31323131
wasOnDeviceConfigurationChangedCallbackCalled = YES;
31333132
};
31343133

31353134
[device unitTestInjectAttributeReport:attributeReport];
31363135

3137-
if (expectConfigurationChanged)
3138-
{
3136+
if (expectConfigurationChanged) {
31393137
[testcase waitForExpectations:@[ gotAttributeReportExpectation, gotAttributeReportEndExpectation, deviceConfigurationChangedExpectation ] timeout:kTimeoutInSeconds];
31403138
XCTAssertTrue(wasOnDeviceConfigurationChangedCallbackCalled);
31413139
} else {
3142-
[testcase waitForExpectations:@[ gotAttributeReportExpectation, gotAttributeReportEndExpectation] timeout:kTimeoutInSeconds];
3140+
[testcase waitForExpectations:@[ gotAttributeReportExpectation, gotAttributeReportEndExpectation ] timeout:kTimeoutInSeconds];
31433141
XCTAssertFalse(wasOnDeviceConfigurationChangedCallbackCalled);
31443142
}
31453143
}
@@ -3427,29 +3425,30 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged
34273425
dataVersionForPowerConfigurationSources = [NSNumber numberWithUnsignedLongLong:(dataVersionForPowerConfigurationSources.unsignedLongLongValue + 1)];
34283426
attributeReport = @[
34293427
@{
3430-
MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypeIdentifyID) attributeID:@(MTRAttributeIDTypeGlobalAttributeAttributeListID)],
3431-
MTRDataKey : @ {
3432-
MTRDataVersionKey : dataVersionForAttributeList,
3433-
MTRTypeKey : MTRArrayValueType,
3434-
MTRValueKey : unsignedIntegerArrayValue,
3435-
}
3428+
MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypeIdentifyID) attributeID:@(MTRAttributeIDTypeGlobalAttributeAttributeListID)],
3429+
MTRDataKey : @ {
3430+
MTRDataVersionKey : dataVersionForAttributeList,
3431+
MTRTypeKey : MTRArrayValueType,
3432+
MTRValueKey : unsignedIntegerArrayValue,
3433+
}
34363434
},
34373435
@{
3438-
MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypeGroupsID) attributeID:@(MTRAttributeIDTypeGlobalAttributeFeatureMapID)],
3439-
MTRDataKey : @ {
3440-
MTRDataVersionKey : dataVersionForFeatureMap,
3441-
MTRTypeKey : MTRUnsignedIntegerValueType,
3442-
MTRValueKey : @3,
3443-
}
3436+
MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypeGroupsID) attributeID:@(MTRAttributeIDTypeGlobalAttributeFeatureMapID)],
3437+
MTRDataKey : @ {
3438+
MTRDataVersionKey : dataVersionForFeatureMap,
3439+
MTRTypeKey : MTRUnsignedIntegerValueType,
3440+
MTRValueKey : @3,
3441+
}
34443442
},
34453443
@{
3446-
MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypePowerSourceConfigurationID) attributeID:@(MTRAttributeIDTypeClusterPowerSourceConfigurationAttributeSourcesID)],
3447-
MTRDataKey : @ {
3448-
MTRDataVersionKey : dataVersionForPowerConfigurationSources,
3449-
MTRTypeKey : MTRArrayValueType,
3450-
MTRValueKey : newUnsignedIntegerArrayValue,
3451-
}
3452-
}];
3444+
MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(0) clusterID:@(MTRClusterIDTypePowerSourceConfigurationID) attributeID:@(MTRAttributeIDTypeClusterPowerSourceConfigurationAttributeSourcesID)],
3445+
MTRDataKey : @ {
3446+
MTRDataVersionKey : dataVersionForPowerConfigurationSources,
3447+
MTRTypeKey : MTRArrayValueType,
3448+
MTRValueKey : newUnsignedIntegerArrayValue,
3449+
}
3450+
}
3451+
];
34533452

34543453
XCTestExpectation * gotAttributeReportWithMultipleAttributesExpectation = [self expectationWithDescription:@"Attribute report with multiple attributes has been received"];
34553454
XCTestExpectation * gotAttributeReportWithMultipleAttributesEndExpectation = [self expectationWithDescription:@"Attribute report with multiple attributes has ended"];

0 commit comments

Comments
 (0)