Go to the documentation of this file.
24 #define xmlrpcpp_EXPORTS // we are mocking XmlRpcSocket, define the symbol in order to export XmlRpcSocket class
26 #undef xmlrpcpp_EXPORTS
36 #include <gtest/gtest.h>
52 std::snprintf(err,
sizeof(err),
"%s", strerror(error));
53 return std::string(err);
56 #define EXPECT_PROLOGUE(name) \
57 EXPECT_EQ(0, name##_calls) \
58 << "Test error; cannont expect " #name " more than once";
189 const std::string& host,
214 const std::string&
s,
239 const std::string&
s,
std::deque< int > close_calls
static int getError()
Returns last errno.
static int socket()
Creates a stream (TCP) socket. Returns -1 on failure.
void Expect_nbWrite(int fd, const std::string &s, int bytes, bool ret)
static void close(int socket)
Closes a socket.
#define EXPECT_PROLOGUE(name)
void Expect_nbRead(int fd, const std::string &s, bool eof, bool ret)
void Expect_socket(int ret)
void Expect_getError(int ret)
void Expect_setReuseAddr(int fd, bool ret)
void Expect_listen(int fd, int backlog, bool ret)
static bool setNonBlocking(int socket)
Sets a stream (TCP) socket to perform non-blocking IO. Returns false on failure.
void Expect_setNonBlocking(int fd, bool ret)
static int get_port(int socket)
void Expect_connect(int fd, const std::string &host, int port, bool ret)
static int accept(int socket)
Accept a client connection request.
void Expect_accept(int fd, int ret)
void Expect_bind(int fd, int port, bool ret)
static bool setReuseAddr(int socket)
static bool nbWrite(int socket, const std::string &s, int *bytesSoFar)
Write text to the specified socket. Returns false on error.
void Expect_get_port(int socket, int ret)
static std::string getErrorMsg()
Returns message corresponding to last error.
static bool nbRead(int socket, std::string &s, bool *eof)
Read text from the specified socket. Returns false on error.
static bool bind(int socket, int port)
Bind to a specified port.
void Expect_close(int fd)
static bool listen(int socket, int backlog)
Set socket in listen mode.
static bool connect(int socket, const std::string &host, int port)
Connect a socket to a server (from a client)
xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:32