From b6b1067caf6ba911efbb4a64a43425ce2d729a1a Mon Sep 17 00:00:00 2001 From: Alexander Shalamov Date: Tue, 11 Dec 2018 17:07:47 +0200 Subject: [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 --- platform/darwin/test/MGLFeatureTests.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'platform/darwin/test/MGLFeatureTests.mm') 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", } ] -- cgit v1.2.1