From a55a0eb4dbc89e31a34ad5341cd7d4673d5ebe3c Mon Sep 17 00:00:00 2001 From: Kyle Nekritz Date: Thu, 21 Sep 2017 13:28:03 -0700 Subject: [PATCH] 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 --- folly/io/async/test/MockAsyncTransport.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } }; -- 2.34.1