summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-05-04 17:26:42 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-05-08 19:39:55 +0300
commitfeae5e22ee4910a1508f2120c8131b2f8531bae8 (patch)
treeb5ca0ba87b42bcc732070485b5ccea2c3f832840 /test
parent20810f988a735e0d43f9abff9260ea0784cd218c (diff)
downloadqtlocation-mapboxgl-feae5e22ee4910a1508f2120c8131b2f8531bae8.tar.gz
[core] generated accessor methods on light
Diffstat (limited to 'test')
-rw-r--r--test/style/conversion/light.test.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/test/style/conversion/light.test.cpp b/test/style/conversion/light.test.cpp
index da0fd3054a..a2185906d6 100644
--- a/test/style/conversion/light.test.cpp
+++ b/test/style/conversion/light.test.cpp
@@ -33,35 +33,35 @@ TEST(StyleConversion, Light) {
auto light = parseLight("{\"color\":{\"stops\":[[14,\"blue\"],[16,\"red\"]]},\"intensity\":0.3,\"position\":[3,90,90]}");
ASSERT_TRUE((bool) light);
- ASSERT_TRUE(light->get<LightAnchor>().value.isUndefined());
- ASSERT_FALSE(light->get<LightAnchor>().value.isConstant());
- ASSERT_FALSE(light->get<LightAnchor>().value.isCameraFunction());
+ ASSERT_TRUE(light->getAnchor().isUndefined());
+ ASSERT_FALSE(light->getAnchor().isConstant());
+ ASSERT_FALSE(light->getAnchor().isCameraFunction());
- ASSERT_FALSE(light->get<LightIntensity>().value.isUndefined());
- ASSERT_TRUE(light->get<LightIntensity>().value.isConstant());
- ASSERT_EQ(light->get<LightIntensity>().value.asConstant(), 0.3f);
- ASSERT_FALSE(light->get<LightAnchor>().value.isCameraFunction());
+ ASSERT_FALSE(light->getIntensity().isUndefined());
+ ASSERT_TRUE(light->getIntensity().isConstant());
+ ASSERT_EQ(light->getIntensity().asConstant(), 0.3f);
+ ASSERT_FALSE(light->getAnchor().isCameraFunction());
- ASSERT_FALSE(light->get<LightColor>().value.isUndefined());
- ASSERT_FALSE(light->get<LightColor>().value.isConstant());
- ASSERT_TRUE(light->get<LightColor>().value.isCameraFunction());
+ ASSERT_FALSE(light->getColor().isUndefined());
+ ASSERT_FALSE(light->getColor().isConstant());
+ ASSERT_TRUE(light->getColor().isCameraFunction());
- ASSERT_FALSE(light->get<LightPosition>().value.isUndefined());
- ASSERT_TRUE(light->get<LightPosition>().value.isConstant());
+ ASSERT_FALSE(light->getPosition().isUndefined());
+ ASSERT_TRUE(light->getPosition().isConstant());
std::array<float, 3> expected{{ 3, 90, 90 }};
- ASSERT_EQ(light->get<LightPosition>().value.asConstant(), mbgl::style::Position({ expected }));
- ASSERT_FALSE(light->get<LightPosition>().value.isCameraFunction());
+ ASSERT_EQ(light->getPosition().asConstant(), mbgl::style::Position({ expected }));
+ ASSERT_FALSE(light->getPosition().isCameraFunction());
}
{
auto light = parseLight("{\"color\":\"blue\",\"intensity\":0.3,\"color-transition\":{\"duration\":1000}}");
ASSERT_TRUE((bool) light);
- ASSERT_FALSE(light->get<LightColor>().value.isUndefined());
- ASSERT_TRUE(light->get<LightColor>().value.isConstant());
- ASSERT_FALSE(light->get<LightColor>().value.isCameraFunction());
- ASSERT_EQ(light->get<LightColor>().transition.duration, mbgl::Duration(mbgl::Milliseconds(1000)));
- ASSERT_FALSE((bool) light->get<LightColor>().transition.delay);
+ ASSERT_FALSE(light->getColor().isUndefined());
+ ASSERT_TRUE(light->getColor().isConstant());
+ ASSERT_FALSE(light->getColor().isCameraFunction());
+ ASSERT_EQ(light->getColorTransition().duration, mbgl::Duration(mbgl::Milliseconds(1000)));
+ ASSERT_FALSE((bool) light->getColorTransition().delay);
}
{