FAKE_CODE variables declared in header, defined in c-file

This commit is contained in:
Johan Wikman
2016-09-12 15:09:05 +03:00
parent 0b4320fb1d
commit d8bff00fa5
2 changed files with 15 additions and 6 deletions

View File

@ -92,6 +92,15 @@
#include <sys/un.h> #include <sys/un.h>
#include <maxscale/alloc.h> #include <maxscale/alloc.h>
#if defined(FAKE_CODE)
unsigned char dcb_fake_write_errno[10240];
__int32_t dcb_fake_write_ev[10240];
bool fail_next_backend_fd;
bool fail_next_client_fd;
int fail_next_accept;
int fail_accept_errno;
#endif /* FAKE_CODE */
/* The list of all DCBs */ /* The list of all DCBs */
static LIST_CONFIG DCBlist = static LIST_CONFIG DCBlist =
{LIST_TYPE_RECYCLABLE, sizeof(DCB), SPINLOCK_INIT}; {LIST_TYPE_RECYCLABLE, sizeof(DCB), SPINLOCK_INIT};

View File

@ -293,12 +293,12 @@ typedef enum
} DCB_USAGE; } DCB_USAGE;
#if defined(FAKE_CODE) #if defined(FAKE_CODE)
unsigned char dcb_fake_write_errno[10240]; extern unsigned char dcb_fake_write_errno[10240];
__int32_t dcb_fake_write_ev[10240]; extern __int32_t dcb_fake_write_ev[10240];
bool fail_next_backend_fd; extern bool fail_next_backend_fd;
bool fail_next_client_fd; extern bool fail_next_client_fd;
int fail_next_accept; extern int fail_next_accept;
int fail_accept_errno; extern int fail_accept_errno;
#endif /* FAKE_CODE */ #endif /* FAKE_CODE */
/* A few useful macros */ /* A few useful macros */