summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLLightTest.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/test/MGLLightTest.mm')
-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);