Skip to content

Commit cf10f8a

Browse files
bzbarsky-applepimpalemahesh
authored andcommitted
Fix comments and naming for Darwin invoke responses validation. (project-chip#37460)
Some typos crept in, and the function argument name was sub-optimal.
1 parent 836ddc7 commit cf10f8a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/darwin/Framework/CHIP/MTRDeviceDataValidation.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ MTR_EXTERN MTR_TESTABLE BOOL MTREventReportIsWellFormed(NSArray<MTRDeviceRespons
3939
// objects in the right places.
4040
MTR_EXTERN MTR_TESTABLE BOOL MTRInvokeResponseIsWellFormed(NSArray<MTRDeviceResponseValueDictionary> * response);
4141

42-
// Returns whether the provided invoke reponses actually has the right sorts of
43-
// objects in the right places. This differes from
44-
// MTRInvokeResponseIsWellFormed in not enforcing that there is only one response.
45-
MTR_EXTERN MTR_TESTABLE BOOL MTRInvokeResponsesAreWellFormed(NSArray<MTRDeviceResponseValueDictionary> * response);
42+
// Returns whether the provided invoke responses actually have the right sorts of objects in the
43+
// right places. This differs from MTRInvokeResponseIsWellFormed in not enforcing that there is
44+
// only one response.
45+
MTR_EXTERN MTR_TESTABLE BOOL MTRInvokeResponsesAreWellFormed(NSArray<MTRDeviceResponseValueDictionary> * responses);
4646

4747
NS_ASSUME_NONNULL_END

src/darwin/Framework/CHIP/MTRDeviceDataValidation.mm

+4-4
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ BOOL MTRInvokeResponseIsWellFormed(NSArray<MTRDeviceResponseValueDictionary> * r
178178
return YES;
179179
}
180180

181-
BOOL MTRInvokeResponsesAreWellFormed(NSArray<MTRDeviceResponseValueDictionary> * response)
181+
BOOL MTRInvokeResponsesAreWellFormed(NSArray<MTRDeviceResponseValueDictionary> * responses)
182182
{
183-
if (!MTR_SAFE_CAST(response, NSArray)) {
184-
MTR_LOG_ERROR("Invoke response is not an array: %@", response);
183+
if (!MTR_SAFE_CAST(responses, NSArray)) {
184+
MTR_LOG_ERROR("Invoke responses are not an array: %@", responses);
185185
return NO;
186186
}
187187

188-
for (MTRDeviceResponseValueDictionary responseValue in response) {
188+
for (MTRDeviceResponseValueDictionary responseValue in responses) {
189189
// Each entry must be a dictionary that has MTRCommandPathKey.
190190

191191
if (!MTR_SAFE_CAST(responseValue, NSDictionary) || !MTR_SAFE_CAST(responseValue[MTRCommandPathKey], MTRCommandPath)) {

0 commit comments

Comments
 (0)