summaryrefslogtreecommitdiff
path: root/platform/darwin/test
diff options
context:
space:
mode:
authorFabian Guerra <fabian.guerra@mapbox.com>2017-05-24 12:20:58 -0400
committerFabian Guerra Soto <fabian.guerra@mapbox.com>2017-05-24 14:47:47 -0400
commite1431f9085153f7afb33ee169289ff46d38fe209 (patch)
treebab62b942fedd972d3e20f34b7f63497ec4c5945 /platform/darwin/test
parent8199315e9d554a002e950508d0b6e51f22f79d1c (diff)
downloadqtlocation-mapboxgl-e1431f9085153f7afb33ee169289ff46d38fe209.tar.gz
[ios, macos] Fix MGLLight.achor to accept style functions
Diffstat (limited to 'platform/darwin/test')
-rw-r--r--platform/darwin/test/MGLLightTest.mm12
1 files changed, 9 insertions, 3 deletions
diff --git a/platform/darwin/test/MGLLightTest.mm b/platform/darwin/test/MGLLightTest.mm
index 4639b13cde..2c3d1c7bd1 100644
--- a/platform/darwin/test/MGLLightTest.mm
+++ b/platform/darwin/test/MGLLightTest.mm
@@ -25,7 +25,10 @@
{
mbgl::style::Light light;
MGLLight *mglLight = [[MGLLight alloc] initWithMBGLLight:&light];
- XCTAssertEqual(mglLight.anchor, MGLLightAnchorViewport);
+
+ NSAssert([mglLight.anchor isKindOfClass:[MGLConstantStyleValue class]], @"mglLight.anchor isn’t a MGLConstantStyleValue.");
+ NSValue *anchorValue = ((MGLConstantStyleValue *)mglLight.anchor).rawValue;
+ XCTAssertEqual(anchorValue.MGLLightAnchorValue, MGLLightAnchorViewport);
XCTAssertEqual(mglLight.anchorTransition.delay, defaultTransition.delay);
XCTAssertEqual(mglLight.anchorTransition.duration, defaultTransition.duration);
@@ -36,10 +39,13 @@
XCTAssert(anchorTransition.delay && MGLTimeIntervalFromDuration(*anchorTransition.delay) == defaultTransition.delay);
XCTAssert(anchorTransition.duration && MGLTimeIntervalFromDuration(*anchorTransition.duration) == defaultTransition.duration);
- mglLight.anchor = MGLLightAnchorMap;
+ MGLStyleValue<NSValue *> *anchorStyleValue = [MGLStyleValue<NSValue *> valueWithRawValue:[NSValue valueWithMGLLightAnchor:MGLLightAnchorMap]];
+ mglLight.anchor = anchorStyleValue;
mglLight.anchorTransition = transition;
+ NSAssert([mglLight.anchor isKindOfClass:[MGLConstantStyleValue class]], @"mglLight.anchor isn’t a MGLConstantStyleValue.");
+ anchorValue = ((MGLConstantStyleValue *)mglLight.anchor).rawValue;
- XCTAssertEqual(mglLight.anchor, MGLLightAnchorMap);
+ XCTAssertEqual(anchorValue.MGLLightAnchorValue, MGLLightAnchorMap);
XCTAssertEqual(mglLight.anchorTransition.delay, transition.delay);
XCTAssertEqual(mglLight.anchorTransition.duration, transition.duration);