Skip to content

Commit

Permalink
Fixed style
Browse files Browse the repository at this point in the history
  • Loading branch information
jtung-apple committed Jul 7, 2022
1 parent 6a63b11 commit d4e74a9
Show file tree
Hide file tree
Showing 6 changed files with 514 additions and 512 deletions.
4 changes: 3 additions & 1 deletion src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ - (nullable MTRBaseDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId error:
return nil;
}

- (BOOL)getBaseDevice:(uint64_t)deviceID queue:(dispatch_queue_t)queue completionHandler:(MTRDeviceConnectionCallback)completionHandler
- (BOOL)getBaseDevice:(uint64_t)deviceID
queue:(dispatch_queue_t)queue
completionHandler:(MTRDeviceConnectionCallback)completionHandler
{
dispatch_async(_workQueue, ^{
dispatch_group_t group = dispatch_group_create();
Expand Down
26 changes: 13 additions & 13 deletions src/darwin/Framework/CHIPTests/MTRClustersTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ - (void)testInitStack

__block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"];
[controller getBaseDevice:nodeId
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[connectionExpectation fulfill];
connectionExpectation = nil;
}];
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[connectionExpectation fulfill];
connectionExpectation = nil;
}];
[self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil];
}

Expand All @@ -169,13 +169,13 @@ - (void)testReuseChipClusterObject
__block MTRBaseDevice * device;
__block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"];
[controller getBaseDevice:nodeId
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable retrievedDevice, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[connectionExpectation fulfill];
connectionExpectation = nil;
device = retrievedDevice;
}];
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable retrievedDevice, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[connectionExpectation fulfill];
connectionExpectation = nil;
device = retrievedDevice;
}];
[self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil];

XCTestExpectation * expectation = [self expectationWithDescription:@"ReuseMTRClusterObjectFirstCall"];
Expand Down
8 changes: 4 additions & 4 deletions src/darwin/Framework/CHIPTests/MTRControllerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ - (void)testControllerInvalidAccess

XCTAssertFalse([controller isRunning]);
XCTAssertFalse([controller getBaseDevice:1234
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable chipDevice, NSError * _Nullable error) {
XCTAssertEqual(error.code, MTRErrorCodeInvalidState);
}]);
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable chipDevice, NSError * _Nullable error) {
XCTAssertEqual(error.code, MTRErrorCodeInvalidState);
}]);

[factory shutdown];
XCTAssertFalse([factory isRunning]);
Expand Down
24 changes: 12 additions & 12 deletions src/darwin/Framework/CHIPTests/MTRDeviceTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ static void WaitForCommissionee(XCTestExpectation * expectation, dispatch_queue_
XCTAssertNotNil(controller);

[controller getBaseDevice:kDeviceId
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[expectation fulfill];
mConnectedDevice = device;
}];
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[expectation fulfill];
mConnectedDevice = device;
}];
}

static MTRBaseDevice * GetConnectedDevice(void)
Expand Down Expand Up @@ -178,12 +178,12 @@ - (void)initStack

__block XCTestExpectation * connectionExpectation = [self expectationWithDescription:@"CASE established"];
[controller getBaseDevice:kDeviceId
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[connectionExpectation fulfill];
connectionExpectation = nil;
}];
queue:dispatch_get_main_queue()
completionHandler:^(MTRBaseDevice * _Nullable device, NSError * _Nullable error) {
XCTAssertEqual(error.code, 0);
[connectionExpectation fulfill];
connectionExpectation = nil;
}];
[self waitForExpectationsWithTimeout:kCASESetupTimeoutInSeconds handler:nil];
}

Expand Down
Loading

0 comments on commit d4e74a9

Please sign in to comment.