Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Check for duplicate source IDs - #7203

Merged
ivovandongen merged 4 commits into
masterfrom
7011-duplicate-sources
Nov 30, 2016
Merged

ivovandongen merged 4 commits into
masterfrom
7011-duplicate-sources

Conversation

@ivovandongen

Copy link
Copy Markdown
Contributor

Fixes #7011

@ivovandongen ivovandongen added Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl labels Nov 28, 2016
@ivovandongen ivovandongen self-assigned this Nov 28, 2016
@mention-bot

Copy link
Copy Markdown

@ivovandongen, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @boundsj and @tmpsantos to be potential reviewers.

@ivovandongen ivovandongen added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS labels Nov 28, 2016
@ivovandongen
ivovandongen force-pushed the 7011-duplicate-sources branch from b256ae5 to 2406e48 Compare November 28, 2016 16:37
Comment thread test/style/style.test.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed spaces and tabs.

Comment thread platform/darwin/src/MGLStyle.mm Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Darwin-side test for this error handling?

@ivovandongen
ivovandongen force-pushed the 7011-duplicate-sources branch 2 times, most recently from 20fd313 to 3b64dbc Compare November 29, 2016 15:40
@ivovandongen
ivovandongen force-pushed the 7011-duplicate-sources branch from 3b64dbc to 9d3d075 Compare November 30, 2016 07:09
@ivovandongen

Copy link
Copy Markdown
Contributor Author

@jfirebaugh With @frederoni's help I've added unit tests for osx/ios as well.

@ivovandongen
ivovandongen force-pushed the 7011-duplicate-sources branch from 9d3d075 to 9fef64e Compare November 30, 2016 08:57
@ivovandongen
ivovandongen force-pushed the 7011-duplicate-sources branch from 9fef64e to 401ee41 Compare November 30, 2016 11:27
@ivovandongen
ivovandongen merged commit d8cef78 into master Nov 30, 2016
@ivovandongen
ivovandongen deleted the 7011-duplicate-sources branch November 30, 2016 17:35

[self.mapView.style addSource: source1];

@try {

@1ec5 1ec5 Dec 1, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, @try-@catch blocks are generally to be avoided in Objective-C code due to their poor performance. (At least the performance is poor when used the way try-catch blocks are used in C++ for flow control.) It’s technically necessary here because we’re trying to detect an exception being raised. However, the more idiomatic way to assert for the exception is to use the XCTAssertThrows(), XCTAssertThrowsSpecific(), or XCTAssertThrowsSpecificNamed() macro.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that once this change is merged into the iOS release branch it might make more sense to do these tests in MGLStyleTests along with what has been added in https://github.com/mapbox/mapbox-gl-native/pull/7272/files#diff-ce3b7fe93109fd552f9627d0dcc0ceb4R107 for checking for duplicate instances.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Android Mapbox Maps SDK for Android Core The cross-platform C++ core, aka mbgl iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants