mock_socket.h
Go to the documentation of this file.
1 /*
2  * Unit tests for XmlRpc++
3  *
4  * Copyright (C) 2017, Zoox Inc
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Author: Austin Hendrix <austin@zoox.com>
21  *
22  */
23 
24 #pragma once
25 #include <string>
26 #include <gtest/gtest.h>
27 
28 class MockSocketTest : public ::testing::Test {
29 protected:
30  void SetUp();
31 
32  void CheckCalls();
33  void TearDown();
34 
35  void Expect_socket(int ret);
36  void Expect_close(int fd);
37  void Expect_setNonBlocking(int fd, bool ret);
38  void Expect_setReuseAddr(int fd, bool ret);
39  void Expect_bind(int fd, int port, bool ret);
40  void Expect_listen(int fd, int backlog, bool ret);
41  void Expect_accept(int fd, int ret);
42  void Expect_connect(int fd, const std::string& host, int port, bool ret);
43  void Expect_nbRead(int fd, const std::string& s, bool eof, bool ret);
44  void Expect_nbWrite(int fd, const std::string& s, int bytes, bool ret);
45  void Expect_getError(int ret);
46  void Expect_get_port(int socket, int ret);
47 };
void Expect_listen(int fd, int backlog, bool ret)
void Expect_setNonBlocking(int fd, bool ret)
void Expect_setReuseAddr(int fd, bool ret)
XmlRpcServer s
Definition: HelloServer.cpp:11
void Expect_bind(int fd, int port, bool ret)
void Expect_close(int fd)
Definition: mock_socket.cpp:74
void Expect_connect(int fd, const std::string &host, int port, bool ret)
void Expect_getError(int ret)
void Expect_get_port(int socket, int ret)
void Expect_nbRead(int fd, const std::string &s, bool eof, bool ret)
void Expect_socket(int ret)
Definition: mock_socket.cpp:86
void Expect_accept(int fd, int ret)
void Expect_nbWrite(int fd, const std::string &s, int bytes, bool ret)


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix
autogenerated on Wed Oct 16 2019 03:27:40