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 };
s
XmlRpcServer s
Definition: HelloServer.cpp:11
MockSocketTest::Expect_nbWrite
void Expect_nbWrite(int fd, const std::string &s, int bytes, bool ret)
Definition: mock_socket.cpp:238
MockSocketTest::Expect_nbRead
void Expect_nbRead(int fd, const std::string &s, bool eof, bool ret)
Definition: mock_socket.cpp:213
MockSocketTest::Expect_socket
void Expect_socket(int ret)
Definition: mock_socket.cpp:82
MockSocketTest::Expect_getError
void Expect_getError(int ret)
Definition: mock_socket.cpp:257
MockSocketTest::Expect_setReuseAddr
void Expect_setReuseAddr(int fd, bool ret)
Definition: mock_socket.cpp:114
MockSocketTest::Expect_listen
void Expect_listen(int fd, int backlog, bool ret)
Definition: mock_socket.cpp:151
MockSocketTest::Expect_setNonBlocking
void Expect_setNonBlocking(int fd, bool ret)
Definition: mock_socket.cpp:97
MockSocketTest::Expect_connect
void Expect_connect(int fd, const std::string &host, int port, bool ret)
Definition: mock_socket.cpp:188
MockSocketTest::SetUp
void SetUp()
Definition: mock_socket.cpp:279
MockSocketTest::Expect_accept
void Expect_accept(int fd, int ret)
Definition: mock_socket.cpp:168
MockSocketTest::Expect_bind
void Expect_bind(int fd, int port, bool ret)
Definition: mock_socket.cpp:132
MockSocketTest
Definition: mock_socket.h:28
MockSocketTest::Expect_get_port
void Expect_get_port(int socket, int ret)
Definition: mock_socket.cpp:272
MockSocketTest::CheckCalls
void CheckCalls()
Definition: mock_socket.cpp:298
MockSocketTest::Expect_close
void Expect_close(int fd)
Definition: mock_socket.cpp:70
MockSocketTest::TearDown
void TearDown()
Definition: mock_socket.cpp:294


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas , Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:32