summaryrefslogtreecommitdiff
path: root/deps/fff/test/src/global_fakes.c
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-24 22:47:46 +1100
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-24 22:47:46 +1100
commit7b3afcaf77f96e7d62f6cd1623ead7f17512d79f (patch)
treeb5f82c64e9c06a84e4d095ab4ac48712e860b673 /deps/fff/test/src/global_fakes.c
parentb047be5252aeb981faea077409c1768fda0301d9 (diff)
repo init. partial port of existing code
Diffstat (limited to 'deps/fff/test/src/global_fakes.c')
-rw-r--r--deps/fff/test/src/global_fakes.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/deps/fff/test/src/global_fakes.c b/deps/fff/test/src/global_fakes.c
new file mode 100644
index 0000000..cbd57ab
--- /dev/null
+++ b/deps/fff/test/src/global_fakes.c
@@ -0,0 +1,34 @@
+#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