Skip to content

Commit

Permalink
correction to unitTestInjectAttributeReport - should have been `fro…
Browse files Browse the repository at this point in the history
…mSubscription:YES`. also allow configuration for all unit test attribute report injections.
  • Loading branch information
kiel-apple committed May 16, 2024
1 parent 76a6f5f commit 476607d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 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 @@ -1179,11 +1179,11 @@ - (void)unitTestInjectEventReport:(NSArray<NSDictionary<NSString *, id> *> *)eve
});
}

- (void)unitTestInjectAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport
- (void)unitTestInjectAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport fromSubscription:(BOOL)isFromSubscription
{
dispatch_async(self.queue, ^{
[self _handleReportBegin];
[self _handleAttributeReport:attributeReport fromSubscription:NO];
[self _handleAttributeReport:attributeReport fromSubscription:isFromSubscription];
[self _handleReportEnd];
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/darwin/Framework/CHIPTests/MTRDeviceTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -3202,7 +3202,7 @@ + (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)att
wasOnDeviceConfigurationChangedCallbackCalled = YES;
};

[device unitTestInjectAttributeReport:attributeReport];
[device unitTestInjectAttributeReport:attributeReport fromSubscription:YES];

[testcase waitForExpectations:@[ gotAttributeReportExpectation, gotAttributeReportEndExpectation, deviceConfigurationChangedExpectation ] timeout:kTimeoutInSeconds];
if (!expectConfigurationChanged) {
Expand Down Expand Up @@ -3530,7 +3530,7 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged
[deviceConfigurationChangedExpectationForAttributeReportWithMultipleAttributes fulfill];
};

[device unitTestInjectAttributeReport:attributeReport];
[device unitTestInjectAttributeReport:attributeReport fromSubscription:YES];
[self waitForExpectations:@[ gotAttributeReportWithMultipleAttributesExpectation, gotAttributeReportWithMultipleAttributesEndExpectation, deviceConfigurationChangedExpectationForAttributeReportWithMultipleAttributes ] timeout:kTimeoutInSeconds];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN

@interface MTRDevice (TestDebug)
- (void)unitTestInjectEventReport:(NSArray<NSDictionary<NSString *, id> *> *)eventReport;
- (void)unitTestInjectAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport;
- (void)unitTestInjectAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport fromSubscription:(BOOL)isFromSubscription;
- (NSUInteger)unitTestAttributesReportedSinceLastCheck;
- (void)unitTestClearClusterData;
@end
Expand Down

0 comments on commit 476607d

Please sign in to comment.