diff options
author | Inkyun Kil <inkyun.kil@samsung.com> | 2022-08-29 18:54:10 +0900 |
---|---|---|
committer | Inkyun Kil <inkyun.kil@samsung.com> | 2022-08-30 13:24:57 +0900 |
commit | c6a891878868846c9e8bea1ea30ae6b5eb62c96d (patch) | |
tree | f93b75b804943c2fac731361ef039726ae558705 | |
parent | 56c45b132de953115eef7adef514e69469fddf82 (diff) | |
download | widget-service-c6a891878868846c9e8bea1ea30ae6b5eb62c96d.tar.gz widget-service-c6a891878868846c9e8bea1ea30ae6b5eb62c96d.tar.bz2 widget-service-c6a891878868846c9e8bea1ea30ae6b5eb62c96d.zip |
Use Gmock instead of fff
Change-Id: I2b521770ebae62fb7d7a8b463ef819ea843d8cf9
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
29 files changed, 1191 insertions, 7169 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ea780b..bcd04ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ FOREACH(flag ${pkg_extra_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -Winline -g") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -g") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") diff --git a/mock/aul_mock.h b/mock/aul_mock.h deleted file mode 100644 index ae33d14..0000000 --- a/mock/aul_mock.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MOCK_AUL_WIDGET_H_ -#define MOCK_AUL_WIDGET_H_ - -#include "mock.h" -#include <bundle.h> - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *aul_app_com_result_e; -typedef void *aul_app_com_permission_h; -typedef void *aul_app_com_connection_h; - -typedef int (*app_com_cb)(const char *endpoint, aul_app_com_result_e result, bundle *envelope, void *user_data); -typedef void (*aul_widget_instance_foreach_cb)(const char *instance_id, void *data); - -DECLARE_FAKE_VALUE_FUNC(int, aul_terminate_pid, int); -DECLARE_FAKE_VALUE_FUNC(int, aul_widget_service_set_disable, - const char *, bool); -DECLARE_FAKE_VALUE_FUNC(int, aul_app_com_create, const char *, aul_app_com_permission_h, - app_com_cb, void *, aul_app_com_connection_h *); -DECLARE_FAKE_VALUE_FUNC(int, aul_app_com_leave, aul_app_com_connection_h); -DECLARE_FAKE_VALUE_FUNC(int, aul_widget_instance_update, const char *, - const char *, bundle *); -DECLARE_FAKE_VALUE_FUNC(int, aul_widget_instance_foreach, const char *, - aul_widget_instance_foreach_cb, void *); -DECLARE_FAKE_VALUE_FUNC(int, aul_widget_instance_get_content, const char *, - const char *, char **); -DECLARE_FAKE_VALUE_FUNC(int, aul_widget_instance_count, const char *); -DECLARE_FAKE_VALUE_FUNC(int, aul_launch_app_async, const char *, bundle *); -DECLARE_FAKE_VALUE_FUNC(int, aul_debug_info_init); -DECLARE_FAKE_VALUE_FUNC(int, aul_debug_info_set, bundle *, bundle *); - - -#ifdef __cplusplus -} -#endif -#endif /* MOCK_AUL_WIDGET_H_ */
\ No newline at end of file diff --git a/mock/cynara_mock.h b/mock/cynara_mock.h deleted file mode 100644 index 1e493b1..0000000 --- a/mock/cynara_mock.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MOCK_CYNARA_H_ -#define MOCK_CYNARA_H_ - -#include "mock.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void cynara; -typedef void* cynara_configuration; - -#define CYNARA_API_ACCESS_ALLOWED 2 - -#define CYNARA_API_SUCCESS 0 - -DECLARE_FAKE_VALUE_FUNC(int, cynara_initialize, cynara**, - const cynara_configuration*); -DECLARE_FAKE_VALUE_FUNC(int, cynara_finish, cynara*); -DECLARE_FAKE_VALUE_FUNC(int, cynara_check, cynara*, - const char*, const char*, const char*, const char*); - -#ifdef __cplusplus -} -#endif -#endif /* MOCK_CYNARA_CLIENT_H_ */
\ No newline at end of file diff --git a/mock/db_mock.cc b/mock/db_mock.cc deleted file mode 100644 index 9420e6c..0000000 --- a/mock/db_mock.cc +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <stdio.h> -#include <sqlite3.h> -#include <string.h> -#include "db_mock.h" - -#define CREATE_WIDGET_TABLE " \ -PRAGMA user_version = 50; \ -PRAGMA journal_mode = PERSIST; \ -PRAGMA foreign_keys = ON; \ -BEGIN EXCLUSIVE TRANSACTION; \ -CREATE TABLE widget_class ( \ - classid TEXT NOT NULL, \ - update_period INTEGER DEFAULT 0, \ - setup_appid TEXT, \ - appid TEXT NOT NULL, \ - pkgid TEXT NOT NULL, \ - nodisplay INTEGER DEFAULT 0, \ - max_instance INTEGER DEFAULT 0, \ - prime INTEGER DEFAULT 0, \ - is_disable INTEGER DEFAULT 0, \ - PRIMARY KEY(classid) \ -); \ -CREATE TABLE support_size ( \ - classid TEXT NOT NULL, \ - preview TEXT NOT NULL, \ - frame INTEGER DEFAULT 0, \ - width INTEGER NOT NULL, \ - height INTEGER NOT NULL, \ - FOREIGN KEY(classid) REFERENCES widget_class (classid) ON DELETE CASCADE \ -); \ -CREATE TABLE label ( \ - classid TEXT NOT NULL, \ - locale TEXT DEFAULT 'No Locale', \ - label TEXT NOT NULL, \ - FOREIGN KEY(classid) REFERENCES widget_class (classid) ON DELETE CASCADE \ -); \ -CREATE TABLE icon ( \ - classid TEXT NOT NULL, \ - locale TEXT DEFAULT 'No Locale', \ - icon TEXT NOT NULL, \ - FOREIGN KEY(classid) REFERENCES widget_class (classid) ON DELETE CASCADE \ -); \ -COMMIT TRANSACTION; " - -int insert_widget_class(sqlite3 *db); -int insert_support_size(sqlite3 *db); -int insert_label(sqlite3 *db); - -const char *get_db_path() { - const char *path = ".widget_test.db"; - return path; -} - -int create_db() { - int ret; - sqlite3 *db; - - ret = sqlite3_open_v2(get_db_path(), &db, - SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE, - nullptr); - if (ret != SQLITE_OK) { - printf("error 1\n"); - goto out; - } - - ret = sqlite3_exec(db, CREATE_WIDGET_TABLE, nullptr, nullptr, nullptr); - if (ret != SQLITE_OK) { - printf("error 2\n"); - goto out; - } - -out: - if (db) - sqlite3_close_v2(db); - - return ret; -} - -int insert_widget_class(sqlite3 *db) { - int ret; - char *query = nullptr; - sqlite3_stmt *stmt = nullptr; - - query = sqlite3_mprintf("INSERT OR REPLACE INTO widget_class " - "(classid, setup_appid, appid, pkgid, prime, nodisplay, max_instance) " - "VALUES (%Q, %Q, %Q, %Q, %d, %d, %d)", - "org.tizen.test_widget", "org.tizen.setup_appid", "org.tizen.test_appid", - "org.tizen.test_pkgid", 1, 2, 3); - - if (query == nullptr) { - printf("widget class error 1\n"); - return SQLITE_ERROR; - } - - ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr); - if (ret != SQLITE_OK) { - printf("widget class error 2\n"); - goto out; - } - - - ret = sqlite3_step(stmt); - if (ret != SQLITE_DONE) { - printf("widget class error 3\n"); - goto out; - } - -out: - sqlite3_free(query); - - if (stmt) - sqlite3_finalize(stmt); - - return ret; -} - -int insert_support_size(sqlite3 *db) { - int ret; - char *query = nullptr; - sqlite3_stmt *stmt = nullptr; - - query = sqlite3_mprintf("INSERT OR REPLACE INTO support_size " - "(classid, preview, width, height) " - "VALUES (%Q, %Q, %d, %d)", - "org.tizen.test_widget", "/unittest/preview.png", 4, 2); - - if (query == nullptr) { - printf("support size error 1\n"); - return SQLITE_ERROR; - } - - ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr); - if (ret != SQLITE_OK) { - printf("support size error 2\n"); - goto out; - } - - - ret = sqlite3_step(stmt); - if (ret != SQLITE_DONE) { - printf("support size error 3\n"); - goto out; - } - -out: - sqlite3_free(query); - - if (stmt) - sqlite3_finalize(stmt); - - return ret; -} - -int insert_label(sqlite3 *db) { - int ret; - char *query = nullptr; - sqlite3_stmt *stmt = nullptr; - - query = sqlite3_mprintf("INSERT OR REPLACE INTO label " - "(classid, locale, label) " - "VALUES (%Q, %Q, %Q)", - "org.tizen.test_widget", "en-us", "TestWidget"); - - if (query == nullptr) { - printf("label error 1\n"); - return SQLITE_ERROR; - } - - ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr); - if (ret != SQLITE_OK) { - printf("label error 2\n"); - goto out; - } - - - ret = sqlite3_step(stmt); - if (ret != SQLITE_DONE) { - printf("label error 3\n"); - goto out; - } - -out: - sqlite3_free(query); - - if (stmt) - sqlite3_finalize(stmt); - - return ret; -} - -int insert_icon(sqlite3 *db) { - int ret; - char *query = nullptr; - sqlite3_stmt *stmt = nullptr; - - query = sqlite3_mprintf("INSERT OR REPLACE INTO icon " - "(classid, locale, icon) " - "VALUES (%Q, %Q, %Q)", - "org.tizen.test_widget", "en-us", "/unittest/icon.png"); - - if (query == nullptr) { - printf("icon error 1\n"); - return SQLITE_ERROR; - } - - ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, nullptr); - if (ret != SQLITE_OK) { - printf("icon error 2\n"); - goto out; - } - - - ret = sqlite3_step(stmt); - if (ret != SQLITE_DONE) { - printf("icon error 3\n"); - goto out; - } - -out: - sqlite3_free(query); - - if (stmt) - sqlite3_finalize(stmt); - - return ret; -} - -int insert_default_data() { - int ret; - sqlite3 *db; - - ret = sqlite3_open_v2(get_db_path(), &db, SQLITE_OPEN_READWRITE, nullptr); - if (ret != SQLITE_OK) { - printf("insert_default_data error 1\n"); - goto out; - } - - ret = insert_widget_class(db); - if (ret != SQLITE_DONE) { - printf("insert_default_data error 2\n"); - goto out; - } - - ret = insert_support_size(db); - if (ret != SQLITE_DONE) { - printf("insert_default_data error 3\n"); - goto out; - } - - ret = insert_label(db); - if (ret != SQLITE_DONE) { - printf("insert_default_data error 4\n"); - goto out; - } - - ret = insert_icon(db); - if (ret != SQLITE_DONE) { - printf("insert_default_data error 5\n"); - goto out; - } - -out: - sqlite3_close_v2(db); - - return ret; -}
\ No newline at end of file diff --git a/mock/fff.h b/mock/fff.h deleted file mode 100644 index f8d6d5f..0000000 --- a/mock/fff.h +++ /dev/null @@ -1,6493 +0,0 @@ -/* -LICENSE - -The MIT License (MIT) - -Copyright (c) 2010 Michael Long - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ -#ifndef FAKE_FUNCTIONS -#define FAKE_FUNCTIONS - -#include <stdarg.h> -#include <string.h> /* For memset and memcpy */ - -#define FFF_MAX_ARGS (20u) -#ifndef FFF_ARG_HISTORY_LEN - #define FFF_ARG_HISTORY_LEN (50u) -#endif -#ifndef FFF_CALL_HISTORY_LEN - #define FFF_CALL_HISTORY_LEN (50u) -#endif -/* -- INTERNAL HELPER MACROS -- */ -#define SET_RETURN_SEQ(FUNCNAME, ARRAY_POINTER, ARRAY_LEN) \ - FUNCNAME##_fake.return_val_seq = ARRAY_POINTER; \ - FUNCNAME##_fake.return_val_seq_len = ARRAY_LEN; -#define SET_CUSTOM_FAKE_SEQ(FUNCNAME, ARRAY_POINTER, ARRAY_LEN) \ - FUNCNAME##_fake.custom_fake_seq = ARRAY_POINTER; \ - FUNCNAME##_fake.custom_fake_seq_len = ARRAY_LEN; - -/* Defining a function to reset a fake function */ -#define RESET_FAKE(FUNCNAME) { \ - FUNCNAME##_reset(); \ -} \ - - -#define DECLARE_ARG(type, n, FUNCNAME) \ - type arg##n##_val; \ - type arg##n##_history[FFF_ARG_HISTORY_LEN]; - -#define DECLARE_ALL_FUNC_COMMON \ - unsigned int call_count; \ - unsigned int arg_history_len; \ - unsigned int arg_histories_dropped; \ - -#define DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - RETURN_TYPE return_val_history[FFF_ARG_HISTORY_LEN]; - -#define SAVE_ARG(FUNCNAME, n) \ - memcpy((void*)&FUNCNAME##_fake.arg##n##_val, (void*)&arg##n, sizeof(arg##n)); - -#define ROOM_FOR_MORE_HISTORY(FUNCNAME) \ - FUNCNAME##_fake.call_count < FFF_ARG_HISTORY_LEN - -#define SAVE_RET_HISTORY(FUNCNAME, RETVAL) \ - if ((FUNCNAME##_fake.call_count - 1) < FFF_ARG_HISTORY_LEN) \ - memcpy((void *)&FUNCNAME##_fake.return_val_history[FUNCNAME##_fake.call_count - 1], (const void *) &RETVAL, sizeof(RETVAL)); \ - -#define SAVE_ARG_HISTORY(FUNCNAME, ARGN) \ - memcpy((void*)&FUNCNAME##_fake.arg##ARGN##_history[FUNCNAME##_fake.call_count], (void*)&arg##ARGN, sizeof(arg##ARGN)); - -#define HISTORY_DROPPED(FUNCNAME) \ - FUNCNAME##_fake.arg_histories_dropped++ - -#define DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - RETURN_TYPE return_val; \ - int return_val_seq_len; \ - int return_val_seq_idx; \ - RETURN_TYPE * return_val_seq; \ - -#define DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - int custom_fake_seq_len; \ - int custom_fake_seq_idx; \ - -#define INCREMENT_CALL_COUNT(FUNCNAME) \ - FUNCNAME##_fake.call_count++ - -#define RETURN_FAKE_RESULT(FUNCNAME) \ - if (FUNCNAME##_fake.return_val_seq_len){ /* then its a sequence */ \ - if(FUNCNAME##_fake.return_val_seq_idx < FUNCNAME##_fake.return_val_seq_len) { \ - SAVE_RET_HISTORY(FUNCNAME, FUNCNAME##_fake.return_val_seq[FUNCNAME##_fake.return_val_seq_idx]) \ - return FUNCNAME##_fake.return_val_seq[FUNCNAME##_fake.return_val_seq_idx++]; \ - } \ - SAVE_RET_HISTORY(FUNCNAME, FUNCNAME##_fake.return_val_seq[FUNCNAME##_fake.return_val_seq_len-1]) \ - return FUNCNAME##_fake.return_val_seq[FUNCNAME##_fake.return_val_seq_len-1]; /* return last element */ \ - } \ - SAVE_RET_HISTORY(FUNCNAME, FUNCNAME##_fake.return_val) \ - return FUNCNAME##_fake.return_val; \ - -#ifdef __cplusplus - #define FFF_EXTERN_C extern "C"{ - #define FFF_END_EXTERN_C } -#else /* ansi c */ - #define FFF_EXTERN_C - #define FFF_END_EXTERN_C -#endif /* cpp/ansi c */ - -#define DEFINE_RESET_FUNCTION(FUNCNAME) \ - void FUNCNAME##_reset(void){ \ - memset(&FUNCNAME##_fake, 0, sizeof(FUNCNAME##_fake)); \ - FUNCNAME##_fake.arg_history_len = FFF_ARG_HISTORY_LEN; \ - } -/* -- END INTERNAL HELPER MACROS -- */ - -typedef void (*fff_function_t)(void); -typedef struct { - fff_function_t call_history[FFF_CALL_HISTORY_LEN]; - unsigned int call_history_idx; -} fff_globals_t; - -FFF_EXTERN_C -extern fff_globals_t fff; -FFF_END_EXTERN_C - -#define DEFINE_FFF_GLOBALS \ - FFF_EXTERN_C \ - fff_globals_t fff; \ - FFF_END_EXTERN_C - -#define FFF_RESET_HISTORY() \ - fff.call_history_idx = 0; \ - memset(fff.call_history, 0, sizeof(fff.call_history)); - -#define REGISTER_CALL(function) \ - if(fff.call_history_idx < FFF_CALL_HISTORY_LEN) \ - fff.call_history[fff.call_history_idx++] = (fff_function_t)function; - -#define DECLARE_FAKE_VOID_FUNC0(FUNCNAME) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(void); \ - void(**custom_fake_seq)(void); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(void); \ - -#define DEFINE_FAKE_VOID_FUNC0(FUNCNAME) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(void){ \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC0(FUNCNAME) \ - DECLARE_FAKE_VOID_FUNC0(FUNCNAME) \ - DEFINE_FAKE_VOID_FUNC0(FUNCNAME) \ - - -#define DECLARE_FAKE_VOID_FUNC1(FUNCNAME, ARG0_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0); \ - void(**custom_fake_seq)(ARG0_TYPE arg0); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0); \ - -#define DEFINE_FAKE_VOID_FUNC1(FUNCNAME, ARG0_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0){ \ - SAVE_ARG(FUNCNAME, 0); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC1(FUNCNAME, ARG0_TYPE) \ - DECLARE_FAKE_VOID_FUNC1(FUNCNAME, ARG0_TYPE) \ - DEFINE_FAKE_VOID_FUNC1(FUNCNAME, ARG0_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC2(FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1); \ - -#define DEFINE_FAKE_VOID_FUNC2(FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC2(FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - DECLARE_FAKE_VOID_FUNC2(FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - DEFINE_FAKE_VOID_FUNC2(FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC3(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2); \ - -#define DEFINE_FAKE_VOID_FUNC3(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC3(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - DECLARE_FAKE_VOID_FUNC3(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - DEFINE_FAKE_VOID_FUNC3(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC4(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3); \ - -#define DEFINE_FAKE_VOID_FUNC4(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC4(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - DECLARE_FAKE_VOID_FUNC4(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - DEFINE_FAKE_VOID_FUNC4(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC5(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4); \ - -#define DEFINE_FAKE_VOID_FUNC5(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC5(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - DECLARE_FAKE_VOID_FUNC5(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - DEFINE_FAKE_VOID_FUNC5(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC6(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5); \ - -#define DEFINE_FAKE_VOID_FUNC6(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC6(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - DECLARE_FAKE_VOID_FUNC6(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - DEFINE_FAKE_VOID_FUNC6(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC7(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6); \ - -#define DEFINE_FAKE_VOID_FUNC7(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC7(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - DECLARE_FAKE_VOID_FUNC7(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - DEFINE_FAKE_VOID_FUNC7(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC8(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7); \ - -#define DEFINE_FAKE_VOID_FUNC8(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC8(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - DECLARE_FAKE_VOID_FUNC8(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - DEFINE_FAKE_VOID_FUNC8(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC9(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8); \ - -#define DEFINE_FAKE_VOID_FUNC9(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC9(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - DECLARE_FAKE_VOID_FUNC9(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - DEFINE_FAKE_VOID_FUNC9(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC10(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9); \ - -#define DEFINE_FAKE_VOID_FUNC10(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC10(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - DECLARE_FAKE_VOID_FUNC10(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - DEFINE_FAKE_VOID_FUNC10(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC11(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10); \ - -#define DEFINE_FAKE_VOID_FUNC11(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC11(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - DECLARE_FAKE_VOID_FUNC11(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - DEFINE_FAKE_VOID_FUNC11(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC12(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11); \ - -#define DEFINE_FAKE_VOID_FUNC12(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC12(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - DECLARE_FAKE_VOID_FUNC12(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - DEFINE_FAKE_VOID_FUNC12(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC13(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12); \ - -#define DEFINE_FAKE_VOID_FUNC13(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC13(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - DECLARE_FAKE_VOID_FUNC13(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - DEFINE_FAKE_VOID_FUNC13(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC14(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13); \ - -#define DEFINE_FAKE_VOID_FUNC14(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC14(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - DECLARE_FAKE_VOID_FUNC14(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - DEFINE_FAKE_VOID_FUNC14(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC15(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14); \ - -#define DEFINE_FAKE_VOID_FUNC15(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC15(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - DECLARE_FAKE_VOID_FUNC15(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - DEFINE_FAKE_VOID_FUNC15(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC16(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15); \ - -#define DEFINE_FAKE_VOID_FUNC16(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC16(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - DECLARE_FAKE_VOID_FUNC16(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - DEFINE_FAKE_VOID_FUNC16(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC17(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16); \ - -#define DEFINE_FAKE_VOID_FUNC17(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC17(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - DECLARE_FAKE_VOID_FUNC17(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - DEFINE_FAKE_VOID_FUNC17(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC18(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17); \ - -#define DEFINE_FAKE_VOID_FUNC18(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC18(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - DECLARE_FAKE_VOID_FUNC18(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - DEFINE_FAKE_VOID_FUNC18(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC19(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ARG(ARG18_TYPE, 18, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18); \ - -#define DEFINE_FAKE_VOID_FUNC19(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - SAVE_ARG(FUNCNAME, 18); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - SAVE_ARG_HISTORY(FUNCNAME, 18); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC19(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - DECLARE_FAKE_VOID_FUNC19(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - DEFINE_FAKE_VOID_FUNC19(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC20(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ARG(ARG18_TYPE, 18, FUNCNAME) \ - DECLARE_ARG(ARG19_TYPE, 19, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ARG19_TYPE arg19); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ARG19_TYPE arg19); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ARG19_TYPE arg19); \ - -#define DEFINE_FAKE_VOID_FUNC20(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ARG19_TYPE arg19){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - SAVE_ARG(FUNCNAME, 18); \ - SAVE_ARG(FUNCNAME, 19); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - SAVE_ARG_HISTORY(FUNCNAME, 18); \ - SAVE_ARG_HISTORY(FUNCNAME, 19); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \ - } \ - else{ \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC20(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - DECLARE_FAKE_VOID_FUNC20(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - DEFINE_FAKE_VOID_FUNC20(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC0(RETURN_TYPE, FUNCNAME) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(void); \ - RETURN_TYPE(**custom_fake_seq)(void); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(void); \ - -#define DEFINE_FAKE_VALUE_FUNC0(RETURN_TYPE, FUNCNAME) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(void){ \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC0(RETURN_TYPE, FUNCNAME) \ - DECLARE_FAKE_VALUE_FUNC0(RETURN_TYPE, FUNCNAME) \ - DEFINE_FAKE_VALUE_FUNC0(RETURN_TYPE, FUNCNAME) \ - - -#define DECLARE_FAKE_VALUE_FUNC1(RETURN_TYPE, FUNCNAME, ARG0_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0); \ - -#define DEFINE_FAKE_VALUE_FUNC1(RETURN_TYPE, FUNCNAME, ARG0_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0){ \ - SAVE_ARG(FUNCNAME, 0); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC1(RETURN_TYPE, FUNCNAME, ARG0_TYPE) \ - DECLARE_FAKE_VALUE_FUNC1(RETURN_TYPE, FUNCNAME, ARG0_TYPE) \ - DEFINE_FAKE_VALUE_FUNC1(RETURN_TYPE, FUNCNAME, ARG0_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC2(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1); \ - -#define DEFINE_FAKE_VALUE_FUNC2(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC2(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - DECLARE_FAKE_VALUE_FUNC2(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - DEFINE_FAKE_VALUE_FUNC2(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC3(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2); \ - -#define DEFINE_FAKE_VALUE_FUNC3(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC3(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - DECLARE_FAKE_VALUE_FUNC3(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - DEFINE_FAKE_VALUE_FUNC3(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC4(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3); \ - -#define DEFINE_FAKE_VALUE_FUNC4(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC4(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - DECLARE_FAKE_VALUE_FUNC4(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - DEFINE_FAKE_VALUE_FUNC4(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC5(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4); \ - -#define DEFINE_FAKE_VALUE_FUNC5(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC5(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - DECLARE_FAKE_VALUE_FUNC5(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - DEFINE_FAKE_VALUE_FUNC5(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC6(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5); \ - -#define DEFINE_FAKE_VALUE_FUNC6(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC6(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - DECLARE_FAKE_VALUE_FUNC6(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - DEFINE_FAKE_VALUE_FUNC6(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC7(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6); \ - -#define DEFINE_FAKE_VALUE_FUNC7(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC7(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - DECLARE_FAKE_VALUE_FUNC7(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - DEFINE_FAKE_VALUE_FUNC7(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC8(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7); \ - -#define DEFINE_FAKE_VALUE_FUNC8(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC8(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - DECLARE_FAKE_VALUE_FUNC8(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - DEFINE_FAKE_VALUE_FUNC8(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC9(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8); \ - -#define DEFINE_FAKE_VALUE_FUNC9(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC9(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - DECLARE_FAKE_VALUE_FUNC9(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - DEFINE_FAKE_VALUE_FUNC9(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC10(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9); \ - -#define DEFINE_FAKE_VALUE_FUNC10(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC10(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - DECLARE_FAKE_VALUE_FUNC10(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - DEFINE_FAKE_VALUE_FUNC10(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC11(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10); \ - -#define DEFINE_FAKE_VALUE_FUNC11(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC11(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - DECLARE_FAKE_VALUE_FUNC11(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - DEFINE_FAKE_VALUE_FUNC11(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC12(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11); \ - -#define DEFINE_FAKE_VALUE_FUNC12(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC12(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - DECLARE_FAKE_VALUE_FUNC12(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - DEFINE_FAKE_VALUE_FUNC12(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC13(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12); \ - -#define DEFINE_FAKE_VALUE_FUNC13(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC13(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - DECLARE_FAKE_VALUE_FUNC13(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - DEFINE_FAKE_VALUE_FUNC13(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC14(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13); \ - -#define DEFINE_FAKE_VALUE_FUNC14(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC14(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - DECLARE_FAKE_VALUE_FUNC14(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - DEFINE_FAKE_VALUE_FUNC14(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC15(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14); \ - -#define DEFINE_FAKE_VALUE_FUNC15(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC15(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - DECLARE_FAKE_VALUE_FUNC15(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - DEFINE_FAKE_VALUE_FUNC15(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC16(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15); \ - -#define DEFINE_FAKE_VALUE_FUNC16(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC16(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - DECLARE_FAKE_VALUE_FUNC16(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - DEFINE_FAKE_VALUE_FUNC16(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC17(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16); \ - -#define DEFINE_FAKE_VALUE_FUNC17(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC17(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - DECLARE_FAKE_VALUE_FUNC17(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - DEFINE_FAKE_VALUE_FUNC17(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC18(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17); \ - -#define DEFINE_FAKE_VALUE_FUNC18(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC18(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - DECLARE_FAKE_VALUE_FUNC18(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - DEFINE_FAKE_VALUE_FUNC18(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC19(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ARG(ARG18_TYPE, 18, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18); \ - -#define DEFINE_FAKE_VALUE_FUNC19(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - SAVE_ARG(FUNCNAME, 18); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - SAVE_ARG_HISTORY(FUNCNAME, 18); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC19(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - DECLARE_FAKE_VALUE_FUNC19(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - DEFINE_FAKE_VALUE_FUNC19(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE) \ - - -#define DECLARE_FAKE_VALUE_FUNC20(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ARG(ARG18_TYPE, 18, FUNCNAME) \ - DECLARE_ARG(ARG19_TYPE, 19, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ARG19_TYPE arg19); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ARG19_TYPE arg19); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ARG19_TYPE arg19); \ - -#define DEFINE_FAKE_VALUE_FUNC20(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ARG19_TYPE arg19){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - SAVE_ARG(FUNCNAME, 18); \ - SAVE_ARG(FUNCNAME, 19); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - SAVE_ARG_HISTORY(FUNCNAME, 18); \ - SAVE_ARG_HISTORY(FUNCNAME, 19); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - else{ \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \ - } \ - } \ - if (FUNCNAME##_fake.custom_fake) return FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC20(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - DECLARE_FAKE_VALUE_FUNC20(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - DEFINE_FAKE_VALUE_FUNC20(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ARG19_TYPE) \ - - -#define DECLARE_FAKE_VOID_FUNC2_VARARG(FUNCNAME, ARG0_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ...); \ - -#define DEFINE_FAKE_VOID_FUNC2_VARARG(FUNCNAME, ARG0_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg0); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg0); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg0); \ - FUNCNAME##_fake.custom_fake(arg0, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC2_VARARG(FUNCNAME, ARG0_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC2_VARARG(FUNCNAME, ARG0_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC2_VARARG(FUNCNAME, ARG0_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC3_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ...); \ - -#define DEFINE_FAKE_VOID_FUNC3_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg1); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg1); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg1); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC3_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC3_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC3_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC4_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ...); \ - -#define DEFINE_FAKE_VOID_FUNC4_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg2); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg2); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg2); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC4_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC4_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC4_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC5_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ...); \ - -#define DEFINE_FAKE_VOID_FUNC5_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg3); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg3); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg3); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC5_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC5_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC5_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC6_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ...); \ - -#define DEFINE_FAKE_VOID_FUNC6_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg4); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg4); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg4); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC6_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC6_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC6_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC7_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ...); \ - -#define DEFINE_FAKE_VOID_FUNC7_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg5); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg5); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg5); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC7_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC7_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC7_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC8_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ...); \ - -#define DEFINE_FAKE_VOID_FUNC8_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg6); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg6); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg6); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC8_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC8_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC8_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC9_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ...); \ - -#define DEFINE_FAKE_VOID_FUNC9_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg7); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg7); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg7); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC9_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC9_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC9_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC10_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ...); \ - -#define DEFINE_FAKE_VOID_FUNC10_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg8); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg8); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg8); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC10_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC10_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC10_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC11_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ...); \ - -#define DEFINE_FAKE_VOID_FUNC11_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg9); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg9); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg9); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC11_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC11_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC11_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC12_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ...); \ - -#define DEFINE_FAKE_VOID_FUNC12_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg10); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg10); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg10); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC12_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC12_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC12_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC13_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ...); \ - -#define DEFINE_FAKE_VOID_FUNC13_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg11); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg11); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg11); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC13_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC13_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC13_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC14_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ...); \ - -#define DEFINE_FAKE_VOID_FUNC14_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg12); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg12); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg12); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC14_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC14_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC14_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC15_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ...); \ - -#define DEFINE_FAKE_VOID_FUNC15_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg13); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg13); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg13); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC15_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC15_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC15_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC16_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ...); \ - -#define DEFINE_FAKE_VOID_FUNC16_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg14); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg14); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg14); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC16_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC16_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC16_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC17_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ...); \ - -#define DEFINE_FAKE_VOID_FUNC17_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg15); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg15); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg15); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC17_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC17_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC17_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC18_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ...); \ - -#define DEFINE_FAKE_VOID_FUNC18_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg16); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg16); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg16); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC18_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC18_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC18_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC19_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ...); \ - -#define DEFINE_FAKE_VOID_FUNC19_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg17); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg17); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg17); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC19_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC19_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC19_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - - -#define DECLARE_FAKE_VOID_FUNC20_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ARG(ARG18_TYPE, 18, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - void(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, va_list ap); \ - void(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ...); \ - -#define DEFINE_FAKE_VOID_FUNC20_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - SAVE_ARG(FUNCNAME, 18); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - SAVE_ARG_HISTORY(FUNCNAME, 18); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg18); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, ap); \ - va_end(ap); \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg18); \ - FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, ap); \ - va_end(ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - va_list ap; \ - va_start(ap, arg18); \ - FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, ap); \ - va_end(ap); \ - } \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VOID_FUNC20_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - DECLARE_FAKE_VOID_FUNC20_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - DEFINE_FAKE_VOID_FUNC20_VARARG(FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC2_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC2_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg0); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg0); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg0); \ - ret = FUNCNAME##_fake.custom_fake(arg0, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC2_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC2_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC2_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC3_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC3_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg1); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg1); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg1); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC3_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC3_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC3_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC4_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC4_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg2); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg2); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg2); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC4_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC4_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC4_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC5_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC5_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg3); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg3); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg3); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC5_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC5_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC5_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC6_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC6_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg4); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg4); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg4); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC6_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC6_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC6_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC7_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC7_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg5); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg5); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg5); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC7_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC7_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC7_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC8_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC8_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg6); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg6); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg6); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC8_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC8_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC8_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC9_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC9_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg7); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg7); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg7); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC9_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC9_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC9_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC10_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC10_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg8); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg8); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg8); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC10_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC10_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC10_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC11_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC11_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg9); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg9); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg9); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC11_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC11_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC11_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC12_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC12_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg10); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg10); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg10); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC12_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC12_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC12_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC13_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC13_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg11); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg11); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg11); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC13_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC13_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC13_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC14_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC14_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg12); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg12); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg12); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC14_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC14_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC14_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC15_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC15_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg13); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg13); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg13); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC15_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC15_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC15_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC16_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC16_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg14); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg14); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg14); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC16_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC16_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC16_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC17_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC17_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg15); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg15); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg15); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC17_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC17_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC17_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC18_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC18_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg16); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg16); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg16); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC18_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC18_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC18_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC19_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC19_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg17); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg17); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg17); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC19_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC19_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC19_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ...) \ - - -#define DECLARE_FAKE_VALUE_FUNC20_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - typedef struct FUNCNAME##_Fake { \ - DECLARE_ARG(ARG0_TYPE, 0, FUNCNAME) \ - DECLARE_ARG(ARG1_TYPE, 1, FUNCNAME) \ - DECLARE_ARG(ARG2_TYPE, 2, FUNCNAME) \ - DECLARE_ARG(ARG3_TYPE, 3, FUNCNAME) \ - DECLARE_ARG(ARG4_TYPE, 4, FUNCNAME) \ - DECLARE_ARG(ARG5_TYPE, 5, FUNCNAME) \ - DECLARE_ARG(ARG6_TYPE, 6, FUNCNAME) \ - DECLARE_ARG(ARG7_TYPE, 7, FUNCNAME) \ - DECLARE_ARG(ARG8_TYPE, 8, FUNCNAME) \ - DECLARE_ARG(ARG9_TYPE, 9, FUNCNAME) \ - DECLARE_ARG(ARG10_TYPE, 10, FUNCNAME) \ - DECLARE_ARG(ARG11_TYPE, 11, FUNCNAME) \ - DECLARE_ARG(ARG12_TYPE, 12, FUNCNAME) \ - DECLARE_ARG(ARG13_TYPE, 13, FUNCNAME) \ - DECLARE_ARG(ARG14_TYPE, 14, FUNCNAME) \ - DECLARE_ARG(ARG15_TYPE, 15, FUNCNAME) \ - DECLARE_ARG(ARG16_TYPE, 16, FUNCNAME) \ - DECLARE_ARG(ARG17_TYPE, 17, FUNCNAME) \ - DECLARE_ARG(ARG18_TYPE, 18, FUNCNAME) \ - DECLARE_ALL_FUNC_COMMON \ - DECLARE_VALUE_FUNCTION_VARIABLES(RETURN_TYPE) \ - DECLARE_RETURN_VALUE_HISTORY(RETURN_TYPE) \ - DECLARE_CUSTOM_FAKE_SEQ_VARIABLES \ - RETURN_TYPE(*custom_fake)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, va_list ap); \ - RETURN_TYPE(**custom_fake_seq)(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, va_list ap); \ - } FUNCNAME##_Fake; \ - extern FUNCNAME##_Fake FUNCNAME##_fake; \ - void FUNCNAME##_reset(void); \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ...); \ - -#define DEFINE_FAKE_VALUE_FUNC20_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - FUNCNAME##_Fake FUNCNAME##_fake; \ - RETURN_TYPE FUNCNAME(ARG0_TYPE arg0, ARG1_TYPE arg1, ARG2_TYPE arg2, ARG3_TYPE arg3, ARG4_TYPE arg4, ARG5_TYPE arg5, ARG6_TYPE arg6, ARG7_TYPE arg7, ARG8_TYPE arg8, ARG9_TYPE arg9, ARG10_TYPE arg10, ARG11_TYPE arg11, ARG12_TYPE arg12, ARG13_TYPE arg13, ARG14_TYPE arg14, ARG15_TYPE arg15, ARG16_TYPE arg16, ARG17_TYPE arg17, ARG18_TYPE arg18, ...){ \ - SAVE_ARG(FUNCNAME, 0); \ - SAVE_ARG(FUNCNAME, 1); \ - SAVE_ARG(FUNCNAME, 2); \ - SAVE_ARG(FUNCNAME, 3); \ - SAVE_ARG(FUNCNAME, 4); \ - SAVE_ARG(FUNCNAME, 5); \ - SAVE_ARG(FUNCNAME, 6); \ - SAVE_ARG(FUNCNAME, 7); \ - SAVE_ARG(FUNCNAME, 8); \ - SAVE_ARG(FUNCNAME, 9); \ - SAVE_ARG(FUNCNAME, 10); \ - SAVE_ARG(FUNCNAME, 11); \ - SAVE_ARG(FUNCNAME, 12); \ - SAVE_ARG(FUNCNAME, 13); \ - SAVE_ARG(FUNCNAME, 14); \ - SAVE_ARG(FUNCNAME, 15); \ - SAVE_ARG(FUNCNAME, 16); \ - SAVE_ARG(FUNCNAME, 17); \ - SAVE_ARG(FUNCNAME, 18); \ - if(ROOM_FOR_MORE_HISTORY(FUNCNAME)){ \ - SAVE_ARG_HISTORY(FUNCNAME, 0); \ - SAVE_ARG_HISTORY(FUNCNAME, 1); \ - SAVE_ARG_HISTORY(FUNCNAME, 2); \ - SAVE_ARG_HISTORY(FUNCNAME, 3); \ - SAVE_ARG_HISTORY(FUNCNAME, 4); \ - SAVE_ARG_HISTORY(FUNCNAME, 5); \ - SAVE_ARG_HISTORY(FUNCNAME, 6); \ - SAVE_ARG_HISTORY(FUNCNAME, 7); \ - SAVE_ARG_HISTORY(FUNCNAME, 8); \ - SAVE_ARG_HISTORY(FUNCNAME, 9); \ - SAVE_ARG_HISTORY(FUNCNAME, 10); \ - SAVE_ARG_HISTORY(FUNCNAME, 11); \ - SAVE_ARG_HISTORY(FUNCNAME, 12); \ - SAVE_ARG_HISTORY(FUNCNAME, 13); \ - SAVE_ARG_HISTORY(FUNCNAME, 14); \ - SAVE_ARG_HISTORY(FUNCNAME, 15); \ - SAVE_ARG_HISTORY(FUNCNAME, 16); \ - SAVE_ARG_HISTORY(FUNCNAME, 17); \ - SAVE_ARG_HISTORY(FUNCNAME, 18); \ - } \ - else{ \ - HISTORY_DROPPED(FUNCNAME); \ - } \ - INCREMENT_CALL_COUNT(FUNCNAME); \ - REGISTER_CALL(FUNCNAME); \ - if (FUNCNAME##_fake.custom_fake_seq_len){ /* a sequence of custom fakes */ \ - if (FUNCNAME##_fake.custom_fake_seq_idx < FUNCNAME##_fake.custom_fake_seq_len){ \ - va_list ap; \ - va_start(ap, arg18); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_idx++](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - } \ - else{ \ - va_list ap; \ - va_start(ap, arg18); \ - RETURN_TYPE ret = FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - va_end(ap); \ - return ret; \ - return FUNCNAME##_fake.custom_fake_seq[FUNCNAME##_fake.custom_fake_seq_len-1](arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, ap); \ - } \ - } \ - if(FUNCNAME##_fake.custom_fake){ \ - RETURN_TYPE ret; \ - va_list ap; \ - va_start(ap, arg18); \ - ret = FUNCNAME##_fake.custom_fake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, ap); \ - va_end(ap); \ - SAVE_RET_HISTORY(FUNCNAME, ret); \ - return ret; \ - } \ - RETURN_FAKE_RESULT(FUNCNAME) \ - } \ - DEFINE_RESET_FUNCTION(FUNCNAME) \ - -#define FAKE_VALUE_FUNC20_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - DECLARE_FAKE_VALUE_FUNC20_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - DEFINE_FAKE_VALUE_FUNC20_VARARG(RETURN_TYPE, FUNCNAME, ARG0_TYPE, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE, ARG4_TYPE, ARG5_TYPE, ARG6_TYPE, ARG7_TYPE, ARG8_TYPE, ARG9_TYPE, ARG10_TYPE, ARG11_TYPE, ARG12_TYPE, ARG13_TYPE, ARG14_TYPE, ARG15_TYPE, ARG16_TYPE, ARG17_TYPE, ARG18_TYPE, ...) \ - -/* MSVC expand macro fix */ -#define EXPAND(x) x - -#define PP_NARG_MINUS2(...) EXPAND(PP_NARG_MINUS2_(__VA_ARGS__, PP_RSEQ_N_MINUS2())) - -#define PP_NARG_MINUS2_(...) EXPAND(PP_ARG_MINUS2_N(__VA_ARGS__)) - -#define PP_ARG_MINUS2_N(returnVal, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, N, ...) N - -#define PP_RSEQ_N_MINUS2() 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 - -#define PP_NARG_MINUS1(...) EXPAND(PP_NARG_MINUS1_(__VA_ARGS__, PP_RSEQ_N_MINUS1())) - -#define PP_NARG_MINUS1_(...) EXPAND(PP_ARG_MINUS1_N(__VA_ARGS__)) - -#define PP_ARG_MINUS1_N( _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, N, ...) N - -#define PP_RSEQ_N_MINUS1() 20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0 - - - -/* DECLARE AND DEFINE FAKE FUNCTIONS - PLACE IN TEST FILES */ - -#define FAKE_VALUE_FUNC(...) EXPAND(FUNC_VALUE_(PP_NARG_MINUS2(__VA_ARGS__), __VA_ARGS__)) - -#define FUNC_VALUE_(N,...) EXPAND(FUNC_VALUE_N(N,__VA_ARGS__)) - -#define FUNC_VALUE_N(N,...) EXPAND(FAKE_VALUE_FUNC ## N(__VA_ARGS__)) - - -#define FAKE_VOID_FUNC(...) EXPAND(FUNC_VOID_(PP_NARG_MINUS1(__VA_ARGS__), __VA_ARGS__)) - -#define FUNC_VOID_(N,...) EXPAND(FUNC_VOID_N(N,__VA_ARGS__)) - -#define FUNC_VOID_N(N,...) EXPAND(FAKE_VOID_FUNC ## N(__VA_ARGS__)) - - -#define FAKE_VALUE_FUNC_VARARG(...) EXPAND(FUNC_VALUE_VARARG_(PP_NARG_MINUS2(__VA_ARGS__), __VA_ARGS__)) - -#define FUNC_VALUE_VARARG_(N,...) EXPAND(FUNC_VALUE_VARARG_N(N,__VA_ARGS__)) - -#define FUNC_VALUE_VARARG_N(N,...) EXPAND(FAKE_VALUE_FUNC ## N ## _VARARG(__VA_ARGS__)) - - -#define FAKE_VOID_FUNC_VARARG(...) EXPAND(FUNC_VOID_VARARG_(PP_NARG_MINUS1(__VA_ARGS__), __VA_ARGS__)) - -#define FUNC_VOID_VARARG_(N,...) EXPAND(FUNC_VOID_VARARG_N(N,__VA_ARGS__)) - -#define FUNC_VOID_VARARG_N(N,...) EXPAND(FAKE_VOID_FUNC ## N ## _VARARG(__VA_ARGS__)) - - - -/* DECLARE FAKE FUNCTIONS - PLACE IN HEADER FILES */ - -#define DECLARE_FAKE_VALUE_FUNC(...) EXPAND(DECLARE_FUNC_VALUE_(PP_NARG_MINUS2(__VA_ARGS__), __VA_ARGS__)) - -#define DECLARE_FUNC_VALUE_(N,...) EXPAND(DECLARE_FUNC_VALUE_N(N,__VA_ARGS__)) - -#define DECLARE_FUNC_VALUE_N(N,...) EXPAND(DECLARE_FAKE_VALUE_FUNC ## N(__VA_ARGS__)) - - -#define DECLARE_FAKE_VOID_FUNC(...) EXPAND(DECLARE_FUNC_VOID_(PP_NARG_MINUS1(__VA_ARGS__), __VA_ARGS__)) - -#define DECLARE_FUNC_VOID_(N,...) EXPAND(DECLARE_FUNC_VOID_N(N,__VA_ARGS__)) - -#define DECLARE_FUNC_VOID_N(N,...) EXPAND(DECLARE_FAKE_VOID_FUNC ## N(__VA_ARGS__)) - - -#define DECLARE_FAKE_VALUE_FUNC_VARARG(...) EXPAND(DECLARE_FUNC_VALUE_VARARG_(PP_NARG_MINUS2(__VA_ARGS__), __VA_ARGS__)) - -#define DECLARE_FUNC_VALUE_VARARG_(N,...) EXPAND(DECLARE_FUNC_VALUE_VARARG_N(N,__VA_ARGS__)) - -#define DECLARE_FUNC_VALUE_VARARG_N(N,...) EXPAND(DECLARE_FAKE_VALUE_FUNC ## N ## _VARARG(__VA_ARGS__)) - - -#define DECLARE_FAKE_VOID_FUNC_VARARG(...) EXPAND(DECLARE_FUNC_VOID_VARARG_(PP_NARG_MINUS1(__VA_ARGS__), __VA_ARGS__)) - -#define DECLARE_FUNC_VOID_VARARG_(N,...) EXPAND(DECLARE_FUNC_VOID_VARARG_N(N,__VA_ARGS__)) - -#define DECLARE_FUNC_VOID_VARARG_N(N,...) EXPAND(DECLARE_FAKE_VOID_FUNC ## N ## _VARARG(__VA_ARGS__)) - - - -/* DEFINE FAKE FUNCTIONS - PLACE IN SOURCE FILES */ - -#define DEFINE_FAKE_VALUE_FUNC(...) EXPAND(DEFINE_FUNC_VALUE_(PP_NARG_MINUS2(__VA_ARGS__), __VA_ARGS__)) - -#define DEFINE_FUNC_VALUE_(N,...) EXPAND(DEFINE_FUNC_VALUE_N(N,__VA_ARGS__)) - -#define DEFINE_FUNC_VALUE_N(N,...) EXPAND(DEFINE_FAKE_VALUE_FUNC ## N(__VA_ARGS__)) - - -#define DEFINE_FAKE_VOID_FUNC(...) EXPAND(DEFINE_FUNC_VOID_(PP_NARG_MINUS1(__VA_ARGS__), __VA_ARGS__)) - -#define DEFINE_FUNC_VOID_(N,...) EXPAND(DEFINE_FUNC_VOID_N(N,__VA_ARGS__)) - -#define DEFINE_FUNC_VOID_N(N,...) EXPAND(DEFINE_FAKE_VOID_FUNC ## N(__VA_ARGS__)) - - -#define DEFINE_FAKE_VALUE_FUNC_VARARG(...) EXPAND(DEFINE_FUNC_VALUE_VARARG_(PP_NARG_MINUS2(__VA_ARGS__), __VA_ARGS__)) - -#define DEFINE_FUNC_VALUE_VARARG_(N,...) EXPAND(DEFINE_FUNC_VALUE_VARARG_N(N,__VA_ARGS__)) - -#define DEFINE_FUNC_VALUE_VARARG_N(N,...) EXPAND(DEFINE_FAKE_VALUE_FUNC ## N ## _VARARG(__VA_ARGS__)) - - -#define DEFINE_FAKE_VOID_FUNC_VARARG(...) EXPAND(DEFINE_FUNC_VOID_VARARG_(PP_NARG_MINUS1(__VA_ARGS__), __VA_ARGS__)) - -#define DEFINE_FUNC_VOID_VARARG_(N,...) EXPAND(DEFINE_FUNC_VOID_VARARG_N(N,__VA_ARGS__)) - -#define DEFINE_FUNC_VOID_VARARG_N(N,...) EXPAND(DEFINE_FAKE_VOID_FUNC ## N ## _VARARG(__VA_ARGS__)) - - - - -#endif /* FAKE_FUNCTIONS */ diff --git a/mock/mock.cc b/mock/mock.cc deleted file mode 100644 index 031ede4..0000000 --- a/mock/mock.cc +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <sys/types.h> - -#include "mock.h" -#include "system_info_mock.h" -#include "aul_mock.h" -#include "cynara_mock.h" -#include "fcntl_mock.h" -#include "tzplatform_config_mock.h" -#include "pkgmgr_info_mock.h" - -DEFINE_FFF_GLOBALS; - -/* system */ -DEFINE_FAKE_VALUE_FUNC(int, system_info_get_platform_bool, - const char*, bool*); -DEFINE_FAKE_VALUE_FUNC(uid_t, getuid); - -/* aul */ -DEFINE_FAKE_VALUE_FUNC(int, aul_terminate_pid, int); -DEFINE_FAKE_VALUE_FUNC(int, aul_widget_service_set_disable, - const char*, bool); -DEFINE_FAKE_VALUE_FUNC(int, aul_app_com_create, const char *, aul_app_com_permission_h, - app_com_cb, void *, aul_app_com_connection_h *); -DEFINE_FAKE_VALUE_FUNC(int, aul_app_com_leave, aul_app_com_connection_h); -DEFINE_FAKE_VALUE_FUNC(int, aul_widget_instance_update, const char *, - const char *, bundle *); -DEFINE_FAKE_VALUE_FUNC(int, aul_widget_instance_foreach, const char *, - aul_widget_instance_foreach_cb, void *); -DEFINE_FAKE_VALUE_FUNC(int, aul_widget_instance_get_content, const char *, - const char *, char **); -DEFINE_FAKE_VALUE_FUNC(int, aul_widget_instance_count, const char *); -DEFINE_FAKE_VALUE_FUNC(int, aul_launch_app_async, const char *, bundle *); -DEFINE_FAKE_VALUE_FUNC(int, aul_debug_info_init); -DEFINE_FAKE_VALUE_FUNC(int, aul_debug_info_set, bundle *, bundle *); - -/* cynara */ -DEFINE_FAKE_VALUE_FUNC(int, cynara_initialize, cynara**, - const cynara_configuration*); -DEFINE_FAKE_VALUE_FUNC(int, cynara_finish, cynara*); -DEFINE_FAKE_VALUE_FUNC(int, cynara_check, cynara*, - const char*, const char*, const char*, const char*); - -/* fcntl */ -DEFINE_FAKE_VALUE_FUNC(int, open, const char *, int); -DEFINE_FAKE_VALUE_FUNC(ssize_t, read, int, void *, size_t); -DEFINE_FAKE_VALUE_FUNC(int, chown, const char *, uid_t, gid_t); -DEFINE_FAKE_VALUE_FUNC(int, chmod, const char *, mode_t); - -/* tzplatform_config */ -DEFINE_FAKE_VALUE_FUNC(const char *, tzplatform_mkpath, - enum tzplatform_variable, const char *); - -/* pkgmgr_info */ -DEFINE_FAKE_VALUE_FUNC(int, pkgmgrinfo_pkginfo_get_usr_pkginfo, - const char *, uid_t, pkgmgrinfo_pkginfo_h *); -DEFINE_FAKE_VALUE_FUNC(int, pkgmgrinfo_pkginfo_get_mainappid, - pkgmgrinfo_pkginfo_h, char **); -DEFINE_FAKE_VALUE_FUNC(int, pkgmgrinfo_pkginfo_destroy_pkginfo, - pkgmgrinfo_pkginfo_h); - diff --git a/mock/pkgmgr_info_mock.h b/mock/pkgmgr_info_mock.h deleted file mode 100644 index 5051246..0000000 --- a/mock/pkgmgr_info_mock.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef MOCK_PKGMGR_INFO_H_ -#define MOCK_PKGMGR_INFO_H_ - -#include "mock.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void *pkgmgrinfo_pkginfo_h; - -enum { - PMINFO_R_ENOENT = -3, /**< No result */ - PMINFO_R_EINVAL = -2, /**< Invalid argument */ - PMINFO_R_ERROR = -1, /**< General error */ - PMINFO_R_OK = 0 /**< General success */ -}; - -DECLARE_FAKE_VALUE_FUNC(int, pkgmgrinfo_pkginfo_get_usr_pkginfo, - const char *, uid_t, pkgmgrinfo_pkginfo_h *); -DECLARE_FAKE_VALUE_FUNC(int, pkgmgrinfo_pkginfo_get_mainappid, - pkgmgrinfo_pkginfo_h, char **); -DECLARE_FAKE_VALUE_FUNC(int, pkgmgrinfo_pkginfo_destroy_pkginfo, - pkgmgrinfo_pkginfo_h); - -#ifdef __cplusplus -} -#endif -#endif /* MOCK_PKGMGR_INFO_H_ */
\ No newline at end of file diff --git a/unittest/CMakeLists.txt b/unittest/CMakeLists.txt index 6c30ccb..2acadbe 100644 --- a/unittest/CMakeLists.txt +++ b/unittest/CMakeLists.txt @@ -13,17 +13,17 @@ pkg_check_modules(widget_service_unittests REQUIRED FOREACH(flag ${widget_service_unittests_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror -Winline") +SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Werror") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} -std=c++11") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}") SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") SET(CMAKE_CXX_FLAGS_RELEASE "-O2") INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../mock) +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/mock) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) -AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../mock MOCK_SOURCES) +AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/mock MOCK_SOURCES) AUX_SOURCE_DIRECTORY(src SOURCES) AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../src WIDGET_SERVICE_SOURCES) ADD_EXECUTABLE(${PROJECT_NAME} diff --git a/unittest/mock/aul_mock.cc b/unittest/mock/aul_mock.cc new file mode 100644 index 0000000..4fa9ce0 --- /dev/null +++ b/unittest/mock/aul_mock.cc @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "aul_mock.h" +#include "mock_hook.h" +#include "test_fixture.h" + +extern "C" int aul_debug_info_init() { + return MOCK_HOOK_P0(AulMock, aul_debug_info_init); +} + +extern "C" int aul_terminate_pid(int arg1) { + return MOCK_HOOK_P1(AulMock, aul_terminate_pid, arg1); +} + +extern "C" int aul_app_com_leave(aul_app_com_connection_h arg1) { + return MOCK_HOOK_P1(AulMock, aul_app_com_leave, arg1); +} + +extern "C" int aul_widget_instance_count(const char* arg1) { + return MOCK_HOOK_P1(AulMock, aul_widget_instance_count, arg1); +} + +extern "C" int aul_widget_service_set_disable(const char* arg1, bool arg2) { + return MOCK_HOOK_P2(AulMock, aul_widget_service_set_disable, arg1, arg2); +} + +extern "C" int aul_launch_app_async(const char* arg1, bundle* arg2) { + return MOCK_HOOK_P2(AulMock, aul_launch_app_async, arg1, arg2); +} + +extern "C" int aul_debug_info_set(bundle* arg1, bundle* arg2) { + return MOCK_HOOK_P2(AulMock, aul_debug_info_set, arg1, arg2); +} + +extern "C" int aul_widget_instance_update(const char* arg1, + const char* arg2, bundle* arg3) { + return MOCK_HOOK_P3(AulMock, aul_widget_instance_update, arg1, arg2, arg3); +} + +extern "C" int aul_widget_instance_foreach(const char* arg1, + aul_widget_instance_foreach_cb arg2, void* arg3) { + return MOCK_HOOK_P3(AulMock, aul_widget_instance_foreach, arg1, arg2, arg3); +} + +extern "C" int aul_widget_instance_get_content(const char* arg1, + const char* arg2, char** arg3) { + return MOCK_HOOK_P3(AulMock, aul_widget_instance_get_content, arg1, arg2, arg3); +} + +extern "C" int aul_app_com_create(const char* arg1, + aul_app_com_permission_h arg2, app_com_cb arg3, void* arg4, + aul_app_com_connection_h* arg5) { + return MOCK_HOOK_P5(AulMock, aul_app_com_create, arg1, arg2, arg3, arg4, arg5); +}
\ No newline at end of file diff --git a/unittest/mock/aul_mock.h b/unittest/mock/aul_mock.h new file mode 100644 index 0000000..5d2587c --- /dev/null +++ b/unittest/mock/aul_mock.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIT_TESTS_MOCK_AUL_MOCK_H_ +#define UNIT_TESTS_MOCK_AUL_MOCK_H_ + +#include <aul.h> +#include <aul_app_com.h> +#include <bundle.h> +#include <gmock/gmock.h> + +#include "module_mock.h" + +class AulMock : public virtual ModuleMock { + public: + virtual ~AulMock() {} + + MOCK_METHOD0(aul_debug_info_init, int (void)); + MOCK_METHOD1(aul_widget_instance_count, int (const char *)); + MOCK_METHOD1(aul_app_com_leave, int (aul_app_com_connection_h)); + MOCK_METHOD1(aul_terminate_pid, int (int)); + MOCK_METHOD2(aul_launch_app_async, int (const char *, bundle *)); + MOCK_METHOD2(aul_debug_info_set, int (bundle *, bundle *)); + MOCK_METHOD2(aul_widget_service_set_disable, int (const char *, bool)); + MOCK_METHOD3(aul_widget_instance_update, int (const char *, + const char *, bundle *)); + MOCK_METHOD3(aul_widget_instance_foreach, int (const char *, + aul_widget_instance_foreach_cb, void *)); + MOCK_METHOD3(aul_widget_instance_get_content, int (const char *, + const char *, char **)); + MOCK_METHOD5(aul_app_com_create, int (const char *, aul_app_com_permission_h, + app_com_cb, void *, aul_app_com_connection_h *)); + +}; + +#endif // UNIT_TESTS_MOCK_AUL_MOCK_H_ diff --git a/unittest/mock/cynara_mock.cc b/unittest/mock/cynara_mock.cc new file mode 100644 index 0000000..7dc3e08 --- /dev/null +++ b/unittest/mock/cynara_mock.cc @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "cynara_mock.h" + +#include "mock_hook.h" +#include "test_fixture.h" + +extern "C" int cynara_initialize(cynara** arg1, const cynara_configuration* arg2) { + return MOCK_HOOK_P2(CynaraMock, cynara_initialize, arg1, arg2); +} + +extern "C" int cynara_finish(cynara* arg1) { + return MOCK_HOOK_P1(CynaraMock, cynara_finish, arg1); +} + +extern "C" int cynara_check(cynara* arg1, const char* arg2, const char* arg3, + const char* arg4, const char* arg5) { + return MOCK_HOOK_P5(CynaraMock, cynara_check, arg1, arg2, arg3, arg4, arg5); +}
\ No newline at end of file diff --git a/unittest/mock/cynara_mock.h b/unittest/mock/cynara_mock.h new file mode 100644 index 0000000..cdcc962 --- /dev/null +++ b/unittest/mock/cynara_mock.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIT_TESTS_MOCK_CYNARA_MOCK_H_ +#define UNIT_TESTS_MOCK_CYNARA_MOCK_H_ + +#include <gmock/gmock.h> +#include <cynara-client.h> + +#include "module_mock.h" + +class CynaraMock : public virtual ModuleMock { + public: + virtual ~CynaraMock() {} + + MOCK_METHOD2(cynara_initialize, int (cynara**, const cynara_configuration*)); + MOCK_METHOD1(cynara_finish, int (cynara*)); + MOCK_METHOD5(cynara_check, + int (cynara*, const char*, const char*, const char*, const char*)); +}; + +#endif // UNIT_TESTS_MOCK_CYNARA_MOCK_H_
\ No newline at end of file diff --git a/mock/db_mock.h b/unittest/mock/glib_mock.cc index bcbaf4f..9312aa9 100644 --- a/mock/db_mock.h +++ b/unittest/mock/glib_mock.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,11 @@ * limitations under the License. */ -#ifndef MOCK_DB_H_ -#define MOCK_DB_H_ +#include "glib_mock.h" +#include "mock_hook.h" +#include "test_fixture.h" -#ifdef __cplusplus -extern "C" { -#endif - -const char *get_db_path(); -int create_db(); -int insert_default_data(); - -#ifdef __cplusplus +extern "C" guint g_list_length(GList* arg1) { + return MOCK_HOOK_P1(GlibMock, g_list_length, arg1); } -#endif -#endif /* MOCK_DB_H_ */
\ No newline at end of file diff --git a/unittest/mock/glib_mock.h b/unittest/mock/glib_mock.h new file mode 100644 index 0000000..9852de9 --- /dev/null +++ b/unittest/mock/glib_mock.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIT_TESTS_MOCK_GLIB_MOCK_H_ +#define UNIT_TESTS_MOCK_GLIB_MOCK_H_ + +#include <glib.h> +#include <gmock/gmock.h> + +#include "module_mock.h" + +class GlibMock : public virtual ModuleMock { + public: + GlibMock() { + using ::testing::_; + using ::testing::Return; + using ::testing::Invoke; + } + + MOCK_METHOD1(g_list_length, guint (GList*)); +}; + +#endif // UNIT_TESTS_MOCK_GLIB_MOCK_H_ diff --git a/unittest/mock/mock_hook.h b/unittest/mock/mock_hook.h new file mode 100644 index 0000000..29b0932 --- /dev/null +++ b/unittest/mock/mock_hook.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIT_TESTS_MOCK_MOCK_HOOK_H_ +#define UNIT_TESTS_MOCK_MOCK_HOOK_H_ + +#define MOCK_HOOK_P0(MOCK_CLASS, f) \ + TestFixture::GetMock<MOCK_CLASS>().f() +#define MOCK_HOOK_P1(MOCK_CLASS, f, p1) \ + TestFixture::GetMock<MOCK_CLASS>().f(p1) +#define MOCK_HOOK_P2(MOCK_CLASS, f, p1, p2) \ + TestFixture::GetMock<MOCK_CLASS>().f(p1, p2) +#define MOCK_HOOK_P3(MOCK_CLASS, f, p1, p2, p3) \ + TestFixture::GetMock<MOCK_CLASS>().f(p1, p2, p3) +#define MOCK_HOOK_P4(MOCK_CLASS, f, p1, p2, p3, p4) \ + TestFixture::GetMock<MOCK_CLASS>().f(p1, p2, p3, p4) +#define MOCK_HOOK_P5(MOCK_CLASS, f, p1, p2, p3, p4, p5) \ + TestFixture::GetMock<MOCK_CLASS>().f(p1, p2, p3, p4, p5) +#define MOCK_HOOK_P6(MOCK_CLASS, f, p1, p2, p3, p4, p5, p6) \ + TestFixture::GetMock<MOCK_CLASS>().f(p1, p2, p3, p4, p5, p6) +#define MOCK_HOOK_P7(MOCK_CLASS, f, p1, p2, p3, p4, p5, p6, p7) \ + TestFixture::GetMock<MOCK_CLASS>().f(p1, p2, p3, p4, p5, p6, p7) +#define MOCK_HOOK_P8(MOCK_CLASS, f, p1, p2, p3, p4, p5, p6, p7, p8) \ + TestFixture::GetMock<MOCK_CLASS>().f(p1, p2, p3, p4, p5, p6, p7, p8) +#define MOCK_HOOK_P10(MOCK_CLASS, f, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) \ + TestFixture::GetMock<MOCK_CLASS>().f( \ + p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) +#define MOCK_HOOK_P11(MOCK_CLASS, f, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) \ + TestFixture::GetMock<MOCK_CLASS>().f( \ + p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11) + +#endif // UNIT_TESTS_MOCK_MOCK_HOOK_H_ diff --git a/mock/system_info_mock.h b/unittest/mock/module_mock.h index de826a1..bfcb05e 100644 --- a/mock/system_info_mock.h +++ b/unittest/mock/module_mock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,20 +14,12 @@ * limitations under the License. */ -#ifndef MOCK_SYSTEM_INFO_H_ -#define MOCK_SYSTEM_INFO_H_ +#ifndef UNIT_TESTS_MOCK_MODULE_MOCK_H_ +#define UNIT_TESTS_MOCK_MODULE_MOCK_H_ -#include "mock.h" +class ModuleMock { + public: + virtual ~ModuleMock() {} +}; -#ifdef __cplusplus -extern "C" { -#endif - -DECLARE_FAKE_VALUE_FUNC(int, system_info_get_platform_bool, - const char *, bool *); -DECLARE_FAKE_VALUE_FUNC(uid_t, getuid); - -#ifdef __cplusplus -} -#endif -#endif /* MOCK_SYSTEM_INFO_H_ */
\ No newline at end of file +#endif // UNIT_TESTS_MOCK_MODULE_MOCK_H_ diff --git a/unittest/mock/pkgmgr-info_mock.cc b/unittest/mock/pkgmgr-info_mock.cc new file mode 100644 index 0000000..f27fdd2 --- /dev/null +++ b/unittest/mock/pkgmgr-info_mock.cc @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "pkgmgr-info_mock.h" + +#include "mock_hook.h" +#include "test_fixture.h" + +extern "C" int pkgmgrinfo_pkginfo_get_usr_pkginfo(const char* arg1, uid_t arg2, + pkgmgrinfo_pkginfo_h* arg3) { + return MOCK_HOOK_P3(PkgMgrInfoMock, pkgmgrinfo_pkginfo_get_usr_pkginfo, + arg1, arg2, arg3); +} + +extern "C" int pkgmgrinfo_pkginfo_get_mainappid(pkgmgrinfo_pkginfo_h arg1, + char** arg2) { + return MOCK_HOOK_P2(PkgMgrInfoMock, pkgmgrinfo_pkginfo_get_mainappid, + arg1, arg2); +} + +extern "C" int pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_appinfo_h arg1) { + return MOCK_HOOK_P1(PkgMgrInfoMock, pkgmgrinfo_pkginfo_destroy_pkginfo, arg1); +}
\ No newline at end of file diff --git a/unittest/mock/pkgmgr-info_mock.h b/unittest/mock/pkgmgr-info_mock.h new file mode 100644 index 0000000..891e8c1 --- /dev/null +++ b/unittest/mock/pkgmgr-info_mock.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIT_TESTS_MOCK_PKGMGR_INFO_MOCK_H_ +#define UNIT_TESTS_MOCK_PKGMGR_INFO_MOCK_H_ + +#include <gmock/gmock.h> +#include <pkgmgr-info.h> + +#include "module_mock.h" + +class PkgMgrInfoMock : public virtual ModuleMock { + public: + virtual ~PkgMgrInfoMock() {} + + MOCK_METHOD3(pkgmgrinfo_pkginfo_get_usr_pkginfo, + int (const char*, uid_t, pkgmgrinfo_pkginfo_h*)); + MOCK_METHOD2(pkgmgrinfo_pkginfo_get_mainappid, + int (pkgmgrinfo_pkginfo_h, char**)); + MOCK_METHOD1(pkgmgrinfo_pkginfo_destroy_pkginfo, + int (pkgmgrinfo_pkginfo_h)); +}; + +#endif // UNIT_TESTS_MOCK_PKGMGR_INFO_MOCK_H_
\ No newline at end of file diff --git a/unittest/mock/sqlite3_mock.cc b/unittest/mock/sqlite3_mock.cc new file mode 100644 index 0000000..ac6dd6f --- /dev/null +++ b/unittest/mock/sqlite3_mock.cc @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mock_hook.h" +#include "test_fixture.h" +#include "sqlite3_mock.h" + +typedef int(*cb)(void*, int); +typedef int(*execcb)(void*, int, char**, char**); +typedef void(*bindcb)(void*); + +extern "C" int sqlite3_step(sqlite3_stmt* arg0) { + return MOCK_HOOK_P1(SqlMock, sqlite3_step, arg0); +} + +extern "C" int sqlite3_prepare_v2(sqlite3* arg0, const char* arg1, + int arg2, sqlite3_stmt** arg3, const char** arg4) { + return MOCK_HOOK_P5(SqlMock, sqlite3_prepare_v2, arg0, arg1, arg2, arg3, arg4); +} + +extern "C" int sqlite3_open_v2(const char* arg0, + sqlite3** arg1, int arg2, const char* arg3) { + return MOCK_HOOK_P4(SqlMock, sqlite3_open_v2, arg0, arg1, arg2, arg3); +} + +extern "C" int sqlite3_close_v2(sqlite3* arg0) { + return MOCK_HOOK_P1(SqlMock, sqlite3_close_v2, arg0); +} + +extern "C" int sqlite3_changes(sqlite3* arg0) { + return MOCK_HOOK_P1(SqlMock, sqlite3_changes, arg0); +} + +extern "C" void sqlite3_free_table(char** arg0) { + return MOCK_HOOK_P1(SqlMock, sqlite3_free_table, arg0); +} + +extern "C" int sqlite3_busy_handler(sqlite3* arg0, cb arg1, void* arg2) { + return MOCK_HOOK_P3(SqlMock, sqlite3_busy_handler, arg0, arg1, arg2); +} + +extern "C" int sqlite3_get_table(sqlite3* arg0, const char* arg1, + char*** arg2, int* arg3, int* arg4, char** arg5) { + return MOCK_HOOK_P6(SqlMock, sqlite3_get_table, arg0, arg1, arg2, arg3, + arg4, arg5); +} + +extern "C" int sqlite3_exec(sqlite3* arg0, const char* arg1, + execcb arg2, void* arg3, char** arg4) { + return MOCK_HOOK_P5(SqlMock, sqlite3_exec, arg0, arg1, arg2, arg3, arg4); +} + +extern "C" int sqlite3_prepare(sqlite3* arg0, const char* arg1, + int arg2, sqlite3_stmt** arg3, const char** arg4) { + return MOCK_HOOK_P5(SqlMock, sqlite3_prepare, arg0, arg1, arg2, arg3, arg4); +} + +extern "C" int sqlite3_bind_text(sqlite3_stmt* arg0, int arg1, const char* arg2, + int arg3, bindcb arg4) { + return MOCK_HOOK_P5(SqlMock, sqlite3_bind_text, arg0, arg1, arg2, arg3, arg4); +} + +extern "C" int sqlite3_bind_int(sqlite3_stmt* arg0, int arg1, int arg2) { + return MOCK_HOOK_P3(SqlMock, sqlite3_bind_int, arg0, arg1, arg2); +} + +extern "C" int sqlite3_bind_double(sqlite3_stmt* arg0, int arg1, double arg2) { + return MOCK_HOOK_P3(SqlMock, sqlite3_bind_double, arg0, arg1, arg2); +} + +extern "C" const unsigned char* sqlite3_column_text(sqlite3_stmt* arg0, int arg1) { + return MOCK_HOOK_P2(SqlMock, sqlite3_column_text, arg0, arg1); +} + +extern "C" int sqlite3_column_int(sqlite3_stmt* arg0, int arg1) { + return MOCK_HOOK_P2(SqlMock, sqlite3_column_int, arg0, arg1); +} + +extern "C" double sqlite3_column_double(sqlite3_stmt* arg0, int arg1) { + return MOCK_HOOK_P2(SqlMock, sqlite3_column_double, arg0, arg1); +} + +extern "C" int sqlite3_finalize(sqlite3_stmt* arg0) { + return MOCK_HOOK_P1(SqlMock, sqlite3_finalize, arg0); +}
\ No newline at end of file diff --git a/unittest/mock/sqlite3_mock.h b/unittest/mock/sqlite3_mock.h new file mode 100644 index 0000000..3beea6b --- /dev/null +++ b/unittest/mock/sqlite3_mock.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIT_TESTS_MOCK_SQLITE3_MOCK_H_ +#define UNIT_TESTS_MOCK_SQLITE3_MOCK_H_ + +#include <gmock/gmock.h> +#include <sqlite3.h> + +#include "module_mock.h" + +class SqlMock : public virtual ModuleMock { + public: + virtual ~SqlMock() {} + MOCK_METHOD1(sqlite3_step, int(sqlite3_stmt*)); + MOCK_METHOD5(sqlite3_prepare_v2, int(sqlite3*, const char*, + int, sqlite3_stmt**, const char**)); + + MOCK_METHOD1(sqlite3_free_table, void(char**)); + MOCK_METHOD1(sqlite3_close_v2, int(sqlite3*)); + MOCK_METHOD1(sqlite3_changes, int(sqlite3*)); + MOCK_METHOD3(sqlite3_busy_handler, int(sqlite3*, int(*)(void*, int), void*)); + MOCK_METHOD4(sqlite3_open_v2, int(const char*, sqlite3**, int, const char*)); + MOCK_METHOD6(sqlite3_get_table, int (sqlite3*, const char*, char***, + int*, int*, char**)); + MOCK_METHOD5(sqlite3_exec, int(sqlite3*, const char*, + int(*)(void*, int, char**, char**), void*, char**)); + MOCK_METHOD5(sqlite3_prepare, int(sqlite3*, const char*, + int, sqlite3_stmt**, const char**)); + + MOCK_METHOD5(sqlite3_bind_text, int(sqlite3_stmt*, int, const char*, + int, void(*)(void*))); + MOCK_METHOD3(sqlite3_bind_int, int(sqlite3_stmt*, int, int)); + MOCK_METHOD3(sqlite3_bind_double, int(sqlite3_stmt*, int, double)); + MOCK_METHOD2(sqlite3_column_text, const unsigned char*(sqlite3_stmt*, int)); + MOCK_METHOD2(sqlite3_column_int, int(sqlite3_stmt*, int)); + MOCK_METHOD2(sqlite3_column_double, double(sqlite3_stmt*, int)); + MOCK_METHOD1(sqlite3_finalize, int(sqlite3_stmt*)); + +}; + +#endif // UNIT_TESTS_MOCK_SQLITE3_MOCK_H_ diff --git a/mock/tzplatform_config_mock.h b/unittest/mock/system_info_mock.cc index 423dbf0..9d83ca3 100644 --- a/mock/tzplatform_config_mock.h +++ b/unittest/mock/system_info_mock.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,24 +14,15 @@ * limitations under the License. */ -#ifndef MOCK_TZPLATFORM_CONFIG_H_ -#define MOCK_TZPLATFORM_CONFIG_H_ +#include "system_info_mock.h" -#include "mock.h" +#include "mock_hook.h" +#include "test_fixture.h" -#ifdef __cplusplus -extern "C" { -#endif - -enum tzplatform_variable { - USER = 0, - SYSTEM = 1, -}; - -DECLARE_FAKE_VALUE_FUNC(const char *, tzplatform_mkpath, - enum tzplatform_variable, const char *); - -#ifdef __cplusplus +extern "C" uid_t getuid(void) { + return MOCK_HOOK_P0(SystemInfoMock, getuid); } -#endif -#endif /* MOCK_TZPLATFORM_CONFIG_H_ */
\ No newline at end of file + +extern "C" int system_info_get_platform_bool(const char* arg1, bool* arg2) { + return MOCK_HOOK_P2(SystemInfoMock, system_info_get_platform_bool, arg1, arg2); +}
\ No newline at end of file diff --git a/mock/fcntl_mock.h b/unittest/mock/system_info_mock.h index 52de55c..3d24290 100644 --- a/mock/fcntl_mock.h +++ b/unittest/mock/system_info_mock.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,21 +14,24 @@ * limitations under the License. */ -#ifndef MOCK_FCNTL_H_ -#define MOCK_FCNTL_H_ +#ifndef UNIT_TESTS_MOCK_SYSTEM_INFO_MOCK_H_ +#define UNIT_TESTS_MOCK_SYSTEM_INFO_MOCK_H_ -#include "mock.h" +#include <system_info.h> +#include <gmock/gmock.h> -#ifdef __cplusplus -extern "C" { -#endif +#include "module_mock.h" -DECLARE_FAKE_VALUE_FUNC(int, open, const char *, int); -DECLARE_FAKE_VALUE_FUNC(ssize_t, read, int, void *, size_t); -DECLARE_FAKE_VALUE_FUNC(int, chown, const char *, uid_t, gid_t); -DECLARE_FAKE_VALUE_FUNC(int, chmod, const char *, mode_t); +class SystemInfoMock : public virtual ModuleMock { + public: + SystemInfoMock() { + using ::testing::_; + using ::testing::Return; + using ::testing::Invoke; + } -#ifdef __cplusplus -} -#endif -#endif /* MOCK_FCNTL_H_ */
\ No newline at end of file + MOCK_METHOD0(getuid, uid_t (void)); + MOCK_METHOD2(system_info_get_platform_bool, int (const char*, bool*)); +}; + +#endif // UNIT_TESTS_MOCK_SYSTEM_INFO_MOCK_H_
\ No newline at end of file diff --git a/mock/mock.h b/unittest/mock/test_fixture.cc index 2ba0991..27f5666 100644 --- a/mock/mock.h +++ b/unittest/mock/test_fixture.cc @@ -14,9 +14,8 @@ * limitations under the License. */ -#ifndef MOCK_MOCK_H__ -#define MOCK_MOCK_H__ +#include "test_fixture.h" -#include "fff.h" +#include <memory> -#endif // MOCK_MOCK_H__ +std::unique_ptr<ModuleMock> TestFixture::mock_; diff --git a/unittest/mock/test_fixture.h b/unittest/mock/test_fixture.h new file mode 100644 index 0000000..1ea3b8f --- /dev/null +++ b/unittest/mock/test_fixture.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIT_TESTS_MOCK_TEST_FIXTURE_H_ +#define UNIT_TESTS_MOCK_TEST_FIXTURE_H_ + +#include <gtest/gtest.h> + +#include <memory> +#include <stdexcept> +#include <string> +#include <utility> + +#include "module_mock.h" + +class TestFixture : public ::testing::Test { + public: + explicit TestFixture(std::unique_ptr<ModuleMock>&& mock) { + mock_ = std::move(mock); + } + virtual ~TestFixture() { + mock_.reset(); + } + + virtual void SetUp() {} + virtual void TearDown() {} + + template <typename T> + static T& GetMock() { + auto ptr = dynamic_cast<T*>(mock_.get()); + if (!ptr) + throw std::invalid_argument("The test does not provide mock of \"" + + std::string(typeid(T).name()) + "\""); + return *ptr; + } + + static std::unique_ptr<ModuleMock> mock_; +}; + +#endif // UNIT_TESTS_MOCK_TEST_FIXTURE_H_ diff --git a/unittest/mock/tzplatform_config_mock.cc b/unittest/mock/tzplatform_config_mock.cc new file mode 100644 index 0000000..05e3211 --- /dev/null +++ b/unittest/mock/tzplatform_config_mock.cc @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "tzplatform_config_mock.h" + +#include "mock_hook.h" +#include "test_fixture.h" + +extern "C" const char* tzplatform_mkpath(enum tzplatform_variable arg1, const char* arg2) { + return MOCK_HOOK_P2(TzplatformConfigMock, tzplatform_mkpath, arg1, arg2); +}
\ No newline at end of file diff --git a/unittest/mock/tzplatform_config_mock.h b/unittest/mock/tzplatform_config_mock.h new file mode 100644 index 0000000..a251057 --- /dev/null +++ b/unittest/mock/tzplatform_config_mock.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef UNIT_TESTS_MOCK_TZPLATFORM_CONFIG_MOCK_H_ +#define UNIT_TESTS_MOCK_TZPLATFORM_CONFIG_MOCK_H_ + +#include <tzplatform_config.h> +#include <gmock/gmock.h> + +#include "module_mock.h" + +class TzplatformConfigMock : public virtual ModuleMock { + public: + TzplatformConfigMock() { + using ::testing::_; + using ::testing::Return; + using ::testing::Invoke; + } + + MOCK_METHOD2(tzplatform_mkpath, const char* (enum tzplatform_variable, + const char*)); +}; + +#endif // UNIT_TESTS_MOCK_TZPLATFORM_CONFIG_MOCK_H_
\ No newline at end of file diff --git a/unittest/src/test_main.cc b/unittest/src/test_main.cc index bc22e69..8065f0f 100644 --- a/unittest/src/test_main.cc +++ b/unittest/src/test_main.cc @@ -16,7 +16,6 @@ #include <gtest/gtest.h> #include <gmock/gmock.h> -#include "mock/db_mock.h" int main(int argc, char** argv){ int ret = -1; diff --git a/unittest/src/test_widget_service.cc b/unittest/src/test_widget_service.cc index d07a382..3c8b381 100644 --- a/unittest/src/test_widget_service.cc +++ b/unittest/src/test_widget_service.cc @@ -23,13 +23,20 @@ #include "include/widget_service.h" #include "include/widget_errno.h" #include "include/widget_service_internal.h" -#include "mock/system_info_mock.h" -#include "mock/aul_mock.h" -#include "mock/cynara_mock.h" -#include "mock/fcntl_mock.h" -#include "mock/tzplatform_config_mock.h" -#include "mock/db_mock.h" -#include "mock/pkgmgr_info_mock.h" +#include "system_info_mock.h" +#include "aul_mock.h" +#include "cynara_mock.h" +#include "glib_mock.h" +#include "sqlite3_mock.h" +#include "tzplatform_config_mock.h" +#include "pkgmgr-info_mock.h" +#include "test_fixture.h" + +using ::testing::_; +using ::testing::DoAll; +using ::testing::Invoke; +using ::testing::SetArgPointee; +using ::testing::Return; namespace { @@ -38,10 +45,6 @@ int __fake_system_info_get_platform_bool(const char* key, bool* value) { return 0; } -uid_t __fake_getuid(void) { - return (uid_t)0; -} - int __fake_aul_widget_service_set_disable(const char* widget_id, bool disabled) { return 0; } @@ -59,35 +62,6 @@ int __fake_cynara_finish(cynara* cyn) { return 0; } -int __fake_open(const char* path, int flag) { - auto o_open = reinterpret_cast<decltype(open)*>(dlsym(RTLD_NEXT, "open")); - if (o_open != nullptr) - o_open(path, flag); - return 0; -} - -ssize_t __fake_read(int fd, void* buf, size_t size) { - /* - auto o_read = reinterpret_cast<decltype(read)*>(dlsym(RTLD_NEXT, "read")); - if (o_read != nullptr) - o_read(fd, buf, size); - */ - return 0; -} - -int __fake_chown(const char *pathname, uid_t owner, gid_t group) { - auto o_chown = reinterpret_cast<decltype(chown)*>(dlsym(RTLD_NEXT, "chown")); - if (o_chown != nullptr) - o_chown(pathname, owner, group); - return 0; -} -int __fake_chmod(const char *pathname, mode_t mode) { - auto o_chmod = reinterpret_cast<decltype(chmod)*>(dlsym(RTLD_NEXT, "chmod")); - if (o_chmod != nullptr) - o_chmod(pathname, mode); - return 0; -} - int __fake_aul_app_com_create(const char *endpoint, aul_app_com_permission_h permission, app_com_cb callback, void *user_data, aul_app_com_connection_h *connection) { static int __not_null; @@ -151,7 +125,7 @@ int __fake_aul_widget_instance_foreach(const char *widget_id, aul_widget_instanc } const char *__fake_tzplatform_mkpath(enum tzplatform_variable id, const char *path) { - return get_db_path(); + return ".widget_test.db"; } int __fake_pkgmgrinfo_pkginfo_get_usr_pkginfo(const char *pkgid, @@ -168,47 +142,49 @@ int __fake_pkgmgrinfo_pkginfo_destroy_pkginfo(pkgmgrinfo_pkginfo_h handle) { return PMINFO_R_OK; } -class WidgetServiceTest : public ::testing::Test { - public: - virtual void SetUp() { - system_info_get_platform_bool_fake.custom_fake = __fake_system_info_get_platform_bool; - aul_widget_service_set_disable_fake.custom_fake = __fake_aul_widget_service_set_disable; - cynara_initialize_fake.custom_fake = __fake_cynara_initialize; - cynara_check_fake.custom_fake = __fake_cynara_check; - cynara_finish_fake.custom_fake = __fake_cynara_finish; - open_fake.custom_fake = __fake_open; - read_fake.custom_fake = __fake_read; - chmod_fake.custom_fake = __fake_chmod; - chown_fake.custom_fake = __fake_chown; - aul_app_com_create_fake.custom_fake = __fake_aul_app_com_create; - aul_app_com_leave_fake.custom_fake = __fake_aul_app_com_leave; - aul_widget_instance_update_fake.custom_fake = __fake_aul_widget_instance_update; - aul_widget_instance_foreach_fake.custom_fake = __fake_aul_widget_instance_foreach; - aul_widget_instance_get_content_fake.custom_fake = __fake_aul_widget_instance_get_content; - aul_widget_instance_count_fake.custom_fake = __fake_aul_widget_instance_count; - tzplatform_mkpath_fake.custom_fake = __fake_tzplatform_mkpath; - getuid_fake.custom_fake = __fake_getuid; - pkgmgrinfo_pkginfo_get_usr_pkginfo_fake.custom_fake = __fake_pkgmgrinfo_pkginfo_get_usr_pkginfo; - pkgmgrinfo_pkginfo_get_mainappid_fake.custom_fake = __fake_pkgmgrinfo_pkginfo_get_mainappid; - pkgmgrinfo_pkginfo_destroy_pkginfo_fake.custom_fake = __fake_pkgmgrinfo_pkginfo_destroy_pkginfo; - } - virtual void TearDown() { - } +class Mocks : virtual public ::testing::NiceMock<AulMock>, + virtual public ::testing::NiceMock<CynaraMock>, + virtual public ::testing::NiceMock<GlibMock>, + virtual public ::testing::NiceMock<PkgMgrInfoMock>, + virtual public ::testing::NiceMock<SystemInfoMock>, + virtual public ::testing::NiceMock<SqlMock>, + virtual public ::testing::NiceMock<TzplatformConfigMock> {}; + +} // namespace + +class WidgetServiceTest : public TestFixture { + public: + WidgetServiceTest() : TestFixture(std::make_unique<::Mocks>()) {} + void SetUp() override { + table_ = (char** )calloc(10, sizeof(char*)); + db_ = (sqlite3*) table_; + } + void TearDown() override { + free(table_); + } + + char **table_; + sqlite3 *db_; }; /* internal api */ -TEST_F(WidgetServiceTest, CheckDBIntegrity) { - int ret; +// TEST_F(WidgetServiceTest, CheckDBIntegrity) { +// int ret; - // create db - ret = widget_service_check_db_integrity(false); - ASSERT_EQ(ret, WIDGET_ERROR_NONE); +// // create db +// ret = widget_service_check_db_integrity(false); +// ASSERT_EQ(ret, WIDGET_ERROR_NONE); - // insert default data - insert_default_data(); -} +// // insert default data +// insert_default_data(); +// } TEST_F(WidgetServiceTest, SetDisabled) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<AulMock>(), aul_widget_service_set_disable(_, _)) + .WillRepeatedly(Invoke(__fake_aul_widget_service_set_disable)); + int ret; ret = widget_service_set_widget_disabled("org.tizen.test_widget", true); @@ -216,6 +192,21 @@ TEST_F(WidgetServiceTest, SetDisabled) { } TEST_F(WidgetServiceTest, GetDisabled) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillOnce(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillOnce(Return(SQLITE_ROW)); + int ret = WIDGET_ERROR_NONE; bool is_disabled; @@ -228,6 +219,16 @@ void _widget_disable_event_cb(const char *widget_id, bool is_disabled, void *use } TEST_F(WidgetServiceTest, SetDisabledEventCallback) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<AulMock>(), aul_app_com_create(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_aul_app_com_create)); int ret; ret = widget_service_set_disable_event_cb(_widget_disable_event_cb, NULL); @@ -235,6 +236,19 @@ TEST_F(WidgetServiceTest, SetDisabledEventCallback) { } TEST_F(WidgetServiceTest, UnsetDisabledEventCallback) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<AulMock>(), aul_app_com_create(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_aul_app_com_create)); + EXPECT_CALL(GetMock<AulMock>(), aul_app_com_leave(_)) + .WillRepeatedly(Invoke(__fake_aul_app_com_leave)); + int ret; ret = widget_service_set_disable_event_cb(_widget_disable_event_cb, NULL); @@ -243,6 +257,9 @@ TEST_F(WidgetServiceTest, UnsetDisabledEventCallback) { } TEST_F(WidgetServiceTest, GetSize) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + int ret; int width, height; @@ -251,6 +268,9 @@ TEST_F(WidgetServiceTest, GetSize) { } TEST_F(WidgetServiceTest, GetSizeType) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + int ret; widget_size_type_e type; @@ -259,6 +279,15 @@ TEST_F(WidgetServiceTest, GetSizeType) { } TEST_F(WidgetServiceTest, GetNeedOfMouseEvent) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + int ret; bool need_of_event; @@ -268,6 +297,15 @@ TEST_F(WidgetServiceTest, GetNeedOfMouseEvent) { } TEST_F(WidgetServiceTest, GetNeedOfTouchEffect) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + int ret; bool need_of_event; @@ -277,6 +315,15 @@ TEST_F(WidgetServiceTest, GetNeedOfTouchEffect) { } TEST_F(WidgetServiceTest, GetNeedOfFrame) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + int ret; bool need_of_frame; @@ -286,6 +333,17 @@ TEST_F(WidgetServiceTest, GetNeedOfFrame) { } TEST_F(WidgetServiceTest, TriggerUpdate) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<AulMock>(), aul_widget_instance_update(_, _, _)) + .WillRepeatedly(Invoke(__fake_aul_widget_instance_update)); + int ret; ret = widget_service_trigger_update("org.tizen.test_widget", @@ -294,6 +352,11 @@ TEST_F(WidgetServiceTest, TriggerUpdate) { } TEST_F(WidgetServiceTest, ChangePeriod) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<AulMock>(), aul_widget_instance_foreach(_, _, _)) + .WillRepeatedly(Invoke(__fake_aul_widget_instance_foreach)); + int ret; ret = widget_service_change_period("org.tizen.test_widget", @@ -306,6 +369,21 @@ int _widget_list_cb(const char *pkgid, const char *widget_id, int is_prime, void } TEST_F(WidgetServiceTest, GetWidgetList) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<GlibMock>(), + g_list_length(_)).WillOnce(Return(1)); + int ret; ret = widget_service_get_widget_list(_widget_list_cb, NULL); @@ -313,6 +391,33 @@ TEST_F(WidgetServiceTest, GetWidgetList) { } TEST_F(WidgetServiceTest, GetMainAppId) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_get_usr_pkginfo(_, _, _)) + .WillRepeatedly(Invoke(__fake_pkgmgrinfo_pkginfo_get_usr_pkginfo)); + EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_get_mainappid(_, _)) + .WillRepeatedly(Invoke(__fake_pkgmgrinfo_pkginfo_get_mainappid)); + EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_destroy_pkginfo(_)) + .WillRepeatedly(Invoke(__fake_pkgmgrinfo_pkginfo_destroy_pkginfo)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_int(_, _)) + .WillRepeatedly(Return(3)); + char *app_id = NULL; app_id = widget_service_get_main_app_id("org.tizen.test_widget"); @@ -325,6 +430,15 @@ int _widget_list_by_pkgid_cb(const char *widget_id, int is_prime, void *user_dat } TEST_F(WidgetServiceTest, GetWidgetListByPkgId) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + int ret; ret = widget_service_get_widget_list_by_pkgid("org.tizen.test_widget", _widget_list_by_pkgid_cb, NULL); @@ -332,6 +446,33 @@ TEST_F(WidgetServiceTest, GetWidgetListByPkgId) { } TEST_F(WidgetServiceTest, GetWidgetId) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_get_usr_pkginfo(_, _, _)) + .WillRepeatedly(Invoke(__fake_pkgmgrinfo_pkginfo_get_usr_pkginfo)); + EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_get_mainappid(_, _)) + .WillRepeatedly(Invoke(__fake_pkgmgrinfo_pkginfo_get_mainappid)); + EXPECT_CALL(GetMock<PkgMgrInfoMock>(), pkgmgrinfo_pkginfo_destroy_pkginfo(_)) + .WillRepeatedly(Invoke(__fake_pkgmgrinfo_pkginfo_destroy_pkginfo)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_text(_, _)) + .WillRepeatedly(Return((unsigned char*)"org.tizen.test_widget")); + char *widget_id = NULL; widget_id = widget_service_get_widget_id("org.tizen.test_appid"); @@ -340,14 +481,57 @@ TEST_F(WidgetServiceTest, GetWidgetId) { } TEST_F(WidgetServiceTest, GetAppIdOfSetupApp) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_text(_, _)) + .WillRepeatedly(Return((unsigned char*)"org.tizen.setup_appid")); + char *app_id = NULL; app_id = widget_service_get_app_id_of_setup_app("org.tizen.test_widget"); auto p = std::unique_ptr<char, decltype(std::free)*>(app_id, std::free); + ASSERT_STREQ(p.get(), "org.tizen.setup_appid"); } TEST_F(WidgetServiceTest, GetPackageId) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_text(_, _)) + .WillRepeatedly(Return((unsigned char*)"org.tizen.test_pkgid")); + char *package_id = NULL; package_id = widget_service_get_package_id("org.tizen.test_widget"); @@ -356,6 +540,27 @@ TEST_F(WidgetServiceTest, GetPackageId) { } TEST_F(WidgetServiceTest, GetName) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_text(_, _)) + .WillRepeatedly(Return((unsigned char*)"TestWidget")); + char *name = NULL; name = widget_service_get_name("org.tizen.test_widget", "en-us"); @@ -364,6 +569,27 @@ TEST_F(WidgetServiceTest, GetName) { } TEST_F(WidgetServiceTest, GetPreviewImagePath) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_text(_, _)) + .WillRepeatedly(Return((unsigned char*)"/unittest/preview.png")); + char *path = NULL; path = widget_service_get_preview_image_path( @@ -373,6 +599,27 @@ TEST_F(WidgetServiceTest, GetPreviewImagePath) { } TEST_F(WidgetServiceTest, GetIcon) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_text(_, _)) + .WillRepeatedly(Return((unsigned char*)"/unittest/icon.png")); + char *path = NULL; path = widget_service_get_icon("org.tizen.test_pkgid", "en-us"); @@ -381,6 +628,27 @@ TEST_F(WidgetServiceTest, GetIcon) { } TEST_F(WidgetServiceTest, GetNodisplay) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_int(_, _)) + .WillRepeatedly(Return(2)); + int ret = WIDGET_ERROR_NONE; ret = widget_service_get_nodisplay("org.tizen.test_widget"); @@ -388,6 +656,30 @@ TEST_F(WidgetServiceTest, GetNodisplay) { } TEST_F(WidgetServiceTest, GetSupportedSizes) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).Times(3) + .WillOnce(Return(SQLITE_ROW)) + .WillOnce(Return(SQLITE_DONE)) + .WillOnce(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_int(_, _)) + .WillRepeatedly(Return(3)); + int ret; int cnt = 10; int *w; @@ -398,6 +690,30 @@ TEST_F(WidgetServiceTest, GetSupportedSizes) { } TEST_F(WidgetServiceTest, GetSupportedSizeTypes) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).Times(3) + .WillOnce(Return(SQLITE_ROW)) + .WillOnce(Return(SQLITE_DONE)) + .WillOnce(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_int(_, _)) + .WillRepeatedly(Return(3)); + int ret; int cnt = 10; int *types; @@ -406,11 +722,22 @@ TEST_F(WidgetServiceTest, GetSupportedSizeTypes) { ASSERT_EQ(ret, WIDGET_ERROR_NONE); } -int _widget_instance_list_cb(const char *widget_id, const char *instance_id, void *user_data) { +static int _widget_instance_list_cb(const char *widget_id, const char *instance_id, void *user_data) { return 0; } TEST_F(WidgetServiceTest, GetInstanceList) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<AulMock>(), aul_widget_instance_foreach(_, _, _)) + .WillRepeatedly(Invoke(__fake_aul_widget_instance_foreach)); + int ret; struct instance_cb cb_data; @@ -430,6 +757,9 @@ int _widget_lifecycle_event_cb(const char *widget_id, widget_lifecycle_event_e l } TEST_F(WidgetServiceTest, SetLifecycleEventCb) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + int ret; ret = widget_service_set_lifecycle_event_cb("org.tizen.test_widget", @@ -439,6 +769,9 @@ TEST_F(WidgetServiceTest, SetLifecycleEventCb) { TEST_F(WidgetServiceTest, UnsetLifecycleEventCb) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + int ret; ret = widget_service_unset_lifecycle_event_cb("org.tizen.test_widget", NULL); @@ -446,6 +779,11 @@ TEST_F(WidgetServiceTest, UnsetLifecycleEventCb) { } TEST_F(WidgetServiceTest, GetContent) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<AulMock>(), aul_widget_instance_get_content(_, _, _)) + .WillRepeatedly(Invoke(__fake_aul_widget_instance_get_content)); + int ret; bundle *b; @@ -457,6 +795,27 @@ TEST_F(WidgetServiceTest, GetContent) { /* internal api */ TEST_F(WidgetServiceTest, GetWidgetMaxCount) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_column_int(_, _)) + .WillRepeatedly(Return(3)); + int ret; ret = widget_service_get_widget_max_count("org.tizen.test_widget"); @@ -465,10 +824,19 @@ TEST_F(WidgetServiceTest, GetWidgetMaxCount) { /* internal api */ TEST_F(WidgetServiceTest, GetInstanceCount) { + EXPECT_CALL(GetMock<SystemInfoMock>(), system_info_get_platform_bool(_, _)) + .WillRepeatedly(Invoke(__fake_system_info_get_platform_bool)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_initialize(_, _)) + .WillRepeatedly(Invoke(__fake_cynara_initialize)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_check(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_cynara_check)); + EXPECT_CALL(GetMock<CynaraMock>(), cynara_finish(_)) + .WillRepeatedly(Invoke(__fake_cynara_finish)); + EXPECT_CALL(GetMock<AulMock>(), aul_widget_instance_count(_)) + .WillRepeatedly(Invoke(__fake_aul_widget_instance_count)); + int ret; ret = widget_service_get_instance_count("org.tizen.test_widget", NULL, NULL); ASSERT_EQ(ret, WIDGET_ERROR_NONE); } - -} diff --git a/unittest/src/test_widget_service_instance.cc b/unittest/src/test_widget_service_instance.cc index 97ce0af..b3d882b 100644 --- a/unittest/src/test_widget_service_instance.cc +++ b/unittest/src/test_widget_service_instance.cc @@ -21,15 +21,25 @@ #include "include/widget_errno.h" #include "include/widget_instance.h" #include "include/widget_service_internal.h" -#include "mock/tzplatform_config_mock.h" -#include "mock/db_mock.h" -#include "mock/aul_mock.h" + +#include "aul_mock.h" +#include "sqlite3_mock.h" +#include "system_info_mock.h" +#include "tzplatform_config_mock.h" +#include "test_fixture.h" + +using ::testing::_; +using ::testing::DoAll; +using ::testing::Invoke; +using ::testing::SetArgPointee; +using ::testing::Return; namespace { const char *__fake_tzplatform_mkpath(enum tzplatform_variable id, const char *path) { - return get_db_path(); + return ".widget_test.db"; } + static int __pid = 77; int __fake_aul_launch_app_async(const char *appid, bundle *kb) { return __pid; @@ -62,23 +72,31 @@ int __fake_aul_terminate_pid(int pid) { return 0; } -class WidgetInstanceTest : public ::testing::Test { - public: - virtual void SetUp() { - tzplatform_mkpath_fake.custom_fake = __fake_tzplatform_mkpath; - aul_terminate_pid_fake.custom_fake= __fake_aul_terminate_pid; - aul_launch_app_async_fake.custom_fake= __fake_aul_launch_app_async; - aul_app_com_create_fake.custom_fake = __fake_aul_app_com_create; - aul_app_com_leave_fake.custom_fake = __fake_aul_app_com_leave; - aul_widget_instance_update_fake.custom_fake = __fake_aul_widget_instance_update; - aul_debug_info_init_fake.custom_fake = __fake_aul_debug_info_init; - aul_debug_info_set_fake.custom_fake = __fake_aul_debug_info_set; - } - virtual void TearDown() { - } +class Mocks : virtual public ::testing::NiceMock<AulMock>, + virtual public ::testing::NiceMock<SqlMock>, + virtual public ::testing::NiceMock<SystemInfoMock>, + virtual public ::testing::NiceMock<TzplatformConfigMock> {}; + +} // namespace + +class WidgetInstanceTest : public TestFixture { + public: + WidgetInstanceTest() : TestFixture(std::make_unique<::Mocks>()) {} + void SetUp() override { + table_ = (char** )calloc(10, sizeof(char*)); + db_ = (sqlite3*) table_; + } + void TearDown() override { + free(table_); + } + char** table_; + sqlite3* db_; }; TEST_F(WidgetInstanceTest, InstanceInit) { + EXPECT_CALL(GetMock<AulMock>(), aul_app_com_create(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_aul_app_com_create)); + int ret; ret = widget_instance_init("org.tizen.test_viewer"); @@ -88,6 +106,16 @@ TEST_F(WidgetInstanceTest, InstanceInit) { char *instance_id = NULL; TEST_F(WidgetInstanceTest, InstanceCreate) { + EXPECT_CALL(GetMock<TzplatformConfigMock>(), tzplatform_mkpath(_, _)) + .WillRepeatedly(Invoke(__fake_tzplatform_mkpath)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_open_v2(_, _, _, _)). + WillRepeatedly(DoAll(SetArgPointee<1>(db_), (Return(0)))); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_prepare_v2(_, _, _, _, _)).WillRepeatedly(Return(0)); + EXPECT_CALL(GetMock<SqlMock>(), + sqlite3_step(_)).WillRepeatedly(Return(SQLITE_ROW)); + int ret = 0; ret = widget_instance_create("org.tizen.test_widget", &instance_id); @@ -95,6 +123,9 @@ TEST_F(WidgetInstanceTest, InstanceCreate) { } TEST_F(WidgetInstanceTest, InstanceLaunch) { + EXPECT_CALL(GetMock<AulMock>(), aul_launch_app_async(_, _)) + .WillRepeatedly(Invoke(__fake_aul_launch_app_async)); + int ret = 0; ret = widget_instance_launch(instance_id, (char *)"TestContent", 4, 2); @@ -102,6 +133,9 @@ TEST_F(WidgetInstanceTest, InstanceLaunch) { } TEST_F(WidgetInstanceTest, InstanceResume) { + EXPECT_CALL(GetMock<AulMock>(), aul_launch_app_async(_, _)) + .WillRepeatedly(Invoke(__fake_aul_launch_app_async)); + int ret = 0; ret = widget_instance_resume(instance_id); @@ -109,6 +143,9 @@ TEST_F(WidgetInstanceTest, InstanceResume) { } TEST_F(WidgetInstanceTest, InstancePause) { + EXPECT_CALL(GetMock<AulMock>(), aul_launch_app_async(_, _)) + .WillRepeatedly(Invoke(__fake_aul_launch_app_async)); + int ret = 0; ret = widget_instance_pause(instance_id); @@ -116,6 +153,9 @@ TEST_F(WidgetInstanceTest, InstancePause) { } TEST_F(WidgetInstanceTest, InstanceResize) { + EXPECT_CALL(GetMock<AulMock>(), aul_launch_app_async(_, _)) + .WillRepeatedly(Invoke(__fake_aul_launch_app_async)); + int ret = 0; ret = widget_instance_resize(instance_id, 4, 2); @@ -199,7 +239,7 @@ TEST_F(WidgetInstanceTest, InstanceGetErr) { ASSERT_EQ(ret, 0); } -int _widget_instance_list_cb(const char *widget_id, const char *instance_id, void *user_data) { +static int _widget_instance_list_cb(const char *widget_id, const char *instance_id, void *user_data) { return 0; } @@ -211,6 +251,9 @@ TEST_F(WidgetInstanceTest, InstanceGetList) { } TEST_F(WidgetInstanceTest, InstanceChangePeriod) { + EXPECT_CALL(GetMock<AulMock>(), aul_widget_instance_update(_, _, _)) + .WillRepeatedly(Invoke(__fake_aul_widget_instance_update)); + int ret = 0; ret = widget_instance_change_period("org.tizen.test_widget", instance_id, 5.0); @@ -218,6 +261,9 @@ TEST_F(WidgetInstanceTest, InstanceChangePeriod) { } TEST_F(WidgetInstanceTest, InstanceTriggerUpdate) { + EXPECT_CALL(GetMock<AulMock>(), aul_widget_instance_update(_, _, _)) + .WillRepeatedly(Invoke(__fake_aul_widget_instance_update)); + int ret = 0; ret = widget_instance_trigger_update(ins, "ContentInfo", 1); @@ -243,6 +289,10 @@ TEST_F(WidgetInstanceTest, InstanceUnlistenEvent) { } TEST_F(WidgetInstanceTest, InstanceListenStatus) { + + EXPECT_CALL(GetMock<AulMock>(), aul_app_com_create(_, _, _, _, _)) + .WillRepeatedly(Invoke(__fake_aul_app_com_create)); + int ret = 0; ret = widget_instance_listen_status("org.tizen.test_widget", _widget_instance_event_cb, NULL); @@ -257,6 +307,9 @@ TEST_F(WidgetInstanceTest, InstanceUnlistenStatus) { } TEST_F(WidgetInstanceTest, InstanceTriggerUpdateV2) { + EXPECT_CALL(GetMock<AulMock>(), aul_widget_instance_update(_, _, _)) + .WillRepeatedly(Invoke(__fake_aul_widget_instance_update)); + int ret = 0; ret = widget_instance_trigger_update_v2("org.tizen.test_widget", instance_id, "ContetnInfo", 1); @@ -265,6 +318,11 @@ TEST_F(WidgetInstanceTest, InstanceTriggerUpdateV2) { TEST_F(WidgetInstanceTest, InstanceSetSdkUtil) { + EXPECT_CALL(GetMock<AulMock>(), aul_debug_info_init()) + .WillRepeatedly(Invoke(__fake_aul_debug_info_init)); + EXPECT_CALL(GetMock<AulMock>(), aul_debug_info_set(_, _)) + .WillRepeatedly(Invoke(__fake_aul_debug_info_set)); + int ret = 0; bundle *b; @@ -287,31 +345,38 @@ TEST_F(WidgetInstanceTest, InstanceRefUnref) { } TEST_F(WidgetInstanceTest, InstanceTerminate) { - int ret = 0; + EXPECT_CALL(GetMock<AulMock>(), aul_launch_app_async(_, _)) + .WillRepeatedly(Invoke(__fake_aul_launch_app_async)); + int ret = 0; ret = widget_instance_terminate(instance_id); ASSERT_EQ(ret, __pid); } TEST_F(WidgetInstanceTest, AppTerminate) { - int ret = 0; + EXPECT_CALL(GetMock<AulMock>(), aul_terminate_pid(_)) + .WillRepeatedly(Invoke(__fake_aul_terminate_pid)); + int ret = 0; ret = widget_instance_terminate_app(instance_id); ASSERT_EQ(ret, 0); } TEST_F(WidgetInstanceTest, InstanceDestroy) { - int ret = 0; + EXPECT_CALL(GetMock<AulMock>(), aul_launch_app_async(_, _)) + .WillRepeatedly(Invoke(__fake_aul_launch_app_async)); + int ret = 0; ret = widget_instance_destroy(instance_id); ASSERT_EQ(ret, __pid); } TEST_F(WidgetInstanceTest, InstanceFini) { + EXPECT_CALL(GetMock<AulMock>(), aul_app_com_leave(_)) + .WillRepeatedly(Invoke(__fake_aul_app_com_leave)); + int ret = 0; ret = widget_instance_fini(); ASSERT_EQ(ret, 0); -} - }
\ No newline at end of file |