diff options
author | Tobrun <tobrun@mapbox.com> | 2017-06-09 12:05:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-09 12:05:54 +0200 |
commit | 6ec5e4f8cdb98227db11e5989376c31832ca2048 (patch) | |
tree | 666de95e35b73f4c6f851e9c243c29fe74ce4465 /platform/darwin/test | |
parent | fa972fad60e58e5b8f9f9622f508e9732c8c9ffd (diff) | |
download | qtlocation-mapboxgl-6ec5e4f8cdb98227db11e5989376c31832ca2048.tar.gz |
Cherry picks to release branch (#9230)
* [ios][macos] test remove source in use
* [android] test remove source in use
* [core] check source usage before remove
* [core] ensure layer::accept works with non-void return values on gcc
* [android] - remove upgrade runtime exceptions (#9191)
Diffstat (limited to 'platform/darwin/test')
-rw-r--r-- | platform/darwin/test/MGLStyleTests.mm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLStyleTests.mm b/platform/darwin/test/MGLStyleTests.mm index f80d5776f0..d93483ea6e 100644 --- a/platform/darwin/test/MGLStyleTests.mm +++ b/platform/darwin/test/MGLStyleTests.mm @@ -240,6 +240,22 @@ XCTAssertTrue([[self.style sourceWithIdentifier:shapeSource.identifier] isMemberOfClass:[MGLVectorSource class]]); } +- (void)testRemovingSourceInUse { + // Add a raster source + MGLRasterSource *rasterSource = [[MGLRasterSource alloc] initWithIdentifier:@"some-identifier" tileURLTemplates:@[] options:nil]; + [self.style addSource:rasterSource]; + + // Add a layer using it + MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:rasterSource]; + [self.style addLayer:fillLayer]; + + // Attempt to remove the raster source + [self.style removeSource:rasterSource]; + + // Ensure it is still there + XCTAssertTrue([[self.style sourceWithIdentifier:rasterSource.identifier] isMemberOfClass:[MGLRasterSource class]]); +} + - (void)testLayers { NSArray<MGLStyleLayer *> *initialLayers = self.style.layers; if ([initialLayers.firstObject.identifier isEqualToString:@"com.mapbox.annotations.points"]) { |