ios: apply clang-format to Objective-C++ sources (#4060)

This commit is contained in:
Bart Louwers
2026-02-24 14:37:35 +01:00
committed by GitHub
parent 41832b518d
commit 5787f9cc38
134 changed files with 29751 additions and 27896 deletions

View File

@@ -1,6 +1,6 @@
#import "../../../darwin/src/MLNGeometry_Private.h"
#import "MLNMapViewIntegrationTest.h"
#import "MLNTestUtility.h"
#import "../../../darwin/src/MLNGeometry_Private.h"
#include <mbgl/map/camera.hpp>
@@ -10,90 +10,93 @@
@implementation MLNCameraTransitionFinishTests
- (void)testEaseToCompletionHandler {
MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0),
CLLocationCoordinate2DMake(1.0, 1.0));
MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds];
MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0),
CLLocationCoordinate2DMake(1.0, 1.0));
MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds];
XCTestExpectation *expectation =
[self expectationWithDescription:@"Completion block should be called"];
XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should be called"];
[self.mapView setCamera:camera
withDuration:0.0
animationTimingFunction:nil
completionHandler:^{
[self.mapView setCamera:camera
withDuration:0.0
animationTimingFunction:nil
completionHandler:^{
[expectation fulfill];
}];
}];
[self waitForExpectations:@[expectation] timeout:0.5];
[self waitForExpectations:@[ expectation ] timeout:0.5];
}
- (void)testEaseToCompletionHandlerAnimated {
MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0),
CLLocationCoordinate2DMake(1.0, 1.0));
MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds];
MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0),
CLLocationCoordinate2DMake(1.0, 1.0));
MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds];
XCTestExpectation *expectation =
[self expectationWithDescription:@"Completion block should be called"];
XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should be called"];
[self.mapView setCamera:camera
withDuration:0.3
animationTimingFunction:nil
completionHandler:^{
[self.mapView setCamera:camera
withDuration:0.3
animationTimingFunction:nil
completionHandler:^{
[expectation fulfill];
}];
}];
[self waitForExpectations:@[expectation] timeout:0.5];
[self waitForExpectations:@[ expectation ] timeout:0.5];
}
- (void)testFlyToCompletionHandler {
MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0),
CLLocationCoordinate2DMake(1.0, 1.0));
MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds];
MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0),
CLLocationCoordinate2DMake(1.0, 1.0));
MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds];
XCTestExpectation *expectation =
[self expectationWithDescription:@"Completion block should be called"];
XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should be called"];
[self.mapView flyToCamera:camera
withDuration:0.0
completionHandler:^{
[expectation fulfill];
}];
[self.mapView flyToCamera:camera
withDuration:0.0
completionHandler:^{
[expectation fulfill];
}];
[self waitForExpectations:@[expectation] timeout:0.5];
[self waitForExpectations:@[ expectation ] timeout:0.5];
}
- (void)testFlyToCompletionHandlerAnimated {
MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0),
CLLocationCoordinate2DMake(1.0, 1.0));
MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds];
MLNCoordinateBounds bounds = MLNCoordinateBoundsMake(CLLocationCoordinate2DMake(0.0, 0.0),
CLLocationCoordinate2DMake(1.0, 1.0));
MLNMapCamera *camera = [self.mapView cameraThatFitsCoordinateBounds:bounds];
XCTestExpectation *expectation =
[self expectationWithDescription:@"Completion block should be called"];
XCTestExpectation *expectation = [self expectationWithDescription:@"Completion block should be called"];
[self.mapView flyToCamera:camera
withDuration:0.3
completionHandler:^{
[expectation fulfill];
}];
[self.mapView flyToCamera:camera
withDuration:0.3
completionHandler:^{
[expectation fulfill];
}];
[self waitForExpectations:@[expectation] timeout:0.5];
[self waitForExpectations:@[ expectation ] timeout:0.5];
}
@end
// MARK: - camera transitions with NaN values
@interface MLNMapView (MLNCameraTransitionFinishNaNTests)
- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MLNMapCamera *)camera edgePadding:(UIEdgeInsets)insets;
- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MLNMapCamera *)camera
edgePadding:(UIEdgeInsets)insets;
@end
@interface MLNCameraTransitionNaNZoomMapView: MLNMapView
@interface MLNCameraTransitionNaNZoomMapView : MLNMapView
@end
@implementation MLNCameraTransitionNaNZoomMapView
- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MLNMapCamera *)camera edgePadding:(UIEdgeInsets)insets {
mbgl::CameraOptions options = [super cameraOptionsObjectForAnimatingToCamera:camera edgePadding:insets];
options.zoom = NAN;
return options;
- (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MLNMapCamera *)camera
edgePadding:(UIEdgeInsets)insets {
mbgl::CameraOptions options = [super cameraOptionsObjectForAnimatingToCamera:camera
edgePadding:insets];
options.zoom = NAN;
return options;
}
@end
@@ -103,6 +106,6 @@
@implementation MLNCameraTransitionFinishNaNTests
- (MLNMapView *)mapViewForTestWithFrame:(CGRect)rect styleURL:(NSURL *)styleURL {
return [[MLNCameraTransitionNaNZoomMapView alloc] initWithFrame:rect styleURL:styleURL];
return [[MLNCameraTransitionNaNZoomMapView alloc] initWithFrame:rect styleURL:styleURL];
}
@end