summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2018-03-06 15:13:13 -0800
committerMinh Nguyễn <mxn@1ec5.org>2018-03-06 15:13:13 -0800
commitb631a3d8169ee164b3de70eb6bbee6933942146d (patch)
tree68ea5eaa3e749e6e940c29db25661da98ada6fe3
parentcdf627cf5d76f6185fd3db789d68c88a614190c6 (diff)
downloadqtlocation-mapboxgl-b631a3d8169ee164b3de70eb6bbee6933942146d.tar.gz
[TEST] Assert on individual components
-rw-r--r--platform/darwin/test/MGLBackgroundStyleLayerTests.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/darwin/test/MGLBackgroundStyleLayerTests.mm b/platform/darwin/test/MGLBackgroundStyleLayerTests.mm
index e7c2982413..58ff42cd9d 100644
--- a/platform/darwin/test/MGLBackgroundStyleLayerTests.mm
+++ b/platform/darwin/test/MGLBackgroundStyleLayerTests.mm
@@ -36,6 +36,15 @@
NSExpression *constantExpression = [NSExpression expressionWithFormat:@"%@", [MGLColor redColor]];
layer.backgroundColor = constantExpression;
mbgl::style::PropertyValue<mbgl::Color> propertyValue = { { 1, 0, 0, 1 } };
+ auto constantValue = rawLayer->getBackgroundColor();
+ XCTAssertEqual(constantValue.asConstant().r, propertyValue.asConstant().r,
+ @"Setting backgroundColor to a constant value expression should update background-color (red).");
+ XCTAssertEqual(constantValue.asConstant().g, propertyValue.asConstant().g,
+ @"Setting backgroundColor to a constant value expression should update background-color (green).");
+ XCTAssertEqual(constantValue.asConstant().b, propertyValue.asConstant().b,
+ @"Setting backgroundColor to a constant value expression should update background-color (blue).");
+ XCTAssertEqual(constantValue.asConstant().a, propertyValue.asConstant().a,
+ @"Setting backgroundColor to a constant value expression should update background-color (alpha).");
XCTAssertEqual(rawLayer->getBackgroundColor(), propertyValue,
@"Setting backgroundColor to a constant value expression should update background-color.");
XCTAssertEqualObjects(layer.backgroundColor, constantExpression,