summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLFeatureTests.mm
diff options
context:
space:
mode:
authorAlexander Shalamov <alexander.shalamov@mapbox.com>2018-12-11 17:07:47 +0200
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2018-12-13 19:38:50 +0200
commitb6b1067caf6ba911efbb4a64a43425ce2d729a1a (patch)
tree3bdc97f4ed23e6b3abeb47c85a6b559a813059ac /platform/darwin/test/MGLFeatureTests.mm
parent1d410c94fc6bd6d9f4880f22193328403302a847 (diff)
downloadqtlocation-mapboxgl-b6b1067caf6ba911efbb4a64a43425ce2d729a1a.tar.gz
[ios, darwin] Make MGLFeature.attributes non-nullable and add integration test
Enforce non-nullable semantics for MGLFeature.attributes, to avoid construction of invalid mbgl::Feature properties from nil NSDictionary object and align with public SDK property definition. Integration test "testShapeSourceWithLineDistanceMetrics" is added to verify that MGLFeature is correctly converted. Fixes issue #13378
Diffstat (limited to 'platform/darwin/test/MGLFeatureTests.mm')
-rw-r--r--platform/darwin/test/MGLFeatureTests.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/darwin/test/MGLFeatureTests.mm b/platform/darwin/test/MGLFeatureTests.mm
index 3e8e47474b..67f2a9a45e 100644
--- a/platform/darwin/test/MGLFeatureTests.mm
+++ b/platform/darwin/test/MGLFeatureTests.mm
@@ -176,7 +176,7 @@
// it has no "id" key (or value)
XCTAssertNil(geoJSONFeature[@"id"]);
// it has a null representation of the properties object
- XCTAssertEqualObjects(geoJSONFeature[@"properties"], [NSNull null]);
+ XCTAssertEqualObjects(geoJSONFeature[@"properties"], @{});
// when there is a string identifier
pointFeature.identifier = @"string-id";
@@ -317,13 +317,13 @@
@"geometries": @[
@{ @"geometry": @{@"type": @"Point",
@"coordinates": @[@(pointCoordinate.longitude), @(pointCoordinate.latitude)]},
- @"properties": [NSNull null],
+ @"properties": @{},
@"type": @"Feature",
},
@{ @"geometry": @{@"type": @"LineString",
@"coordinates": @[@[@(coord1.longitude), @(coord1.latitude)],
@[@(coord2.longitude), @(coord2.latitude)]]},
- @"properties": [NSNull null],
+ @"properties": @{},
@"type": @"Feature",
}
]