diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-04 17:24:33 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-03-18 01:26:22 +0200 |
commit | 01edd4503c5b78a73ac8ce1ee1de8b403d76d4fc (patch) | |
tree | 2d8f558c511b220bd27798ea16cc3d53286ce25b /test/style/style.cpp | |
parent | c561ea5d0564193a4fb7cb84fba5a2d008e30540 (diff) | |
download | qtlocation-mapboxgl-01edd4503c5b78a73ac8ce1ee1de8b403d76d4fc.tar.gz |
[core] Move class handling to Style
Diffstat (limited to 'test/style/style.cpp')
-rw-r--r-- | test/style/style.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/style/style.cpp b/test/style/style.cpp index b4211cb071..6fa6a64b18 100644 --- a/test/style/style.cpp +++ b/test/style/style.cpp @@ -38,13 +38,25 @@ TEST(Style, UnusedSourceActiveViaClassUpdate) { StubFileSource fileSource; Style style { data, fileSource }; - data.addClass("visible"); - style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json"), ""); + EXPECT_TRUE(style.addClass("visible")); + EXPECT_TRUE(style.hasClass("visible")); + style.cascade(); style.recalculate(0); Source *unusedSource = style.getSource("unusedsource"); EXPECT_TRUE(unusedSource); EXPECT_TRUE(unusedSource->isLoaded()); + + // Style classes should be cleared upon new style load. + style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json"), ""); + EXPECT_FALSE(style.hasClass("visible")); + + style.cascade(); + style.recalculate(0); + + unusedSource = style.getSource("unusedsource"); + EXPECT_TRUE(unusedSource); + EXPECT_FALSE(unusedSource->isLoaded()); } |