Commit a55a0eb4 authored by Kyle Nekritz's avatar Kyle Nekritz Committed by Facebook Github Bot

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
parent 14e3d271
...@@ -77,15 +77,15 @@ class MockReadCallback: public AsyncTransportWrapper::ReadCallback { ...@@ -77,15 +77,15 @@ class MockReadCallback: public AsyncTransportWrapper::ReadCallback {
GMOCK_METHOD1_(, noexcept, , readDataAvailable, void(size_t)); GMOCK_METHOD1_(, noexcept, , readDataAvailable, void(size_t));
GMOCK_METHOD0_(, noexcept, , isBufferMovable, bool()); GMOCK_METHOD0_(, noexcept, , isBufferMovable, bool());
GMOCK_METHOD1_(, noexcept, , GMOCK_METHOD1_(, noexcept, ,
readBufferAvailableInternal, void(std::shared_ptr<folly::IOBuf>)); readBufferAvailableInternal,
void(std::unique_ptr<folly::IOBuf>&));
GMOCK_METHOD0_(, noexcept, , readEOF, void()); GMOCK_METHOD0_(, noexcept, , readEOF, void());
GMOCK_METHOD1_(, noexcept, , readErr, GMOCK_METHOD1_(, noexcept, , readErr,
void(const AsyncSocketException&)); void(const AsyncSocketException&));
void readBufferAvailable(std::unique_ptr<folly::IOBuf> readBuf) void readBufferAvailable(std::unique_ptr<folly::IOBuf> readBuf)
noexcept override { noexcept override {
readBufferAvailableInternal( readBufferAvailableInternal(readBuf);
folly::to_shared_ptr(std::move(readBuf)));
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment