blob: 8d8026985331c0e08ebe291e9093be21f2e20e4b [file] [log] [blame]
Darin Petkov633ac6f2011-07-08 13:56:13 -07001// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SHILL_MOCK_SOCKETS_H_
6#define SHILL_MOCK_SOCKETS_H_
7
Darin Petkovef34f182011-08-26 14:14:40 -07008#include <base/basictypes.h>
Darin Petkov633ac6f2011-07-08 13:56:13 -07009#include <gmock/gmock.h>
10
11#include "shill/sockets.h"
12
13namespace shill {
14
15class MockSockets : public Sockets {
16 public:
Darin Petkovef34f182011-08-26 14:14:40 -070017 MockSockets();
18 virtual ~MockSockets();
19
Darin Petkov633ac6f2011-07-08 13:56:13 -070020 MOCK_METHOD3(Bind,
21 int(int sockfd, const struct sockaddr *addr, socklen_t addrlen));
22 MOCK_METHOD1(Close, int(int fd));
Darin Petkove0a312e2011-07-20 13:45:28 -070023 MOCK_METHOD3(Ioctl, int(int d, int request, void *argp));
Darin Petkov633ac6f2011-07-08 13:56:13 -070024 MOCK_METHOD4(Send,
25 ssize_t(int sockfd, const void *buf, size_t len, int flags));
26 MOCK_METHOD6(SendTo, ssize_t(int sockfd,
27 const void *buf,
28 size_t len,
29 int flags,
30 const struct sockaddr *dest_addr,
31 socklen_t addrlen));
32 MOCK_METHOD3(Socket, int(int domain, int type, int protocol));
Darin Petkovef34f182011-08-26 14:14:40 -070033
34 private:
35 DISALLOW_COPY_AND_ASSIGN(MockSockets);
Darin Petkov633ac6f2011-07-08 13:56:13 -070036};
37
38} // namespace shill
39
40#endif // SHILL_MOCK_SOCKETS_H_