From c78afbd2f3284d9b4acd96141667c15dbecc7f84 Mon Sep 17 00:00:00 2001 From: Subodh Iyengar Date: Wed, 8 Jul 2015 22:44:59 -0700 Subject: [PATCH] Add mocks for isBufferMovable Summary: Add mocks for the new isBufferMovable methods. Reviewed By: @yfeldblum Differential Revision: D2222642 --- folly/io/async/test/MockAsyncTransport.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/folly/io/async/test/MockAsyncTransport.h b/folly/io/async/test/MockAsyncTransport.h index e4f559c5..84ce7b93 100644 --- a/folly/io/async/test/MockAsyncTransport.h +++ b/folly/io/async/test/MockAsyncTransport.h @@ -17,6 +17,7 @@ #include +#include #include namespace folly { namespace test { @@ -75,9 +76,18 @@ class MockReadCallback: public AsyncTransportWrapper::ReadCallback { public: MOCK_METHOD2(getReadBuffer, void(void**, size_t*)); GMOCK_METHOD1_(, noexcept, , readDataAvailable, void(size_t)); + GMOCK_METHOD0_(, noexcept, , isBufferMovable, bool()); + GMOCK_METHOD1_(, noexcept, , + readBufferAvailableInternal, void(std::shared_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))); + } }; class MockWriteCallback: public AsyncTransportWrapper::WriteCallback { -- 2.34.1