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/vector_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/vector_tile.test.cpp')
-rw-r--r-- | test/tile/vector_tile.test.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/tile/vector_tile.test.cpp b/test/tile/vector_tile.test.cpp index 45eab21576..7e8b659b7a 100644 --- a/test/tile/vector_tile.test.cpp +++ b/test/tile/vector_tile.test.cpp @@ -59,7 +59,8 @@ TEST(VectorTile, setError) { TEST(VectorTile, onError) { VectorTileTest test; VectorTile tile(OverscaledTileID(0, 0, 0), "source", 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()); @@ -86,16 +87,14 @@ TEST(VectorTile, Issue7615) { nullptr, {}, {}, - 0 - }); + }, 0); // Subsequent onLayout should not cause the existing symbol bucket to be discarded. tile.onLayout(GeometryTile::LayoutResult { std::unordered_map<std::string, std::shared_ptr<Bucket>>(), nullptr, nullptr, - 0 - }); + }, 0); EXPECT_EQ(symbolBucket.get(), tile.getBucket(*symbolLayer.baseImpl)); } |