diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-12-01 16:45:39 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-12-03 15:38:36 +0100 |
commit | dc620f48de48d500298044d8da0ba946b3b0c566 (patch) | |
tree | 60110336706627dea9f18821f5d8fc6e9713210a /test | |
parent | e12cd6aef4858b09c8ca449e779a58d15e878932 (diff) | |
download | qtlocation-mapboxgl-dc620f48de48d500298044d8da0ba946b3b0c566.tar.gz |
[core] Fix std::move() misuse that disables copy elision
Diffstat (limited to 'test')
-rw-r--r-- | test/api/annotations.cpp | 2 | ||||
-rw-r--r-- | test/api/repeated_render.cpp | 4 | ||||
-rw-r--r-- | test/fixtures/mock_file_source.cpp | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp index 5c4e201fd7..d944887f20 100644 --- a/test/api/annotations.cpp +++ b/test/api/annotations.cpp @@ -36,7 +36,7 @@ PremultipliedImage render(Map& map) { map.renderStill([&](std::exception_ptr, PremultipliedImage&& image) { promise.set_value(std::move(image)); }); - return std::move(promise.get_future().get()); + return promise.get_future().get(); } void checkRendering(Map& map, const char * name) { diff --git a/test/api/repeated_render.cpp b/test/api/repeated_render.cpp index d92dcf2909..d3d3926a49 100644 --- a/test/api/repeated_render.cpp +++ b/test/api/repeated_render.cpp @@ -33,7 +33,7 @@ TEST(API, RepeatedRender) { map.renderStill([&promise](std::exception_ptr, PremultipliedImage&& image) { promise.set_value(std::move(image)); }); - auto result = std::move(promise.get_future().get()); + auto result = promise.get_future().get(); ASSERT_EQ(256, result.width); ASSERT_EQ(512, result.height); util::write_file("test/fixtures/api/1.png", encodePNG(result)); @@ -45,7 +45,7 @@ TEST(API, RepeatedRender) { map.renderStill([&promise](std::exception_ptr, PremultipliedImage&& image) { promise.set_value(std::move(image)); }); - auto result = std::move(promise.get_future().get()); + auto result = promise.get_future().get(); ASSERT_EQ(256, result.width); ASSERT_EQ(512, result.height); util::write_file("test/fixtures/api/2.png", encodePNG(result)); diff --git a/test/fixtures/mock_file_source.cpp b/test/fixtures/mock_file_source.cpp index 021ddfa8df..7b4ca82e04 100644 --- a/test/fixtures/mock_file_source.cpp +++ b/test/fixtures/mock_file_source.cpp @@ -67,7 +67,7 @@ void MockFileSource::Impl::replyWithSuccess(Resource resource, Callback callback Response res; try { - res.data = std::make_shared<const std::string>(std::move(util::read_file(resource.url))); + res.data = std::make_shared<const std::string>(util::read_file(resource.url)); } catch (const std::exception& err) { res.error = std::make_unique<Response::Error>(Response::Error::Reason::Other, err.what()); } @@ -103,7 +103,7 @@ void MockFileSource::Impl::replyWithCorruptedData(Resource resource, Callback ca } Response res; - auto data = std::make_shared<std::string>(std::move(util::read_file(resource.url))); + auto data = std::make_shared<std::string>(util::read_file(resource.url)); data->insert(0, "CORRUPTED"); res.data = std::move(data); callback(res); |