From 62ea1f21858c69f6921c775ba7a3de201f0514d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 26 Jan 2017 18:52:44 +0100 Subject: [core] remove trailing whitespace, add trailing newlines, add space after // --- platform/darwin/test/MGLStyleTests.mm | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'platform/darwin/test/MGLStyleTests.mm') diff --git a/platform/darwin/test/MGLStyleTests.mm b/platform/darwin/test/MGLStyleTests.mm index 176217619d..ed86a252fa 100644 --- a/platform/darwin/test/MGLStyleTests.mm +++ b/platform/darwin/test/MGLStyleTests.mm @@ -25,7 +25,7 @@ - (void)setUp { [super setUp]; - + [MGLAccountManager setAccessToken:@"pk.feedcafedeadbeefbadebede"]; NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"]; self.mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 100, 100) styleURL:styleURL]; @@ -39,14 +39,14 @@ - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { XCTAssertNotNil(mapView.style); XCTAssertEqual(mapView.style, style); - + [_styleLoadingExpectation fulfill]; } - (void)tearDown { _styleLoadingExpectation = nil; self.mapView = nil; - + [super tearDown]; } @@ -81,7 +81,7 @@ XCTAssertEqualObjects([MGLStyle satelliteStyleURLWithVersion:99].absoluteString, @"mapbox://styles/mapbox/satellite-v99"); XCTAssertEqualObjects([MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::satelliteStreets.url)); XCTAssertEqualObjects([MGLStyle satelliteStreetsStyleURLWithVersion:99].absoluteString, @"mapbox://styles/mapbox/satellite-streets-v99"); - + static_assert(6 == mbgl::util::default_styles::numOrderedStyles, "MGLStyleTests isn’t testing all the styles in mbgl::util::default_styles."); } @@ -109,17 +109,17 @@ XCTAssertEqual(mbgl::util::default_styles::numOrderedStyles, numVersionedMethods, @"There are %lu default styles but MGLStyleTests only provides versioned style URL methods for %u of them.", mbgl::util::default_styles::numOrderedStyles, numVersionedMethods); - + // Test that all the versioned style methods are in the public header. NSString *styleHeader = self.stringWithContentsOfStyleHeader; - + NSError *versionedMethodError; NSString *versionedMethodExpressionString = @(R"RE(^\+\s*\(NSURL\s*\*\s*\)\s*\w+StyleURLWithVersion\s*:\s*\(\s*NSInteger\s*\)\s*version\s*;)RE"); NSRegularExpression *versionedMethodExpression = [NSRegularExpression regularExpressionWithPattern:versionedMethodExpressionString options:NSRegularExpressionAnchorsMatchLines error:&versionedMethodError]; XCTAssertNil(versionedMethodError, @"Error compiling regular expression to search for versioned methods."); NSUInteger numVersionedMethodDeclarations = [versionedMethodExpression numberOfMatchesInString:styleHeader options:0 range:NSMakeRange(0, styleHeader.length)]; XCTAssertEqual(numVersionedMethodDeclarations, numVersionedMethods); - + // Test that “current version is” statements are present and current for all versioned style methods. NSError *versionError; NSString *versionExpressionString = @(R"RE(current version is `(\d+)`)RE"); @@ -219,15 +219,15 @@ } - (void)testAddingLayersWithDuplicateIdentifiers { - //Just some source + // Just some source MGLVectorSource *source = [[MGLVectorSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"mapbox://mapbox.mapbox-terrain-v2"]]; [self.style addSource: source]; - - //Add initial layer + + // Add initial layer MGLFillStyleLayer *initial = [[MGLFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source]; [self.style addLayer:initial]; - - //Try to add the duplicate + + // Try to add the duplicate XCTAssertThrowsSpecificNamed([self.style addLayer:[[MGLFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source]], NSException, @"MGLRedundantLayerIdentifierException"); XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MGLFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source] belowLayer:initial],NSException, @"MGLRedundantLayerIdentifierException"); XCTAssertThrowsSpecificNamed([self.style insertLayer:[[MGLFillStyleLayer alloc] initWithIdentifier:@"my-layer" source:source] aboveLayer:initial], NSException, @"MGLRedundantLayerIdentifierException"); @@ -259,10 +259,10 @@ MGLImage *image = [[NSBundle bundleForClass:[self class]] imageForResource:imageName]; #endif XCTAssertNotNil(image); - + [self.style setImage:image forName:imageName]; MGLImage *styleImage = [self.style imageForName:imageName]; - + XCTAssertNotNil(styleImage); XCTAssertEqual(image.size.width, styleImage.size.width); XCTAssertEqual(image.size.height, styleImage.size.height); @@ -273,28 +273,28 @@ NSURL *url = [NSURL fileURLWithPath:filePath]; MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil]; [self.style addSource:source]; - + MGLCircleStyleLayer *layer1 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer1" source:source]; [self.style addLayer:layer1]; - + MGLCircleStyleLayer *layer3 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer3" source:source]; [self.style addLayer:layer3]; - + MGLCircleStyleLayer *layer2 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer2" source:source]; [self.style insertLayer:layer2 aboveLayer:layer1]; - + MGLCircleStyleLayer *layer4 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer4" source:source]; [self.style insertLayer:layer4 aboveLayer:layer3]; - + MGLCircleStyleLayer *layer0 = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layer0" source:source]; [self.style insertLayer:layer0 belowLayer:layer1]; - + NSArray *layers = [self.style layers]; NSUInteger startIndex = 0; if ([layers.firstObject.identifier isEqualToString:@"com.mapbox.annotations.points"]) { startIndex++; } - + XCTAssertEqualObjects(layers[startIndex++].identifier, layer0.identifier); XCTAssertEqualObjects(layers[startIndex++].identifier, layer1.identifier); XCTAssertEqualObjects(layers[startIndex++].identifier, layer2.identifier); -- cgit v1.2.1