summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLAttributionInfoTests.m
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-01-26 18:52:44 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-01-27 11:44:16 +0100
commit62ea1f21858c69f6921c775ba7a3de201f0514d8 (patch)
tree7a4da88706e8a5513e1e13e993b2acc212cae3b1 /platform/darwin/test/MGLAttributionInfoTests.m
parenta662508ddde4043ece36d8ea9b424368891d892c (diff)
downloadqtlocation-mapboxgl-62ea1f21858c69f6921c775ba7a3de201f0514d8.tar.gz
[core] remove trailing whitespace, add trailing newlines, add space after //
Diffstat (limited to 'platform/darwin/test/MGLAttributionInfoTests.m')
-rw-r--r--platform/darwin/test/MGLAttributionInfoTests.m26
1 files changed, 13 insertions, 13 deletions
diff --git a/platform/darwin/test/MGLAttributionInfoTests.m b/platform/darwin/test/MGLAttributionInfoTests.m
index 3cdb7adffb..74859bda82 100644
--- a/platform/darwin/test/MGLAttributionInfoTests.m
+++ b/platform/darwin/test/MGLAttributionInfoTests.m
@@ -16,7 +16,7 @@
@"CC&nbsp;BY-SA "
@"<a class=\"mapbox-improve-map\" href=\"https://www.mapbox.com/map-feedback/\" target=\"_blank\">Improve this map</a>",
};
-
+
NS_MUTABLE_ARRAY_OF(MGLAttributionInfo *) *infos = [NSMutableArray array];
for (NSUInteger i = 0; i < sizeof(htmlStrings) / sizeof(htmlStrings[0]); i++) {
NSArray *subinfos = [MGLAttributionInfo attributionInfosFromHTMLString:htmlStrings[i]
@@ -24,25 +24,25 @@
linkColor:nil];
[infos growArrayByAddingAttributionInfosFromArray:subinfos];
}
-
+
XCTAssertEqual(infos.count, 4);
-
+
CLLocationCoordinate2D mapbox = CLLocationCoordinate2DMake(12.9810816, 77.6368034);
XCTAssertEqualObjects(infos[0].title.string, @"© Mapbox");
XCTAssertEqualObjects(infos[0].URL, [NSURL URLWithString:@"https://www.mapbox.com/about/maps/"]);
XCTAssertFalse(infos[0].feedbackLink);
XCTAssertNil([infos[0] feedbackURLAtCenterCoordinate:mapbox zoomLevel:14]);
-
+
XCTAssertEqualObjects(infos[1].title.string, @"©️ OpenStreetMap");
XCTAssertEqualObjects(infos[1].URL, [NSURL URLWithString:@"http://www.openstreetmap.org/about/"]);
XCTAssertFalse(infos[1].feedbackLink);
XCTAssertNil([infos[1] feedbackURLAtCenterCoordinate:mapbox zoomLevel:14]);
-
+
XCTAssertEqualObjects(infos[2].title.string, @"CC\u00a0BY-SA");
XCTAssertNil(infos[2].URL);
XCTAssertFalse(infos[2].feedbackLink);
XCTAssertNil([infos[2] feedbackURLAtCenterCoordinate:mapbox zoomLevel:14]);
-
+
XCTAssertEqualObjects(infos[3].title.string, @"Improve this map");
XCTAssertEqualObjects(infos[3].URL, [NSURL URLWithString:@"https://www.mapbox.com/map-feedback/"]);
XCTAssertTrue(infos[3].feedbackLink);
@@ -54,7 +54,7 @@
static NSString * const htmlStrings[] = {
@"<a href=\"https://www.mapbox.com/\">Mapbox</a>",
};
-
+
CGFloat fontSize = 72;
MGLColor *color = [MGLColor redColor];
NS_MUTABLE_ARRAY_OF(MGLAttributionInfo *) *infos = [NSMutableArray array];
@@ -64,13 +64,13 @@
linkColor:color];
[infos growArrayByAddingAttributionInfosFromArray:subinfos];
}
-
+
XCTAssertEqual(infos.count, 1);
-
+
XCTAssertEqualObjects(infos[0].title.string, @"Mapbox");
XCTAssertEqualObjects([infos[0].title attribute:NSLinkAttributeName atIndex:0 effectiveRange:nil], [NSURL URLWithString:@"https://www.mapbox.com/"]);
XCTAssertEqualObjects([infos[0].title attribute:NSUnderlineStyleAttributeName atIndex:0 effectiveRange:nil], @(NSUnderlineStyleSingle));
-
+
#if TARGET_OS_IPHONE
UIFont *font;
#else
@@ -78,7 +78,7 @@
#endif
font = [infos[0].title attribute:NSFontAttributeName atIndex:0 effectiveRange:nil];
XCTAssertEqual(font.pointSize, fontSize);
-
+
CGFloat r, g, b, a;
[color getRed:&r green:&g blue:&b alpha:&a];
MGLColor *linkColor = [infos[0].title attribute:NSForegroundColorAttributeName atIndex:0 effectiveRange:nil];
@@ -98,7 +98,7 @@
@"Hello",
@"Hello World",
};
-
+
NS_MUTABLE_ARRAY_OF(MGLAttributionInfo *) *infos = [NSMutableArray array];
for (NSUInteger i = 0; i < sizeof(htmlStrings) / sizeof(htmlStrings[0]); i++) {
NSArray *subinfos = [MGLAttributionInfo attributionInfosFromHTMLString:htmlStrings[i]
@@ -106,7 +106,7 @@
linkColor:nil];
[infos growArrayByAddingAttributionInfosFromArray:subinfos];
}
-
+
XCTAssertEqual(infos.count, 2);
XCTAssertEqualObjects(infos[0].title.string, @"Hello World");
XCTAssertEqualObjects(infos[1].title.string, @"Another Source");