apply clang-tidy modernize-use-override
[folly.git] / folly / io / async / test / MockAsyncUDPSocket.h
1 /*
2  * Copyright 2017 Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17
18 #include <folly/io/async/AsyncUDPSocket.h>
19 #include <folly/portability/GMock.h>
20
21 namespace folly { namespace test {
22
23 struct MockAsyncUDPSocket : public AsyncUDPSocket {
24   explicit MockAsyncUDPSocket(EventBase* evb) : AsyncUDPSocket(evb) {}
25   ~MockAsyncUDPSocket() override {}
26
27   MOCK_CONST_METHOD0(address, const SocketAddress&());
28   MOCK_METHOD1(bind, void(const SocketAddress&));
29   MOCK_METHOD2(setFD, void(int, AsyncUDPSocket::FDOwnership));
30   MOCK_METHOD2(
31    write,
32    ssize_t(const SocketAddress&, const std::unique_ptr<IOBuf>&));
33   MOCK_METHOD3(
34    writev,
35    ssize_t(const SocketAddress&, const struct iovec*, size_t));
36   MOCK_METHOD1(resumeRead, void(ReadCallback*));
37   MOCK_METHOD0(pauseRead, void());
38   MOCK_METHOD0(close, void());
39   MOCK_CONST_METHOD0(getFD, int());
40   MOCK_METHOD1(setReusePort, void(bool));
41   MOCK_METHOD1(setReuseAddr, void(bool));
42 };
43
44 }}