Macros | Functions | Variables
test_system_mocks.h File Reference
#include <arpa/inet.h>
#include <fcntl.h>
#include <limits.h>
#include <netdb.h>
#include <stdarg.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
Include dependency graph for test_system_mocks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MOCK_SYSCALL(ret, name, ARG_TYPES, ARG_NAMES)
 

Functions

int count_fcntl (int fd, int cmd, unsigned long arg)
 
void count_freeaddrinfo (struct addrinfo *res)
 
 MOCK_SYSCALL (int, accept,(int sockfd, struct sockaddr *addr, socklen_t *addrlen),(sockfd, addr, addrlen))
 
 MOCK_SYSCALL (int, bind,(int sockfd, const struct sockaddr *addr, socklen_t addrlen),(sockfd, addr, addrlen))
 
 MOCK_SYSCALL (int, close,(int socket),(socket))
 
 MOCK_SYSCALL (int, connect,(int sockfd, const struct sockaddr *addr, socklen_t addrlen),(sockfd, addr, addrlen))
 
 MOCK_SYSCALL (int, getaddrinfo,(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res),(node, service, hints, res))
 
 MOCK_SYSCALL (int, getsockname,(int sockfd, struct sockaddr *addr, socklen_t *addrlen),(sockfd, addr, addrlen))
 
 MOCK_SYSCALL (int, listen,(int sockfd, int backlog),(sockfd, backlog))
 
 MOCK_SYSCALL (ssize_t, read,(int fd, void *buf, size_t count),(fd, buf, count))
 
 MOCK_SYSCALL (int, setsockopt,(int sockfd, int level, int optname, const void *optval, socklen_t optlen),(sockfd, level, optname, optval, optlen))
 
 MOCK_SYSCALL (int, select,(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout),(nfds, readfds, writefds, exceptfds, timeout))
 
 MOCK_SYSCALL (int, socket,(int domain, int type, int protocol),(domain, type, protocol))
 
 MOCK_SYSCALL (ssize_t, write,(int fd, const void *buf, size_t count),(fd, buf, count))
 

Variables

int(* fake_fcntl )(int fd, int cmd, unsigned long)
 
void(* fake_freeaddrinfo )(struct addrinfo *res)
 
int fcntl_calls
 
int freeaddrinfo_calls
 

Macro Definition Documentation

◆ MOCK_SYSCALL

#define MOCK_SYSCALL (   ret,
  name,
  ARG_TYPES,
  ARG_NAMES 
)
Value:
extern ret(*fake_##name) ARG_TYPES; \
extern int name##_calls; \
ret count_##name ARG_TYPES;

Definition at line 36 of file test_system_mocks.h.

Function Documentation

◆ count_fcntl()

int count_fcntl ( int  fd,
int  cmd,
unsigned long  arg 
)

Definition at line 63 of file test_system_mocks.c.

◆ count_freeaddrinfo()

void count_freeaddrinfo ( struct addrinfo *  res)

Definition at line 78 of file test_system_mocks.c.

◆ MOCK_SYSCALL() [1/12]

MOCK_SYSCALL ( int  ,
accept  ,
(int sockfd, struct sockaddr *addr, socklen_t *addrlen)  ,
(sockfd, addr, addrlen)   
)

◆ MOCK_SYSCALL() [2/12]

MOCK_SYSCALL ( int  ,
bind  ,
(int sockfd, const struct sockaddr *addr, socklen_t addrlen)  ,
(sockfd, addr, addrlen)   
)

◆ MOCK_SYSCALL() [3/12]

MOCK_SYSCALL ( int  ,
close  ,
(int socket)  ,
(socket)   
)

◆ MOCK_SYSCALL() [4/12]

MOCK_SYSCALL ( int  ,
connect  ,
(int sockfd, const struct sockaddr *addr, socklen_t addrlen)  ,
(sockfd, addr, addrlen)   
)

◆ MOCK_SYSCALL() [5/12]

MOCK_SYSCALL ( int  ,
getaddrinfo  ,
(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res)  ,
(node, service, hints, res)   
)

◆ MOCK_SYSCALL() [6/12]

MOCK_SYSCALL ( int  ,
getsockname  ,
(int sockfd, struct sockaddr *addr, socklen_t *addrlen)  ,
(sockfd, addr, addrlen)   
)

◆ MOCK_SYSCALL() [7/12]

MOCK_SYSCALL ( int  ,
listen  ,
(int sockfd, int backlog)  ,
(sockfd, backlog)   
)

◆ MOCK_SYSCALL() [8/12]

MOCK_SYSCALL ( ssize_t  ,
read  ,
(int fd, void *buf, size_t count)  ,
(fd, buf, count)   
)

◆ MOCK_SYSCALL() [9/12]

MOCK_SYSCALL ( int  ,
setsockopt  ,
(int sockfd, int level, int optname, const void *optval, socklen_t optlen)  ,
(sockfd, level, optname, optval, optlen)   
)

◆ MOCK_SYSCALL() [10/12]

MOCK_SYSCALL ( int  ,
select  ,
(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)  ,
(nfds, readfds, writefds, exceptfds, timeout)   
)

◆ MOCK_SYSCALL() [11/12]

MOCK_SYSCALL ( int  ,
socket  ,
(int domain, int type, int protocol)  ,
(domain, type, protocol)   
)

◆ MOCK_SYSCALL() [12/12]

MOCK_SYSCALL ( ssize_t  ,
write  ,
(int fd, const void *buf, size_t count)  ,
(fd, buf, count)   
)

Variable Documentation

◆ fake_fcntl

int(* fake_fcntl) (int fd, int cmd, unsigned long)

Definition at line 49 of file test_system_mocks.c.

◆ fake_freeaddrinfo

void(* fake_freeaddrinfo) (struct addrinfo *res)

Definition at line 69 of file test_system_mocks.c.

◆ fcntl_calls

int fcntl_calls

Definition at line 62 of file test_system_mocks.c.

◆ freeaddrinfo_calls

int freeaddrinfo_calls

Definition at line 77 of file test_system_mocks.c.



xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix
autogenerated on Mon Jun 1 2020 03:22:44