From: Subodh Iyengar Date: Thu, 9 Jul 2015 05:44:59 +0000 (-0700) Subject: Add mocks for isBufferMovable X-Git-Tag: v0.50.0~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c78afbd2f3284d9b4acd96141667c15dbecc7f84;p=folly.git Add mocks for isBufferMovable Summary: Add mocks for the new isBufferMovable methods. Reviewed By: @yfeldblum Differential Revision: D2222642 --- 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 {