diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-02-22 15:47:37 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-02-22 22:28:29 +0100 |
commit | 9ffbfdc7b94ec60bc0a5253a56121b7bf707a23f (patch) | |
tree | 225f1e487f6cebcea79ad9fbec65174670c208e7 /test/tile | |
parent | 0562bcb418d8e1af7e181264bb763a071854f7e1 (diff) | |
download | qtlocation-mapboxgl-9ffbfdc7b94ec60bc0a5253a56121b7bf707a23f.tar.gz |
[core] don't treat empty raster tiles as "DataAvailability::All"
Diffstat (limited to 'test/tile')
-rw-r--r-- | test/tile/raster_tile.test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/tile/raster_tile.test.cpp b/test/tile/raster_tile.test.cpp index 0d599ceae0..5cfc274be0 100644 --- a/test/tile/raster_tile.test.cpp +++ b/test/tile/raster_tile.test.cpp @@ -9,6 +9,7 @@ #include <mbgl/style/style.hpp> #include <mbgl/style/update_parameters.hpp> #include <mbgl/annotation/annotation_manager.hpp> +#include <mbgl/renderer/raster_bucket.hpp> using namespace mbgl; @@ -45,5 +46,19 @@ TEST(RasterTile, onError) { RasterTileTest test; RasterTile tile(OverscaledTileID(0, 0, 0), test.updateParameters, test.tileset); tile.onError(std::make_exception_ptr(std::runtime_error("test"))); + EXPECT_FALSE(tile.isRenderable()); +} + +TEST(RasterTile, onParsed) { + RasterTileTest test; + RasterTile tile(OverscaledTileID(0, 0, 0), test.updateParameters, test.tileset); + tile.onParsed(std::make_unique<RasterBucket>(UnassociatedImage{})); EXPECT_TRUE(tile.isRenderable()); } + +TEST(RasterTile, onParsedEmpty) { + RasterTileTest test; + RasterTile tile(OverscaledTileID(0, 0, 0), test.updateParameters, test.tileset); + tile.onParsed(nullptr); + EXPECT_FALSE(tile.isRenderable()); +} |