diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-09-11 14:16:53 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-09-11 14:56:29 +0300 |
commit | 1a71d0ca03f6bd6c7e3fa14fd9fedc037c0585a4 (patch) | |
tree | dc3a9cbc42de7f9f50b74a212646634161546af1 /test/style | |
parent | dbe0f706c34852cd18637ba28167731e72712de6 (diff) | |
download | qtlocation-mapboxgl-1a71d0ca03f6bd6c7e3fa14fd9fedc037c0585a4.tar.gz |
test
Diffstat (limited to 'test/style')
-rw-r--r-- | test/style/expression/expression.test.cpp | 6 | ||||
-rw-r--r-- | test/style/source.test.cpp | 4 | ||||
-rw-r--r-- | test/style/style.test.cpp | 6 | ||||
-rw-r--r-- | test/style/style_layer.test.cpp | 4 | ||||
-rw-r--r-- | test/style/style_parser.test.cpp | 8 |
5 files changed, 14 insertions, 14 deletions
diff --git a/test/style/expression/expression.test.cpp b/test/style/expression/expression.test.cpp index dd986c98f5..213963ed12 100644 --- a/test/style/expression/expression.test.cpp +++ b/test/style/expression/expression.test.cpp @@ -1,5 +1,5 @@ #include <mbgl/test/util.hpp> -#include <mbgl/util/io.hpp> +#include <mapbox/io.hpp> #include <mbgl/style/conversion_impl.hpp> #include <mbgl/util/rapidjson.hpp> #include <mbgl/style/rapidjson_conversion.hpp> @@ -17,7 +17,7 @@ using namespace mbgl::style; TEST(Expression, IsExpression) { rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtAllocator> spec; - spec.Parse<0>(util::read_file("mapbox-gl-js/src/style-spec/reference/v8.json").c_str()); + spec.Parse<0>(mapbox::base::io::readFile("mapbox-gl-js/src/style-spec/reference/v8.json")->c_str()); ASSERT_FALSE(spec.HasParseError()); ASSERT_TRUE(spec.IsObject() && spec.HasMember("expression_name") && @@ -55,7 +55,7 @@ TEST_P(ExpressionEqualityTest, ExpressionEquality) { std::string error; auto parse = [&](std::string filename, std::string& error_) -> std::unique_ptr<expression::Expression> { rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtAllocator> document; - document.Parse<0>(util::read_file(filename).c_str()); + document.Parse<0>(mapbox::base::io::readFile(filename)->c_str()); assert(!document.HasParseError()); const JSValue* expression = &document; expression::ParsingContext ctx; diff --git a/test/style/source.test.cpp b/test/style/source.test.cpp index ca0e79f46a..0e7b3c4356 100644 --- a/test/style/source.test.cpp +++ b/test/style/source.test.cpp @@ -26,7 +26,7 @@ #include <mbgl/util/run_loop.hpp> #include <mbgl/util/string.hpp> -#include <mbgl/util/io.hpp> +#include <mapbox/io.hpp> #include <mbgl/util/premultiply.hpp> #include <mbgl/util/image.hpp> @@ -729,7 +729,7 @@ TEST(Source, ImageSourceImageUpdate) { test.fileSource->response = [&] (const Resource& resource) { EXPECT_EQ("http://url", resource.url); Response response; - response.data = std::make_unique<std::string>(util::read_file("test/fixtures/image/no_profile.png")); + response.data = std::make_unique<std::string>(*mapbox::base::io::readFile("test/fixtures/image/no_profile.png")); return response; }; test.styleObserver.sourceChanged = [&] (Source&) { diff --git a/test/style/style.test.cpp b/test/style/style.test.cpp index 72f74d3b01..c8d15d20fc 100644 --- a/test/style/style.test.cpp +++ b/test/style/style.test.cpp @@ -7,7 +7,7 @@ #include <mbgl/style/sources/vector_source.hpp> #include <mbgl/style/layer.hpp> #include <mbgl/style/layers/line_layer.hpp> -#include <mbgl/util/io.hpp> +#include <mapbox/io.hpp> #include <mbgl/util/run_loop.hpp> #include <memory> @@ -63,7 +63,7 @@ TEST(Style, DuplicateSource) { StubFileSource fileSource; Style::Impl style { fileSource, 1.0 }; - style.loadJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); + style.loadJSON(*mapbox::base::io::readFile("test/fixtures/resources/style-unused-sources.json")); style.addSource(std::make_unique<VectorSource>("sourceId", "mapbox://mapbox.mapbox-terrain-v2")); @@ -84,7 +84,7 @@ TEST(Style, RemoveSourceInUse) { StubFileSource fileSource; Style::Impl style { fileSource, 1.0 }; - style.loadJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); + style.loadJSON(*mapbox::base::io::readFile("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 d6a926c631..2f41fdf9c4 100644 --- a/test/style/style_layer.test.cpp +++ b/test/style/style_layer.test.cpp @@ -21,7 +21,7 @@ #include <mbgl/test/stub_file_source.hpp> #include <mbgl/util/color.hpp> #include <mbgl/util/run_loop.hpp> -#include <mbgl/util/io.hpp> +#include <mapbox/io.hpp> #include <memory> @@ -284,7 +284,7 @@ TEST(Layer, DuplicateLayer) { // Setup style StubFileSource fileSource; Style::Impl style { fileSource, 1.0 }; - style.loadJSON(util::read_file("test/fixtures/resources/style-unused-sources.json")); + style.loadJSON(*mapbox::base::io::readFile("test/fixtures/resources/style-unused-sources.json")); // Add initial layer style.addLayer(std::make_unique<LineLayer>("line", "unusedsource")); diff --git a/test/style/style_parser.test.cpp b/test/style/style_parser.test.cpp index a18a9bbf57..3236be5caf 100644 --- a/test/style/style_parser.test.cpp +++ b/test/style/style_parser.test.cpp @@ -2,7 +2,7 @@ #include <mbgl/test/fixture_log_observer.hpp> #include <mbgl/style/parser.hpp> -#include <mbgl/util/io.hpp> +#include <mapbox/io.hpp> #include <mbgl/util/enum.hpp> #include <mbgl/util/string.hpp> #include <mbgl/util/tileset.hpp> @@ -26,7 +26,7 @@ TEST_P(StyleParserTest, ParseStyle) { const std::string base = std::string("test/fixtures/style_parser/") + GetParam(); rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtAllocator> infoDoc; - infoDoc.Parse<0>(util::read_file(base + ".info.json").c_str()); + infoDoc.Parse<0>(mapbox::base::io::readFile(base + ".info.json")->c_str()); ASSERT_FALSE(infoDoc.HasParseError()); ASSERT_TRUE(infoDoc.IsObject()); @@ -34,7 +34,7 @@ TEST_P(StyleParserTest, ParseStyle) { Log::setObserver(std::unique_ptr<Log::Observer>(observer)); style::Parser parser; - auto error = parser.parse(util::read_file(base + ".style.json")); + auto error = parser.parse(*mapbox::base::io::readFile(base + ".style.json")); if (error) { Log::Error(Event::ParseStyle, "Failed to parse style: %s", util::toString(error).c_str()); @@ -96,7 +96,7 @@ INSTANTIATE_TEST_CASE_P(StyleParser, StyleParserTest, ::testing::ValuesIn([] { TEST(StyleParser, FontStacks) { style::Parser parser; - parser.parse(util::read_file("test/fixtures/style_parser/font_stacks.json")); + parser.parse(*mapbox::base::io::readFile("test/fixtures/style_parser/font_stacks.json")); std::set<mbgl::FontStack> expected; expected.insert(FontStack({"a"})); expected.insert(FontStack({"a", "b"})); |