diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-03-30 05:43:56 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-04-02 10:42:54 -0700 |
commit | a877b6dbe8ff576f82ab9222f418da51591dd423 (patch) | |
tree | a998c9174b643e982e54d31a4bba349a6279632c /platform/darwin/test/MGLStyleTests.mm | |
parent | 10440640178429fc8e5c319c86e7a3e89746952e (diff) | |
download | qtlocation-mapboxgl-a877b6dbe8ff576f82ab9222f418da51591dd423.tar.gz |
[ios, macos] Renamed MGLVectorSource to MGLVectorTileSource
Diffstat (limited to 'platform/darwin/test/MGLStyleTests.mm')
-rw-r--r-- | platform/darwin/test/MGLStyleTests.mm | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/platform/darwin/test/MGLStyleTests.mm b/platform/darwin/test/MGLStyleTests.mm index b9fbe1cfd4..7b1cc56ba4 100644 --- a/platform/darwin/test/MGLStyleTests.mm +++ b/platform/darwin/test/MGLStyleTests.mm @@ -161,14 +161,14 @@ [self.style addSource:rasterTileSource]; XCTAssertThrowsSpecificNamed([self.style addSource:rasterTileSource], NSException, @"MGLRedundantSourceException"); - MGLVectorSource *vectorSource = [[MGLVectorSource alloc] initWithIdentifier:@"vectorSource" configurationURL:[NSURL URLWithString:@".json"]]; - [self.style addSource:vectorSource]; - XCTAssertThrowsSpecificNamed([self.style addSource:vectorSource], NSException, @"MGLRedundantSourceException"); + MGLVectorTileSource *vectorTileSource = [[MGLVectorTileSource alloc] initWithIdentifier:@"vectorTileSource" configurationURL:[NSURL URLWithString:@".json"]]; + [self.style addSource:vectorTileSource]; + XCTAssertThrowsSpecificNamed([self.style addSource:vectorTileSource], NSException, @"MGLRedundantSourceException"); } - (void)testAddingSourcesWithDuplicateIdentifiers { - MGLVectorSource *source1 = [[MGLVectorSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"mapbox://mapbox.mapbox-terrain-v2"]]; - MGLVectorSource *source2 = [[MGLVectorSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"mapbox://mapbox.mapbox-terrain-v2"]]; + MGLVectorTileSource *source1 = [[MGLVectorTileSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"mapbox://mapbox.mapbox-terrain-v2"]]; + MGLVectorTileSource *source2 = [[MGLVectorTileSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"mapbox://mapbox.mapbox-terrain-v2"]]; [self.style addSource: source1]; XCTAssertThrowsSpecificNamed([self.style addSource: source2], NSException, @"MGLRedundantSourceIdentifierException"); @@ -185,10 +185,10 @@ [self.style addSource:shapeSource]; XCTAssertNotNil([self.style sourceWithIdentifier:shapeSource.identifier]); - MGLVectorSource *vectorSource = [[MGLVectorSource alloc] initWithIdentifier:@"vector-source" tileURLTemplates:@[] options:nil]; - [self.style removeSource:vectorSource]; - [self.style addSource:vectorSource]; - XCTAssertNotNil([self.style sourceWithIdentifier:vectorSource.identifier]); + MGLVectorTileSource *vectorTileSource = [[MGLVectorTileSource alloc] initWithIdentifier:@"vector-tile-source" tileURLTemplates:@[] options:nil]; + [self.style removeSource:vectorTileSource]; + [self.style addSource:vectorTileSource]; + XCTAssertNotNil([self.style sourceWithIdentifier:vectorTileSource.identifier]); } - (void)testAddingSourceOfTypeABeforeSourceOfTypeBWithSameIdentifier { @@ -208,22 +208,22 @@ // Add the shape source [self.style addSource:imageSource]; - // Attempt to remove a vector source with the same identifer as the shape source - MGLVectorSource *vectorSource = [[MGLVectorSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; - [self.style removeSource:vectorSource]; + // Attempt to remove a vector tile source with the same identifer as the shape source + MGLVectorTileSource *vectorTileSource = [[MGLVectorTileSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; + [self.style removeSource:vectorTileSource]; // The image source should still be added XCTAssertTrue([[self.style sourceWithIdentifier:imageSource.identifier] isMemberOfClass:[MGLImageSource class]]); // Remove the image source [self.style removeSource:imageSource]; - // Add the vector source - [self.style addSource:vectorSource]; + // Add the vector tile source + [self.style addSource:vectorTileSource]; // Attempt to remove the previously created raster tile source that has the same identifer as the shape source [self.style removeSource:rasterTileSource]; - // The vector source should still be added - XCTAssertTrue([[self.style sourceWithIdentifier:imageSource.identifier] isMemberOfClass:[MGLVectorSource class]]); + // The vector tile source should still be added + XCTAssertTrue([[self.style sourceWithIdentifier:imageSource.identifier] isMemberOfClass:[MGLVectorTileSource class]]); } - (void)testRemovingSourceInUse { @@ -289,7 +289,7 @@ - (void)testAddingLayersWithDuplicateIdentifiers { // Just some source - MGLVectorSource *source = [[MGLVectorSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"mapbox://mapbox.mapbox-terrain-v2"]]; + MGLVectorTileSource *source = [[MGLVectorTileSource alloc] initWithIdentifier:@"my-source" configurationURL:[NSURL URLWithString:@"mapbox://mapbox.mapbox-terrain-v2"]]; [self.style addSource: source]; // Add initial layer |