diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-20 17:12:58 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-22 08:04:39 -0700 |
commit | 40e47556214e999c952c1e88e026d673cdd96c72 (patch) | |
tree | e8d15795cbecc07c94908a8ebed31b73def64614 /test/style | |
parent | 1520a56813f82bbe875774fdc2b3df26392278d6 (diff) | |
download | qtlocation-mapboxgl-40e47556214e999c952c1e88e026d673cdd96c72.tar.gz |
[core] Move setStyleJSON/URL to Style; add Map::setStyle
Diffstat (limited to 'test/style')
-rw-r--r-- | test/style/style.test.cpp | 16 | ||||
-rw-r--r-- | test/style/style_layer.test.cpp | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/test/style/style.test.cpp b/test/style/style.test.cpp index 701e4a6434..ab58eb1024 100644 --- a/test/style/style.test.cpp +++ b/test/style/style.test.cpp @@ -23,27 +23,27 @@ TEST(Style, Properties) { StubFileSource fileSource; Style::Impl style { threadPool, fileSource, 1.0 }; - style.setJSON(R"STYLE({"name": "Test"})STYLE"); + style.loadJSON(R"STYLE({"name": "Test"})STYLE"); ASSERT_EQ("Test", style.getName()); - style.setJSON(R"STYLE({"center": [10, 20]})STYLE"); + style.loadJSON(R"STYLE({"center": [10, 20]})STYLE"); ASSERT_EQ("", style.getName()); ASSERT_EQ((LatLng{20, 10}), style.getDefaultLatLng()); - style.setJSON(R"STYLE({"bearing": 24})STYLE"); + style.loadJSON(R"STYLE({"bearing": 24})STYLE"); ASSERT_EQ("", style.getName()); ASSERT_EQ((LatLng{0, 0}), style.getDefaultLatLng()); ASSERT_EQ(24, style.getDefaultBearing()); - style.setJSON(R"STYLE({"zoom": 13.3})STYLE"); + style.loadJSON(R"STYLE({"zoom": 13.3})STYLE"); ASSERT_EQ("", style.getName()); ASSERT_EQ(13.3, style.getDefaultZoom()); - style.setJSON(R"STYLE({"pitch": 60})STYLE"); + style.loadJSON(R"STYLE({"pitch": 60})STYLE"); ASSERT_EQ("", style.getName()); ASSERT_EQ(60, style.getDefaultPitch()); - style.setJSON(R"STYLE({"name": 23, "center": {}, "bearing": "north", "zoom": null, "pitch": "wide"})STYLE"); + style.loadJSON(R"STYLE({"name": 23, "center": {}, "bearing": "north", "zoom": null, "pitch": "wide"})STYLE"); ASSERT_EQ("", style.getName()); ASSERT_EQ((LatLng{0, 0}), style.getDefaultLatLng()); ASSERT_EQ(0, style.getDefaultBearing()); @@ -58,7 +58,7 @@ TEST(Style, DuplicateSource) { StubFileSource fileSource; Style::Impl style { threadPool, fileSource, 1.0 }; - style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); + style.loadJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); style.addSource(std::make_unique<VectorSource>("sourceId", "mapbox://mapbox.mapbox-terrain-v2")); @@ -80,7 +80,7 @@ TEST(Style, RemoveSourceInUse) { StubFileSource fileSource; Style::Impl style { threadPool, fileSource, 1.0 }; - style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); + style.loadJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); style.addSource(std::make_unique<VectorSource>("sourceId", "mapbox://mapbox.mapbox-terrain-v2")); style.addLayer(std::make_unique<LineLayer>("layerId", "sourceId")); diff --git a/test/style/style_layer.test.cpp b/test/style/style_layer.test.cpp index 0e7957c490..77acca2868 100644 --- a/test/style/style_layer.test.cpp +++ b/test/style/style_layer.test.cpp @@ -276,7 +276,7 @@ TEST(Layer, DuplicateLayer) { ThreadPool threadPool{ 1 }; StubFileSource fileSource; Style::Impl style { threadPool, fileSource, 1.0 }; - style.setJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); + style.loadJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); // Add initial layer style.addLayer(std::make_unique<LineLayer>("line", "unusedsource")); |