diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-08-25 11:47:34 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-08-25 23:41:52 +0300 |
commit | fe8cbc78d3b01004ba672fe4836cc252ffd52605 (patch) | |
tree | 7ed11089942404d97363029403a33d7837852adb /test | |
parent | f3fc9b2b923113b10d7ec97531865e625c44fa54 (diff) | |
download | qtlocation-mapboxgl-fe8cbc78d3b01004ba672fe4836cc252ffd52605.tar.gz |
[core] Added GeometryTileWorker-owned image correlation ID
Diffstat (limited to 'test')
-rw-r--r-- | test/renderer/image_manager.test.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/test/renderer/image_manager.test.cpp b/test/renderer/image_manager.test.cpp index 5e6da5c005..ebe1bcd72f 100644 --- a/test/renderer/image_manager.test.cpp +++ b/test/renderer/image_manager.test.cpp @@ -108,11 +108,12 @@ TEST(ImageManager, RemoveReleasesBinPackRect) { class StubImageRequestor : public ImageRequestor { public: - void onImagesAvailable(ImageMap images) final { - if (imagesAvailable) imagesAvailable(images); + void onImagesAvailable(ImageMap images, uint64_t imageCorrelationID_) final { + if (imagesAvailable && imageCorrelationID == imageCorrelationID_) imagesAvailable(images); } std::function<void (ImageMap)> imagesAvailable; + uint64_t imageCorrelationID = 0; }; TEST(ImageManager, NotifiesRequestorWhenSpriteIsLoaded) { @@ -124,7 +125,8 @@ TEST(ImageManager, NotifiesRequestorWhenSpriteIsLoaded) { notified = true; }; - imageManager.getImages(requestor, {"one"}); + uint64_t imageCorrelationID = 0; + imageManager.getImages(requestor, std::make_pair(std::set<std::string> {"one"}, imageCorrelationID)); ASSERT_FALSE(notified); imageManager.setLoaded(true); @@ -140,8 +142,9 @@ TEST(ImageManager, NotifiesRequestorImmediatelyIfDependenciesAreSatisfied) { notified = true; }; + uint64_t imageCorrelationID = 0; imageManager.addImage(makeMutable<style::Image::Impl>("one", PremultipliedImage({ 16, 16 }), 2)); - imageManager.getImages(requestor, {"one"}); + imageManager.getImages(requestor, std::make_pair(std::set<std::string> {"one"}, imageCorrelationID)); ASSERT_TRUE(notified); } |