-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
426 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
#include <functional> | ||
|
||
#define CUSTOM_FFF_FUNCTION_TEMPLATE(RETURN, FUNCNAME, ...) \ | ||
std::function<RETURN (__VA_ARGS__)> FUNCNAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,4 @@ | ||
#include "global_fakes.h" | ||
#include <string.h> // for memcpy | ||
|
||
#ifndef TEST_WITH_CALLING_CONVENTIONS | ||
DEFINE_FAKE_VOID_FUNC(voidfunc1, int); | ||
DEFINE_FAKE_VOID_FUNC(voidfunc2, char, char); | ||
DEFINE_FAKE_VOID_FUNC(voidfunc1outparam, char *); | ||
|
||
DEFINE_FAKE_VALUE_FUNC(long, longfunc0); | ||
DEFINE_FAKE_VALUE_FUNC(enum MYBOOL, enumfunc0); | ||
DEFINE_FAKE_VALUE_FUNC(struct MyStruct, structfunc0); | ||
DEFINE_FAKE_VOID_FUNC_VARARG(voidfunc3var, const char *, int, ...); | ||
DEFINE_FAKE_VALUE_FUNC_VARARG(int, valuefunc3var, const char *, int, ...); | ||
#ifndef __cplusplus | ||
DEFINE_FAKE_VALUE_FUNC(int, strlcpy3, char* const, const char* const, const size_t); | ||
#endif /* __cplusplus */ | ||
DEFINE_FAKE_VOID_FUNC(voidfunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
DEFINE_FAKE_VALUE_FUNC(int, valuefunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
#else | ||
DEFINE_FAKE_VOID_FUNC(__cdecl, voidfunc1, int); | ||
DEFINE_FAKE_VOID_FUNC(__cdecl, voidfunc2, char, char); | ||
DEFINE_FAKE_VOID_FUNC(__cdecl, voidfunc1outparam, char *); | ||
|
||
DEFINE_FAKE_VALUE_FUNC(long, __cdecl, longfunc0); | ||
DEFINE_FAKE_VALUE_FUNC(enum MYBOOL, __cdecl, enumfunc0); | ||
DEFINE_FAKE_VALUE_FUNC(struct MyStruct, __cdecl, structfunc0); | ||
DEFINE_FAKE_VOID_FUNC_VARARG(__cdecl, voidfunc3var, const char *, int, ...); | ||
DEFINE_FAKE_VALUE_FUNC_VARARG(int, __cdecl, valuefunc3var, const char *, int, ...); | ||
#ifndef __cplusplus | ||
DEFINE_FAKE_VALUE_FUNC(int, __cdecl, strlcpy3, char* const, const char* const, const size_t); | ||
#endif /* __cplusplus */ | ||
DEFINE_FAKE_VOID_FUNC(__cdecl, voidfunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
DEFINE_FAKE_VALUE_FUNC(int, __cdecl,valuefunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
#endif | ||
#include "global_fakes.include" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,9 @@ | ||
#ifndef GLOBAL_FAKES_H_ | ||
#define GLOBAL_FAKES_H_ | ||
|
||
#include "../fff.h" | ||
#include "string.h" | ||
|
||
|
||
//// Imaginary production code header file /// | ||
enum MYBOOL { FALSE = 899, TRUE }; | ||
struct MyStruct { | ||
int x; | ||
int y; | ||
}; | ||
enum MYBOOL enumfunc(); | ||
struct MyStruct structfunc(); | ||
//// End Imaginary production code header file /// | ||
|
||
#ifndef TEST_WITH_CALLING_CONVENTIONS | ||
DECLARE_FAKE_VOID_FUNC(voidfunc1, int); | ||
DECLARE_FAKE_VOID_FUNC(voidfunc2, char, char); | ||
DECLARE_FAKE_VOID_FUNC(voidfunc1outparam, char *); | ||
DECLARE_FAKE_VALUE_FUNC(long, longfunc0); | ||
DECLARE_FAKE_VALUE_FUNC(enum MYBOOL, enumfunc0); | ||
DECLARE_FAKE_VALUE_FUNC(struct MyStruct, structfunc0); | ||
DECLARE_FAKE_VOID_FUNC_VARARG(voidfunc3var, const char *, int, ...); | ||
DECLARE_FAKE_VALUE_FUNC_VARARG(int, valuefunc3var, const char *, int, ...); | ||
DECLARE_FAKE_VOID_FUNC(voidfunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
DECLARE_FAKE_VALUE_FUNC(int, valuefunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
#else | ||
DECLARE_FAKE_VOID_FUNC(__cdecl, voidfunc1, int); | ||
DECLARE_FAKE_VOID_FUNC(__cdecl, voidfunc2, char, char); | ||
DECLARE_FAKE_VOID_FUNC(__cdecl, voidfunc1outparam, char *); | ||
DECLARE_FAKE_VALUE_FUNC(long, __cdecl, longfunc0); | ||
DECLARE_FAKE_VALUE_FUNC(enum MYBOOL, __cdecl, enumfunc0); | ||
DECLARE_FAKE_VALUE_FUNC(struct MyStruct, __cdecl, structfunc0); | ||
DECLARE_FAKE_VOID_FUNC_VARARG(__cdecl, voidfunc3var, const char *, int, ...); | ||
DECLARE_FAKE_VALUE_FUNC_VARARG(int, __cdecl, valuefunc3var, const char *, int, ...); | ||
DECLARE_FAKE_VOID_FUNC(__cdecl, voidfunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
DECLARE_FAKE_VALUE_FUNC(int, __cdecl, valuefunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifndef __cplusplus | ||
#ifndef TEST_WITH_CALLING_CONVENTIONS | ||
DECLARE_FAKE_VALUE_FUNC(int, strlcpy3, char* const, const char* const, const size_t); | ||
#else | ||
DECLARE_FAKE_VALUE_FUNC(int, __cdecl, strlcpy3, char* const, const char* const, const size_t); | ||
#include "global_fakes.hpp" | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif /* __cplusplus */ | ||
#endif /* GLOBAL_FAKES_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#ifndef GLOBAL_FAKES_H_ | ||
#define GLOBAL_FAKES_H_ | ||
|
||
#include "../fff.h" | ||
#include "string.h" | ||
|
||
|
||
//// Imaginary production code header file /// | ||
enum MYBOOL { FALSE = 899, TRUE }; | ||
struct MyStruct { | ||
int x; | ||
int y; | ||
}; | ||
enum MYBOOL enumfunc(); | ||
struct MyStruct structfunc(); | ||
//// End Imaginary production code header file /// | ||
|
||
#ifndef TEST_WITH_CALLING_CONVENTIONS | ||
DECLARE_FAKE_VOID_FUNC(voidfunc1, int); | ||
DECLARE_FAKE_VOID_FUNC(voidfunc2, char, char); | ||
DECLARE_FAKE_VOID_FUNC(voidfunc1outparam, char *); | ||
DECLARE_FAKE_VALUE_FUNC(long, longfunc0); | ||
DECLARE_FAKE_VALUE_FUNC(enum MYBOOL, enumfunc0); | ||
DECLARE_FAKE_VALUE_FUNC(struct MyStruct, structfunc0); | ||
DECLARE_FAKE_VOID_FUNC_VARARG(voidfunc3var, const char *, int, ...); | ||
DECLARE_FAKE_VALUE_FUNC_VARARG(int, valuefunc3var, const char *, int, ...); | ||
DECLARE_FAKE_VOID_FUNC(voidfunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
DECLARE_FAKE_VALUE_FUNC(int, valuefunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
#else | ||
DECLARE_FAKE_VOID_FUNC(__cdecl, voidfunc1, int); | ||
DECLARE_FAKE_VOID_FUNC(__cdecl, voidfunc2, char, char); | ||
DECLARE_FAKE_VOID_FUNC(__cdecl, voidfunc1outparam, char *); | ||
DECLARE_FAKE_VALUE_FUNC(long, __cdecl, longfunc0); | ||
DECLARE_FAKE_VALUE_FUNC(enum MYBOOL, __cdecl, enumfunc0); | ||
DECLARE_FAKE_VALUE_FUNC(struct MyStruct, __cdecl, structfunc0); | ||
DECLARE_FAKE_VOID_FUNC_VARARG(__cdecl, voidfunc3var, const char *, int, ...); | ||
DECLARE_FAKE_VALUE_FUNC_VARARG(int, __cdecl, valuefunc3var, const char *, int, ...); | ||
DECLARE_FAKE_VOID_FUNC(__cdecl, voidfunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
DECLARE_FAKE_VALUE_FUNC(int, __cdecl, valuefunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
#endif | ||
|
||
#ifndef __cplusplus | ||
#ifndef TEST_WITH_CALLING_CONVENTIONS | ||
DECLARE_FAKE_VALUE_FUNC(int, strlcpy3, char* const, const char* const, const size_t); | ||
#else | ||
DECLARE_FAKE_VALUE_FUNC(int, __cdecl, strlcpy3, char* const, const char* const, const size_t); | ||
#endif | ||
#endif /* __cplusplus */ | ||
#endif /* GLOBAL_FAKES_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef TEST_WITH_CALLING_CONVENTIONS | ||
DEFINE_FAKE_VOID_FUNC(voidfunc1, int); | ||
DEFINE_FAKE_VOID_FUNC(voidfunc2, char, char); | ||
DEFINE_FAKE_VOID_FUNC(voidfunc1outparam, char *); | ||
|
||
DEFINE_FAKE_VALUE_FUNC(long, longfunc0); | ||
DEFINE_FAKE_VALUE_FUNC(enum MYBOOL, enumfunc0); | ||
DEFINE_FAKE_VALUE_FUNC(struct MyStruct, structfunc0); | ||
DEFINE_FAKE_VOID_FUNC_VARARG(voidfunc3var, const char *, int, ...); | ||
DEFINE_FAKE_VALUE_FUNC_VARARG(int, valuefunc3var, const char *, int, ...); | ||
#ifndef __cplusplus | ||
DEFINE_FAKE_VALUE_FUNC(int, strlcpy3, char* const, const char* const, const size_t); | ||
#endif /* __cplusplus */ | ||
DEFINE_FAKE_VOID_FUNC(voidfunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
DEFINE_FAKE_VALUE_FUNC(int, valuefunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
#else | ||
DEFINE_FAKE_VOID_FUNC(__cdecl, voidfunc1, int); | ||
DEFINE_FAKE_VOID_FUNC(__cdecl, voidfunc2, char, char); | ||
DEFINE_FAKE_VOID_FUNC(__cdecl, voidfunc1outparam, char *); | ||
|
||
DEFINE_FAKE_VALUE_FUNC(long, __cdecl, longfunc0); | ||
DEFINE_FAKE_VALUE_FUNC(enum MYBOOL, __cdecl, enumfunc0); | ||
DEFINE_FAKE_VALUE_FUNC(struct MyStruct, __cdecl, structfunc0); | ||
DEFINE_FAKE_VOID_FUNC_VARARG(__cdecl, voidfunc3var, const char *, int, ...); | ||
DEFINE_FAKE_VALUE_FUNC_VARARG(int, __cdecl, valuefunc3var, const char *, int, ...); | ||
#ifndef __cplusplus | ||
DEFINE_FAKE_VALUE_FUNC(int, __cdecl, strlcpy3, char* const, const char* const, const size_t); | ||
#endif /* __cplusplus */ | ||
DEFINE_FAKE_VOID_FUNC(__cdecl, voidfunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
DEFINE_FAKE_VALUE_FUNC(int, __cdecl,valuefunc20, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "global_fakes.hpp" | ||
#include <cstring> // for memcpy | ||
|
||
#include "global_fakes.include" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.