diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-01-26 12:19:04 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-10 15:40:20 -0800 |
commit | cdedb66387065680efd318dacb61572c920b81b1 (patch) | |
tree | 3cc2676e15fac4c7b024cd17603c46e341f5a589 /test/fixtures | |
parent | 025375ad0b365a06e0742b92fecc9bc538b5a6e0 (diff) | |
download | qtlocation-mapboxgl-cdedb66387065680efd318dacb61572c920b81b1.tar.gz |
[core] Reimplement existing caching within an offline-capable database schema
Diffstat (limited to 'test/fixtures')
-rw-r--r-- | test/fixtures/offline/0-0-0.vector.pbf (renamed from test/fixtures/stale/0-0-0.vector.pbf) | bin | 482553 -> 482553 bytes | |||
-rw-r--r-- | test/fixtures/offline/expected.png | bin | 0 -> 47842 bytes | |||
-rw-r--r-- | test/fixtures/offline/glyph.pbf (renamed from test/fixtures/stale/glyph.pbf) | bin | 74722 -> 74722 bytes | |||
-rw-r--r-- | test/fixtures/offline/sprite.json (renamed from test/fixtures/stale/sprite.json) | 0 | ||||
-rw-r--r-- | test/fixtures/offline/sprite.png (renamed from test/fixtures/stale/sprite.png) | bin | 3351 -> 3351 bytes | |||
-rw-r--r-- | test/fixtures/offline/streets.json (renamed from test/fixtures/stale/streets.json) | 2 | ||||
-rw-r--r-- | test/fixtures/offline/style.json (renamed from test/fixtures/stale/style_and_glyphs.json) | 10 | ||||
-rw-r--r-- | test/fixtures/stale/stale_style/expected.png | bin | 13447 -> 0 bytes | |||
-rw-r--r-- | test/fixtures/stale/stale_style_and_glyphs/expected.png | bin | 36120 -> 0 bytes | |||
-rw-r--r-- | test/fixtures/stale/stale_style_and_sprite/expected.png | bin | 26859 -> 0 bytes | |||
-rw-r--r-- | test/fixtures/stale/stale_style_and_tilejson/expected.png | bin | 13447 -> 0 bytes | |||
-rw-r--r-- | test/fixtures/stale/style.json | 25 | ||||
-rw-r--r-- | test/fixtures/stale/style_and_sprite.json | 26 | ||||
-rw-r--r-- | test/fixtures/stale/style_and_tilejson.json | 25 | ||||
-rw-r--r-- | test/fixtures/util.cpp | 12 | ||||
-rw-r--r-- | test/fixtures/util.hpp | 4 |
16 files changed, 11 insertions, 93 deletions
diff --git a/test/fixtures/stale/0-0-0.vector.pbf b/test/fixtures/offline/0-0-0.vector.pbf Binary files differindex a0f049ad43..a0f049ad43 100644 --- a/test/fixtures/stale/0-0-0.vector.pbf +++ b/test/fixtures/offline/0-0-0.vector.pbf diff --git a/test/fixtures/offline/expected.png b/test/fixtures/offline/expected.png Binary files differnew file mode 100644 index 0000000000..1b1c2be4c6 --- /dev/null +++ b/test/fixtures/offline/expected.png diff --git a/test/fixtures/stale/glyph.pbf b/test/fixtures/offline/glyph.pbf Binary files differindex 0d160f7898..0d160f7898 100644 --- a/test/fixtures/stale/glyph.pbf +++ b/test/fixtures/offline/glyph.pbf diff --git a/test/fixtures/stale/sprite.json b/test/fixtures/offline/sprite.json index e640365519..e640365519 100644 --- a/test/fixtures/stale/sprite.json +++ b/test/fixtures/offline/sprite.json diff --git a/test/fixtures/stale/sprite.png b/test/fixtures/offline/sprite.png Binary files differindex a02d8eb542..a02d8eb542 100644 --- a/test/fixtures/stale/sprite.png +++ b/test/fixtures/offline/sprite.png diff --git a/test/fixtures/stale/streets.json b/test/fixtures/offline/streets.json index 11cb5c8557..805bd68f45 100644 --- a/test/fixtures/stale/streets.json +++ b/test/fixtures/offline/streets.json @@ -10,5 +10,5 @@ "name": "Streets", "scheme": "xyz", "tilejson": "2.0.0", - "tiles": [ "asset://test/fixtures/stale/{z}-{x}-{y}.vector.pbf" ] + "tiles": [ "http://127.0.0.1:3000/offline/{z}-{x}-{y}.vector.pbf" ] } diff --git a/test/fixtures/stale/style_and_glyphs.json b/test/fixtures/offline/style.json index adf91705fb..c34ee59893 100644 --- a/test/fixtures/stale/style_and_glyphs.json +++ b/test/fixtures/offline/style.json @@ -4,10 +4,11 @@ "sources": { "mapbox": { "type": "vector", - "url": "asset://test/fixtures/stale/streets.json" + "url": "http://127.0.0.1:3000/offline/streets.json" } }, - "glyphs": "http://127.0.0.1:3000/stale/{fontstack}/{range}.pbf", + "glyphs": "http://127.0.0.1:3000/offline/{fontstack}/{range}.pbf", + "sprite": "http://127.0.0.1:3000/offline/sprite", "layers": [{ "id": "background", "type": "background", @@ -20,7 +21,7 @@ "source": "mapbox", "source-layer": "water", "paint": { - "fill-color": "blue" + "fill-pattern": "noise" } }, { "id": "admin", @@ -28,7 +29,8 @@ "source": "mapbox", "source-layer": "admin", "layout": { - "text-field": "Text" + "text-font": ["Helvetica"], + "text-field": "Text" }, "paint": { "text-color": "black", diff --git a/test/fixtures/stale/stale_style/expected.png b/test/fixtures/stale/stale_style/expected.png Binary files differdeleted file mode 100644 index d3c6ef3cd5..0000000000 --- a/test/fixtures/stale/stale_style/expected.png +++ /dev/null diff --git a/test/fixtures/stale/stale_style_and_glyphs/expected.png b/test/fixtures/stale/stale_style_and_glyphs/expected.png Binary files differdeleted file mode 100644 index d8dbda1092..0000000000 --- a/test/fixtures/stale/stale_style_and_glyphs/expected.png +++ /dev/null diff --git a/test/fixtures/stale/stale_style_and_sprite/expected.png b/test/fixtures/stale/stale_style_and_sprite/expected.png Binary files differdeleted file mode 100644 index 171599bf5c..0000000000 --- a/test/fixtures/stale/stale_style_and_sprite/expected.png +++ /dev/null diff --git a/test/fixtures/stale/stale_style_and_tilejson/expected.png b/test/fixtures/stale/stale_style_and_tilejson/expected.png Binary files differdeleted file mode 100644 index d3c6ef3cd5..0000000000 --- a/test/fixtures/stale/stale_style_and_tilejson/expected.png +++ /dev/null diff --git a/test/fixtures/stale/style.json b/test/fixtures/stale/style.json deleted file mode 100644 index ca86503d4f..0000000000 --- a/test/fixtures/stale/style.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": 8, - "name": "Water", - "sources": { - "mapbox": { - "type": "vector", - "url": "asset://test/fixtures/stale/streets.json" - } - }, - "layers": [{ - "id": "background", - "type": "background", - "paint": { - "background-color": "red" - } - }, { - "id": "water", - "type": "fill", - "source": "mapbox", - "source-layer": "water", - "paint": { - "fill-color": "blue" - } - }] -} diff --git a/test/fixtures/stale/style_and_sprite.json b/test/fixtures/stale/style_and_sprite.json deleted file mode 100644 index 61e3214a5e..0000000000 --- a/test/fixtures/stale/style_and_sprite.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "version": 8, - "name": "Water", - "sources": { - "mapbox": { - "type": "vector", - "url": "asset://test/fixtures/stale/streets.json" - } - }, - "sprite": "http://127.0.0.1:3000/stale/sprite", - "layers": [{ - "id": "background", - "type": "background", - "paint": { - "background-color": "red" - } - }, { - "id": "water", - "type": "fill", - "source": "mapbox", - "source-layer": "water", - "paint": { - "fill-pattern": "noise" - } - }] -} diff --git a/test/fixtures/stale/style_and_tilejson.json b/test/fixtures/stale/style_and_tilejson.json deleted file mode 100644 index f2a4fddd0b..0000000000 --- a/test/fixtures/stale/style_and_tilejson.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": 8, - "name": "Water", - "sources": { - "mapbox": { - "type": "vector", - "url": "http://127.0.0.1:3000/stale/streets.json" - } - }, - "layers": [{ - "id": "background", - "type": "background", - "paint": { - "background-color": "red" - } - }, { - "id": "water", - "type": "fill", - "source": "mapbox", - "source-layer": "water", - "paint": { - "fill-color": "blue" - } - }] -} diff --git a/test/fixtures/util.cpp b/test/fixtures/util.cpp index fcb6abed4e..5617b15e8b 100644 --- a/test/fixtures/util.cpp +++ b/test/fixtures/util.cpp @@ -106,20 +106,12 @@ uint64_t crc64(const PremultipliedImage &image) { return crc64(reinterpret_cast<const char*>(image.data.get()), image.size()); } -PremultipliedImage render(Map& map, Milliseconds timeout) { +PremultipliedImage render(Map& map) { std::promise<PremultipliedImage> promise; map.renderStill([&](std::exception_ptr, PremultipliedImage&& image) { promise.set_value(std::move(image)); }); - - // Limit maximum wait time. - auto future = promise.get_future(); - if (future.wait_for(timeout) != std::future_status::ready) { - // Alas, we didn't get the promised future :( - Log::Error(Event::Image, "Failed to generate image within %dms", timeout.count()); - return { 0, 0 }; - } - return future.get(); + return promise.get_future().get(); } void checkImage(const std::string& base, diff --git a/test/fixtures/util.hpp b/test/fixtures/util.hpp index b93d822a83..2e27e5bf0f 100644 --- a/test/fixtures/util.hpp +++ b/test/fixtures/util.hpp @@ -4,7 +4,6 @@ #include <mbgl/util/image.hpp> #include <mbgl/util/chrono.hpp> -#include <chrono> #include <cstdint> #include <gtest/gtest.h> @@ -36,12 +35,13 @@ uint64_t crc64(const char*, size_t); uint64_t crc64(const std::string&); uint64_t crc64(const PremultipliedImage&); -PremultipliedImage render(Map&, Milliseconds timeout = Milliseconds(1000)); +PremultipliedImage render(Map&); void checkImage(const std::string& base, const PremultipliedImage& actual, double imageThreshold = 0, double pixelThreshold = 0); + } } |