diff options
author | Juha Alanen <juha.alanen@mapbox.com> | 2019-08-21 13:58:26 +0300 |
---|---|---|
committer | Juha Alanen <19551460+jmalanen@users.noreply.github.com> | 2019-09-18 14:29:15 +0300 |
commit | 97c4f13beca451cd2bd9443adc0859ec2da88f40 (patch) | |
tree | 70f9aa14541237551f74548f7d21f934f4117974 /test | |
parent | 1b639d08198373c1b838aeea838527ce3fc4f59f (diff) | |
download | qtlocation-mapboxgl-97c4f13beca451cd2bd9443adc0859ec2da88f40.tar.gz |
[tests] Add feature state unit test
Diffstat (limited to 'test')
-rw-r--r-- | test/api/query.test.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/api/query.test.cpp b/test/api/query.test.cpp index bf3f64a0c8..83aeec81ec 100644 --- a/test/api/query.test.cpp +++ b/test/api/query.test.cpp @@ -126,6 +126,22 @@ TEST(Query, QuerySourceFeatures) { EXPECT_EQ(features1.size(), 1u); } +TEST(Query, QuerySourceFeatureStates) { + QueryTest test; + + FeatureState newState; + newState["hover"] = true; + newState["radius"].set<uint64_t>(20); + test.frontend.getRenderer()->setFeatureState("source1", {}, "feature1", newState); + + FeatureState states; + test.frontend.getRenderer()->getFeatureState(states, "source1", {}, "feature1"); + ASSERT_EQ(states.size(), 2u); + ASSERT_EQ(states["hover"], true); + ASSERT_EQ(states["radius"].get<uint64_t>(), 20u); + ASSERT_EQ(newState, states); +} + TEST(Query, QuerySourceFeaturesOptionValidation) { QueryTest test; |