Classes | Macros | Functions | Variables
test_dispatch.cpp File Reference
#include "xmlrpcpp/XmlRpcDispatch.h"
#include "xmlrpcpp/XmlRpcSource.h"
#include "xmlrpcpp/XmlRpcSocket.h"
#include "mock_socket.h"
#include <fcntl.h>
#include <netinet/in.h>
#include <poll.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
#include <errno.h>
#include <iostream>
#include <functional>
#include <gtest/gtest.h>
Include dependency graph for test_dispatch.cpp:

Go to the source code of this file.

Classes

class  MockSource
 
class  MockSourceTest
 

Macros

#define EXPECT_CLOSE_CALLS(n)
 
#define EXPECT_EVENT(event)
 
#define EXPECT_EVENTS(n)
 

Functions

int __wrap_poll (struct pollfd *fds, nfds_t nfds, int timeout)
 
void Expect_poll (std::vector< pollfd > fds, int timeout, int _errno, int ret)
 
int main (int argc, char **argv)
 
int mock_poll (struct pollfd *fds, nfds_t nfds, int timeout)
 
 TEST_F (MockSourceTest, ReadEvent)
 
 TEST_F (MockSourceTest, WriteEvent)
 
 TEST_F (MockSourceTest, NonWriteable)
 
 TEST_F (MockSourceTest, WriteClose)
 
 TEST_F (MockSourceTest, Exception)
 
 TEST_F (MockSourceTest, LargeFd)
 

Variables

int(* fake_poll )(struct pollfd *, nfds_t, int)=0
 
int poll_calls = 0
 
int poll_errno = 0
 
std::vector< pollfd > poll_fds
 
int poll_ret = 0
 
int poll_timeout = 0
 

Macro Definition Documentation

◆ EXPECT_CLOSE_CALLS

#define EXPECT_CLOSE_CALLS (   n)
Value:
do { \
EXPECT_EQ(m.close_calls, n); \
m.close_calls = 0; \
} while (0)

Definition at line 149 of file test_dispatch.cpp.

◆ EXPECT_EVENT

#define EXPECT_EVENT (   event)
Value:
do { \
EXPECT_EQ(m.last_event, event); \
EXPECT_EQ(m.handleEvent_calls, 1); \
m.handleEvent_calls = 0; \
} while (0)

Definition at line 161 of file test_dispatch.cpp.

◆ EXPECT_EVENTS

#define EXPECT_EVENTS (   n)
Value:
do { \
EXPECT_EQ(m.handleEvent_calls, n); \
m.handleEvent_calls = 0; \
} while (0)

Definition at line 155 of file test_dispatch.cpp.

Function Documentation

◆ __wrap_poll()

int __wrap_poll ( struct pollfd *  fds,
nfds_t  nfds,
int  timeout 
)

Definition at line 57 of file test_dispatch.cpp.

◆ Expect_poll()

void Expect_poll ( std::vector< pollfd >  fds,
int  timeout,
int  _errno,
int  ret 
)

Definition at line 110 of file test_dispatch.cpp.

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 357 of file test_dispatch.cpp.

◆ mock_poll()

int mock_poll ( struct pollfd *  fds,
nfds_t  nfds,
int  timeout 
)

Definition at line 72 of file test_dispatch.cpp.

◆ TEST_F() [1/6]

TEST_F ( MockSourceTest  ,
ReadEvent   
)

Definition at line 228 of file test_dispatch.cpp.

◆ TEST_F() [2/6]

TEST_F ( MockSourceTest  ,
WriteEvent   
)

Definition at line 251 of file test_dispatch.cpp.

◆ TEST_F() [3/6]

TEST_F ( MockSourceTest  ,
NonWriteable   
)

Definition at line 276 of file test_dispatch.cpp.

◆ TEST_F() [4/6]

TEST_F ( MockSourceTest  ,
WriteClose   
)

Definition at line 291 of file test_dispatch.cpp.

◆ TEST_F() [5/6]

TEST_F ( MockSourceTest  ,
Exception   
)

Definition at line 317 of file test_dispatch.cpp.

◆ TEST_F() [6/6]

TEST_F ( MockSourceTest  ,
LargeFd   
)

Definition at line 340 of file test_dispatch.cpp.

Variable Documentation

◆ fake_poll

int(* fake_poll) (struct pollfd *, nfds_t, int)=0

Definition at line 55 of file test_dispatch.cpp.

◆ poll_calls

int poll_calls = 0

Definition at line 67 of file test_dispatch.cpp.

◆ poll_errno

int poll_errno = 0

Definition at line 69 of file test_dispatch.cpp.

◆ poll_fds

std::vector<pollfd> poll_fds

Definition at line 71 of file test_dispatch.cpp.

◆ poll_ret

int poll_ret = 0

Definition at line 68 of file test_dispatch.cpp.

◆ poll_timeout

int poll_timeout = 0

Definition at line 70 of file test_dispatch.cpp.



xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas
autogenerated on Mon Feb 28 2022 23:33:22