From: Kyle Nekritz Date: Thu, 21 Sep 2017 20:28:03 +0000 (-0700) Subject: Use unique_ptr rather than shared_ptr in MockReadCallback. X-Git-Tag: v2017.09.25.00~4 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a55a0eb4dbc89e31a34ad5341cd7d4673d5ebe3c;p=folly.git Use unique_ptr rather than shared_ptr in MockReadCallback. Summary: This is more convenient to use (for example with an IOBufEqual matcher). Reviewed By: yfeldblum Differential Revision: D5882029 fbshipit-source-id: 6aa12f80479f40bcc2af64dc270fb0a9382983b5 --- diff --git a/folly/io/async/test/MockAsyncTransport.h b/folly/io/async/test/MockAsyncTransport.h index 16bec39c..8690b183 100644 --- a/folly/io/async/test/MockAsyncTransport.h +++ b/folly/io/async/test/MockAsyncTransport.h @@ -77,15 +77,15 @@ class MockReadCallback: public AsyncTransportWrapper::ReadCallback { GMOCK_METHOD1_(, noexcept, , readDataAvailable, void(size_t)); GMOCK_METHOD0_(, noexcept, , isBufferMovable, bool()); GMOCK_METHOD1_(, noexcept, , - readBufferAvailableInternal, void(std::shared_ptr)); + readBufferAvailableInternal, + void(std::unique_ptr&)); GMOCK_METHOD0_(, noexcept, , readEOF, void()); GMOCK_METHOD1_(, noexcept, , readErr, void(const AsyncSocketException&)); void readBufferAvailable(std::unique_ptr readBuf) noexcept override { - readBufferAvailableInternal( - folly::to_shared_ptr(std::move(readBuf))); + readBufferAvailableInternal(readBuf); } };