[ios, macos] Rewrote style layer tests

Replaced the style layer integration tests with unit tests. Test conversion of style values to property values and vice versa, not just round-tripping. Test the initial state and null-resetting of each null-resettable property. Test NSValue additions for style attribute enumerations. Test properties common to all style layer classes. Test MGLStyle’s source and layer collections.

Eviscerated implementations of unavailable style layer properties corresponding to style specification properties that were renamed. Implemented corresponding getters to prevent ivars from being autosynthesized for these unavailable properties.

Added a missing bridging header to the iOS test project.
This commit is contained in:
Minh Nguyễn
2017-01-12 16:48:17 -08:00
committed by Minh Nguyễn
parent 85fc75db8d
commit 4d5036616f
29 changed files with 3846 additions and 1090 deletions

View File

@@ -69,15 +69,15 @@ global.camelizeWithLeadingLowercase = function (str) {
global.objCName = function (property) {
return camelizeWithLeadingLowercase(property.name);
}
};
global.objCGetter = function (property) {
return camelizeWithLeadingLowercase(property.getter || property.name);
}
};
global.objCType = function (layerType, propertyName) {
return `${prefix}${camelize(propertyName)}`;
}
};
global.arrayType = function (property) {
return property.type === 'array' ? originalPropertyName(property).split('-').pop() : false;
@@ -86,7 +86,87 @@ global.arrayType = function (property) {
global.testImplementation = function (property, layerType, isFunction) {
let helperMsg = testHelperMessage(property, layerType, isFunction);
return `layer.${objCName(property)} = [MGLRuntimeStylingHelper ${helperMsg}];`;
}
};
global.objCTestValue = function (property, layerType, indent) {
let propertyName = originalPropertyName(property);
switch (property.type) {
case 'boolean':
return property.default ? '@NO' : '@YES';
case 'number':
return '@0xff';
case 'string':
return `@"${_.startCase(propertyName)}"`;
case 'enum':
let type = objCType(layerType, property.name);
let value = `${type}${camelize(_.last(_.keys(property.values)))}`;
return `[NSValue valueWith${type}:${value}]`;
case 'color':
return '[MGLColor redColor]';
case 'array':
switch (arrayType(property)) {
case 'dasharray':
return '@[@1, @2]';
case 'font':
return `@[@"${_.startCase(propertyName)}", @"${_.startCase(_.reverse(propertyName.split('')).join(''))}"]`;
case 'padding': {
let iosValue = '[NSValue valueWithUIEdgeInsets:UIEdgeInsetsMake(1, 1, 1, 1)]'.indent(indent * 4);
let macosValue = '[NSValue valueWithEdgeInsets:NSEdgeInsetsMake(1, 1, 1, 1)]'.indent(indent * 4);
return `\n#if TARGET_OS_IPHONE\n${iosValue}\n#else\n${macosValue}\n#endif\n${''.indent((indent - 1) * 4)}`;
}
case 'offset':
case 'translate':
let iosValue = '[NSValue valueWithCGVector:CGVectorMake(1, 1)]'.indent(indent * 4);
let macosValue = '[NSValue valueWithMGLVector:CGVectorMake(1, -1)]'.indent(indent * 4);
return `\n#if TARGET_OS_IPHONE\n${iosValue}\n#else\n${macosValue}\n#endif\n${''.indent((indent - 1) * 4)}`;
default:
throw new Error(`unknown array type for ${property.name}`);
}
default:
throw new Error(`unknown type for ${property.name}`);
}
};
global.mbglTestValue = function (property, layerType) {
let propertyName = originalPropertyName(property);
switch (property.type) {
case 'boolean':
return property.default ? 'false' : 'true';
case 'number':
return '0xff';
case 'string':
return `"${_.startCase(propertyName)}"`;
case 'enum': {
let type = camelize(originalPropertyName(property));
if (/-translate-anchor$/.test(originalPropertyName(property))) {
type = 'TranslateAnchor';
}
if (/-(rotation|pitch)-alignment$/.test(originalPropertyName(property))) {
type = 'Alignment';
}
let value = camelize(_.last(_.keys(property.values)));
return `mbgl::style::${type}Type::${value}`;
}
case 'color':
return '{ .r = 1, .g = 0, .b = 0, .a = 1 }';
case 'array':
switch (arrayType(property)) {
case 'dasharray':
return '{1, 2}';
case 'font':
return `{ "${_.startCase(propertyName)}", "${_.startCase(_.reverse(propertyName.split('')).join(''))}" }`;
case 'padding':
return '{ 1, 1, 1, 1 }';
case 'offset':
case 'translate':
return '{ 1, 1 }';
default:
throw new Error(`unknown array type for ${property.name}`);
}
default:
throw new Error(`unknown type for ${property.name}`);
}
};
global.testGetterImplementation = function (property, layerType, isFunction) {
let helperMsg = testHelperMessage(property, layerType, isFunction);
@@ -99,7 +179,7 @@ global.testGetterImplementation = function (property, layerType, isFunction) {
XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`;
}
return `XCTAssertEqualObjects(gLayer.${objCName(property)}, ${value});`;
}
};
global.testHelperMessage = function (property, layerType, isFunction) {
let fnSuffix = isFunction ? 'Function' : '';
@@ -153,7 +233,7 @@ global.propertyDoc = function (propertyName, property, layerType, kind) {
// Requires symbols to be surrounded by backticks.
doc = doc.replace(/`(.+?)`/g, function (m, symbol, offset, str) {
if ('values' in property && Object.keys(property.values).indexOf(symbol) !== -1) {
let objCType = objCType(layerType, property.name);
let objCType = global.objCType(layerType, property.name);
return '`' + `${objCType}${camelize(symbol)}` + '`';
}
if (str.substr(offset - 4, 3) !== 'CSS') {
@@ -288,7 +368,7 @@ global.propertyDefault = function (property, layerType) {
global.originalPropertyName = function (property) {
return property.original || property.name;
}
};
global.propertyType = function (property) {
switch (property.type) {
@@ -353,32 +433,60 @@ global.valueTransformerArguments = function (property) {
}
};
global.mbglType = function(property) {
switch (property.type) {
case 'boolean':
return 'bool';
case 'number':
return 'float';
case 'string':
return 'std::string';
case 'enum': {
let type = camelize(originalPropertyName(property));
if (/-translate-anchor$/.test(originalPropertyName(property))) {
type = 'TranslateAnchor';
}
if (/-(rotation|pitch)-alignment$/.test(originalPropertyName(property))) {
type = 'Alignment';
}
return `mbgl::style::${type}Type`;
}
case 'color':
return 'mbgl::Color';
case 'array':
switch (arrayType(property)) {
case 'dasharray':
return 'std::vector<float>';
case 'font':
return 'std::vector<std::string>';
case 'padding':
return 'std::array<float, 4>';
case 'offset':
case 'translate':
return 'std::array<float, 2>';
default:
throw new Error(`unknown array type for ${property.name}`);
}
default:
throw new Error(`unknown type for ${property.name}`);
}
};
global.initLayer = function (layerType) {
if (layerType == "background") {
return `_layer = new mbgl::style::${camelize(layerType)}Layer(identifier.UTF8String);`
} else {
return `_layer = new mbgl::style::${camelize(layerType)}Layer(identifier.UTF8String, source.identifier.UTF8String);`
}
}
};
global.setSourceLayer = function() {
return `_layer->setSourceLayer(sourceLayer.UTF8String);`
}
global.mbglType = function(property) {
let mbglType = camelize(originalPropertyName(property)) + 'Type';
if (/-translate-anchor$/.test(originalPropertyName(property))) {
mbglType = 'TranslateAnchorType';
}
if (/-(rotation|pitch)-alignment$/.test(originalPropertyName(property))) {
mbglType = 'AlignmentType';
}
return mbglType;
}
return `_layer->setSourceLayer(sourceLayer.UTF8String);`
};
const layerH = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.h.ejs', 'utf8'), { strict: true });
const layerM = ejs.compile(fs.readFileSync('platform/darwin/src/MGLStyleLayer.mm.ejs', 'utf8'), { strict: true});
const testLayers = ejs.compile(fs.readFileSync('platform/darwin/test/MGLStyleLayerTests.m.ejs', 'utf8'), { strict: true});
const testLayers = ejs.compile(fs.readFileSync('platform/darwin/test/MGLStyleLayerTests.mm.ejs', 'utf8'), { strict: true});
const guideMD = ejs.compile(fs.readFileSync('platform/darwin/docs/guides/For Style Authors.md.ejs', 'utf8'), { strict: true });
const layers = _(spec.layer.type.values).map((value, layerType) => {
@@ -439,21 +547,21 @@ ${macosComment}${decl}
var renamedPropertiesByLayerType = {};
for (var layer of layers) {
let properties = _.concat(layer.layoutProperties, layer.paintProperties);
let enumProperties = _.filter(properties, prop => prop.type === 'enum');
layer.properties = _.concat(layer.layoutProperties, layer.paintProperties);
let enumProperties = _.filter(layer.properties, prop => prop.type === 'enum');
if (enumProperties.length) {
layer.enumProperties = enumProperties;
}
let renamedProperties = {};
_.assign(renamedProperties, _.filter(properties, prop => 'original' in prop || 'getter' in prop));
_.assign(renamedProperties, _.filter(layer.properties, prop => 'original' in prop || 'getter' in prop));
if (!_.isEmpty(renamedProperties)) {
renamedPropertiesByLayerType[layer.type] = renamedProperties;
}
fs.writeFileSync(`platform/darwin/src/${prefix}${camelize(layer.type)}${suffix}.h`, duplicatePlatformDecls(layerH(layer)));
fs.writeFileSync(`platform/darwin/src/${prefix}${camelize(layer.type)}${suffix}.mm`, layerM(layer));
fs.writeFileSync(`platform/darwin/test/${prefix}${camelize(layer.type)}${suffix}Tests.m`, testLayers(layer));
fs.writeFileSync(`platform/darwin/test/${prefix}${camelize(layer.type)}${suffix}Tests.mm`, testLayers(layer));
}
fs.writeFileSync(`platform/ios/docs/guides/For Style Authors.md`, guideMD({

View File

@@ -201,9 +201,11 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::CirclePitchScaleType, NSValue *, mbgl::style::CirclePitchScaleType, MGLCircleScaleAlignment>().toEnumStyleValue(propertyValue);
}
- (void)setCirclePitchScale:(MGLStyleValue<NSValue *> *)circlePitchScale {
NSAssert(NO, @"Use -setCircleScaleAlignment: instead.");
}
- (MGLStyleValue<NSValue *> *)circlePitchScale {
return self.circleScaleAlignment;
}
- (void)setCircleTranslation:(MGLStyleValue<NSValue *> *)circleTranslation {
@@ -220,9 +222,11 @@ namespace mbgl {
return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
- (void)setCircleTranslate:(MGLStyleValue<NSValue *> *)circleTranslate {
NSAssert(NO, @"Use -setCircleTranslation: instead.");
}
- (MGLStyleValue<NSValue *> *)circleTranslate {
return self.circleTranslation;
}
- (void)setCircleTranslationAnchor:(MGLStyleValue<NSValue *> *)circleTranslationAnchor {
@@ -239,9 +243,11 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLCircleTranslationAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setCircleTranslateAnchor:(MGLStyleValue<NSValue *> *)circleTranslateAnchor {
NSAssert(NO, @"Use -setCircleTranslationAnchor: instead.");
}
- (MGLStyleValue<NSValue *> *)circleTranslateAnchor {
return self.circleTranslationAnchor;
}

View File

@@ -140,9 +140,11 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setFillAntialias:(MGLStyleValue<NSNumber *> *)fillAntialias {
NSAssert(NO, @"Use -setFillAntialiased: instead.");
}
- (MGLStyleValue<NSNumber *> *)fillAntialias {
return self.isFillAntialiased;
}
- (void)setFillColor:(MGLStyleValue<MGLColor *> *)fillColor {
@@ -215,9 +217,11 @@ namespace mbgl {
return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
- (void)setFillTranslate:(MGLStyleValue<NSValue *> *)fillTranslate {
NSAssert(NO, @"Use -setFillTranslation: instead.");
}
- (MGLStyleValue<NSValue *> *)fillTranslate {
return self.fillTranslation;
}
- (void)setFillTranslationAnchor:(MGLStyleValue<NSValue *> *)fillTranslationAnchor {
@@ -234,9 +238,11 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLFillTranslationAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setFillTranslateAnchor:(MGLStyleValue<NSValue *> *)fillTranslateAnchor {
NSAssert(NO, @"Use -setFillTranslationAnchor: instead.");
}
- (MGLStyleValue<NSValue *> *)fillTranslateAnchor {
return self.fillTranslationAnchor;
}

View File

@@ -238,9 +238,11 @@ namespace mbgl {
return MGLStyleValueTransformer<std::vector<float>, NSArray<NSNumber *> *, float>().toStyleValue(propertyValue);
}
- (void)setLineDasharray:(MGLStyleValue<NSArray<NSNumber *> *> *)lineDasharray {
NSAssert(NO, @"Use -setLineDashPattern: instead.");
}
- (MGLStyleValue<NSArray<NSNumber *> *> *)lineDasharray {
return self.lineDashPattern;
}
- (void)setLineGapWidth:(MGLStyleValue<NSNumber *> *)lineGapWidth {
@@ -313,9 +315,11 @@ namespace mbgl {
return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
- (void)setLineTranslate:(MGLStyleValue<NSValue *> *)lineTranslate {
NSAssert(NO, @"Use -setLineTranslation: instead.");
}
- (MGLStyleValue<NSValue *> *)lineTranslate {
return self.lineTranslation;
}
- (void)setLineTranslationAnchor:(MGLStyleValue<NSValue *> *)lineTranslationAnchor {
@@ -332,9 +336,11 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLLineTranslationAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setLineTranslateAnchor:(MGLStyleValue<NSValue *> *)lineTranslateAnchor {
NSAssert(NO, @"Use -setLineTranslationAnchor: instead.");
}
- (MGLStyleValue<NSValue *> *)lineTranslateAnchor {
return self.lineTranslationAnchor;
}
- (void)setLineWidth:(MGLStyleValue<NSNumber *> *)lineWidth {

View File

@@ -103,9 +103,11 @@
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterBrightnessMax:(MGLStyleValue<NSNumber *> *)rasterBrightnessMax {
NSAssert(NO, @"Use -setMaximumRasterBrightness: instead.");
}
- (MGLStyleValue<NSNumber *> *)rasterBrightnessMax {
return self.maximumRasterBrightness;
}
- (void)setMinimumRasterBrightness:(MGLStyleValue<NSNumber *> *)minimumRasterBrightness {
@@ -122,9 +124,11 @@
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterBrightnessMin:(MGLStyleValue<NSNumber *> *)rasterBrightnessMin {
NSAssert(NO, @"Use -setMinimumRasterBrightness: instead.");
}
- (MGLStyleValue<NSNumber *> *)rasterBrightnessMin {
return self.minimumRasterBrightness;
}
- (void)setRasterContrast:(MGLStyleValue<NSNumber *> *)rasterContrast {
@@ -169,9 +173,11 @@
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setRasterHueRotate:(MGLStyleValue<NSNumber *> *)rasterHueRotate {
NSAssert(NO, @"Use -setRasterHueRotation: instead.");
}
- (MGLStyleValue<NSNumber *> *)rasterHueRotate {
return self.rasterHueRotation;
}
- (void)setRasterOpacity:(MGLStyleValue<NSNumber *> *)rasterOpacity {

View File

@@ -175,7 +175,7 @@ namespace mbgl {
MGLAssertStyleLayerIsValid();
<% if (property.type == "enum") { -%>
auto mbglValue = MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumPropertyValue(<%- objCName(property) %>);
auto mbglValue = MGLStyleValueTransformer<<%- mbglType(property) %>, NSValue *, <%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumPropertyValue(<%- objCName(property) %>);
self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue);
<% } else { -%>
auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue(<%- objCName(property) %>);
@@ -188,15 +188,14 @@ namespace mbgl {
auto propertyValue = self.rawLayer->get<%- camelize(originalPropertyName(property)) %>() ?: self.rawLayer->getDefault<%- camelize(originalPropertyName(property)) %>();
<% if (property.type == "enum") { -%>
return MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumStyleValue(propertyValue);
return MGLStyleValueTransformer<<%- mbglType(property) %>, NSValue *, <%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumStyleValue(propertyValue);
<% } else { -%>
return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(propertyValue);
<% } -%>
}
<% if (property.original) { %>
<% if (property.original) { -%>
- (void)set<%- camelize(originalPropertyName(property)) %>:(MGLStyleValue<<%- propertyType(property, true) %>> *)<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %> {
self.<%- camelizeWithLeadingLowercase(property.name) %> = <%- camelizeWithLeadingLowercase(originalPropertyName(property)) %>;
}
- (MGLStyleValue<<%- propertyType(property, true) %>> *)<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %> {
@@ -214,7 +213,7 @@ namespace mbgl {
MGLAssertStyleLayerIsValid();
<% if (property.type == "enum") { -%>
auto mbglValue = MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumPropertyValue(<%- objCName(property) %>);
auto mbglValue = MGLStyleValueTransformer<<%- mbglType(property) %>, NSValue *, <%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumPropertyValue(<%- objCName(property) %>);
self.rawLayer->set<%- camelize(originalPropertyName(property)) %>(mbglValue);
<% } else { -%>
auto mbglValue = MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toPropertyValue(<%- objCName(property) %>);
@@ -227,15 +226,18 @@ namespace mbgl {
auto propertyValue = self.rawLayer->get<%- camelize(originalPropertyName(property)) %>() ?: self.rawLayer->getDefault<%- camelize(originalPropertyName(property)) %>();
<% if (property.type == "enum") { -%>
return MGLStyleValueTransformer<mbgl::style::<%- mbglType(property) %>, NSValue *, mbgl::style::<%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumStyleValue(propertyValue);
return MGLStyleValueTransformer<<%- mbglType(property) %>, NSValue *, <%- mbglType(property) %>, MGL<%- camelize(property.name) %>>().toEnumStyleValue(propertyValue);
<% } else { -%>
return MGLStyleValueTransformer<<%- valueTransformerArguments(property).join(', ') %>>().toStyleValue(propertyValue);
<% } -%>
}
<% if (property.original) { %>
<% if (property.original) { -%>
- (void)set<%- camelize(originalPropertyName(property)) %>:(MGLStyleValue<<%- propertyType(property, true) %>> *)<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %> {
NSAssert(NO, @"Use -set<%- camelize(property.name) %>: instead.");
}
- (MGLStyleValue<<%- propertyType(property, true) %>> *)<%- camelizeWithLeadingLowercase(originalPropertyName(property)) %> {
return self.<%- objCGetter(property) %>;
}
<% } -%>

View File

@@ -199,9 +199,7 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconAllowOverlap:(MGLStyleValue<NSNumber *> *)iconAllowOverlap {
self.iconAllowsOverlap = iconAllowOverlap;
}
- (MGLStyleValue<NSNumber *> *)iconAllowOverlap {
@@ -222,9 +220,7 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconIgnorePlacement:(MGLStyleValue<NSNumber *> *)iconIgnorePlacement {
self.iconIgnoresPlacement = iconIgnorePlacement;
}
- (MGLStyleValue<NSNumber *> *)iconIgnorePlacement {
@@ -245,9 +241,7 @@ namespace mbgl {
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
- (void)setIconImage:(MGLStyleValue<NSString *> *)iconImage {
self.iconImageName = iconImage;
}
- (MGLStyleValue<NSString *> *)iconImage {
@@ -310,9 +304,7 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconRotate:(MGLStyleValue<NSNumber *> *)iconRotate {
self.iconRotation = iconRotate;
}
- (MGLStyleValue<NSNumber *> *)iconRotate {
@@ -347,9 +339,7 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconSize:(MGLStyleValue<NSNumber *> *)iconSize {
self.iconScale = iconSize;
}
- (MGLStyleValue<NSNumber *> *)iconSize {
@@ -398,9 +388,7 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setIconKeepUpright:(MGLStyleValue<NSNumber *> *)iconKeepUpright {
self.keepsIconUpright = iconKeepUpright;
}
- (MGLStyleValue<NSNumber *> *)iconKeepUpright {
@@ -421,9 +409,7 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextKeepUpright:(MGLStyleValue<NSNumber *> *)textKeepUpright {
self.keepsTextUpright = textKeepUpright;
}
- (MGLStyleValue<NSNumber *> *)textKeepUpright {
@@ -444,9 +430,7 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextMaxAngle:(MGLStyleValue<NSNumber *> *)textMaxAngle {
self.maximumTextAngle = textMaxAngle;
}
- (MGLStyleValue<NSNumber *> *)textMaxAngle {
@@ -467,9 +451,7 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextMaxWidth:(MGLStyleValue<NSNumber *> *)textMaxWidth {
self.maximumTextWidth = textMaxWidth;
}
- (MGLStyleValue<NSNumber *> *)textMaxWidth {
@@ -490,9 +472,7 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setSymbolAvoidEdges:(MGLStyleValue<NSNumber *> *)symbolAvoidEdges {
self.symbolAvoidsEdges = symbolAvoidEdges;
}
- (MGLStyleValue<NSNumber *> *)symbolAvoidEdges {
@@ -541,9 +521,7 @@ namespace mbgl {
return MGLStyleValueTransformer<std::string, NSString *>().toStyleValue(propertyValue);
}
- (void)setTextField:(MGLStyleValue<NSString *> *)textField {
self.text = textField;
}
- (MGLStyleValue<NSString *> *)textField {
@@ -564,9 +542,7 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextAllowOverlap:(MGLStyleValue<NSNumber *> *)textAllowOverlap {
self.textAllowsOverlap = textAllowOverlap;
}
- (MGLStyleValue<NSNumber *> *)textAllowOverlap {
@@ -601,9 +577,7 @@ namespace mbgl {
return MGLStyleValueTransformer<std::vector<std::string>, NSArray<NSString *> *, std::string>().toStyleValue(propertyValue);
}
- (void)setTextFont:(MGLStyleValue<NSArray<NSString *> *> *)textFont {
self.textFontNames = textFont;
}
- (MGLStyleValue<NSArray<NSString *> *> *)textFont {
@@ -624,9 +598,7 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextSize:(MGLStyleValue<NSNumber *> *)textSize {
self.textFontSize = textSize;
}
- (MGLStyleValue<NSNumber *> *)textSize {
@@ -647,9 +619,7 @@ namespace mbgl {
return MGLStyleValueTransformer<bool, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextIgnorePlacement:(MGLStyleValue<NSNumber *> *)textIgnorePlacement {
self.textIgnoresPlacement = textIgnorePlacement;
}
- (MGLStyleValue<NSNumber *> *)textIgnorePlacement {
@@ -670,9 +640,7 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::TextJustifyType, NSValue *, mbgl::style::TextJustifyType, MGLTextJustification>().toEnumStyleValue(propertyValue);
}
- (void)setTextJustify:(MGLStyleValue<NSValue *> *)textJustify {
self.textJustification = textJustify;
}
- (MGLStyleValue<NSValue *> *)textJustify {
@@ -777,9 +745,7 @@ namespace mbgl {
return MGLStyleValueTransformer<float, NSNumber *>().toStyleValue(propertyValue);
}
- (void)setTextRotate:(MGLStyleValue<NSNumber *> *)textRotate {
self.textRotation = textRotate;
}
- (MGLStyleValue<NSNumber *> *)textRotate {
@@ -900,9 +866,11 @@ namespace mbgl {
return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
- (void)setIconTranslate:(MGLStyleValue<NSValue *> *)iconTranslate {
NSAssert(NO, @"Use -setIconTranslation: instead.");
}
- (MGLStyleValue<NSValue *> *)iconTranslate {
return self.iconTranslation;
}
- (void)setIconTranslationAnchor:(MGLStyleValue<NSValue *> *)iconTranslationAnchor {
@@ -919,9 +887,11 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLIconTranslationAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setIconTranslateAnchor:(MGLStyleValue<NSValue *> *)iconTranslateAnchor {
NSAssert(NO, @"Use -setIconTranslationAnchor: instead.");
}
- (MGLStyleValue<NSValue *> *)iconTranslateAnchor {
return self.iconTranslationAnchor;
}
- (void)setTextColor:(MGLStyleValue<MGLColor *> *)textColor {
@@ -1008,9 +978,11 @@ namespace mbgl {
return MGLStyleValueTransformer<std::array<float, 2>, NSValue *>().toStyleValue(propertyValue);
}
- (void)setTextTranslate:(MGLStyleValue<NSValue *> *)textTranslate {
NSAssert(NO, @"Use -setTextTranslation: instead.");
}
- (MGLStyleValue<NSValue *> *)textTranslate {
return self.textTranslation;
}
- (void)setTextTranslationAnchor:(MGLStyleValue<NSValue *> *)textTranslationAnchor {
@@ -1027,9 +999,11 @@ namespace mbgl {
return MGLStyleValueTransformer<mbgl::style::TranslateAnchorType, NSValue *, mbgl::style::TranslateAnchorType, MGLTextTranslationAnchor>().toEnumStyleValue(propertyValue);
}
- (void)setTextTranslateAnchor:(MGLStyleValue<NSValue *> *)textTranslateAnchor {
NSAssert(NO, @"Use -setTextTranslationAnchor: instead.");
}
- (MGLStyleValue<NSValue *> *)textTranslateAnchor {
return self.textTranslationAnchor;
}

View File

@@ -1,44 +0,0 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
@interface MGLBackgroundLayerTests : MGLStyleLayerTests
@end
@implementation MGLBackgroundLayerTests
+ (NSString *)layerType {
return @"background";
}
- (void)testBackgroundLayer {
MGLBackgroundStyleLayer *layer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:@"layerID"];
[self.mapView.style addLayer:layer];
layer.backgroundColor = [MGLRuntimeStylingHelper testColor];
layer.backgroundOpacity = [MGLRuntimeStylingHelper testNumber];
layer.backgroundPattern = [MGLRuntimeStylingHelper testString];
MGLBackgroundStyleLayer *gLayer = (MGLBackgroundStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLBackgroundStyleLayer class]]);
XCTAssertEqualObjects(gLayer.backgroundColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.backgroundOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.backgroundPattern, [MGLRuntimeStylingHelper testString]);
layer.backgroundColor = [MGLRuntimeStylingHelper testColorFunction];
layer.backgroundOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.backgroundPattern = [MGLRuntimeStylingHelper testStringFunction];
XCTAssertEqualObjects(gLayer.backgroundColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.backgroundOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.backgroundPattern, [MGLRuntimeStylingHelper testStringFunction]);
}
- (void)testPropertyNames {
[self testPropertyName:@"background-color" isBoolean:NO];
[self testPropertyName:@"background-opacity" isBoolean:NO];
[self testPropertyName:@"background-pattern" isBoolean:NO];
}
@end

View File

@@ -0,0 +1,134 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
#import "MGLStyleLayer_Private.h"
#include <mbgl/style/layers/background_layer.hpp>
@interface MGLBackgroundLayerTests : MGLStyleLayerTests
@end
@implementation MGLBackgroundLayerTests
+ (NSString *)layerType {
return @"background";
}
- (void)testProperties {
MGLBackgroundStyleLayer *layer = [[MGLBackgroundStyleLayer alloc] initWithIdentifier:@"layerID"];
XCTAssertNotEqual(layer.rawLayer, nullptr);
XCTAssertTrue(layer.rawLayer->is<mbgl::style::BackgroundLayer>());
auto rawLayer = layer.rawLayer->as<mbgl::style::BackgroundLayer>();
// background-color
{
XCTAssertTrue(rawLayer->getBackgroundColor().isUndefined(),
@"background-color should be unset initially.");
MGLStyleValue<MGLColor *> *defaultStyleValue = layer.backgroundColor;
MGLStyleValue<MGLColor *> *styleValue = [MGLStyleValue<MGLColor *> valueWithRawValue:[MGLColor redColor]];
layer.backgroundColor = styleValue;
mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { .r = 1, .g = 0, .b = 0, .a = 1 } };
XCTAssertEqual(rawLayer->getBackgroundColor(), propertyValue,
@"Setting backgroundColor to a constant value should update background-color.");
XCTAssertEqualObjects(layer.backgroundColor, styleValue,
@"backgroundColor should round-trip constant values.");
styleValue = [MGLStyleValue<MGLColor *> valueWithStops:@{
@18: styleValue,
}];
layer.backgroundColor = styleValue;
propertyValue = { mbgl::style::Function<mbgl::Color> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getBackgroundColor(), propertyValue,
@"Setting backgroundColor to a function should update background-color.");
XCTAssertEqualObjects(layer.backgroundColor, styleValue,
@"backgroundColor should round-trip functions.");
layer.backgroundColor = nil;
XCTAssertTrue(rawLayer->getBackgroundColor().isUndefined(),
@"Unsetting backgroundColor should return background-color to the default value.");
XCTAssertEqualObjects(layer.backgroundColor, defaultStyleValue,
@"backgroundColor should return the default value after being unset.");
}
// background-opacity
{
XCTAssertTrue(rawLayer->getBackgroundOpacity().isUndefined(),
@"background-opacity should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.backgroundOpacity;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.backgroundOpacity = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getBackgroundOpacity(), propertyValue,
@"Setting backgroundOpacity to a constant value should update background-opacity.");
XCTAssertEqualObjects(layer.backgroundOpacity, styleValue,
@"backgroundOpacity should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.backgroundOpacity = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getBackgroundOpacity(), propertyValue,
@"Setting backgroundOpacity to a function should update background-opacity.");
XCTAssertEqualObjects(layer.backgroundOpacity, styleValue,
@"backgroundOpacity should round-trip functions.");
layer.backgroundOpacity = nil;
XCTAssertTrue(rawLayer->getBackgroundOpacity().isUndefined(),
@"Unsetting backgroundOpacity should return background-opacity to the default value.");
XCTAssertEqualObjects(layer.backgroundOpacity, defaultStyleValue,
@"backgroundOpacity should return the default value after being unset.");
}
// background-pattern
{
XCTAssertTrue(rawLayer->getBackgroundPattern().isUndefined(),
@"background-pattern should be unset initially.");
MGLStyleValue<NSString *> *defaultStyleValue = layer.backgroundPattern;
MGLStyleValue<NSString *> *styleValue = [MGLStyleValue<NSString *> valueWithRawValue:@"Background Pattern"];
layer.backgroundPattern = styleValue;
mbgl::style::PropertyValue<std::string> propertyValue = { "Background Pattern" };
XCTAssertEqual(rawLayer->getBackgroundPattern(), propertyValue,
@"Setting backgroundPattern to a constant value should update background-pattern.");
XCTAssertEqualObjects(layer.backgroundPattern, styleValue,
@"backgroundPattern should round-trip constant values.");
styleValue = [MGLStyleValue<NSString *> valueWithStops:@{
@18: styleValue,
}];
layer.backgroundPattern = styleValue;
propertyValue = { mbgl::style::Function<std::string> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getBackgroundPattern(), propertyValue,
@"Setting backgroundPattern to a function should update background-pattern.");
XCTAssertEqualObjects(layer.backgroundPattern, styleValue,
@"backgroundPattern should round-trip functions.");
layer.backgroundPattern = nil;
XCTAssertTrue(rawLayer->getBackgroundPattern().isUndefined(),
@"Unsetting backgroundPattern should return background-pattern to the default value.");
XCTAssertEqualObjects(layer.backgroundPattern, defaultStyleValue,
@"backgroundPattern should return the default value after being unset.");
}
}
- (void)testPropertyNames {
[self testPropertyName:@"background-color" isBoolean:NO];
[self testPropertyName:@"background-opacity" isBoolean:NO];
[self testPropertyName:@"background-pattern" isBoolean:NO];
}
@end

View File

@@ -1,70 +0,0 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
@interface MGLCircleLayerTests : MGLStyleLayerTests
@end
@implementation MGLCircleLayerTests
+ (NSString *)layerType {
return @"circle";
}
- (void)testCircleLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
layer.circleBlur = [MGLRuntimeStylingHelper testNumber];
layer.circleColor = [MGLRuntimeStylingHelper testColor];
layer.circleOpacity = [MGLRuntimeStylingHelper testNumber];
layer.circleRadius = [MGLRuntimeStylingHelper testNumber];
layer.circleScaleAlignment = [MGLRuntimeStylingHelper testEnum:MGLCircleScaleAlignmentViewport type:@encode(MGLCircleScaleAlignment)];
layer.circleTranslation = [MGLRuntimeStylingHelper testOffset];
layer.circleTranslationAnchor = [MGLRuntimeStylingHelper testEnum:MGLCircleTranslationAnchorViewport type:@encode(MGLCircleTranslationAnchor)];
MGLCircleStyleLayer *gLayer = (MGLCircleStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLCircleStyleLayer class]]);
XCTAssertEqualObjects(gLayer.circleBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.circleColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.circleOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.circleRadius, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.circleScaleAlignment isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.circleScaleAlignment, [MGLRuntimeStylingHelper testEnum:MGLCircleScaleAlignmentViewport type:@encode(MGLCircleScaleAlignment)]);
XCTAssertEqualObjects(gLayer.circleTranslation, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.circleTranslationAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.circleTranslationAnchor, [MGLRuntimeStylingHelper testEnum:MGLCircleTranslationAnchorViewport type:@encode(MGLCircleTranslationAnchor)]);
layer.circleBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.circleColor = [MGLRuntimeStylingHelper testColorFunction];
layer.circleOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.circleRadius = [MGLRuntimeStylingHelper testNumberFunction];
layer.circleScaleAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLCircleScaleAlignmentViewport type:@encode(MGLCircleScaleAlignment)];
layer.circleTranslation = [MGLRuntimeStylingHelper testOffsetFunction];
layer.circleTranslationAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLCircleTranslationAnchorViewport type:@encode(MGLCircleTranslationAnchor)];
XCTAssertEqualObjects(gLayer.circleBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.circleColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.circleOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.circleRadius, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.circleScaleAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLCircleScaleAlignmentViewport type:@encode(MGLCircleScaleAlignment)]);
XCTAssertEqualObjects(gLayer.circleTranslation, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.circleTranslationAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLCircleTranslationAnchorViewport type:@encode(MGLCircleTranslationAnchor)]);
}
- (void)testPropertyNames {
[self testPropertyName:@"circle-blur" isBoolean:NO];
[self testPropertyName:@"circle-color" isBoolean:NO];
[self testPropertyName:@"circle-opacity" isBoolean:NO];
[self testPropertyName:@"circle-radius" isBoolean:NO];
[self testPropertyName:@"circle-scale-alignment" isBoolean:NO];
[self testPropertyName:@"circle-translation" isBoolean:NO];
[self testPropertyName:@"circle-translation-anchor" isBoolean:NO];
}
@end

View File

@@ -0,0 +1,308 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
#import "MGLStyleLayer_Private.h"
#include <mbgl/style/layers/circle_layer.hpp>
@interface MGLCircleLayerTests : MGLStyleLayerTests
@end
@implementation MGLCircleLayerTests
+ (NSString *)layerType {
return @"circle";
}
- (void)testPredicates {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
XCTAssertNil(layer.sourceLayerIdentifier);
layer.sourceLayerIdentifier = @"layerID";
XCTAssertEqualObjects(layer.sourceLayerIdentifier, @"layerID");
layer.sourceLayerIdentifier = nil;
XCTAssertNil(layer.sourceLayerIdentifier);
XCTAssertNil(layer.predicate);
layer.predicate = [NSPredicate predicateWithValue:NO];
XCTAssertEqualObjects(layer.predicate, [NSPredicate predicateWithValue:NO]);
layer.predicate = nil;
XCTAssertNil(layer.predicate);
}
- (void)testProperties {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
MGLCircleStyleLayer *layer = [[MGLCircleStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
XCTAssertNotEqual(layer.rawLayer, nullptr);
XCTAssertTrue(layer.rawLayer->is<mbgl::style::CircleLayer>());
auto rawLayer = layer.rawLayer->as<mbgl::style::CircleLayer>();
// circle-blur
{
XCTAssertTrue(rawLayer->getCircleBlur().isUndefined(),
@"circle-blur should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.circleBlur;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.circleBlur = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getCircleBlur(), propertyValue,
@"Setting circleBlur to a constant value should update circle-blur.");
XCTAssertEqualObjects(layer.circleBlur, styleValue,
@"circleBlur should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.circleBlur = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getCircleBlur(), propertyValue,
@"Setting circleBlur to a function should update circle-blur.");
XCTAssertEqualObjects(layer.circleBlur, styleValue,
@"circleBlur should round-trip functions.");
layer.circleBlur = nil;
XCTAssertTrue(rawLayer->getCircleBlur().isUndefined(),
@"Unsetting circleBlur should return circle-blur to the default value.");
XCTAssertEqualObjects(layer.circleBlur, defaultStyleValue,
@"circleBlur should return the default value after being unset.");
}
// circle-color
{
XCTAssertTrue(rawLayer->getCircleColor().isUndefined(),
@"circle-color should be unset initially.");
MGLStyleValue<MGLColor *> *defaultStyleValue = layer.circleColor;
MGLStyleValue<MGLColor *> *styleValue = [MGLStyleValue<MGLColor *> valueWithRawValue:[MGLColor redColor]];
layer.circleColor = styleValue;
mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { .r = 1, .g = 0, .b = 0, .a = 1 } };
XCTAssertEqual(rawLayer->getCircleColor(), propertyValue,
@"Setting circleColor to a constant value should update circle-color.");
XCTAssertEqualObjects(layer.circleColor, styleValue,
@"circleColor should round-trip constant values.");
styleValue = [MGLStyleValue<MGLColor *> valueWithStops:@{
@18: styleValue,
}];
layer.circleColor = styleValue;
propertyValue = { mbgl::style::Function<mbgl::Color> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getCircleColor(), propertyValue,
@"Setting circleColor to a function should update circle-color.");
XCTAssertEqualObjects(layer.circleColor, styleValue,
@"circleColor should round-trip functions.");
layer.circleColor = nil;
XCTAssertTrue(rawLayer->getCircleColor().isUndefined(),
@"Unsetting circleColor should return circle-color to the default value.");
XCTAssertEqualObjects(layer.circleColor, defaultStyleValue,
@"circleColor should return the default value after being unset.");
}
// circle-opacity
{
XCTAssertTrue(rawLayer->getCircleOpacity().isUndefined(),
@"circle-opacity should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.circleOpacity;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.circleOpacity = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getCircleOpacity(), propertyValue,
@"Setting circleOpacity to a constant value should update circle-opacity.");
XCTAssertEqualObjects(layer.circleOpacity, styleValue,
@"circleOpacity should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.circleOpacity = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getCircleOpacity(), propertyValue,
@"Setting circleOpacity to a function should update circle-opacity.");
XCTAssertEqualObjects(layer.circleOpacity, styleValue,
@"circleOpacity should round-trip functions.");
layer.circleOpacity = nil;
XCTAssertTrue(rawLayer->getCircleOpacity().isUndefined(),
@"Unsetting circleOpacity should return circle-opacity to the default value.");
XCTAssertEqualObjects(layer.circleOpacity, defaultStyleValue,
@"circleOpacity should return the default value after being unset.");
}
// circle-radius
{
XCTAssertTrue(rawLayer->getCircleRadius().isUndefined(),
@"circle-radius should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.circleRadius;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.circleRadius = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getCircleRadius(), propertyValue,
@"Setting circleRadius to a constant value should update circle-radius.");
XCTAssertEqualObjects(layer.circleRadius, styleValue,
@"circleRadius should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.circleRadius = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getCircleRadius(), propertyValue,
@"Setting circleRadius to a function should update circle-radius.");
XCTAssertEqualObjects(layer.circleRadius, styleValue,
@"circleRadius should round-trip functions.");
layer.circleRadius = nil;
XCTAssertTrue(rawLayer->getCircleRadius().isUndefined(),
@"Unsetting circleRadius should return circle-radius to the default value.");
XCTAssertEqualObjects(layer.circleRadius, defaultStyleValue,
@"circleRadius should return the default value after being unset.");
}
// circle-pitch-scale
{
XCTAssertTrue(rawLayer->getCirclePitchScale().isUndefined(),
@"circle-pitch-scale should be unset initially.");
MGLStyleValue<NSValue *> *defaultStyleValue = layer.circleScaleAlignment;
MGLStyleValue<NSValue *> *styleValue = [MGLStyleValue<NSValue *> valueWithRawValue:[NSValue valueWithMGLCircleScaleAlignment:MGLCircleScaleAlignmentViewport]];
layer.circleScaleAlignment = styleValue;
mbgl::style::PropertyValue<mbgl::style::CirclePitchScaleType> propertyValue = { mbgl::style::CirclePitchScaleType::Viewport };
XCTAssertEqual(rawLayer->getCirclePitchScale(), propertyValue,
@"Setting circleScaleAlignment to a constant value should update circle-pitch-scale.");
XCTAssertEqualObjects(layer.circleScaleAlignment, styleValue,
@"circleScaleAlignment should round-trip constant values.");
styleValue = [MGLStyleValue<NSValue *> valueWithStops:@{
@18: styleValue,
}];
layer.circleScaleAlignment = styleValue;
propertyValue = { mbgl::style::Function<mbgl::style::CirclePitchScaleType> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getCirclePitchScale(), propertyValue,
@"Setting circleScaleAlignment to a function should update circle-pitch-scale.");
XCTAssertEqualObjects(layer.circleScaleAlignment, styleValue,
@"circleScaleAlignment should round-trip functions.");
layer.circleScaleAlignment = nil;
XCTAssertTrue(rawLayer->getCirclePitchScale().isUndefined(),
@"Unsetting circleScaleAlignment should return circle-pitch-scale to the default value.");
XCTAssertEqualObjects(layer.circleScaleAlignment, defaultStyleValue,
@"circleScaleAlignment should return the default value after being unset.");
}
// circle-translate
{
XCTAssertTrue(rawLayer->getCircleTranslate().isUndefined(),
@"circle-translate should be unset initially.");
MGLStyleValue<NSValue *> *defaultStyleValue = layer.circleTranslation;
MGLStyleValue<NSValue *> *styleValue = [MGLStyleValue<NSValue *> valueWithRawValue:
#if TARGET_OS_IPHONE
[NSValue valueWithCGVector:CGVectorMake(1, 1)]
#else
[NSValue valueWithMGLVector:CGVectorMake(1, -1)]
#endif
];
layer.circleTranslation = styleValue;
mbgl::style::PropertyValue<std::array<float, 2>> propertyValue = { { 1, 1 } };
XCTAssertEqual(rawLayer->getCircleTranslate(), propertyValue,
@"Setting circleTranslation to a constant value should update circle-translate.");
XCTAssertEqualObjects(layer.circleTranslation, styleValue,
@"circleTranslation should round-trip constant values.");
styleValue = [MGLStyleValue<NSValue *> valueWithStops:@{
@18: styleValue,
}];
layer.circleTranslation = styleValue;
propertyValue = { mbgl::style::Function<std::array<float, 2>> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getCircleTranslate(), propertyValue,
@"Setting circleTranslation to a function should update circle-translate.");
XCTAssertEqualObjects(layer.circleTranslation, styleValue,
@"circleTranslation should round-trip functions.");
layer.circleTranslation = nil;
XCTAssertTrue(rawLayer->getCircleTranslate().isUndefined(),
@"Unsetting circleTranslation should return circle-translate to the default value.");
XCTAssertEqualObjects(layer.circleTranslation, defaultStyleValue,
@"circleTranslation should return the default value after being unset.");
}
// circle-translate-anchor
{
XCTAssertTrue(rawLayer->getCircleTranslateAnchor().isUndefined(),
@"circle-translate-anchor should be unset initially.");
MGLStyleValue<NSValue *> *defaultStyleValue = layer.circleTranslationAnchor;
MGLStyleValue<NSValue *> *styleValue = [MGLStyleValue<NSValue *> valueWithRawValue:[NSValue valueWithMGLCircleTranslationAnchor:MGLCircleTranslationAnchorViewport]];
layer.circleTranslationAnchor = styleValue;
mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType> propertyValue = { mbgl::style::TranslateAnchorType::Viewport };
XCTAssertEqual(rawLayer->getCircleTranslateAnchor(), propertyValue,
@"Setting circleTranslationAnchor to a constant value should update circle-translate-anchor.");
XCTAssertEqualObjects(layer.circleTranslationAnchor, styleValue,
@"circleTranslationAnchor should round-trip constant values.");
styleValue = [MGLStyleValue<NSValue *> valueWithStops:@{
@18: styleValue,
}];
layer.circleTranslationAnchor = styleValue;
propertyValue = { mbgl::style::Function<mbgl::style::TranslateAnchorType> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getCircleTranslateAnchor(), propertyValue,
@"Setting circleTranslationAnchor to a function should update circle-translate-anchor.");
XCTAssertEqualObjects(layer.circleTranslationAnchor, styleValue,
@"circleTranslationAnchor should round-trip functions.");
layer.circleTranslationAnchor = nil;
XCTAssertTrue(rawLayer->getCircleTranslateAnchor().isUndefined(),
@"Unsetting circleTranslationAnchor should return circle-translate-anchor to the default value.");
XCTAssertEqualObjects(layer.circleTranslationAnchor, defaultStyleValue,
@"circleTranslationAnchor should return the default value after being unset.");
}
}
- (void)testPropertyNames {
[self testPropertyName:@"circle-blur" isBoolean:NO];
[self testPropertyName:@"circle-color" isBoolean:NO];
[self testPropertyName:@"circle-opacity" isBoolean:NO];
[self testPropertyName:@"circle-radius" isBoolean:NO];
[self testPropertyName:@"circle-scale-alignment" isBoolean:NO];
[self testPropertyName:@"circle-translation" isBoolean:NO];
[self testPropertyName:@"circle-translation-anchor" isBoolean:NO];
}
- (void)testValueAdditions {
XCTAssertEqual([NSValue valueWithMGLCircleScaleAlignment:MGLCircleScaleAlignmentMap].MGLCircleScaleAlignmentValue, MGLCircleScaleAlignmentMap);
XCTAssertEqual([NSValue valueWithMGLCircleScaleAlignment:MGLCircleScaleAlignmentViewport].MGLCircleScaleAlignmentValue, MGLCircleScaleAlignmentViewport);
XCTAssertEqual([NSValue valueWithMGLCircleTranslationAnchor:MGLCircleTranslationAnchorMap].MGLCircleTranslationAnchorValue, MGLCircleTranslationAnchorMap);
XCTAssertEqual([NSValue valueWithMGLCircleTranslationAnchor:MGLCircleTranslationAnchorViewport].MGLCircleTranslationAnchorValue, MGLCircleTranslationAnchorViewport);
}
@end

View File

@@ -1,69 +0,0 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
@interface MGLFillLayerTests : MGLStyleLayerTests
@end
@implementation MGLFillLayerTests
+ (NSString *)layerType {
return @"fill";
}
- (void)testFillLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
layer.fillAntialiased = [MGLRuntimeStylingHelper testBool];
layer.fillColor = [MGLRuntimeStylingHelper testColor];
layer.fillOpacity = [MGLRuntimeStylingHelper testNumber];
layer.fillOutlineColor = [MGLRuntimeStylingHelper testColor];
layer.fillPattern = [MGLRuntimeStylingHelper testString];
layer.fillTranslation = [MGLRuntimeStylingHelper testOffset];
layer.fillTranslationAnchor = [MGLRuntimeStylingHelper testEnum:MGLFillTranslationAnchorViewport type:@encode(MGLFillTranslationAnchor)];
MGLFillStyleLayer *gLayer = (MGLFillStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLFillStyleLayer class]]);
XCTAssertEqualObjects(gLayer.fillAntialiased, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.fillColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.fillOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.fillOutlineColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.fillPattern, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.fillTranslation, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.fillTranslationAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.fillTranslationAnchor, [MGLRuntimeStylingHelper testEnum:MGLFillTranslationAnchorViewport type:@encode(MGLFillTranslationAnchor)]);
layer.fillAntialiased = [MGLRuntimeStylingHelper testBoolFunction];
layer.fillColor = [MGLRuntimeStylingHelper testColorFunction];
layer.fillOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.fillOutlineColor = [MGLRuntimeStylingHelper testColorFunction];
layer.fillPattern = [MGLRuntimeStylingHelper testStringFunction];
layer.fillTranslation = [MGLRuntimeStylingHelper testOffsetFunction];
layer.fillTranslationAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLFillTranslationAnchorViewport type:@encode(MGLFillTranslationAnchor)];
XCTAssertEqualObjects(gLayer.fillAntialiased, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.fillColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.fillOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.fillOutlineColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.fillPattern, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.fillTranslation, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.fillTranslationAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLFillTranslationAnchorViewport type:@encode(MGLFillTranslationAnchor)]);
}
- (void)testPropertyNames {
[self testPropertyName:@"is-fill-antialiased" isBoolean:YES];
[self testPropertyName:@"fill-color" isBoolean:NO];
[self testPropertyName:@"fill-opacity" isBoolean:NO];
[self testPropertyName:@"fill-outline-color" isBoolean:NO];
[self testPropertyName:@"fill-pattern" isBoolean:NO];
[self testPropertyName:@"fill-translation" isBoolean:NO];
[self testPropertyName:@"fill-translation-anchor" isBoolean:NO];
}
@end

View File

@@ -0,0 +1,306 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
#import "MGLStyleLayer_Private.h"
#include <mbgl/style/layers/fill_layer.hpp>
@interface MGLFillLayerTests : MGLStyleLayerTests
@end
@implementation MGLFillLayerTests
+ (NSString *)layerType {
return @"fill";
}
- (void)testPredicates {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
XCTAssertNil(layer.sourceLayerIdentifier);
layer.sourceLayerIdentifier = @"layerID";
XCTAssertEqualObjects(layer.sourceLayerIdentifier, @"layerID");
layer.sourceLayerIdentifier = nil;
XCTAssertNil(layer.sourceLayerIdentifier);
XCTAssertNil(layer.predicate);
layer.predicate = [NSPredicate predicateWithValue:NO];
XCTAssertEqualObjects(layer.predicate, [NSPredicate predicateWithValue:NO]);
layer.predicate = nil;
XCTAssertNil(layer.predicate);
}
- (void)testProperties {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
XCTAssertNotEqual(layer.rawLayer, nullptr);
XCTAssertTrue(layer.rawLayer->is<mbgl::style::FillLayer>());
auto rawLayer = layer.rawLayer->as<mbgl::style::FillLayer>();
// fill-antialias
{
XCTAssertTrue(rawLayer->getFillAntialias().isUndefined(),
@"fill-antialias should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.fillAntialiased;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@NO];
layer.fillAntialiased = styleValue;
mbgl::style::PropertyValue<bool> propertyValue = { false };
XCTAssertEqual(rawLayer->getFillAntialias(), propertyValue,
@"Setting fillAntialiased to a constant value should update fill-antialias.");
XCTAssertEqualObjects(layer.fillAntialiased, styleValue,
@"fillAntialiased should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.fillAntialiased = styleValue;
propertyValue = { mbgl::style::Function<bool> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getFillAntialias(), propertyValue,
@"Setting fillAntialiased to a function should update fill-antialias.");
XCTAssertEqualObjects(layer.fillAntialiased, styleValue,
@"fillAntialiased should round-trip functions.");
layer.fillAntialiased = nil;
XCTAssertTrue(rawLayer->getFillAntialias().isUndefined(),
@"Unsetting fillAntialiased should return fill-antialias to the default value.");
XCTAssertEqualObjects(layer.fillAntialiased, defaultStyleValue,
@"fillAntialiased should return the default value after being unset.");
}
// fill-color
{
XCTAssertTrue(rawLayer->getFillColor().isUndefined(),
@"fill-color should be unset initially.");
MGLStyleValue<MGLColor *> *defaultStyleValue = layer.fillColor;
MGLStyleValue<MGLColor *> *styleValue = [MGLStyleValue<MGLColor *> valueWithRawValue:[MGLColor redColor]];
layer.fillColor = styleValue;
mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { .r = 1, .g = 0, .b = 0, .a = 1 } };
XCTAssertEqual(rawLayer->getFillColor(), propertyValue,
@"Setting fillColor to a constant value should update fill-color.");
XCTAssertEqualObjects(layer.fillColor, styleValue,
@"fillColor should round-trip constant values.");
styleValue = [MGLStyleValue<MGLColor *> valueWithStops:@{
@18: styleValue,
}];
layer.fillColor = styleValue;
propertyValue = { mbgl::style::Function<mbgl::Color> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getFillColor(), propertyValue,
@"Setting fillColor to a function should update fill-color.");
XCTAssertEqualObjects(layer.fillColor, styleValue,
@"fillColor should round-trip functions.");
layer.fillColor = nil;
XCTAssertTrue(rawLayer->getFillColor().isUndefined(),
@"Unsetting fillColor should return fill-color to the default value.");
XCTAssertEqualObjects(layer.fillColor, defaultStyleValue,
@"fillColor should return the default value after being unset.");
}
// fill-opacity
{
XCTAssertTrue(rawLayer->getFillOpacity().isUndefined(),
@"fill-opacity should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.fillOpacity;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.fillOpacity = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getFillOpacity(), propertyValue,
@"Setting fillOpacity to a constant value should update fill-opacity.");
XCTAssertEqualObjects(layer.fillOpacity, styleValue,
@"fillOpacity should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.fillOpacity = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getFillOpacity(), propertyValue,
@"Setting fillOpacity to a function should update fill-opacity.");
XCTAssertEqualObjects(layer.fillOpacity, styleValue,
@"fillOpacity should round-trip functions.");
layer.fillOpacity = nil;
XCTAssertTrue(rawLayer->getFillOpacity().isUndefined(),
@"Unsetting fillOpacity should return fill-opacity to the default value.");
XCTAssertEqualObjects(layer.fillOpacity, defaultStyleValue,
@"fillOpacity should return the default value after being unset.");
}
// fill-outline-color
{
XCTAssertTrue(rawLayer->getFillOutlineColor().isUndefined(),
@"fill-outline-color should be unset initially.");
MGLStyleValue<MGLColor *> *defaultStyleValue = layer.fillOutlineColor;
MGLStyleValue<MGLColor *> *styleValue = [MGLStyleValue<MGLColor *> valueWithRawValue:[MGLColor redColor]];
layer.fillOutlineColor = styleValue;
mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { .r = 1, .g = 0, .b = 0, .a = 1 } };
XCTAssertEqual(rawLayer->getFillOutlineColor(), propertyValue,
@"Setting fillOutlineColor to a constant value should update fill-outline-color.");
XCTAssertEqualObjects(layer.fillOutlineColor, styleValue,
@"fillOutlineColor should round-trip constant values.");
styleValue = [MGLStyleValue<MGLColor *> valueWithStops:@{
@18: styleValue,
}];
layer.fillOutlineColor = styleValue;
propertyValue = { mbgl::style::Function<mbgl::Color> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getFillOutlineColor(), propertyValue,
@"Setting fillOutlineColor to a function should update fill-outline-color.");
XCTAssertEqualObjects(layer.fillOutlineColor, styleValue,
@"fillOutlineColor should round-trip functions.");
layer.fillOutlineColor = nil;
XCTAssertTrue(rawLayer->getFillOutlineColor().isUndefined(),
@"Unsetting fillOutlineColor should return fill-outline-color to the default value.");
XCTAssertEqualObjects(layer.fillOutlineColor, defaultStyleValue,
@"fillOutlineColor should return the default value after being unset.");
}
// fill-pattern
{
XCTAssertTrue(rawLayer->getFillPattern().isUndefined(),
@"fill-pattern should be unset initially.");
MGLStyleValue<NSString *> *defaultStyleValue = layer.fillPattern;
MGLStyleValue<NSString *> *styleValue = [MGLStyleValue<NSString *> valueWithRawValue:@"Fill Pattern"];
layer.fillPattern = styleValue;
mbgl::style::PropertyValue<std::string> propertyValue = { "Fill Pattern" };
XCTAssertEqual(rawLayer->getFillPattern(), propertyValue,
@"Setting fillPattern to a constant value should update fill-pattern.");
XCTAssertEqualObjects(layer.fillPattern, styleValue,
@"fillPattern should round-trip constant values.");
styleValue = [MGLStyleValue<NSString *> valueWithStops:@{
@18: styleValue,
}];
layer.fillPattern = styleValue;
propertyValue = { mbgl::style::Function<std::string> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getFillPattern(), propertyValue,
@"Setting fillPattern to a function should update fill-pattern.");
XCTAssertEqualObjects(layer.fillPattern, styleValue,
@"fillPattern should round-trip functions.");
layer.fillPattern = nil;
XCTAssertTrue(rawLayer->getFillPattern().isUndefined(),
@"Unsetting fillPattern should return fill-pattern to the default value.");
XCTAssertEqualObjects(layer.fillPattern, defaultStyleValue,
@"fillPattern should return the default value after being unset.");
}
// fill-translate
{
XCTAssertTrue(rawLayer->getFillTranslate().isUndefined(),
@"fill-translate should be unset initially.");
MGLStyleValue<NSValue *> *defaultStyleValue = layer.fillTranslation;
MGLStyleValue<NSValue *> *styleValue = [MGLStyleValue<NSValue *> valueWithRawValue:
#if TARGET_OS_IPHONE
[NSValue valueWithCGVector:CGVectorMake(1, 1)]
#else
[NSValue valueWithMGLVector:CGVectorMake(1, -1)]
#endif
];
layer.fillTranslation = styleValue;
mbgl::style::PropertyValue<std::array<float, 2>> propertyValue = { { 1, 1 } };
XCTAssertEqual(rawLayer->getFillTranslate(), propertyValue,
@"Setting fillTranslation to a constant value should update fill-translate.");
XCTAssertEqualObjects(layer.fillTranslation, styleValue,
@"fillTranslation should round-trip constant values.");
styleValue = [MGLStyleValue<NSValue *> valueWithStops:@{
@18: styleValue,
}];
layer.fillTranslation = styleValue;
propertyValue = { mbgl::style::Function<std::array<float, 2>> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getFillTranslate(), propertyValue,
@"Setting fillTranslation to a function should update fill-translate.");
XCTAssertEqualObjects(layer.fillTranslation, styleValue,
@"fillTranslation should round-trip functions.");
layer.fillTranslation = nil;
XCTAssertTrue(rawLayer->getFillTranslate().isUndefined(),
@"Unsetting fillTranslation should return fill-translate to the default value.");
XCTAssertEqualObjects(layer.fillTranslation, defaultStyleValue,
@"fillTranslation should return the default value after being unset.");
}
// fill-translate-anchor
{
XCTAssertTrue(rawLayer->getFillTranslateAnchor().isUndefined(),
@"fill-translate-anchor should be unset initially.");
MGLStyleValue<NSValue *> *defaultStyleValue = layer.fillTranslationAnchor;
MGLStyleValue<NSValue *> *styleValue = [MGLStyleValue<NSValue *> valueWithRawValue:[NSValue valueWithMGLFillTranslationAnchor:MGLFillTranslationAnchorViewport]];
layer.fillTranslationAnchor = styleValue;
mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType> propertyValue = { mbgl::style::TranslateAnchorType::Viewport };
XCTAssertEqual(rawLayer->getFillTranslateAnchor(), propertyValue,
@"Setting fillTranslationAnchor to a constant value should update fill-translate-anchor.");
XCTAssertEqualObjects(layer.fillTranslationAnchor, styleValue,
@"fillTranslationAnchor should round-trip constant values.");
styleValue = [MGLStyleValue<NSValue *> valueWithStops:@{
@18: styleValue,
}];
layer.fillTranslationAnchor = styleValue;
propertyValue = { mbgl::style::Function<mbgl::style::TranslateAnchorType> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getFillTranslateAnchor(), propertyValue,
@"Setting fillTranslationAnchor to a function should update fill-translate-anchor.");
XCTAssertEqualObjects(layer.fillTranslationAnchor, styleValue,
@"fillTranslationAnchor should round-trip functions.");
layer.fillTranslationAnchor = nil;
XCTAssertTrue(rawLayer->getFillTranslateAnchor().isUndefined(),
@"Unsetting fillTranslationAnchor should return fill-translate-anchor to the default value.");
XCTAssertEqualObjects(layer.fillTranslationAnchor, defaultStyleValue,
@"fillTranslationAnchor should return the default value after being unset.");
}
}
- (void)testPropertyNames {
[self testPropertyName:@"is-fill-antialiased" isBoolean:YES];
[self testPropertyName:@"fill-color" isBoolean:NO];
[self testPropertyName:@"fill-opacity" isBoolean:NO];
[self testPropertyName:@"fill-outline-color" isBoolean:NO];
[self testPropertyName:@"fill-pattern" isBoolean:NO];
[self testPropertyName:@"fill-translation" isBoolean:NO];
[self testPropertyName:@"fill-translation-anchor" isBoolean:NO];
}
- (void)testValueAdditions {
XCTAssertEqual([NSValue valueWithMGLFillTranslationAnchor:MGLFillTranslationAnchorMap].MGLFillTranslationAnchorValue, MGLFillTranslationAnchorMap);
XCTAssertEqual([NSValue valueWithMGLFillTranslationAnchor:MGLFillTranslationAnchorViewport].MGLFillTranslationAnchorValue, MGLFillTranslationAnchorViewport);
}
@end

View File

@@ -1,106 +0,0 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
@interface MGLLineLayerTests : MGLStyleLayerTests
@end
@implementation MGLLineLayerTests
+ (NSString *)layerType {
return @"line";
}
- (void)testLineLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLLineStyleLayer *layer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
layer.lineCap = [MGLRuntimeStylingHelper testEnum:MGLLineCapSquare type:@encode(MGLLineCap)];
layer.lineJoin = [MGLRuntimeStylingHelper testEnum:MGLLineJoinMiter type:@encode(MGLLineJoin)];
layer.lineMiterLimit = [MGLRuntimeStylingHelper testNumber];
layer.lineRoundLimit = [MGLRuntimeStylingHelper testNumber];
layer.lineBlur = [MGLRuntimeStylingHelper testNumber];
layer.lineColor = [MGLRuntimeStylingHelper testColor];
layer.lineDashPattern = [MGLRuntimeStylingHelper testDashArray];
layer.lineGapWidth = [MGLRuntimeStylingHelper testNumber];
layer.lineOffset = [MGLRuntimeStylingHelper testNumber];
layer.lineOpacity = [MGLRuntimeStylingHelper testNumber];
layer.linePattern = [MGLRuntimeStylingHelper testString];
layer.lineTranslation = [MGLRuntimeStylingHelper testOffset];
layer.lineTranslationAnchor = [MGLRuntimeStylingHelper testEnum:MGLLineTranslationAnchorViewport type:@encode(MGLLineTranslationAnchor)];
layer.lineWidth = [MGLRuntimeStylingHelper testNumber];
MGLLineStyleLayer *gLayer = (MGLLineStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLLineStyleLayer class]]);
XCTAssert([gLayer.lineCap isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.lineCap, [MGLRuntimeStylingHelper testEnum:MGLLineCapSquare type:@encode(MGLLineCap)]);
XCTAssert([gLayer.lineJoin isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.lineJoin, [MGLRuntimeStylingHelper testEnum:MGLLineJoinMiter type:@encode(MGLLineJoin)]);
XCTAssertEqualObjects(gLayer.lineMiterLimit, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineRoundLimit, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.lineDashPattern, [MGLRuntimeStylingHelper testDashArray]);
XCTAssertEqualObjects(gLayer.lineGapWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineOffset, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.lineOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.linePattern, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.lineTranslation, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.lineTranslationAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.lineTranslationAnchor, [MGLRuntimeStylingHelper testEnum:MGLLineTranslationAnchorViewport type:@encode(MGLLineTranslationAnchor)]);
XCTAssertEqualObjects(gLayer.lineWidth, [MGLRuntimeStylingHelper testNumber]);
layer.lineCap = [MGLRuntimeStylingHelper testEnumFunction:MGLLineCapSquare type:@encode(MGLLineCap)];
layer.lineJoin = [MGLRuntimeStylingHelper testEnumFunction:MGLLineJoinMiter type:@encode(MGLLineJoin)];
layer.lineMiterLimit = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineRoundLimit = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineColor = [MGLRuntimeStylingHelper testColorFunction];
layer.lineDashPattern = [MGLRuntimeStylingHelper testDashArrayFunction];
layer.lineGapWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineOffset = [MGLRuntimeStylingHelper testNumberFunction];
layer.lineOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.linePattern = [MGLRuntimeStylingHelper testStringFunction];
layer.lineTranslation = [MGLRuntimeStylingHelper testOffsetFunction];
layer.lineTranslationAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLLineTranslationAnchorViewport type:@encode(MGLLineTranslationAnchor)];
layer.lineWidth = [MGLRuntimeStylingHelper testNumberFunction];
XCTAssertEqualObjects(gLayer.lineCap, [MGLRuntimeStylingHelper testEnumFunction:MGLLineCapSquare type:@encode(MGLLineCap)]);
XCTAssertEqualObjects(gLayer.lineJoin, [MGLRuntimeStylingHelper testEnumFunction:MGLLineJoinMiter type:@encode(MGLLineJoin)]);
XCTAssertEqualObjects(gLayer.lineMiterLimit, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineRoundLimit, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.lineDashPattern, [MGLRuntimeStylingHelper testDashArrayFunction]);
XCTAssertEqualObjects(gLayer.lineGapWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineOffset, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.lineOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.linePattern, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.lineTranslation, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.lineTranslationAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLLineTranslationAnchorViewport type:@encode(MGLLineTranslationAnchor)]);
XCTAssertEqualObjects(gLayer.lineWidth, [MGLRuntimeStylingHelper testNumberFunction]);
}
- (void)testPropertyNames {
[self testPropertyName:@"line-cap" isBoolean:NO];
[self testPropertyName:@"line-join" isBoolean:NO];
[self testPropertyName:@"line-miter-limit" isBoolean:NO];
[self testPropertyName:@"line-round-limit" isBoolean:NO];
[self testPropertyName:@"line-blur" isBoolean:NO];
[self testPropertyName:@"line-color" isBoolean:NO];
[self testPropertyName:@"line-dash-pattern" isBoolean:NO];
[self testPropertyName:@"line-gap-width" isBoolean:NO];
[self testPropertyName:@"line-offset" isBoolean:NO];
[self testPropertyName:@"line-opacity" isBoolean:NO];
[self testPropertyName:@"line-pattern" isBoolean:NO];
[self testPropertyName:@"line-translation" isBoolean:NO];
[self testPropertyName:@"line-translation-anchor" isBoolean:NO];
[self testPropertyName:@"line-width" isBoolean:NO];
}
@end

View File

@@ -0,0 +1,557 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
#import "MGLStyleLayer_Private.h"
#include <mbgl/style/layers/line_layer.hpp>
@interface MGLLineLayerTests : MGLStyleLayerTests
@end
@implementation MGLLineLayerTests
+ (NSString *)layerType {
return @"line";
}
- (void)testPredicates {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
MGLLineStyleLayer *layer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
XCTAssertNil(layer.sourceLayerIdentifier);
layer.sourceLayerIdentifier = @"layerID";
XCTAssertEqualObjects(layer.sourceLayerIdentifier, @"layerID");
layer.sourceLayerIdentifier = nil;
XCTAssertNil(layer.sourceLayerIdentifier);
XCTAssertNil(layer.predicate);
layer.predicate = [NSPredicate predicateWithValue:NO];
XCTAssertEqualObjects(layer.predicate, [NSPredicate predicateWithValue:NO]);
layer.predicate = nil;
XCTAssertNil(layer.predicate);
}
- (void)testProperties {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
MGLLineStyleLayer *layer = [[MGLLineStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
XCTAssertNotEqual(layer.rawLayer, nullptr);
XCTAssertTrue(layer.rawLayer->is<mbgl::style::LineLayer>());
auto rawLayer = layer.rawLayer->as<mbgl::style::LineLayer>();
// line-cap
{
XCTAssertTrue(rawLayer->getLineCap().isUndefined(),
@"line-cap should be unset initially.");
MGLStyleValue<NSValue *> *defaultStyleValue = layer.lineCap;
MGLStyleValue<NSValue *> *styleValue = [MGLStyleValue<NSValue *> valueWithRawValue:[NSValue valueWithMGLLineCap:MGLLineCapSquare]];
layer.lineCap = styleValue;
mbgl::style::PropertyValue<mbgl::style::LineCapType> propertyValue = { mbgl::style::LineCapType::Square };
XCTAssertEqual(rawLayer->getLineCap(), propertyValue,
@"Setting lineCap to a constant value should update line-cap.");
XCTAssertEqualObjects(layer.lineCap, styleValue,
@"lineCap should round-trip constant values.");
styleValue = [MGLStyleValue<NSValue *> valueWithStops:@{
@18: styleValue,
}];
layer.lineCap = styleValue;
propertyValue = { mbgl::style::Function<mbgl::style::LineCapType> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineCap(), propertyValue,
@"Setting lineCap to a function should update line-cap.");
XCTAssertEqualObjects(layer.lineCap, styleValue,
@"lineCap should round-trip functions.");
layer.lineCap = nil;
XCTAssertTrue(rawLayer->getLineCap().isUndefined(),
@"Unsetting lineCap should return line-cap to the default value.");
XCTAssertEqualObjects(layer.lineCap, defaultStyleValue,
@"lineCap should return the default value after being unset.");
}
// line-join
{
XCTAssertTrue(rawLayer->getLineJoin().isUndefined(),
@"line-join should be unset initially.");
MGLStyleValue<NSValue *> *defaultStyleValue = layer.lineJoin;
MGLStyleValue<NSValue *> *styleValue = [MGLStyleValue<NSValue *> valueWithRawValue:[NSValue valueWithMGLLineJoin:MGLLineJoinMiter]];
layer.lineJoin = styleValue;
mbgl::style::PropertyValue<mbgl::style::LineJoinType> propertyValue = { mbgl::style::LineJoinType::Miter };
XCTAssertEqual(rawLayer->getLineJoin(), propertyValue,
@"Setting lineJoin to a constant value should update line-join.");
XCTAssertEqualObjects(layer.lineJoin, styleValue,
@"lineJoin should round-trip constant values.");
styleValue = [MGLStyleValue<NSValue *> valueWithStops:@{
@18: styleValue,
}];
layer.lineJoin = styleValue;
propertyValue = { mbgl::style::Function<mbgl::style::LineJoinType> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineJoin(), propertyValue,
@"Setting lineJoin to a function should update line-join.");
XCTAssertEqualObjects(layer.lineJoin, styleValue,
@"lineJoin should round-trip functions.");
layer.lineJoin = nil;
XCTAssertTrue(rawLayer->getLineJoin().isUndefined(),
@"Unsetting lineJoin should return line-join to the default value.");
XCTAssertEqualObjects(layer.lineJoin, defaultStyleValue,
@"lineJoin should return the default value after being unset.");
}
// line-miter-limit
{
XCTAssertTrue(rawLayer->getLineMiterLimit().isUndefined(),
@"line-miter-limit should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.lineMiterLimit;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.lineMiterLimit = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getLineMiterLimit(), propertyValue,
@"Setting lineMiterLimit to a constant value should update line-miter-limit.");
XCTAssertEqualObjects(layer.lineMiterLimit, styleValue,
@"lineMiterLimit should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.lineMiterLimit = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineMiterLimit(), propertyValue,
@"Setting lineMiterLimit to a function should update line-miter-limit.");
XCTAssertEqualObjects(layer.lineMiterLimit, styleValue,
@"lineMiterLimit should round-trip functions.");
layer.lineMiterLimit = nil;
XCTAssertTrue(rawLayer->getLineMiterLimit().isUndefined(),
@"Unsetting lineMiterLimit should return line-miter-limit to the default value.");
XCTAssertEqualObjects(layer.lineMiterLimit, defaultStyleValue,
@"lineMiterLimit should return the default value after being unset.");
}
// line-round-limit
{
XCTAssertTrue(rawLayer->getLineRoundLimit().isUndefined(),
@"line-round-limit should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.lineRoundLimit;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.lineRoundLimit = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getLineRoundLimit(), propertyValue,
@"Setting lineRoundLimit to a constant value should update line-round-limit.");
XCTAssertEqualObjects(layer.lineRoundLimit, styleValue,
@"lineRoundLimit should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.lineRoundLimit = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineRoundLimit(), propertyValue,
@"Setting lineRoundLimit to a function should update line-round-limit.");
XCTAssertEqualObjects(layer.lineRoundLimit, styleValue,
@"lineRoundLimit should round-trip functions.");
layer.lineRoundLimit = nil;
XCTAssertTrue(rawLayer->getLineRoundLimit().isUndefined(),
@"Unsetting lineRoundLimit should return line-round-limit to the default value.");
XCTAssertEqualObjects(layer.lineRoundLimit, defaultStyleValue,
@"lineRoundLimit should return the default value after being unset.");
}
// line-blur
{
XCTAssertTrue(rawLayer->getLineBlur().isUndefined(),
@"line-blur should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.lineBlur;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.lineBlur = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getLineBlur(), propertyValue,
@"Setting lineBlur to a constant value should update line-blur.");
XCTAssertEqualObjects(layer.lineBlur, styleValue,
@"lineBlur should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.lineBlur = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineBlur(), propertyValue,
@"Setting lineBlur to a function should update line-blur.");
XCTAssertEqualObjects(layer.lineBlur, styleValue,
@"lineBlur should round-trip functions.");
layer.lineBlur = nil;
XCTAssertTrue(rawLayer->getLineBlur().isUndefined(),
@"Unsetting lineBlur should return line-blur to the default value.");
XCTAssertEqualObjects(layer.lineBlur, defaultStyleValue,
@"lineBlur should return the default value after being unset.");
}
// line-color
{
XCTAssertTrue(rawLayer->getLineColor().isUndefined(),
@"line-color should be unset initially.");
MGLStyleValue<MGLColor *> *defaultStyleValue = layer.lineColor;
MGLStyleValue<MGLColor *> *styleValue = [MGLStyleValue<MGLColor *> valueWithRawValue:[MGLColor redColor]];
layer.lineColor = styleValue;
mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { .r = 1, .g = 0, .b = 0, .a = 1 } };
XCTAssertEqual(rawLayer->getLineColor(), propertyValue,
@"Setting lineColor to a constant value should update line-color.");
XCTAssertEqualObjects(layer.lineColor, styleValue,
@"lineColor should round-trip constant values.");
styleValue = [MGLStyleValue<MGLColor *> valueWithStops:@{
@18: styleValue,
}];
layer.lineColor = styleValue;
propertyValue = { mbgl::style::Function<mbgl::Color> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineColor(), propertyValue,
@"Setting lineColor to a function should update line-color.");
XCTAssertEqualObjects(layer.lineColor, styleValue,
@"lineColor should round-trip functions.");
layer.lineColor = nil;
XCTAssertTrue(rawLayer->getLineColor().isUndefined(),
@"Unsetting lineColor should return line-color to the default value.");
XCTAssertEqualObjects(layer.lineColor, defaultStyleValue,
@"lineColor should return the default value after being unset.");
}
// line-dasharray
{
XCTAssertTrue(rawLayer->getLineDasharray().isUndefined(),
@"line-dasharray should be unset initially.");
MGLStyleValue<NSArray<NSNumber *> *> *defaultStyleValue = layer.lineDashPattern;
MGLStyleValue<NSArray<NSNumber *> *> *styleValue = [MGLStyleValue<NSArray<NSNumber *> *> valueWithRawValue:@[@1, @2]];
layer.lineDashPattern = styleValue;
mbgl::style::PropertyValue<std::vector<float>> propertyValue = { {1, 2} };
XCTAssertEqual(rawLayer->getLineDasharray(), propertyValue,
@"Setting lineDashPattern to a constant value should update line-dasharray.");
XCTAssertEqualObjects(layer.lineDashPattern, styleValue,
@"lineDashPattern should round-trip constant values.");
styleValue = [MGLStyleValue<NSArray<NSNumber *> *> valueWithStops:@{
@18: styleValue,
}];
layer.lineDashPattern = styleValue;
propertyValue = { mbgl::style::Function<std::vector<float>> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineDasharray(), propertyValue,
@"Setting lineDashPattern to a function should update line-dasharray.");
XCTAssertEqualObjects(layer.lineDashPattern, styleValue,
@"lineDashPattern should round-trip functions.");
layer.lineDashPattern = nil;
XCTAssertTrue(rawLayer->getLineDasharray().isUndefined(),
@"Unsetting lineDashPattern should return line-dasharray to the default value.");
XCTAssertEqualObjects(layer.lineDashPattern, defaultStyleValue,
@"lineDashPattern should return the default value after being unset.");
}
// line-gap-width
{
XCTAssertTrue(rawLayer->getLineGapWidth().isUndefined(),
@"line-gap-width should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.lineGapWidth;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.lineGapWidth = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getLineGapWidth(), propertyValue,
@"Setting lineGapWidth to a constant value should update line-gap-width.");
XCTAssertEqualObjects(layer.lineGapWidth, styleValue,
@"lineGapWidth should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.lineGapWidth = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineGapWidth(), propertyValue,
@"Setting lineGapWidth to a function should update line-gap-width.");
XCTAssertEqualObjects(layer.lineGapWidth, styleValue,
@"lineGapWidth should round-trip functions.");
layer.lineGapWidth = nil;
XCTAssertTrue(rawLayer->getLineGapWidth().isUndefined(),
@"Unsetting lineGapWidth should return line-gap-width to the default value.");
XCTAssertEqualObjects(layer.lineGapWidth, defaultStyleValue,
@"lineGapWidth should return the default value after being unset.");
}
// line-offset
{
XCTAssertTrue(rawLayer->getLineOffset().isUndefined(),
@"line-offset should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.lineOffset;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.lineOffset = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getLineOffset(), propertyValue,
@"Setting lineOffset to a constant value should update line-offset.");
XCTAssertEqualObjects(layer.lineOffset, styleValue,
@"lineOffset should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.lineOffset = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineOffset(), propertyValue,
@"Setting lineOffset to a function should update line-offset.");
XCTAssertEqualObjects(layer.lineOffset, styleValue,
@"lineOffset should round-trip functions.");
layer.lineOffset = nil;
XCTAssertTrue(rawLayer->getLineOffset().isUndefined(),
@"Unsetting lineOffset should return line-offset to the default value.");
XCTAssertEqualObjects(layer.lineOffset, defaultStyleValue,
@"lineOffset should return the default value after being unset.");
}
// line-opacity
{
XCTAssertTrue(rawLayer->getLineOpacity().isUndefined(),
@"line-opacity should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.lineOpacity;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.lineOpacity = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getLineOpacity(), propertyValue,
@"Setting lineOpacity to a constant value should update line-opacity.");
XCTAssertEqualObjects(layer.lineOpacity, styleValue,
@"lineOpacity should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.lineOpacity = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineOpacity(), propertyValue,
@"Setting lineOpacity to a function should update line-opacity.");
XCTAssertEqualObjects(layer.lineOpacity, styleValue,
@"lineOpacity should round-trip functions.");
layer.lineOpacity = nil;
XCTAssertTrue(rawLayer->getLineOpacity().isUndefined(),
@"Unsetting lineOpacity should return line-opacity to the default value.");
XCTAssertEqualObjects(layer.lineOpacity, defaultStyleValue,
@"lineOpacity should return the default value after being unset.");
}
// line-pattern
{
XCTAssertTrue(rawLayer->getLinePattern().isUndefined(),
@"line-pattern should be unset initially.");
MGLStyleValue<NSString *> *defaultStyleValue = layer.linePattern;
MGLStyleValue<NSString *> *styleValue = [MGLStyleValue<NSString *> valueWithRawValue:@"Line Pattern"];
layer.linePattern = styleValue;
mbgl::style::PropertyValue<std::string> propertyValue = { "Line Pattern" };
XCTAssertEqual(rawLayer->getLinePattern(), propertyValue,
@"Setting linePattern to a constant value should update line-pattern.");
XCTAssertEqualObjects(layer.linePattern, styleValue,
@"linePattern should round-trip constant values.");
styleValue = [MGLStyleValue<NSString *> valueWithStops:@{
@18: styleValue,
}];
layer.linePattern = styleValue;
propertyValue = { mbgl::style::Function<std::string> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLinePattern(), propertyValue,
@"Setting linePattern to a function should update line-pattern.");
XCTAssertEqualObjects(layer.linePattern, styleValue,
@"linePattern should round-trip functions.");
layer.linePattern = nil;
XCTAssertTrue(rawLayer->getLinePattern().isUndefined(),
@"Unsetting linePattern should return line-pattern to the default value.");
XCTAssertEqualObjects(layer.linePattern, defaultStyleValue,
@"linePattern should return the default value after being unset.");
}
// line-translate
{
XCTAssertTrue(rawLayer->getLineTranslate().isUndefined(),
@"line-translate should be unset initially.");
MGLStyleValue<NSValue *> *defaultStyleValue = layer.lineTranslation;
MGLStyleValue<NSValue *> *styleValue = [MGLStyleValue<NSValue *> valueWithRawValue:
#if TARGET_OS_IPHONE
[NSValue valueWithCGVector:CGVectorMake(1, 1)]
#else
[NSValue valueWithMGLVector:CGVectorMake(1, -1)]
#endif
];
layer.lineTranslation = styleValue;
mbgl::style::PropertyValue<std::array<float, 2>> propertyValue = { { 1, 1 } };
XCTAssertEqual(rawLayer->getLineTranslate(), propertyValue,
@"Setting lineTranslation to a constant value should update line-translate.");
XCTAssertEqualObjects(layer.lineTranslation, styleValue,
@"lineTranslation should round-trip constant values.");
styleValue = [MGLStyleValue<NSValue *> valueWithStops:@{
@18: styleValue,
}];
layer.lineTranslation = styleValue;
propertyValue = { mbgl::style::Function<std::array<float, 2>> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineTranslate(), propertyValue,
@"Setting lineTranslation to a function should update line-translate.");
XCTAssertEqualObjects(layer.lineTranslation, styleValue,
@"lineTranslation should round-trip functions.");
layer.lineTranslation = nil;
XCTAssertTrue(rawLayer->getLineTranslate().isUndefined(),
@"Unsetting lineTranslation should return line-translate to the default value.");
XCTAssertEqualObjects(layer.lineTranslation, defaultStyleValue,
@"lineTranslation should return the default value after being unset.");
}
// line-translate-anchor
{
XCTAssertTrue(rawLayer->getLineTranslateAnchor().isUndefined(),
@"line-translate-anchor should be unset initially.");
MGLStyleValue<NSValue *> *defaultStyleValue = layer.lineTranslationAnchor;
MGLStyleValue<NSValue *> *styleValue = [MGLStyleValue<NSValue *> valueWithRawValue:[NSValue valueWithMGLLineTranslationAnchor:MGLLineTranslationAnchorViewport]];
layer.lineTranslationAnchor = styleValue;
mbgl::style::PropertyValue<mbgl::style::TranslateAnchorType> propertyValue = { mbgl::style::TranslateAnchorType::Viewport };
XCTAssertEqual(rawLayer->getLineTranslateAnchor(), propertyValue,
@"Setting lineTranslationAnchor to a constant value should update line-translate-anchor.");
XCTAssertEqualObjects(layer.lineTranslationAnchor, styleValue,
@"lineTranslationAnchor should round-trip constant values.");
styleValue = [MGLStyleValue<NSValue *> valueWithStops:@{
@18: styleValue,
}];
layer.lineTranslationAnchor = styleValue;
propertyValue = { mbgl::style::Function<mbgl::style::TranslateAnchorType> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineTranslateAnchor(), propertyValue,
@"Setting lineTranslationAnchor to a function should update line-translate-anchor.");
XCTAssertEqualObjects(layer.lineTranslationAnchor, styleValue,
@"lineTranslationAnchor should round-trip functions.");
layer.lineTranslationAnchor = nil;
XCTAssertTrue(rawLayer->getLineTranslateAnchor().isUndefined(),
@"Unsetting lineTranslationAnchor should return line-translate-anchor to the default value.");
XCTAssertEqualObjects(layer.lineTranslationAnchor, defaultStyleValue,
@"lineTranslationAnchor should return the default value after being unset.");
}
// line-width
{
XCTAssertTrue(rawLayer->getLineWidth().isUndefined(),
@"line-width should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.lineWidth;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.lineWidth = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getLineWidth(), propertyValue,
@"Setting lineWidth to a constant value should update line-width.");
XCTAssertEqualObjects(layer.lineWidth, styleValue,
@"lineWidth should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.lineWidth = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getLineWidth(), propertyValue,
@"Setting lineWidth to a function should update line-width.");
XCTAssertEqualObjects(layer.lineWidth, styleValue,
@"lineWidth should round-trip functions.");
layer.lineWidth = nil;
XCTAssertTrue(rawLayer->getLineWidth().isUndefined(),
@"Unsetting lineWidth should return line-width to the default value.");
XCTAssertEqualObjects(layer.lineWidth, defaultStyleValue,
@"lineWidth should return the default value after being unset.");
}
}
- (void)testPropertyNames {
[self testPropertyName:@"line-cap" isBoolean:NO];
[self testPropertyName:@"line-join" isBoolean:NO];
[self testPropertyName:@"line-miter-limit" isBoolean:NO];
[self testPropertyName:@"line-round-limit" isBoolean:NO];
[self testPropertyName:@"line-blur" isBoolean:NO];
[self testPropertyName:@"line-color" isBoolean:NO];
[self testPropertyName:@"line-dash-pattern" isBoolean:NO];
[self testPropertyName:@"line-gap-width" isBoolean:NO];
[self testPropertyName:@"line-offset" isBoolean:NO];
[self testPropertyName:@"line-opacity" isBoolean:NO];
[self testPropertyName:@"line-pattern" isBoolean:NO];
[self testPropertyName:@"line-translation" isBoolean:NO];
[self testPropertyName:@"line-translation-anchor" isBoolean:NO];
[self testPropertyName:@"line-width" isBoolean:NO];
}
- (void)testValueAdditions {
XCTAssertEqual([NSValue valueWithMGLLineCap:MGLLineCapButt].MGLLineCapValue, MGLLineCapButt);
XCTAssertEqual([NSValue valueWithMGLLineCap:MGLLineCapRound].MGLLineCapValue, MGLLineCapRound);
XCTAssertEqual([NSValue valueWithMGLLineCap:MGLLineCapSquare].MGLLineCapValue, MGLLineCapSquare);
XCTAssertEqual([NSValue valueWithMGLLineJoin:MGLLineJoinBevel].MGLLineJoinValue, MGLLineJoinBevel);
XCTAssertEqual([NSValue valueWithMGLLineJoin:MGLLineJoinRound].MGLLineJoinValue, MGLLineJoinRound);
XCTAssertEqual([NSValue valueWithMGLLineJoin:MGLLineJoinMiter].MGLLineJoinValue, MGLLineJoinMiter);
XCTAssertEqual([NSValue valueWithMGLLineTranslationAnchor:MGLLineTranslationAnchorMap].MGLLineTranslationAnchorValue, MGLLineTranslationAnchorMap);
XCTAssertEqual([NSValue valueWithMGLLineTranslationAnchor:MGLLineTranslationAnchorViewport].MGLLineTranslationAnchorValue, MGLLineTranslationAnchorViewport);
}
@end

View File

@@ -1,68 +0,0 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
@interface MGLRasterLayerTests : MGLStyleLayerTests
@end
@implementation MGLRasterLayerTests
+ (NSString *)layerType {
return @"raster";
}
- (void)testRasterLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLRasterStyleLayer *layer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
layer.maximumRasterBrightness = [MGLRuntimeStylingHelper testNumber];
layer.minimumRasterBrightness = [MGLRuntimeStylingHelper testNumber];
layer.rasterContrast = [MGLRuntimeStylingHelper testNumber];
layer.rasterFadeDuration = [MGLRuntimeStylingHelper testNumber];
layer.rasterHueRotation = [MGLRuntimeStylingHelper testNumber];
layer.rasterOpacity = [MGLRuntimeStylingHelper testNumber];
layer.rasterSaturation = [MGLRuntimeStylingHelper testNumber];
MGLRasterStyleLayer *gLayer = (MGLRasterStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLRasterStyleLayer class]]);
XCTAssertEqualObjects(gLayer.maximumRasterBrightness, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.minimumRasterBrightness, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterContrast, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterFadeDuration, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterHueRotation, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.rasterSaturation, [MGLRuntimeStylingHelper testNumber]);
layer.maximumRasterBrightness = [MGLRuntimeStylingHelper testNumberFunction];
layer.minimumRasterBrightness = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterContrast = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterFadeDuration = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterHueRotation = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.rasterSaturation = [MGLRuntimeStylingHelper testNumberFunction];
XCTAssertEqualObjects(gLayer.maximumRasterBrightness, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.minimumRasterBrightness, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterContrast, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterFadeDuration, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterHueRotation, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.rasterSaturation, [MGLRuntimeStylingHelper testNumberFunction]);
}
- (void)testPropertyNames {
[self testPropertyName:@"maximum-raster-brightness" isBoolean:NO];
[self testPropertyName:@"minimum-raster-brightness" isBoolean:NO];
[self testPropertyName:@"raster-contrast" isBoolean:NO];
[self testPropertyName:@"raster-fade-duration" isBoolean:NO];
[self testPropertyName:@"raster-hue-rotation" isBoolean:NO];
[self testPropertyName:@"raster-opacity" isBoolean:NO];
[self testPropertyName:@"raster-saturation" isBoolean:NO];
}
@end

View File

@@ -0,0 +1,277 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
#import "MGLStyleLayer_Private.h"
#include <mbgl/style/layers/raster_layer.hpp>
@interface MGLRasterLayerTests : MGLStyleLayerTests
@end
@implementation MGLRasterLayerTests
+ (NSString *)layerType {
return @"raster";
}
- (void)testProperties {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
MGLRasterStyleLayer *layer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
XCTAssertNotEqual(layer.rawLayer, nullptr);
XCTAssertTrue(layer.rawLayer->is<mbgl::style::RasterLayer>());
auto rawLayer = layer.rawLayer->as<mbgl::style::RasterLayer>();
// raster-brightness-max
{
XCTAssertTrue(rawLayer->getRasterBrightnessMax().isUndefined(),
@"raster-brightness-max should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.maximumRasterBrightness;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.maximumRasterBrightness = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getRasterBrightnessMax(), propertyValue,
@"Setting maximumRasterBrightness to a constant value should update raster-brightness-max.");
XCTAssertEqualObjects(layer.maximumRasterBrightness, styleValue,
@"maximumRasterBrightness should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.maximumRasterBrightness = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getRasterBrightnessMax(), propertyValue,
@"Setting maximumRasterBrightness to a function should update raster-brightness-max.");
XCTAssertEqualObjects(layer.maximumRasterBrightness, styleValue,
@"maximumRasterBrightness should round-trip functions.");
layer.maximumRasterBrightness = nil;
XCTAssertTrue(rawLayer->getRasterBrightnessMax().isUndefined(),
@"Unsetting maximumRasterBrightness should return raster-brightness-max to the default value.");
XCTAssertEqualObjects(layer.maximumRasterBrightness, defaultStyleValue,
@"maximumRasterBrightness should return the default value after being unset.");
}
// raster-brightness-min
{
XCTAssertTrue(rawLayer->getRasterBrightnessMin().isUndefined(),
@"raster-brightness-min should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.minimumRasterBrightness;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.minimumRasterBrightness = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getRasterBrightnessMin(), propertyValue,
@"Setting minimumRasterBrightness to a constant value should update raster-brightness-min.");
XCTAssertEqualObjects(layer.minimumRasterBrightness, styleValue,
@"minimumRasterBrightness should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.minimumRasterBrightness = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getRasterBrightnessMin(), propertyValue,
@"Setting minimumRasterBrightness to a function should update raster-brightness-min.");
XCTAssertEqualObjects(layer.minimumRasterBrightness, styleValue,
@"minimumRasterBrightness should round-trip functions.");
layer.minimumRasterBrightness = nil;
XCTAssertTrue(rawLayer->getRasterBrightnessMin().isUndefined(),
@"Unsetting minimumRasterBrightness should return raster-brightness-min to the default value.");
XCTAssertEqualObjects(layer.minimumRasterBrightness, defaultStyleValue,
@"minimumRasterBrightness should return the default value after being unset.");
}
// raster-contrast
{
XCTAssertTrue(rawLayer->getRasterContrast().isUndefined(),
@"raster-contrast should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.rasterContrast;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.rasterContrast = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getRasterContrast(), propertyValue,
@"Setting rasterContrast to a constant value should update raster-contrast.");
XCTAssertEqualObjects(layer.rasterContrast, styleValue,
@"rasterContrast should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.rasterContrast = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getRasterContrast(), propertyValue,
@"Setting rasterContrast to a function should update raster-contrast.");
XCTAssertEqualObjects(layer.rasterContrast, styleValue,
@"rasterContrast should round-trip functions.");
layer.rasterContrast = nil;
XCTAssertTrue(rawLayer->getRasterContrast().isUndefined(),
@"Unsetting rasterContrast should return raster-contrast to the default value.");
XCTAssertEqualObjects(layer.rasterContrast, defaultStyleValue,
@"rasterContrast should return the default value after being unset.");
}
// raster-fade-duration
{
XCTAssertTrue(rawLayer->getRasterFadeDuration().isUndefined(),
@"raster-fade-duration should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.rasterFadeDuration;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.rasterFadeDuration = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getRasterFadeDuration(), propertyValue,
@"Setting rasterFadeDuration to a constant value should update raster-fade-duration.");
XCTAssertEqualObjects(layer.rasterFadeDuration, styleValue,
@"rasterFadeDuration should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.rasterFadeDuration = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getRasterFadeDuration(), propertyValue,
@"Setting rasterFadeDuration to a function should update raster-fade-duration.");
XCTAssertEqualObjects(layer.rasterFadeDuration, styleValue,
@"rasterFadeDuration should round-trip functions.");
layer.rasterFadeDuration = nil;
XCTAssertTrue(rawLayer->getRasterFadeDuration().isUndefined(),
@"Unsetting rasterFadeDuration should return raster-fade-duration to the default value.");
XCTAssertEqualObjects(layer.rasterFadeDuration, defaultStyleValue,
@"rasterFadeDuration should return the default value after being unset.");
}
// raster-hue-rotate
{
XCTAssertTrue(rawLayer->getRasterHueRotate().isUndefined(),
@"raster-hue-rotate should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.rasterHueRotation;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.rasterHueRotation = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getRasterHueRotate(), propertyValue,
@"Setting rasterHueRotation to a constant value should update raster-hue-rotate.");
XCTAssertEqualObjects(layer.rasterHueRotation, styleValue,
@"rasterHueRotation should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.rasterHueRotation = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getRasterHueRotate(), propertyValue,
@"Setting rasterHueRotation to a function should update raster-hue-rotate.");
XCTAssertEqualObjects(layer.rasterHueRotation, styleValue,
@"rasterHueRotation should round-trip functions.");
layer.rasterHueRotation = nil;
XCTAssertTrue(rawLayer->getRasterHueRotate().isUndefined(),
@"Unsetting rasterHueRotation should return raster-hue-rotate to the default value.");
XCTAssertEqualObjects(layer.rasterHueRotation, defaultStyleValue,
@"rasterHueRotation should return the default value after being unset.");
}
// raster-opacity
{
XCTAssertTrue(rawLayer->getRasterOpacity().isUndefined(),
@"raster-opacity should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.rasterOpacity;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.rasterOpacity = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getRasterOpacity(), propertyValue,
@"Setting rasterOpacity to a constant value should update raster-opacity.");
XCTAssertEqualObjects(layer.rasterOpacity, styleValue,
@"rasterOpacity should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.rasterOpacity = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getRasterOpacity(), propertyValue,
@"Setting rasterOpacity to a function should update raster-opacity.");
XCTAssertEqualObjects(layer.rasterOpacity, styleValue,
@"rasterOpacity should round-trip functions.");
layer.rasterOpacity = nil;
XCTAssertTrue(rawLayer->getRasterOpacity().isUndefined(),
@"Unsetting rasterOpacity should return raster-opacity to the default value.");
XCTAssertEqualObjects(layer.rasterOpacity, defaultStyleValue,
@"rasterOpacity should return the default value after being unset.");
}
// raster-saturation
{
XCTAssertTrue(rawLayer->getRasterSaturation().isUndefined(),
@"raster-saturation should be unset initially.");
MGLStyleValue<NSNumber *> *defaultStyleValue = layer.rasterSaturation;
MGLStyleValue<NSNumber *> *styleValue = [MGLStyleValue<NSNumber *> valueWithRawValue:@0xff];
layer.rasterSaturation = styleValue;
mbgl::style::PropertyValue<float> propertyValue = { 0xff };
XCTAssertEqual(rawLayer->getRasterSaturation(), propertyValue,
@"Setting rasterSaturation to a constant value should update raster-saturation.");
XCTAssertEqualObjects(layer.rasterSaturation, styleValue,
@"rasterSaturation should round-trip constant values.");
styleValue = [MGLStyleValue<NSNumber *> valueWithStops:@{
@18: styleValue,
}];
layer.rasterSaturation = styleValue;
propertyValue = { mbgl::style::Function<float> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->getRasterSaturation(), propertyValue,
@"Setting rasterSaturation to a function should update raster-saturation.");
XCTAssertEqualObjects(layer.rasterSaturation, styleValue,
@"rasterSaturation should round-trip functions.");
layer.rasterSaturation = nil;
XCTAssertTrue(rawLayer->getRasterSaturation().isUndefined(),
@"Unsetting rasterSaturation should return raster-saturation to the default value.");
XCTAssertEqualObjects(layer.rasterSaturation, defaultStyleValue,
@"rasterSaturation should return the default value after being unset.");
}
}
- (void)testPropertyNames {
[self testPropertyName:@"maximum-raster-brightness" isBoolean:NO];
[self testPropertyName:@"minimum-raster-brightness" isBoolean:NO];
[self testPropertyName:@"raster-contrast" isBoolean:NO];
[self testPropertyName:@"raster-fade-duration" isBoolean:NO];
[self testPropertyName:@"raster-hue-rotation" isBoolean:NO];
[self testPropertyName:@"raster-opacity" isBoolean:NO];
[self testPropertyName:@"raster-saturation" isBoolean:NO];
}
@end

View File

@@ -1,35 +0,0 @@
#import <Foundation/Foundation.h>
#import "MGLTypes.h"
#import "MGLStyleValue.h"
@interface MGLRuntimeStylingHelper : NSObject
+ (MGLStyleConstantValue<NSValue *> *)testPadding;
+ (MGLStyleFunction<NSValue *> *)testPaddingFunction;
+ (MGLStyleConstantValue<NSValue *> *)testOffset;
+ (MGLStyleFunction<NSValue *> *)testOffsetFunction;
+ (MGLStyleConstantValue<NSArray<NSString *> *> *)testFont;
+ (MGLStyleFunction<NSArray<NSString *> *> *)testFontFunction;
+ (MGLStyleConstantValue<NSArray<NSNumber *> *> *)testDashArray;
+ (MGLStyleFunction<NSArray<NSNumber *> *> *)testDashArrayFunction;
+ (MGLStyleConstantValue<NSNumber *> *)testNumber;
+ (MGLStyleFunction<NSNumber *> *)testNumberFunction;
+ (MGLStyleConstantValue<NSNumber *> *)testBool;
+ (MGLStyleFunction<NSNumber *> *)testBoolFunction;
+ (MGLStyleConstantValue<NSString *> *)testString;
+ (MGLStyleFunction<NSString *> *)testStringFunction;
+ (MGLStyleConstantValue<MGLColor *> *)testColor;
+ (MGLStyleFunction<MGLColor *> *)testColorFunction;
+ (MGLStyleConstantValue<NSValue *> *)testEnum:(NSUInteger)value type:(const char *)type;
+ (MGLStyleFunction<NSValue *> *)testEnumFunction:(NSUInteger)value type:(const char *)type;
@end

View File

@@ -1,122 +0,0 @@
#import "MGLRuntimeStylingHelper.h"
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
#import <UIKit/UIKit.h>
#define MGLEdgeInsets UIEdgeInsets
#else
#import <Cocoa/Cocoa.h>
#define MGLEdgeInsets NSEdgeInsets
#endif
@implementation MGLRuntimeStylingHelper
+ (MGLStyleConstantValue<NSValue *> *)testPadding
{
MGLEdgeInsets insets = {
.top = 1,
.left = 1,
.bottom = 1,
.right = 1,
};
return [MGLStyleConstantValue<NSValue *> valueWithRawValue:[NSValue value:&insets withObjCType:@encode(MGLEdgeInsets)]];
}
+ (MGLStyleFunction<NSValue *> *)testPaddingFunction
{
return [MGLStyleFunction<NSValue *> functionWithStops:@{@(18): self.testPadding}];
}
+ (MGLStyleConstantValue<NSValue *> *)testOffset
{
CGVector vector = CGVectorMake(1, 1);
return [MGLStyleConstantValue<NSValue *> valueWithRawValue:[NSValue value:&vector withObjCType:@encode(CGVector)]];
}
+ (MGLStyleFunction<NSValue *> *)testOffsetFunction
{
return [MGLStyleFunction<NSValue *> valueWithStops:@{ @(18): self.testOffset }];
}
+ (MGLStyleConstantValue<NSArray<NSString *> *> *)testFont
{
return [MGLStyleConstantValue<NSArray<NSString *> *> valueWithRawValue:@[@"Open Sans Regular", @"Arial Unicode MS Regular"]];
}
+ (MGLStyleFunction<NSArray<NSString *> *> *)testFontFunction
{
return [MGLStyleFunction<NSArray<NSString *> *> valueWithStops:@{ @18: self.testFont }];
}
+ (MGLStyleConstantValue<NSArray<NSNumber *> *> *)testDashArray
{
return [MGLStyleConstantValue<NSArray<NSNumber *> *> valueWithRawValue:@[@1, @2]];
}
+ (MGLStyleFunction<NSArray<NSNumber *> *> *)testDashArrayFunction
{
return [MGLStyleFunction<NSArray<NSNumber *> *> valueWithStops:@{
@18: self.testDashArray,
}];
}
+ (MGLStyleConstantValue<NSNumber *> *)testNumber
{
return [MGLStyleConstantValue<NSNumber *> valueWithRawValue:@1];
}
+ (MGLStyleFunction<NSNumber *> *)testNumberFunction
{
return [MGLStyleFunction<NSNumber *> valueWithStops:@{
@18: self.testNumber,
}];
}
+ (MGLStyleConstantValue<NSNumber *> *)testBool
{
return [MGLStyleConstantValue<NSNumber *> valueWithRawValue:@YES];
}
+ (MGLStyleFunction<NSNumber *> *)testBoolFunction
{
return [MGLStyleFunction<NSNumber *> valueWithStops:@{
@18: self.testBool,
}];
}
+ (MGLStyleConstantValue<NSString *> *)testString
{
return [MGLStyleConstantValue<NSString *> valueWithRawValue:@"test"];
}
+ (MGLStyleFunction<NSString *> *)testStringFunction
{
return [MGLStyleFunction<NSString *> valueWithStops:@{
@18: self.testString,
}];
}
+ (MGLStyleConstantValue<MGLColor *> *)testColor
{
return [MGLStyleConstantValue<MGLColor *> valueWithRawValue:[MGLColor redColor]];
}
+ (MGLStyleFunction<MGLColor *> *)testColorFunction
{
return [MGLStyleFunction<MGLColor *> valueWithStops:@{
@18: self.testColor,
}];
}
+ (MGLStyleConstantValue<NSValue *> *)testEnum:(NSUInteger)value type:(const char *)type
{
return [MGLStyleConstantValue<NSValue *> valueWithRawValue:[NSValue value:&value withObjCType:type]];
}
+ (MGLStyleFunction<NSValue *> *)testEnumFunction:(NSUInteger)value type:(const char *)type
{
return [MGLStyleFunction<NSValue *> valueWithStops:@{
@18: [self testEnum:value type:type],
}];
}
@end

View File

@@ -1,10 +1,8 @@
#import <Mapbox/Mapbox.h>
#import "MGLRuntimeStylingHelper.h"
#import <XCTest/XCTest.h>
@interface MGLStyleLayerTests : XCTestCase <MGLMapViewDelegate>
@property (nonatomic) IBOutlet MGLMapView *mapView;
@property (nonatomic, copy, readonly, class) NSString *layerType;
- (void)testPropertyName:(NSString *)name isBoolean:(BOOL)isBoolean;
@@ -17,3 +15,11 @@
@property (nonatomic, readonly, copy) NSString *lemma;
@end
@interface NSValue (MGLStyleLayerTestAdditions)
+ (instancetype)valueWithMGLVector:(CGVector)vector;
@property (readonly) CGVector MGLVectorValue;
@end

View File

@@ -4,37 +4,32 @@
#define TEST_STRICT_NAMING_CONVENTIONS 0
@implementation MGLStyleLayerTests {
XCTestExpectation *_styleLoadingExpectation;
}
@implementation MGLStyleLayerTests
@dynamic layerType;
- (void)setUp {
[super setUp];
[MGLAccountManager setAccessToken:@"pk.feedcafedeadbeefbadebede"];
NSURL *styleURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"one-liner" withExtension:@"json"];
self.mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 256, 256) styleURL:styleURL];
self.mapView.delegate = self;
if (!self.mapView.style) {
_styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."];
[self waitForExpectationsWithTimeout:1 handler:nil];
}
}
- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style {
XCTAssertNotNil(mapView.style);
XCTAssertEqual(mapView.style, style);
XCTAssertNil(style.name);
- (void)testProperties {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
[_styleLoadingExpectation fulfill];
}
- (void)tearDown {
_styleLoadingExpectation = nil;
_mapView = nil;
MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[super tearDown];
XCTAssertEqualObjects(layer.identifier, @"layerID");
XCTAssertEqualObjects(layer.sourceIdentifier, source.identifier);
XCTAssertTrue(layer.visible);
layer.visible = NO;
XCTAssertFalse(layer.visible);
layer.visible = YES;
XCTAssertTrue(layer.visible);
XCTAssertEqual(layer.minimumZoomLevel, -INFINITY);
layer.minimumZoomLevel = 22;
XCTAssertEqual(layer.minimumZoomLevel, 22);
XCTAssertEqual(layer.maximumZoomLevel, INFINITY);
layer.maximumZoomLevel = 0;
XCTAssertEqual(layer.maximumZoomLevel, 0);
}
- (void)testPropertyName:(NSString *)name isBoolean:(BOOL)isBoolean {
@@ -99,3 +94,25 @@
}
@end
@implementation NSValue (MGLStyleLayerTestAdditions)
+ (instancetype)valueWithMGLVector:(CGVector)vector {
#if TARGET_OS_IPHONE
return [self valueWithCGVector:vector];
#else
return [self value:&vector withObjCType:@encode(CGVector)];
#endif
}
- (CGVector)MGLVectorValue {
#if TARGET_OS_IPHONE
return self.CGVectorValue;
#else
CGVector vector;
[self getValue:&vector];
return vector;
#endif
}
@end

View File

@@ -1,72 +0,0 @@
<%
const type = locals.type;
const layoutProperties = locals.layoutProperties;
const paintProperties = locals.paintProperties;
-%>
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
@interface MGL<%- camelize(type) %>LayerTests : MGLStyleLayerTests
@end
@implementation MGL<%- camelize(type) %>LayerTests
+ (NSString *)layerType {
return @"<%- type %>";
}
- (void)test<%- camelize(type) %>Layer {
<% if (type === 'background') { -%>
MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID"];
<% } else { -%>
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID" source:source];
<% } -%>
[self.mapView.style addLayer:layer];
<% for (const property of layoutProperties) { -%>
<%- testImplementation(property, type) %>
<% } -%>
<% for (const property of paintProperties) { -%>
<%- testImplementation(property, type) %>
<% } -%>
MGL<%- camelize(type) %>StyleLayer *gLayer = (MGL<%- camelize(type) %>StyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGL<%- camelize(type) %>StyleLayer class]]);
<% for (const property of layoutProperties) { -%>
<%- testGetterImplementation(property, type) %>
<% } -%>
<% for (const property of paintProperties) { -%>
<%- testGetterImplementation(property, type) %>
<% } -%>
<% for (const property of layoutProperties) { -%>
<%- testImplementation(property, type, true) %>
<% } -%>
<% for (const property of paintProperties) { -%>
<%- testImplementation(property, type, true) %>
<% } -%>
<% for (const property of layoutProperties) { -%>
<%- testGetterImplementation(property, type, true) %>
<% } -%>
<% for (const property of paintProperties) { -%>
<%- testGetterImplementation(property, type, true) %>
<% } -%>
}
- (void)testPropertyNames {
<% for (const property of layoutProperties) { -%>
[self testPropertyName:@"<%- property.getter || property.name %>" isBoolean:<%- property.type === 'boolean' ? 'YES' : 'NO' %>];
<% } -%>
<% for (const property of paintProperties) { -%>
[self testPropertyName:@"<%- property.getter || property.name %>" isBoolean:<%- property.type === 'boolean' ? 'YES' : 'NO' %>];
<% } -%>
}
@end

View File

@@ -0,0 +1,114 @@
<%
const type = locals.type;
const properties = locals.properties;
const enumProperties = locals.enumProperties;
-%>
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
#import "MGLStyleLayer_Private.h"
#include <mbgl/style/layers/<%- type %>_layer.hpp>
@interface MGL<%- camelize(type) %>LayerTests : MGLStyleLayerTests
@end
@implementation MGL<%- camelize(type) %>LayerTests
+ (NSString *)layerType {
return @"<%- type %>";
}
<% if (type !== 'background' && type !== 'raster') { -%>
- (void)testPredicates {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID" source:source];
XCTAssertNil(layer.sourceLayerIdentifier);
layer.sourceLayerIdentifier = @"layerID";
XCTAssertEqualObjects(layer.sourceLayerIdentifier, @"layerID");
layer.sourceLayerIdentifier = nil;
XCTAssertNil(layer.sourceLayerIdentifier);
XCTAssertNil(layer.predicate);
layer.predicate = [NSPredicate predicateWithValue:NO];
XCTAssertEqualObjects(layer.predicate, [NSPredicate predicateWithValue:NO]);
layer.predicate = nil;
XCTAssertNil(layer.predicate);
}
<% } -%>
- (void)testProperties {
<% if (type === 'background') { -%>
MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID"];
<% } else { -%>
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" shape:feature options:nil];
MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID" source:source];
<% } -%>
XCTAssertNotEqual(layer.rawLayer, nullptr);
XCTAssertTrue(layer.rawLayer->is<mbgl::style::<%- camelize(type) %>Layer>());
auto rawLayer = layer.rawLayer->as<mbgl::style::<%- camelize(type) %>Layer>();
<% for (const property of properties) { -%>
// <%- originalPropertyName(property) %>
{
XCTAssertTrue(rawLayer->get<%- camelize(originalPropertyName(property)) %>().isUndefined(),
@"<%- originalPropertyName(property) %> should be unset initially.");
MGLStyleValue<<%- propertyType(property) %>> *defaultStyleValue = layer.<%- objCName(property) %>;
MGLStyleValue<<%- propertyType(property) %>> *styleValue = [MGLStyleValue<<%- propertyType(property) %>> valueWithRawValue:<%- objCTestValue(property, type, 3) %>];
layer.<%- objCName(property) %> = styleValue;
mbgl::style::PropertyValue<<%- mbglType(property) %>> propertyValue = { <%- mbglTestValue(property, type) %> };
XCTAssertEqual(rawLayer->get<%- camelize(originalPropertyName(property)) %>(), propertyValue,
@"Setting <%- objCName(property) %> to a constant value should update <%- originalPropertyName(property) %>.");
XCTAssertEqualObjects(layer.<%- objCName(property) %>, styleValue,
@"<%- objCName(property) %> should round-trip constant values.");
styleValue = [MGLStyleValue<<%- propertyType(property) %>> valueWithStops:@{
@18: styleValue,
}];
layer.<%- objCName(property) %> = styleValue;
propertyValue = { mbgl::style::Function<<%- mbglType(property) %>> {
{{ 18, propertyValue.asConstant() }},
1,
}};
XCTAssertEqual(rawLayer->get<%- camelize(originalPropertyName(property)) %>(), propertyValue,
@"Setting <%- objCName(property) %> to a function should update <%- originalPropertyName(property) %>.");
XCTAssertEqualObjects(layer.<%- objCName(property) %>, styleValue,
@"<%- objCName(property) %> should round-trip functions.");
<% if (!property.required) { -%>
layer.<%- objCName(property) %> = nil;
XCTAssertTrue(rawLayer->get<%- camelize(originalPropertyName(property)) %>().isUndefined(),
@"Unsetting <%- objCName(property) %> should return <%- originalPropertyName(property) %> to the default value.");
XCTAssertEqualObjects(layer.<%- objCName(property) %>, defaultStyleValue,
@"<%- objCName(property) %> should return the default value after being unset.");
<% } -%>
}
<% } -%>
}
- (void)testPropertyNames {
<% for (const property of properties) { -%>
[self testPropertyName:@"<%- property.getter || property.name %>" isBoolean:<%- property.type === 'boolean' ? 'YES' : 'NO' %>];
<% } -%>
}
<% if (enumProperties) { -%>
- (void)testValueAdditions {
<% for (let property of enumProperties) { -%>
<% for (let value in property.values) { -%>
<% if (property.values.hasOwnProperty(value)) { -%>
XCTAssertEqual([NSValue valueWithMGL<%- camelize(property.name) %>:MGL<%- camelize(property.name) %><%- camelize(value) %>].MGL<%- camelize(property.name) %>Value, MGL<%- camelize(property.name) %><%- camelize(value) %>);
<% } -%>
<% } -%>
<% } -%>
}
<% } -%>
@end

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1212" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MGLMapViewTests"/>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="MGLMapViewTests" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="256" height="256"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="256" height="256"/>
<autoresizingMask key="autoresizingMask"/>
</view>
</window>
</objects>
</document>

View File

@@ -39,7 +39,6 @@
- (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style {
XCTAssertNotNil(mapView.style);
XCTAssertEqual(mapView.style, style);
XCTAssertNil(style.name);
[_styleLoadingExpectation fulfill];
}
@@ -135,6 +134,24 @@
}];
}
- (void)testName {
XCTAssertNil(self.style.name);
}
- (void)testSources {
NSSet<MGLSource *> *initialSources = self.style.sources;
if ([initialSources.anyObject.identifier isEqualToString:@"com.mapbox.annotations"]) {
XCTAssertEqual(self.style.sources.count, 1);
} else {
XCTAssertEqual(self.style.sources.count, 0);
}
MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil];
[self.style addSource:shapeSource];
XCTAssertEqual(self.style.sources.count, initialSources.count + 1);
[self.style removeSource:shapeSource];
XCTAssertEqual(self.style.sources.count, initialSources.count);
}
- (void)testAddingSourcesTwice {
MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil];
[self.style addSource:shapeSource];
@@ -157,6 +174,22 @@
XCTAssertThrowsSpecificNamed([self.style addSource: source2], NSException, @"MGLRedundantSourceIdentifierException");
}
- (void)testLayers {
NSArray<MGLStyleLayer *> *initialLayers = self.style.layers;
if ([initialLayers.firstObject.identifier isEqualToString:@"com.mapbox.annotations.points"]) {
XCTAssertEqual(self.style.layers.count, 1);
} else {
XCTAssertEqual(self.style.layers.count, 0);
}
MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil];
[self.style addSource:shapeSource];
MGLFillStyleLayer *fillLayer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"fillLayer" source:shapeSource];
[self.style addLayer:fillLayer];
XCTAssertEqual(self.style.layers.count, initialLayers.count + 1);
[self.style removeLayer:fillLayer];
XCTAssertEqual(self.style.layers.count, initialLayers.count);
}
- (void)testAddingLayersTwice {
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil];
@@ -212,6 +245,10 @@
return styleHeader;
}
- (void)testClasses {
XCTAssertEqual(self.style.styleClasses.count, 0);
}
- (void)testImages {
NSString *imageName = @"TrackingLocationMask";
#if TARGET_OS_IPHONE

View File

@@ -1,283 +0,0 @@
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
#import "MGLStyleLayerTests.h"
@interface MGLSymbolLayerTests : MGLStyleLayerTests
@end
@implementation MGLSymbolLayerTests
+ (NSString *)layerType {
return @"symbol";
}
- (void)testSymbolLayer {
NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"];
NSURL *url = [NSURL fileURLWithPath:filePath];
MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil];
[self.mapView.style addSource:source];
MGLSymbolStyleLayer *layer = [[MGLSymbolStyleLayer alloc] initWithIdentifier:@"layerID" source:source];
[self.mapView.style addLayer:layer];
layer.iconAllowsOverlap = [MGLRuntimeStylingHelper testBool];
layer.iconIgnoresPlacement = [MGLRuntimeStylingHelper testBool];
layer.iconImageName = [MGLRuntimeStylingHelper testString];
layer.iconOffset = [MGLRuntimeStylingHelper testOffset];
layer.iconOptional = [MGLRuntimeStylingHelper testBool];
layer.iconPadding = [MGLRuntimeStylingHelper testNumber];
layer.iconRotation = [MGLRuntimeStylingHelper testNumber];
layer.iconRotationAlignment = [MGLRuntimeStylingHelper testEnum:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)];
layer.iconScale = [MGLRuntimeStylingHelper testNumber];
layer.iconTextFit = [MGLRuntimeStylingHelper testEnum:MGLIconTextFitBoth type:@encode(MGLIconTextFit)];
layer.iconTextFitPadding = [MGLRuntimeStylingHelper testPadding];
layer.keepsIconUpright = [MGLRuntimeStylingHelper testBool];
layer.keepsTextUpright = [MGLRuntimeStylingHelper testBool];
layer.maximumTextAngle = [MGLRuntimeStylingHelper testNumber];
layer.maximumTextWidth = [MGLRuntimeStylingHelper testNumber];
layer.symbolAvoidsEdges = [MGLRuntimeStylingHelper testBool];
layer.symbolPlacement = [MGLRuntimeStylingHelper testEnum:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)];
layer.symbolSpacing = [MGLRuntimeStylingHelper testNumber];
layer.text = [MGLRuntimeStylingHelper testString];
layer.textAllowsOverlap = [MGLRuntimeStylingHelper testBool];
layer.textAnchor = [MGLRuntimeStylingHelper testEnum:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)];
layer.textFontNames = [MGLRuntimeStylingHelper testFont];
layer.textFontSize = [MGLRuntimeStylingHelper testNumber];
layer.textIgnoresPlacement = [MGLRuntimeStylingHelper testBool];
layer.textJustification = [MGLRuntimeStylingHelper testEnum:MGLTextJustificationRight type:@encode(MGLTextJustification)];
layer.textLetterSpacing = [MGLRuntimeStylingHelper testNumber];
layer.textLineHeight = [MGLRuntimeStylingHelper testNumber];
layer.textOffset = [MGLRuntimeStylingHelper testOffset];
layer.textOptional = [MGLRuntimeStylingHelper testBool];
layer.textPadding = [MGLRuntimeStylingHelper testNumber];
layer.textPitchAlignment = [MGLRuntimeStylingHelper testEnum:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)];
layer.textRotation = [MGLRuntimeStylingHelper testNumber];
layer.textRotationAlignment = [MGLRuntimeStylingHelper testEnum:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)];
layer.textTransform = [MGLRuntimeStylingHelper testEnum:MGLTextTransformLowercase type:@encode(MGLTextTransform)];
layer.iconColor = [MGLRuntimeStylingHelper testColor];
layer.iconHaloBlur = [MGLRuntimeStylingHelper testNumber];
layer.iconHaloColor = [MGLRuntimeStylingHelper testColor];
layer.iconHaloWidth = [MGLRuntimeStylingHelper testNumber];
layer.iconOpacity = [MGLRuntimeStylingHelper testNumber];
layer.iconTranslation = [MGLRuntimeStylingHelper testOffset];
layer.iconTranslationAnchor = [MGLRuntimeStylingHelper testEnum:MGLIconTranslationAnchorViewport type:@encode(MGLIconTranslationAnchor)];
layer.textColor = [MGLRuntimeStylingHelper testColor];
layer.textHaloBlur = [MGLRuntimeStylingHelper testNumber];
layer.textHaloColor = [MGLRuntimeStylingHelper testColor];
layer.textHaloWidth = [MGLRuntimeStylingHelper testNumber];
layer.textOpacity = [MGLRuntimeStylingHelper testNumber];
layer.textTranslation = [MGLRuntimeStylingHelper testOffset];
layer.textTranslationAnchor = [MGLRuntimeStylingHelper testEnum:MGLTextTranslationAnchorViewport type:@encode(MGLTextTranslationAnchor)];
MGLSymbolStyleLayer *gLayer = (MGLSymbolStyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"];
XCTAssertTrue([gLayer isKindOfClass:[MGLSymbolStyleLayer class]]);
XCTAssertEqualObjects(gLayer.iconAllowsOverlap, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconIgnoresPlacement, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconImageName, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.iconOffset, [MGLRuntimeStylingHelper testOffset]);
XCTAssertEqualObjects(gLayer.iconOptional, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.iconPadding, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconRotation, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.iconRotationAlignment isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.iconRotationAlignment, [MGLRuntimeStylingHelper testEnum:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)]);
XCTAssertEqualObjects(gLayer.iconScale, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.iconTextFit isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.iconTextFit, [MGLRuntimeStylingHelper testEnum:MGLIconTextFitBoth type:@encode(MGLIconTextFit)]);
XCTAssertEqualObjects(gLayer.iconTextFitPadding, [MGLRuntimeStylingHelper testPadding]);
XCTAssertEqualObjects(gLayer.keepsIconUpright, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.keepsTextUpright, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.maximumTextAngle, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.maximumTextWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.symbolAvoidsEdges, [MGLRuntimeStylingHelper testBool]);
XCTAssert([gLayer.symbolPlacement isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.symbolPlacement, [MGLRuntimeStylingHelper testEnum:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)]);
XCTAssertEqualObjects(gLayer.symbolSpacing, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.text, [MGLRuntimeStylingHelper testString]);
XCTAssertEqualObjects(gLayer.textAllowsOverlap, [MGLRuntimeStylingHelper testBool]);
XCTAssert([gLayer.textAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textAnchor, [MGLRuntimeStylingHelper testEnum:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)]);
XCTAssertEqualObjects(gLayer.textFontNames, [MGLRuntimeStylingHelper testFont]);
XCTAssertEqualObjects(gLayer.textFontSize, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textIgnoresPlacement, [MGLRuntimeStylingHelper testBool]);
XCTAssert([gLayer.textJustification isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textJustification, [MGLRuntimeStylingHelper testEnum:MGLTextJustificationRight type:@encode(MGLTextJustification)]);
XCTAssertEqualObjects(gLayer.textLetterSpacing, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textLineHeight, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textOffset, [MGLRuntimeStylingHelper testOffset]);
XCTAssertEqualObjects(gLayer.textOptional, [MGLRuntimeStylingHelper testBool]);
XCTAssertEqualObjects(gLayer.textPadding, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.textPitchAlignment isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textPitchAlignment, [MGLRuntimeStylingHelper testEnum:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)]);
XCTAssertEqualObjects(gLayer.textRotation, [MGLRuntimeStylingHelper testNumber]);
XCTAssert([gLayer.textRotationAlignment isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textRotationAlignment, [MGLRuntimeStylingHelper testEnum:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)]);
XCTAssert([gLayer.textTransform isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textTransform, [MGLRuntimeStylingHelper testEnum:MGLTextTransformLowercase type:@encode(MGLTextTransform)]);
XCTAssertEqualObjects(gLayer.iconColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.iconHaloBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconHaloColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.iconHaloWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.iconTranslation, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.iconTranslationAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.iconTranslationAnchor, [MGLRuntimeStylingHelper testEnum:MGLIconTranslationAnchorViewport type:@encode(MGLIconTranslationAnchor)]);
XCTAssertEqualObjects(gLayer.textColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.textHaloBlur, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textHaloColor, [MGLRuntimeStylingHelper testColor]);
XCTAssertEqualObjects(gLayer.textHaloWidth, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textOpacity, [MGLRuntimeStylingHelper testNumber]);
XCTAssertEqualObjects(gLayer.textTranslation, [MGLRuntimeStylingHelper testOffset]);
XCTAssert([gLayer.textTranslationAnchor isKindOfClass:[MGLStyleConstantValue class]]);
XCTAssertEqualObjects(gLayer.textTranslationAnchor, [MGLRuntimeStylingHelper testEnum:MGLTextTranslationAnchorViewport type:@encode(MGLTextTranslationAnchor)]);
layer.iconAllowsOverlap = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconIgnoresPlacement = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconImageName = [MGLRuntimeStylingHelper testStringFunction];
layer.iconOffset = [MGLRuntimeStylingHelper testOffsetFunction];
layer.iconOptional = [MGLRuntimeStylingHelper testBoolFunction];
layer.iconPadding = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconRotation = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconRotationAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)];
layer.iconScale = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconTextFit = [MGLRuntimeStylingHelper testEnumFunction:MGLIconTextFitBoth type:@encode(MGLIconTextFit)];
layer.iconTextFitPadding = [MGLRuntimeStylingHelper testPaddingFunction];
layer.keepsIconUpright = [MGLRuntimeStylingHelper testBoolFunction];
layer.keepsTextUpright = [MGLRuntimeStylingHelper testBoolFunction];
layer.maximumTextAngle = [MGLRuntimeStylingHelper testNumberFunction];
layer.maximumTextWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.symbolAvoidsEdges = [MGLRuntimeStylingHelper testBoolFunction];
layer.symbolPlacement = [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)];
layer.symbolSpacing = [MGLRuntimeStylingHelper testNumberFunction];
layer.text = [MGLRuntimeStylingHelper testStringFunction];
layer.textAllowsOverlap = [MGLRuntimeStylingHelper testBoolFunction];
layer.textAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)];
layer.textFontNames = [MGLRuntimeStylingHelper testFontFunction];
layer.textFontSize = [MGLRuntimeStylingHelper testNumberFunction];
layer.textIgnoresPlacement = [MGLRuntimeStylingHelper testBoolFunction];
layer.textJustification = [MGLRuntimeStylingHelper testEnumFunction:MGLTextJustificationRight type:@encode(MGLTextJustification)];
layer.textLetterSpacing = [MGLRuntimeStylingHelper testNumberFunction];
layer.textLineHeight = [MGLRuntimeStylingHelper testNumberFunction];
layer.textOffset = [MGLRuntimeStylingHelper testOffsetFunction];
layer.textOptional = [MGLRuntimeStylingHelper testBoolFunction];
layer.textPadding = [MGLRuntimeStylingHelper testNumberFunction];
layer.textPitchAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)];
layer.textRotation = [MGLRuntimeStylingHelper testNumberFunction];
layer.textRotationAlignment = [MGLRuntimeStylingHelper testEnumFunction:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)];
layer.textTransform = [MGLRuntimeStylingHelper testEnumFunction:MGLTextTransformLowercase type:@encode(MGLTextTransform)];
layer.iconColor = [MGLRuntimeStylingHelper testColorFunction];
layer.iconHaloBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconHaloColor = [MGLRuntimeStylingHelper testColorFunction];
layer.iconHaloWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.iconTranslation = [MGLRuntimeStylingHelper testOffsetFunction];
layer.iconTranslationAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLIconTranslationAnchorViewport type:@encode(MGLIconTranslationAnchor)];
layer.textColor = [MGLRuntimeStylingHelper testColorFunction];
layer.textHaloBlur = [MGLRuntimeStylingHelper testNumberFunction];
layer.textHaloColor = [MGLRuntimeStylingHelper testColorFunction];
layer.textHaloWidth = [MGLRuntimeStylingHelper testNumberFunction];
layer.textOpacity = [MGLRuntimeStylingHelper testNumberFunction];
layer.textTranslation = [MGLRuntimeStylingHelper testOffsetFunction];
layer.textTranslationAnchor = [MGLRuntimeStylingHelper testEnumFunction:MGLTextTranslationAnchorViewport type:@encode(MGLTextTranslationAnchor)];
XCTAssertEqualObjects(gLayer.iconAllowsOverlap, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconIgnoresPlacement, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconImageName, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.iconOffset, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.iconOptional, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.iconPadding, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconRotation, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconRotationAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLIconRotationAlignmentAuto type:@encode(MGLIconRotationAlignment)]);
XCTAssertEqualObjects(gLayer.iconScale, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconTextFit, [MGLRuntimeStylingHelper testEnumFunction:MGLIconTextFitBoth type:@encode(MGLIconTextFit)]);
XCTAssertEqualObjects(gLayer.iconTextFitPadding, [MGLRuntimeStylingHelper testPaddingFunction]);
XCTAssertEqualObjects(gLayer.keepsIconUpright, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.keepsTextUpright, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.maximumTextAngle, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.maximumTextWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.symbolAvoidsEdges, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.symbolPlacement, [MGLRuntimeStylingHelper testEnumFunction:MGLSymbolPlacementLine type:@encode(MGLSymbolPlacement)]);
XCTAssertEqualObjects(gLayer.symbolSpacing, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.text, [MGLRuntimeStylingHelper testStringFunction]);
XCTAssertEqualObjects(gLayer.textAllowsOverlap, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.textAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLTextAnchorBottomRight type:@encode(MGLTextAnchor)]);
XCTAssertEqualObjects(gLayer.textFontNames, [MGLRuntimeStylingHelper testFontFunction]);
XCTAssertEqualObjects(gLayer.textFontSize, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textIgnoresPlacement, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.textJustification, [MGLRuntimeStylingHelper testEnumFunction:MGLTextJustificationRight type:@encode(MGLTextJustification)]);
XCTAssertEqualObjects(gLayer.textLetterSpacing, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textLineHeight, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textOffset, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.textOptional, [MGLRuntimeStylingHelper testBoolFunction]);
XCTAssertEqualObjects(gLayer.textPadding, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textPitchAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLTextPitchAlignmentAuto type:@encode(MGLTextPitchAlignment)]);
XCTAssertEqualObjects(gLayer.textRotation, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textRotationAlignment, [MGLRuntimeStylingHelper testEnumFunction:MGLTextRotationAlignmentAuto type:@encode(MGLTextRotationAlignment)]);
XCTAssertEqualObjects(gLayer.textTransform, [MGLRuntimeStylingHelper testEnumFunction:MGLTextTransformLowercase type:@encode(MGLTextTransform)]);
XCTAssertEqualObjects(gLayer.iconColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.iconHaloBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconHaloColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.iconHaloWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.iconTranslation, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.iconTranslationAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLIconTranslationAnchorViewport type:@encode(MGLIconTranslationAnchor)]);
XCTAssertEqualObjects(gLayer.textColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.textHaloBlur, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textHaloColor, [MGLRuntimeStylingHelper testColorFunction]);
XCTAssertEqualObjects(gLayer.textHaloWidth, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textOpacity, [MGLRuntimeStylingHelper testNumberFunction]);
XCTAssertEqualObjects(gLayer.textTranslation, [MGLRuntimeStylingHelper testOffsetFunction]);
XCTAssertEqualObjects(gLayer.textTranslationAnchor, [MGLRuntimeStylingHelper testEnumFunction:MGLTextTranslationAnchorViewport type:@encode(MGLTextTranslationAnchor)]);
}
- (void)testPropertyNames {
[self testPropertyName:@"icon-allows-overlap" isBoolean:YES];
[self testPropertyName:@"icon-ignores-placement" isBoolean:YES];
[self testPropertyName:@"icon-image-name" isBoolean:NO];
[self testPropertyName:@"icon-offset" isBoolean:NO];
[self testPropertyName:@"is-icon-optional" isBoolean:YES];
[self testPropertyName:@"icon-padding" isBoolean:NO];
[self testPropertyName:@"icon-rotation" isBoolean:NO];
[self testPropertyName:@"icon-rotation-alignment" isBoolean:NO];
[self testPropertyName:@"icon-scale" isBoolean:NO];
[self testPropertyName:@"icon-text-fit" isBoolean:NO];
[self testPropertyName:@"icon-text-fit-padding" isBoolean:NO];
[self testPropertyName:@"keeps-icon-upright" isBoolean:YES];
[self testPropertyName:@"keeps-text-upright" isBoolean:YES];
[self testPropertyName:@"maximum-text-angle" isBoolean:NO];
[self testPropertyName:@"maximum-text-width" isBoolean:NO];
[self testPropertyName:@"symbol-avoids-edges" isBoolean:YES];
[self testPropertyName:@"symbol-placement" isBoolean:NO];
[self testPropertyName:@"symbol-spacing" isBoolean:NO];
[self testPropertyName:@"text" isBoolean:NO];
[self testPropertyName:@"text-allows-overlap" isBoolean:YES];
[self testPropertyName:@"text-anchor" isBoolean:NO];
[self testPropertyName:@"text-font-names" isBoolean:NO];
[self testPropertyName:@"text-font-size" isBoolean:NO];
[self testPropertyName:@"text-ignores-placement" isBoolean:YES];
[self testPropertyName:@"text-justification" isBoolean:NO];
[self testPropertyName:@"text-letter-spacing" isBoolean:NO];
[self testPropertyName:@"text-line-height" isBoolean:NO];
[self testPropertyName:@"text-offset" isBoolean:NO];
[self testPropertyName:@"is-text-optional" isBoolean:YES];
[self testPropertyName:@"text-padding" isBoolean:NO];
[self testPropertyName:@"text-pitch-alignment" isBoolean:NO];
[self testPropertyName:@"text-rotation" isBoolean:NO];
[self testPropertyName:@"text-rotation-alignment" isBoolean:NO];
[self testPropertyName:@"text-transform" isBoolean:NO];
[self testPropertyName:@"icon-color" isBoolean:NO];
[self testPropertyName:@"icon-halo-blur" isBoolean:NO];
[self testPropertyName:@"icon-halo-color" isBoolean:NO];
[self testPropertyName:@"icon-halo-width" isBoolean:NO];
[self testPropertyName:@"icon-opacity" isBoolean:NO];
[self testPropertyName:@"icon-translation" isBoolean:NO];
[self testPropertyName:@"icon-translation-anchor" isBoolean:NO];
[self testPropertyName:@"text-color" isBoolean:NO];
[self testPropertyName:@"text-halo-blur" isBoolean:NO];
[self testPropertyName:@"text-halo-color" isBoolean:NO];
[self testPropertyName:@"text-halo-width" isBoolean:NO];
[self testPropertyName:@"text-opacity" isBoolean:NO];
[self testPropertyName:@"text-translation" isBoolean:NO];
[self testPropertyName:@"text-translation-anchor" isBoolean:NO];
}
@end

File diff suppressed because it is too large Load Diff

View File

@@ -86,13 +86,12 @@
3566C76F1D4A8DFA008152BC /* MGLRasterSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3566C76B1D4A8DFA008152BC /* MGLRasterSource.mm */; };
3566C7711D4A9198008152BC /* MGLSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C7701D4A9198008152BC /* MGLSource_Private.h */; };
3566C7721D4A9198008152BC /* MGLSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3566C7701D4A9198008152BC /* MGLSource_Private.h */; };
357579801D501E09000B822E /* MGLFillStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3575797F1D501E09000B822E /* MGLFillStyleLayerTests.m */; };
357579831D502AE6000B822E /* MGLRasterStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 357579821D502AE6000B822E /* MGLRasterStyleLayerTests.m */; };
357579851D502AF5000B822E /* MGLSymbolStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 357579841D502AF5000B822E /* MGLSymbolStyleLayerTests.m */; };
357579871D502AFE000B822E /* MGLLineStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 357579861D502AFE000B822E /* MGLLineStyleLayerTests.m */; };
357579891D502B06000B822E /* MGLCircleStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 357579881D502B06000B822E /* MGLCircleStyleLayerTests.m */; };
3575798B1D502B0C000B822E /* MGLBackgroundStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3575798A1D502B0C000B822E /* MGLBackgroundStyleLayerTests.m */; };
3575798E1D502EC7000B822E /* MGLRuntimeStylingHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 3575798D1D502EC7000B822E /* MGLRuntimeStylingHelper.m */; };
357579801D501E09000B822E /* MGLFillStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3575797F1D501E09000B822E /* MGLFillStyleLayerTests.mm */; };
357579831D502AE6000B822E /* MGLRasterStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 357579821D502AE6000B822E /* MGLRasterStyleLayerTests.mm */; };
357579851D502AF5000B822E /* MGLSymbolStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 357579841D502AF5000B822E /* MGLSymbolStyleLayerTests.mm */; };
357579871D502AFE000B822E /* MGLLineStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 357579861D502AFE000B822E /* MGLLineStyleLayerTests.mm */; };
357579891D502B06000B822E /* MGLCircleStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 357579881D502B06000B822E /* MGLCircleStyleLayerTests.mm */; };
3575798B1D502B0C000B822E /* MGLBackgroundStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3575798A1D502B0C000B822E /* MGLBackgroundStyleLayerTests.mm */; };
357FE2DD1E02D2B20068B753 /* NSCoder+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 357FE2DB1E02D2B20068B753 /* NSCoder+MGLAdditions.h */; };
357FE2DE1E02D2B20068B753 /* NSCoder+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 357FE2DB1E02D2B20068B753 /* NSCoder+MGLAdditions.h */; };
357FE2DF1E02D2B20068B753 /* NSCoder+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 357FE2DC1E02D2B20068B753 /* NSCoder+MGLAdditions.mm */; };
@@ -553,14 +552,12 @@
3566C76A1D4A8DFA008152BC /* MGLRasterSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRasterSource.h; sourceTree = "<group>"; };
3566C76B1D4A8DFA008152BC /* MGLRasterSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterSource.mm; sourceTree = "<group>"; };
3566C7701D4A9198008152BC /* MGLSource_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLSource_Private.h; sourceTree = "<group>"; };
3575797F1D501E09000B822E /* MGLFillStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLFillStyleLayerTests.m; path = ../../darwin/test/MGLFillStyleLayerTests.m; sourceTree = "<group>"; };
357579821D502AE6000B822E /* MGLRasterStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLRasterStyleLayerTests.m; path = ../../darwin/test/MGLRasterStyleLayerTests.m; sourceTree = "<group>"; };
357579841D502AF5000B822E /* MGLSymbolStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLSymbolStyleLayerTests.m; path = ../../darwin/test/MGLSymbolStyleLayerTests.m; sourceTree = "<group>"; };
357579861D502AFE000B822E /* MGLLineStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLLineStyleLayerTests.m; path = ../../darwin/test/MGLLineStyleLayerTests.m; sourceTree = "<group>"; };
357579881D502B06000B822E /* MGLCircleStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLCircleStyleLayerTests.m; path = ../../darwin/test/MGLCircleStyleLayerTests.m; sourceTree = "<group>"; };
3575798A1D502B0C000B822E /* MGLBackgroundStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLBackgroundStyleLayerTests.m; path = ../../darwin/test/MGLBackgroundStyleLayerTests.m; sourceTree = "<group>"; };
3575798C1D502EC7000B822E /* MGLRuntimeStylingHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLRuntimeStylingHelper.h; path = ../../darwin/test/MGLRuntimeStylingHelper.h; sourceTree = "<group>"; };
3575798D1D502EC7000B822E /* MGLRuntimeStylingHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLRuntimeStylingHelper.m; path = ../../darwin/test/MGLRuntimeStylingHelper.m; sourceTree = "<group>"; };
3575797F1D501E09000B822E /* MGLFillStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLFillStyleLayerTests.mm; path = ../../darwin/test/MGLFillStyleLayerTests.mm; sourceTree = "<group>"; };
357579821D502AE6000B822E /* MGLRasterStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLRasterStyleLayerTests.mm; path = ../../darwin/test/MGLRasterStyleLayerTests.mm; sourceTree = "<group>"; };
357579841D502AF5000B822E /* MGLSymbolStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLSymbolStyleLayerTests.mm; path = ../../darwin/test/MGLSymbolStyleLayerTests.mm; sourceTree = "<group>"; };
357579861D502AFE000B822E /* MGLLineStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLLineStyleLayerTests.mm; path = ../../darwin/test/MGLLineStyleLayerTests.mm; sourceTree = "<group>"; };
357579881D502B06000B822E /* MGLCircleStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLCircleStyleLayerTests.mm; path = ../../darwin/test/MGLCircleStyleLayerTests.mm; sourceTree = "<group>"; };
3575798A1D502B0C000B822E /* MGLBackgroundStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLBackgroundStyleLayerTests.mm; path = ../../darwin/test/MGLBackgroundStyleLayerTests.mm; sourceTree = "<group>"; };
357F09091DF84F3800941873 /* MGLStyleValueTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLStyleValueTests.h; path = ../../darwin/test/MGLStyleValueTests.h; sourceTree = "<group>"; };
357FE2DB1E02D2B20068B753 /* NSCoder+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSCoder+MGLAdditions.h"; path = "../../darwin/src/NSCoder+MGLAdditions.h"; sourceTree = "<group>"; };
357FE2DC1E02D2B20068B753 /* NSCoder+MGLAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "NSCoder+MGLAdditions.mm"; path = "../../darwin/src/NSCoder+MGLAdditions.mm"; sourceTree = "<group>"; };
@@ -664,6 +661,7 @@
DA35A2C81CCAAAD200E826B2 /* NSValue+MGLAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSValue+MGLAdditions.m"; sourceTree = "<group>"; };
DA35A2D11CCAB25200E826B2 /* jazzy.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = jazzy.yml; sourceTree = "<group>"; };
DA35D0871E1A6309007DED41 /* one-liner.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = "one-liner.json"; path = "../../darwin/test/one-liner.json"; sourceTree = "<group>"; };
DA3C6FF21E2859E700F962BE /* test-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "test-Bridging-Header.h"; path = "../../darwin/test/test-Bridging-Header.h"; sourceTree = "<group>"; };
DA4A26961CB6E795000B7809 /* Mapbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Mapbox.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DA6408D91DA4E7D300908C90 /* MGLVectorStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLVectorStyleLayer.h; sourceTree = "<group>"; };
DA6408DA1DA4E7D300908C90 /* MGLVectorStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLVectorStyleLayer.m; sourceTree = "<group>"; };
@@ -764,7 +762,7 @@
DA8963341CC549A100684375 /* sprites */ = {isa = PBXFileReference; lastKnownFileType = folder; path = sprites; sourceTree = "<group>"; };
DA8963351CC549A100684375 /* styles */ = {isa = PBXFileReference; lastKnownFileType = folder; path = styles; sourceTree = "<group>"; };
DA8963361CC549A100684375 /* tiles */ = {isa = PBXFileReference; lastKnownFileType = folder; path = tiles; sourceTree = "<group>"; };
DA8F25B91D51D2570010E6B5 /* MGLStyleLayerTests.m.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; name = MGLStyleLayerTests.m.ejs; path = ../test/MGLStyleLayerTests.m.ejs; sourceTree = "<group>"; };
DA8F25B91D51D2570010E6B5 /* MGLStyleLayerTests.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; name = MGLStyleLayerTests.mm.ejs; path = ../test/MGLStyleLayerTests.mm.ejs; sourceTree = "<group>"; };
DA8F25BA1D51D2570010E6B5 /* MGLStyleLayer.h.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLStyleLayer.h.ejs; sourceTree = "<group>"; };
DA8F25BB1D51D2570010E6B5 /* MGLStyleLayer.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLStyleLayer.mm.ejs; sourceTree = "<group>"; };
DAA4E4021CBB5C2F00178DFB /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
@@ -942,14 +940,15 @@
3575798F1D513EF1000B822E /* Layers */ = {
isa = PBXGroup;
children = (
3575797F1D501E09000B822E /* MGLFillStyleLayerTests.m */,
357579821D502AE6000B822E /* MGLRasterStyleLayerTests.m */,
357579841D502AF5000B822E /* MGLSymbolStyleLayerTests.m */,
357579861D502AFE000B822E /* MGLLineStyleLayerTests.m */,
357579881D502B06000B822E /* MGLCircleStyleLayerTests.m */,
3575798A1D502B0C000B822E /* MGLBackgroundStyleLayerTests.m */,
3575798C1D502EC7000B822E /* MGLRuntimeStylingHelper.h */,
3575798D1D502EC7000B822E /* MGLRuntimeStylingHelper.m */,
DA2DBBCC1D51E80400D38FF9 /* MGLStyleLayerTests.h */,
DA2DBBCD1D51E80400D38FF9 /* MGLStyleLayerTests.m */,
DA3C6FF21E2859E700F962BE /* test-Bridging-Header.h */,
3575797F1D501E09000B822E /* MGLFillStyleLayerTests.mm */,
357579821D502AE6000B822E /* MGLRasterStyleLayerTests.mm */,
357579841D502AF5000B822E /* MGLSymbolStyleLayerTests.mm */,
357579861D502AFE000B822E /* MGLLineStyleLayerTests.mm */,
357579881D502B06000B822E /* MGLCircleStyleLayerTests.mm */,
3575798A1D502B0C000B822E /* MGLBackgroundStyleLayerTests.mm */,
);
name = Layers;
sourceTree = "<group>";
@@ -1094,8 +1093,6 @@
DD58A4C51D822BD000E1F038 /* MGLExpressionTests.mm */,
DA0CD58F1CF56F6A00A5F5A5 /* MGLFeatureTests.mm */,
DA2E885C1CC0382C00F24E7B /* MGLGeometryTests.mm */,
DA2DBBCC1D51E80400D38FF9 /* MGLStyleLayerTests.h */,
DA2DBBCD1D51E80400D38FF9 /* MGLStyleLayerTests.m */,
35E208A61D24210F00EC9A46 /* MGLNSDataAdditionsTests.m */,
DAE7DEC11E245455007505A6 /* MGLNSStringAdditionsTests.m */,
DA2E885D1CC0382C00F24E7B /* MGLOfflinePackTests.m */,
@@ -1258,7 +1255,7 @@
children = (
DA8F25BA1D51D2570010E6B5 /* MGLStyleLayer.h.ejs */,
DA8F25BB1D51D2570010E6B5 /* MGLStyleLayer.mm.ejs */,
DA8F25B91D51D2570010E6B5 /* MGLStyleLayerTests.m.ejs */,
DA8F25B91D51D2570010E6B5 /* MGLStyleLayerTests.mm.ejs */,
);
name = "Foundation Templates";
path = ../../darwin/src;
@@ -1949,27 +1946,26 @@
3599A3E61DF708BC00E77FB2 /* MGLStyleValueTests.m in Sources */,
DA2E88651CC0382C00F24E7B /* MGLStyleTests.mm in Sources */,
DA2E88611CC0382C00F24E7B /* MGLGeometryTests.mm in Sources */,
357579801D501E09000B822E /* MGLFillStyleLayerTests.m in Sources */,
357579801D501E09000B822E /* MGLFillStyleLayerTests.mm in Sources */,
35D9DDE21DA25EEC00DAAD69 /* MGLCodingTests.m in Sources */,
DA2E88641CC0382C00F24E7B /* MGLOfflineStorageTests.m in Sources */,
DA2DBBCE1D51E80400D38FF9 /* MGLStyleLayerTests.m in Sources */,
DA35A2C61CCA9F8300E826B2 /* MGLCompassDirectionFormatterTests.m in Sources */,
DAE7DEC21E245455007505A6 /* MGLNSStringAdditionsTests.m in Sources */,
3575798E1D502EC7000B822E /* MGLRuntimeStylingHelper.m in Sources */,
4085AF091D933DEA00F11B22 /* MGLTileSetTests.mm in Sources */,
DAEDC4341D603417000224FF /* MGLAttributionInfoTests.m in Sources */,
357579851D502AF5000B822E /* MGLSymbolStyleLayerTests.m in Sources */,
357579871D502AFE000B822E /* MGLLineStyleLayerTests.m in Sources */,
357579891D502B06000B822E /* MGLCircleStyleLayerTests.m in Sources */,
357579851D502AF5000B822E /* MGLSymbolStyleLayerTests.mm in Sources */,
357579871D502AFE000B822E /* MGLLineStyleLayerTests.mm in Sources */,
357579891D502B06000B822E /* MGLCircleStyleLayerTests.mm in Sources */,
DA2207BF1DC0805F0002F84D /* MGLStyleValueTests.swift in Sources */,
40CFA6511D7875BB008103BD /* MGLShapeSourceTests.mm in Sources */,
DA35A2C51CCA9F8300E826B2 /* MGLClockDirectionFormatterTests.m in Sources */,
35B8E08C1D6C8B5100E768D2 /* MGLPredicateTests.mm in Sources */,
DD58A4C61D822BD000E1F038 /* MGLExpressionTests.mm in Sources */,
3575798B1D502B0C000B822E /* MGLBackgroundStyleLayerTests.m in Sources */,
3575798B1D502B0C000B822E /* MGLBackgroundStyleLayerTests.mm in Sources */,
DA2E88621CC0382C00F24E7B /* MGLOfflinePackTests.m in Sources */,
DA35A2AA1CCA058D00E826B2 /* MGLCoordinateFormatterTests.m in Sources */,
357579831D502AE6000B822E /* MGLRasterStyleLayerTests.m in Sources */,
357579831D502AE6000B822E /* MGLRasterStyleLayerTests.mm in Sources */,
353D23961D0B0DFE002BE09D /* MGLAnnotationViewTests.m in Sources */,
35E208A71D24210F00EC9A46 /* MGLNSDataAdditionsTests.m in Sources */,
DA0CD5901CF56F6A00A5F5A5 /* MGLFeatureTests.mm in Sources */,

View File

@@ -67,7 +67,6 @@
DA2207BC1DC076940002F84D /* MGLStyleValueTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2207BB1DC076940002F84D /* MGLStyleValueTests.swift */; };
DA2784FE1DF03060001D5B8D /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA2784FD1DF03060001D5B8D /* Media.xcassets */; };
DA29875A1E1A4290002299F5 /* MGLDocumentationExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA2987591E1A4290002299F5 /* MGLDocumentationExampleTests.swift */; };
DA2DBBCB1D51E30A00D38FF9 /* MGLStyleLayerTests.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA2DBBCA1D51E30A00D38FF9 /* MGLStyleLayerTests.xib */; };
DA35A2A41CC9EB1A00E826B2 /* MGLCoordinateFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = DA35A2A31CC9EB1A00E826B2 /* MGLCoordinateFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; };
DA35A2A61CC9EB2700E826B2 /* MGLCoordinateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2A51CC9EB2700E826B2 /* MGLCoordinateFormatter.m */; };
DA35A2A81CC9F41600E826B2 /* MGLCoordinateFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA35A2A71CC9F41600E826B2 /* MGLCoordinateFormatterTests.m */; };
@@ -101,13 +100,12 @@
DA87A99C1DC9D8DD00810D09 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DA87A99B1DC9D8DD00810D09 /* MGLShapeSource_Private.h */; };
DA87A99E1DC9DC2100810D09 /* MGLPredicateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35C5D84B1D6DD75B00E95907 /* MGLPredicateTests.mm */; };
DA87A9A01DC9DC6200810D09 /* MGLValueEvaluator.h in Headers */ = {isa = PBXBuildFile; fileRef = DA87A99F1DC9DC6200810D09 /* MGLValueEvaluator.h */; };
DA87A9A11DC9DCB400810D09 /* MGLRuntimeStylingHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8F257B1D51C5F40010E6B5 /* MGLRuntimeStylingHelper.m */; };
DA87A9A21DC9DCF100810D09 /* MGLFillStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25741D51C5F40010E6B5 /* MGLFillStyleLayerTests.m */; };
DA87A9A31DCACC5000810D09 /* MGLRasterStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25751D51C5F40010E6B5 /* MGLRasterStyleLayerTests.m */; };
DA87A9A41DCACC5000810D09 /* MGLSymbolStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25761D51C5F40010E6B5 /* MGLSymbolStyleLayerTests.m */; };
DA87A9A51DCACC5000810D09 /* MGLLineStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25771D51C5F40010E6B5 /* MGLLineStyleLayerTests.m */; };
DA87A9A61DCACC5000810D09 /* MGLCircleStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25781D51C5F40010E6B5 /* MGLCircleStyleLayerTests.m */; };
DA87A9A71DCACC5000810D09 /* MGLBackgroundStyleLayerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25791D51C5F40010E6B5 /* MGLBackgroundStyleLayerTests.m */; };
DA87A9A21DC9DCF100810D09 /* MGLFillStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25741D51C5F40010E6B5 /* MGLFillStyleLayerTests.mm */; };
DA87A9A31DCACC5000810D09 /* MGLRasterStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25751D51C5F40010E6B5 /* MGLRasterStyleLayerTests.mm */; };
DA87A9A41DCACC5000810D09 /* MGLSymbolStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25761D51C5F40010E6B5 /* MGLSymbolStyleLayerTests.mm */; };
DA87A9A51DCACC5000810D09 /* MGLLineStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25771D51C5F40010E6B5 /* MGLLineStyleLayerTests.mm */; };
DA87A9A61DCACC5000810D09 /* MGLCircleStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25781D51C5F40010E6B5 /* MGLCircleStyleLayerTests.mm */; };
DA87A9A71DCACC5000810D09 /* MGLBackgroundStyleLayerTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = DA8F25791D51C5F40010E6B5 /* MGLBackgroundStyleLayerTests.mm */; };
DA8933A51CCD287300E68420 /* MGLAnnotationCallout.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA8933A71CCD287300E68420 /* MGLAnnotationCallout.xib */; };
DA8933AE1CCD290700E68420 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA8933AB1CCD290700E68420 /* Localizable.strings */; };
DA8933B51CCD2C2500E68420 /* Foundation.strings in Resources */ = {isa = PBXBuildFile; fileRef = DA8933B31CCD2C2500E68420 /* Foundation.strings */; };
@@ -320,7 +318,6 @@
DA2207BB1DC076940002F84D /* MGLStyleValueTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MGLStyleValueTests.swift; sourceTree = "<group>"; };
DA2784FD1DF03060001D5B8D /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Media.xcassets; path = ../../darwin/test/Media.xcassets; sourceTree = "<group>"; };
DA2987591E1A4290002299F5 /* MGLDocumentationExampleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MGLDocumentationExampleTests.swift; path = ../../darwin/test/MGLDocumentationExampleTests.swift; sourceTree = "<group>"; };
DA2DBBCA1D51E30A00D38FF9 /* MGLStyleLayerTests.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MGLStyleLayerTests.xib; sourceTree = "<group>"; };
DA35A2A31CC9EB1A00E826B2 /* MGLCoordinateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCoordinateFormatter.h; sourceTree = "<group>"; };
DA35A2A51CC9EB2700E826B2 /* MGLCoordinateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLCoordinateFormatter.m; sourceTree = "<group>"; };
DA35A2A71CC9F41600E826B2 /* MGLCoordinateFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLCoordinateFormatterTests.m; path = ../../darwin/test/MGLCoordinateFormatterTests.m; sourceTree = "<group>"; };
@@ -361,14 +358,12 @@
DA8933AC1CCD290700E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = "<group>"; };
DA8933B41CCD2C2500E68420 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Foundation.strings; sourceTree = "<group>"; };
DA8933B71CCD2C2D00E68420 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Foundation.stringsdict; sourceTree = "<group>"; };
DA8F25741D51C5F40010E6B5 /* MGLFillStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLFillStyleLayerTests.m; path = ../../darwin/test/MGLFillStyleLayerTests.m; sourceTree = "<group>"; };
DA8F25751D51C5F40010E6B5 /* MGLRasterStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLRasterStyleLayerTests.m; path = ../../darwin/test/MGLRasterStyleLayerTests.m; sourceTree = "<group>"; };
DA8F25761D51C5F40010E6B5 /* MGLSymbolStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLSymbolStyleLayerTests.m; path = ../../darwin/test/MGLSymbolStyleLayerTests.m; sourceTree = "<group>"; };
DA8F25771D51C5F40010E6B5 /* MGLLineStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLLineStyleLayerTests.m; path = ../../darwin/test/MGLLineStyleLayerTests.m; sourceTree = "<group>"; };
DA8F25781D51C5F40010E6B5 /* MGLCircleStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLCircleStyleLayerTests.m; path = ../../darwin/test/MGLCircleStyleLayerTests.m; sourceTree = "<group>"; };
DA8F25791D51C5F40010E6B5 /* MGLBackgroundStyleLayerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLBackgroundStyleLayerTests.m; path = ../../darwin/test/MGLBackgroundStyleLayerTests.m; sourceTree = "<group>"; };
DA8F257A1D51C5F40010E6B5 /* MGLRuntimeStylingHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MGLRuntimeStylingHelper.h; path = ../../darwin/test/MGLRuntimeStylingHelper.h; sourceTree = "<group>"; };
DA8F257B1D51C5F40010E6B5 /* MGLRuntimeStylingHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLRuntimeStylingHelper.m; path = ../../darwin/test/MGLRuntimeStylingHelper.m; sourceTree = "<group>"; };
DA8F25741D51C5F40010E6B5 /* MGLFillStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLFillStyleLayerTests.mm; sourceTree = "<group>"; };
DA8F25751D51C5F40010E6B5 /* MGLRasterStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRasterStyleLayerTests.mm; sourceTree = "<group>"; };
DA8F25761D51C5F40010E6B5 /* MGLSymbolStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLSymbolStyleLayerTests.mm; sourceTree = "<group>"; };
DA8F25771D51C5F40010E6B5 /* MGLLineStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLLineStyleLayerTests.mm; sourceTree = "<group>"; };
DA8F25781D51C5F40010E6B5 /* MGLCircleStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLCircleStyleLayerTests.mm; sourceTree = "<group>"; };
DA8F25791D51C5F40010E6B5 /* MGLBackgroundStyleLayerTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLBackgroundStyleLayerTests.mm; sourceTree = "<group>"; };
DA8F25851D51C9E10010E6B5 /* MGLBackgroundStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLBackgroundStyleLayer.h; sourceTree = "<group>"; };
DA8F25861D51C9E10010E6B5 /* MGLBackgroundStyleLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLBackgroundStyleLayer.mm; sourceTree = "<group>"; };
DA8F25891D51CA540010E6B5 /* MGLLineStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLineStyleLayer.h; sourceTree = "<group>"; };
@@ -383,7 +378,7 @@
DA8F259B1D51CB000010E6B5 /* MGLStyleValue_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleValue_Private.h; sourceTree = "<group>"; };
DA8F25A61D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+MGLStyleAttributeAdditions.h"; sourceTree = "<group>"; };
DA8F25A71D51CB270010E6B5 /* NSValue+MGLStyleAttributeAdditions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "NSValue+MGLStyleAttributeAdditions.mm"; sourceTree = "<group>"; };
DA8F25B51D51D2240010E6B5 /* MGLStyleLayerTests.m.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; name = MGLStyleLayerTests.m.ejs; path = ../test/MGLStyleLayerTests.m.ejs; sourceTree = "<group>"; };
DA8F25B51D51D2240010E6B5 /* MGLStyleLayerTests.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; name = MGLStyleLayerTests.mm.ejs; path = ../test/MGLStyleLayerTests.mm.ejs; sourceTree = "<group>"; };
DA8F25B61D51D2240010E6B5 /* MGLStyleLayer.h.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLStyleLayer.h.ejs; sourceTree = "<group>"; };
DA8F25B71D51D2240010E6B5 /* MGLStyleLayer.mm.ejs */ = {isa = PBXFileReference; lastKnownFileType = text; path = MGLStyleLayer.mm.ejs; sourceTree = "<group>"; };
DAA48EFB1D6A4731006A7E36 /* StyleLayerIconTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleLayerIconTransformer.h; sourceTree = "<group>"; };
@@ -699,15 +694,12 @@
40E1601A1DF216E6005EA6D9 /* MGLStyleLayerTests.h */,
40E1601B1DF216E6005EA6D9 /* MGLStyleLayerTests.m */,
DA2207BA1DC076930002F84D /* test-Bridging-Header.h */,
DA8F25741D51C5F40010E6B5 /* MGLFillStyleLayerTests.m */,
DA8F25751D51C5F40010E6B5 /* MGLRasterStyleLayerTests.m */,
DA8F25761D51C5F40010E6B5 /* MGLSymbolStyleLayerTests.m */,
DA8F25771D51C5F40010E6B5 /* MGLLineStyleLayerTests.m */,
DA8F25781D51C5F40010E6B5 /* MGLCircleStyleLayerTests.m */,
DA8F25791D51C5F40010E6B5 /* MGLBackgroundStyleLayerTests.m */,
DA8F257A1D51C5F40010E6B5 /* MGLRuntimeStylingHelper.h */,
DA8F257B1D51C5F40010E6B5 /* MGLRuntimeStylingHelper.m */,
DA2DBBCA1D51E30A00D38FF9 /* MGLStyleLayerTests.xib */,
DA8F25741D51C5F40010E6B5 /* MGLFillStyleLayerTests.mm */,
DA8F25751D51C5F40010E6B5 /* MGLRasterStyleLayerTests.mm */,
DA8F25761D51C5F40010E6B5 /* MGLSymbolStyleLayerTests.mm */,
DA8F25771D51C5F40010E6B5 /* MGLLineStyleLayerTests.mm */,
DA8F25781D51C5F40010E6B5 /* MGLCircleStyleLayerTests.mm */,
DA8F25791D51C5F40010E6B5 /* MGLBackgroundStyleLayerTests.mm */,
);
name = Layers;
sourceTree = "<group>";
@@ -730,7 +722,7 @@
children = (
DA8F25B61D51D2240010E6B5 /* MGLStyleLayer.h.ejs */,
DA8F25B71D51D2240010E6B5 /* MGLStyleLayer.mm.ejs */,
DA8F25B51D51D2240010E6B5 /* MGLStyleLayerTests.m.ejs */,
DA8F25B51D51D2240010E6B5 /* MGLStyleLayerTests.mm.ejs */,
);
name = "Foundation Templates";
path = ../../darwin/src;
@@ -1218,7 +1210,6 @@
files = (
35724FC41D630502002A4AB4 /* amsterdam.geojson in Resources */,
DA2784FE1DF03060001D5B8D /* Media.xcassets in Resources */,
DA2DBBCB1D51E30A00D38FF9 /* MGLStyleLayerTests.xib in Resources */,
DA35D08A1E1A631B007DED41 /* one-liner.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -1318,28 +1309,27 @@
files = (
DA35A2C21CCA9F4A00E826B2 /* MGLClockDirectionFormatterTests.m in Sources */,
DAE6C3D41CC34C9900DB3429 /* MGLOfflineRegionTests.m in Sources */,
DA87A9A11DC9DCB400810D09 /* MGLRuntimeStylingHelper.m in Sources */,
DAE6C3D61CC34C9900DB3429 /* MGLStyleTests.mm in Sources */,
DAEDC4371D606291000224FF /* MGLAttributionButtonTests.m in Sources */,
DA35A2B61CCA14D700E826B2 /* MGLCompassDirectionFormatterTests.m in Sources */,
DAE6C3D21CC34C9900DB3429 /* MGLGeometryTests.mm in Sources */,
DA87A9A41DCACC5000810D09 /* MGLSymbolStyleLayerTests.m in Sources */,
DA87A9A41DCACC5000810D09 /* MGLSymbolStyleLayerTests.mm in Sources */,
DAE6C3D51CC34C9900DB3429 /* MGLOfflineStorageTests.m in Sources */,
40E1601D1DF217D6005EA6D9 /* MGLStyleLayerTests.m in Sources */,
DA87A9A61DCACC5000810D09 /* MGLCircleStyleLayerTests.m in Sources */,
DA87A9A61DCACC5000810D09 /* MGLCircleStyleLayerTests.mm in Sources */,
DA87A99E1DC9DC2100810D09 /* MGLPredicateTests.mm in Sources */,
DD58A4C91D822C6700E1F038 /* MGLExpressionTests.mm in Sources */,
DA87A9A71DCACC5000810D09 /* MGLBackgroundStyleLayerTests.m in Sources */,
DA87A9A71DCACC5000810D09 /* MGLBackgroundStyleLayerTests.mm in Sources */,
DA29875A1E1A4290002299F5 /* MGLDocumentationExampleTests.swift in Sources */,
DAE6C3D31CC34C9900DB3429 /* MGLOfflinePackTests.m in Sources */,
DA87A9A51DCACC5000810D09 /* MGLLineStyleLayerTests.m in Sources */,
DA87A9A31DCACC5000810D09 /* MGLRasterStyleLayerTests.m in Sources */,
DA87A9A51DCACC5000810D09 /* MGLLineStyleLayerTests.mm in Sources */,
DA87A9A31DCACC5000810D09 /* MGLRasterStyleLayerTests.mm in Sources */,
DA87A9991DC9D88400810D09 /* MGLTileSetTests.mm in Sources */,
DA35A2A81CC9F41600E826B2 /* MGLCoordinateFormatterTests.m in Sources */,
DAE7DEC41E24549F007505A6 /* MGLNSStringAdditionsTests.m in Sources */,
DA87A9981DC9D88400810D09 /* MGLShapeSourceTests.mm in Sources */,
3526EABD1DF9B19800006B43 /* MGLCodingTests.m in Sources */,
DA87A9A21DC9DCF100810D09 /* MGLFillStyleLayerTests.m in Sources */,
DA87A9A21DC9DCF100810D09 /* MGLFillStyleLayerTests.mm in Sources */,
3599A3E81DF70E2000E77FB2 /* MGLStyleValueTests.m in Sources */,
DAEDC4321D6033F1000224FF /* MGLAttributionInfoTests.m in Sources */,
DA0CD58E1CF56F5800A5F5A5 /* MGLFeatureTests.mm in Sources */,