diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-09-16 00:44:33 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-09-21 12:20:54 +0200 |
commit | f659aa4eda4cf2be743c7ad229ffcc4b62d4be6d (patch) | |
tree | e4af5854833d2eb19cd864d9d4622cc125c037b9 /test/tile/raster_tile.test.cpp | |
parent | 1a684c1f48ef9fdc40ffcaacf1abe33b28370562 (diff) | |
download | qtlocation-mapboxgl-f659aa4eda4cf2be743c7ad229ffcc4b62d4be6d.tar.gz |
[core] make sure tiles are not treated as complete until all worker operations completed
Previously, when we started a worker operation that eventually throws an exception (e.g. due to the tile not being parseable), and then enqueue another worker operation while the first one is processing, we treated the worker as idle once the first operation's error callback fired, even though the second operation was still in progress. Due to our use of coalescing, I was unable to come up with a reliable test since we'd need to reproduce the behavior described above, which is timing dependent.
Diffstat (limited to 'test/tile/raster_tile.test.cpp')
-rw-r--r-- | test/tile/raster_tile.test.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/tile/raster_tile.test.cpp b/test/tile/raster_tile.test.cpp index efdc4767d9..8b2b3dee61 100644 --- a/test/tile/raster_tile.test.cpp +++ b/test/tile/raster_tile.test.cpp @@ -53,7 +53,7 @@ TEST(RasterTile, setError) { TEST(RasterTile, onError) { RasterTileTest test; RasterTile tile(OverscaledTileID(0, 0, 0), test.tileParameters, test.tileset); - tile.onError(std::make_exception_ptr(std::runtime_error("test"))); + tile.onError(std::make_exception_ptr(std::runtime_error("test")), 0); EXPECT_FALSE(tile.isRenderable()); EXPECT_TRUE(tile.isLoaded()); EXPECT_TRUE(tile.isComplete()); @@ -62,7 +62,7 @@ TEST(RasterTile, onError) { TEST(RasterTile, onParsed) { RasterTileTest test; RasterTile tile(OverscaledTileID(0, 0, 0), test.tileParameters, test.tileset); - tile.onParsed(std::make_unique<RasterBucket>(PremultipliedImage{})); + tile.onParsed(std::make_unique<RasterBucket>(PremultipliedImage{}), 0); EXPECT_TRUE(tile.isRenderable()); EXPECT_TRUE(tile.isLoaded()); EXPECT_TRUE(tile.isComplete()); @@ -85,7 +85,7 @@ TEST(RasterTile, onParsed) { TEST(RasterTile, onParsedEmpty) { RasterTileTest test; RasterTile tile(OverscaledTileID(0, 0, 0), test.tileParameters, test.tileset); - tile.onParsed(nullptr); + tile.onParsed(nullptr, 0); EXPECT_FALSE(tile.isRenderable()); EXPECT_TRUE(tile.isLoaded()); EXPECT_TRUE(tile.isComplete()); |