diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-03-06 15:13:13 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-03-06 15:13:13 -0800 |
commit | b631a3d8169ee164b3de70eb6bbee6933942146d (patch) | |
tree | 68ea5eaa3e749e6e940c29db25661da98ada6fe3 | |
parent | cdf627cf5d76f6185fd3db789d68c88a614190c6 (diff) | |
download | qtlocation-mapboxgl-b631a3d8169ee164b3de70eb6bbee6933942146d.tar.gz |
[TEST] Assert on individual components
-rw-r--r-- | platform/darwin/test/MGLBackgroundStyleLayerTests.mm | 9 |
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, |