blob: 0a89de2dfc638cc2deb286b33f6391f24ff403be [file] [log] [blame]
Paul Stewartc2350ee2011-10-19 12:28:40 -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_ARES_H_
6#define SHILL_MOCK_ARES_H_
7
8#include <base/basictypes.h>
9#include <gmock/gmock.h>
10
11#include "shill/shill_ares.h"
12
13namespace shill {
14
15class MockAres : public Ares {
16 public:
17 MockAres();
18 virtual ~MockAres();
19
20 MOCK_METHOD1(Destroy, void(ares_channel channel));
21 MOCK_METHOD5(GetHostByName, void(ares_channel channel,
22 const char *hostname,
23 int family,
24 ares_host_callback callback,
25 void *arg));
26 MOCK_METHOD3(GetSock, int(ares_channel channel,
27 ares_socket_t *socks,
28 int numsocks));
29 MOCK_METHOD3(InitOptions, int(ares_channel *channelptr,
30 struct ares_options *options,
31 int optmask));
32 MOCK_METHOD3(ProcessFd, void(ares_channel channel,
33 ares_socket_t read_fd,
34 ares_socket_t write_fd));
35 MOCK_METHOD2(SetLocalDev, void(ares_channel channel,
36 const char *local_dev_name));
37 MOCK_METHOD3(Timeout, struct timeval *(ares_channel channel,
38 struct timeval *maxtv,
39 struct timeval *tv));
40
41 private:
42 DISALLOW_COPY_AND_ASSIGN(MockAres);
43};
44
45} // namespace shill
46
47#endif // SHILL_MOCK_ARES_H_