Macros | Functions | Variables
test_system_mocks.c File Reference
#include "test_system_mocks.h"
Include dependency graph for test_system_mocks.c:

Go to the source code of this file.

Macros

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

Functions

int __wrap_fcntl (int fd, int cmd,...)
 
void __wrap_freeaddrinfo (struct addrinfo *res)
 
int count_fcntl (int fd, int cmd, unsigned long arg)
 
void count_freeaddrinfo (struct addrinfo *res)
 

Variables

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

Macro Definition Documentation

◆ MOCK_SYSCALL

#define MOCK_SYSCALL (   ret,
  name,
  ARG_TYPES,
  ARG_NAMES 
)
Value:
ret(*fake_##name) ARG_TYPES = 0; \
ret __wrap_##name ARG_TYPES { \
if (fake_##name) { \
return fake_##name ARG_NAMES; \
} else { \
return -1; \
} \
} \
int name##_calls = 0; \
ret count_##name ARG_TYPES { \
name##_calls++; \
return 0; \
}

Definition at line 30 of file test_system_mocks.c.

Function Documentation

◆ __wrap_fcntl()

int __wrap_fcntl ( int  fd,
int  cmd,
  ... 
)

Definition at line 50 of file test_system_mocks.c.

◆ __wrap_freeaddrinfo()

void __wrap_freeaddrinfo ( struct addrinfo *  res)

Definition at line 70 of file test_system_mocks.c.

◆ 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.

Variable Documentation

◆ fake_fcntl

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

Definition at line 49 of file test_system_mocks.c.

◆ fake_freeaddrinfo

void(* fake_freeaddrinfo) (struct addrinfo *res)=0

Definition at line 69 of file test_system_mocks.c.

◆ fcntl_calls

int fcntl_calls = 0

Definition at line 62 of file test_system_mocks.c.

◆ freeaddrinfo_calls

int freeaddrinfo_calls = 0

Definition at line 77 of file test_system_mocks.c.



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