diff --git a/module/scmi_power_domain/test/CMakeLists.txt b/module/scmi_power_domain/test/CMakeLists.txt new file mode 100644 index 000000000..3133c8e17 --- /dev/null +++ b/module/scmi_power_domain/test/CMakeLists.txt @@ -0,0 +1,27 @@ +# +# Arm SCP/MCP Software +# Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause +# + +set(TEST_SRC mod_scmi_power_domain) +set(TEST_FILE mod_scmi_power_domain) + +set(UNIT_TEST_TARGET mod_${TEST_MODULE}_unit_test) + +set(MODULE_SRC ${MODULE_ROOT}/${TEST_MODULE}/src) +set(MODULE_INC ${MODULE_ROOT}/${TEST_MODULE}/include) +list(APPEND OTHER_MODULE_INC ${MODULE_ROOT}/scmi/include) +list(APPEND OTHER_MODULE_INC ${MODULE_ROOT}/power_domain/include) +set(MODULE_UT_SRC ${CMAKE_CURRENT_LIST_DIR}) +set(MODULE_UT_INC ${CMAKE_CURRENT_LIST_DIR}) +set(MODULE_UT_MOCK_SRC ${CMAKE_CURRENT_LIST_DIR}/mocks) + +list(APPEND MOCK_REPLACEMENTS fwk_module) +list(APPEND MOCK_REPLACEMENTS fwk_id) +list(APPEND MOCK_REPLACEMENTS fwk_core) + +include(${SCP_ROOT}/unit_test/module_common.cmake) + +target_compile_definitions(${UNIT_TEST_TARGET} PUBLIC "BUILD_HAS_MOD_POWER_DOMAIN") diff --git a/module/scmi_power_domain/test/config_scmi_power_domain_ut.h b/module/scmi_power_domain/test/config_scmi_power_domain_ut.h new file mode 100644 index 000000000..61d41070a --- /dev/null +++ b/module/scmi_power_domain/test/config_scmi_power_domain_ut.h @@ -0,0 +1,35 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Description: + * SCMI System Power unit test configuration. + */ + +#include + +#include +#include +#include + +static struct mod_pd_restricted_api pd_api_ut = { + .get_domain_type = get_domain_type, + .get_domain_parent_id = get_domain_parent_id, + .set_state = set_state, + .get_state = get_state, + .reset = reset, + .system_suspend = system_suspend, + .system_shutdown = system_shutdown, +}; + +struct mod_scmi_from_protocol_api from_protocol_api = { + .get_agent_count = mod_scmi_from_protocol_api_get_agent_count, + .get_agent_id = mod_scmi_from_protocol_api_get_agent_id, + .get_agent_type = mod_scmi_from_protocol_api_get_agent_type, + .get_max_payload_size = mod_scmi_from_protocol_api_get_max_payload_size, + .write_payload = mod_scmi_from_protocol_api_write_payload, + .respond = mod_scmi_from_protocol_api_respond, + .notify = mod_scmi_from_protocol_api_notify, +}; diff --git a/module/scmi_power_domain/test/fwk_module_idx.h b/module/scmi_power_domain/test/fwk_module_idx.h new file mode 100644 index 000000000..9df98208b --- /dev/null +++ b/module/scmi_power_domain/test/fwk_module_idx.h @@ -0,0 +1,29 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef TEST_FWK_MODULE_MODULE_IDX_H +#define TEST_FWK_MODULE_MODULE_IDX_H + +#include + +enum fwk_module_idx { + FWK_MODULE_IDX_SCMI_POWER_DOMAIN, + FWK_MODULE_IDX_SCMI, + FWK_MODULE_IDX_POWER_DOMAIN, + FWK_MODULE_IDX_COUNT, +}; + +static const fwk_id_t fwk_module_id_scmi_power_domain = + FWK_ID_MODULE_INIT(FWK_MODULE_IDX_SCMI_POWER_DOMAIN); + +static const fwk_id_t fwk_module_id_scmi = + FWK_ID_MODULE_INIT(FWK_MODULE_IDX_SCMI); + +static const fwk_id_t fwk_module_id_power_domain = + FWK_ID_MODULE_INIT(FWK_MODULE_IDX_POWER_DOMAIN); + +#endif /* TEST_FWK_MODULE_MODULE_IDX_H */ diff --git a/module/scmi_power_domain/test/mocks/.clang-format b/module/scmi_power_domain/test/mocks/.clang-format new file mode 100644 index 000000000..eeca2395f --- /dev/null +++ b/module/scmi_power_domain/test/mocks/.clang-format @@ -0,0 +1,4 @@ +{ + "DisableFormat": true, + "SortIncludes": false, +} diff --git a/module/scmi_power_domain/test/mocks/Mockmod_scmi_power_domain_extra.c b/module/scmi_power_domain/test/mocks/Mockmod_scmi_power_domain_extra.c new file mode 100644 index 000000000..99f97f232 --- /dev/null +++ b/module/scmi_power_domain/test/mocks/Mockmod_scmi_power_domain_extra.c @@ -0,0 +1,2710 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ +#include +#include +#include +#include "cmock.h" +#include "Mockmod_scmi_power_domain_extra.h" + +static const char* CMockString_agent_count = "agent_count"; +static const char* CMockString_agent_id = "agent_id"; +static const char* CMockString_agent_type = "agent_type"; +static const char* CMockString_get_domain_parent_id = "get_domain_parent_id"; +static const char* CMockString_get_domain_type = "get_domain_type"; +static const char* CMockString_get_state = "get_state"; +static const char* CMockString_message_id = "message_id"; +static const char* CMockString_mod_scmi_from_protocol_api_get_agent_count = "mod_scmi_from_protocol_api_get_agent_count"; +static const char* CMockString_mod_scmi_from_protocol_api_get_agent_id = "mod_scmi_from_protocol_api_get_agent_id"; +static const char* CMockString_mod_scmi_from_protocol_api_get_agent_type = "mod_scmi_from_protocol_api_get_agent_type"; +static const char* CMockString_mod_scmi_from_protocol_api_get_max_payload_size = "mod_scmi_from_protocol_api_get_max_payload_size"; +static const char* CMockString_mod_scmi_from_protocol_api_notify = "mod_scmi_from_protocol_api_notify"; +static const char* CMockString_mod_scmi_from_protocol_api_respond = "mod_scmi_from_protocol_api_respond"; +static const char* CMockString_mod_scmi_from_protocol_api_write_payload = "mod_scmi_from_protocol_api_write_payload"; +static const char* CMockString_offset = "offset"; +static const char* CMockString_parent_pd_id = "parent_pd_id"; +static const char* CMockString_payload = "payload"; +static const char* CMockString_pd_id = "pd_id"; +static const char* CMockString_protocol_id = "protocol_id"; +static const char* CMockString_reset = "reset"; +static const char* CMockString_resp_requested = "resp_requested"; +static const char* CMockString_service_id = "service_id"; +static const char* CMockString_set_state = "set_state"; +static const char* CMockString_size = "size"; +static const char* CMockString_state = "state"; +static const char* CMockString_system_shsutdown = "system_shsutdown"; +static const char* CMockString_system_shutdown = "system_shutdown"; +static const char* CMockString_system_suspend = "system_suspend"; +static const char* CMockString_type = "type"; + +typedef struct _CMOCK_get_domain_type_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + fwk_id_t Expected_pd_id; + enum mod_pd_type* Expected_type; + int Expected_type_Depth; + char ReturnThruPtr_type_Used; + enum mod_pd_type* ReturnThruPtr_type_Val; + size_t ReturnThruPtr_type_Size; + char IgnoreArg_pd_id; + char IgnoreArg_type; + +} CMOCK_get_domain_type_CALL_INSTANCE; + +typedef struct _CMOCK_get_domain_parent_id_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + fwk_id_t Expected_pd_id; + fwk_id_t* Expected_parent_pd_id; + int Expected_parent_pd_id_Depth; + char ReturnThruPtr_parent_pd_id_Used; + fwk_id_t* ReturnThruPtr_parent_pd_id_Val; + size_t ReturnThruPtr_parent_pd_id_Size; + char IgnoreArg_pd_id; + char IgnoreArg_parent_pd_id; + +} CMOCK_get_domain_parent_id_CALL_INSTANCE; + +typedef struct _CMOCK_set_state_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + fwk_id_t Expected_pd_id; + bool Expected_resp_requested; + uint32_t Expected_state; + char IgnoreArg_pd_id; + char IgnoreArg_resp_requested; + char IgnoreArg_state; + +} CMOCK_set_state_CALL_INSTANCE; + +typedef struct _CMOCK_get_state_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + fwk_id_t Expected_pd_id; + unsigned int* Expected_state; + int Expected_state_Depth; + char ReturnThruPtr_state_Used; + unsigned int* ReturnThruPtr_state_Val; + size_t ReturnThruPtr_state_Size; + char IgnoreArg_pd_id; + char IgnoreArg_state; + +} CMOCK_get_state_CALL_INSTANCE; + +typedef struct _CMOCK_reset_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + fwk_id_t Expected_pd_id; + bool Expected_resp_requested; + char IgnoreArg_pd_id; + char IgnoreArg_resp_requested; + +} CMOCK_reset_CALL_INSTANCE; + +typedef struct _CMOCK_system_suspend_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + unsigned int Expected_state; + char IgnoreArg_state; + +} CMOCK_system_suspend_CALL_INSTANCE; + +typedef struct _CMOCK_system_shutdown_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + enum mod_pd_system_shutdown Expected_system_shsutdown; + char IgnoreArg_system_shsutdown; + +} CMOCK_system_shutdown_CALL_INSTANCE; + +typedef struct _CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + unsigned int* Expected_agent_count; + int Expected_agent_count_Depth; + char ReturnThruPtr_agent_count_Used; + unsigned int* ReturnThruPtr_agent_count_Val; + size_t ReturnThruPtr_agent_count_Size; + char IgnoreArg_agent_count; + +} CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE; + +typedef struct _CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + fwk_id_t Expected_service_id; + unsigned int* Expected_agent_id; + int Expected_agent_id_Depth; + char ReturnThruPtr_agent_id_Used; + unsigned int* ReturnThruPtr_agent_id_Val; + size_t ReturnThruPtr_agent_id_Size; + char IgnoreArg_service_id; + char IgnoreArg_agent_id; + +} CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE; + +typedef struct _CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + uint32_t Expected_agent_id; + enum scmi_agent_type* Expected_agent_type; + int Expected_agent_type_Depth; + char ReturnThruPtr_agent_type_Used; + enum scmi_agent_type* ReturnThruPtr_agent_type_Val; + size_t ReturnThruPtr_agent_type_Size; + char IgnoreArg_agent_id; + char IgnoreArg_agent_type; + +} CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE; + +typedef struct _CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + fwk_id_t Expected_service_id; + size_t* Expected_size; + int Expected_size_Depth; + char ReturnThruPtr_size_Used; + size_t* ReturnThruPtr_size_Val; + size_t ReturnThruPtr_size_Size; + char IgnoreArg_service_id; + char IgnoreArg_size; + +} CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE; + +typedef struct _CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + fwk_id_t Expected_service_id; + size_t Expected_offset; + const void* Expected_payload; + size_t Expected_size; + int Expected_payload_Depth; + char IgnoreArg_service_id; + char IgnoreArg_offset; + char IgnoreArg_payload; + char IgnoreArg_size; + +} CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE; + +typedef struct _CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + int ReturnVal; + fwk_id_t Expected_service_id; + const void* Expected_payload; + size_t Expected_size; + int Expected_payload_Depth; + char IgnoreArg_service_id; + char IgnoreArg_payload; + char IgnoreArg_size; + +} CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE; + +typedef struct _CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE +{ + UNITY_LINE_TYPE LineNumber; + char ExpectAnyArgsBool; + fwk_id_t Expected_service_id; + int Expected_protocol_id; + int Expected_message_id; + const void* Expected_payload; + size_t Expected_size; + int Expected_payload_Depth; + char IgnoreArg_service_id; + char IgnoreArg_protocol_id; + char IgnoreArg_message_id; + char IgnoreArg_payload; + char IgnoreArg_size; + +} CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE; + +static struct Mockmod_scmi_power_domain_extraInstance +{ + char get_domain_type_IgnoreBool; + int get_domain_type_FinalReturn; + char get_domain_type_CallbackBool; + CMOCK_get_domain_type_CALLBACK get_domain_type_CallbackFunctionPointer; + int get_domain_type_CallbackCalls; + CMOCK_MEM_INDEX_TYPE get_domain_type_CallInstance; + char get_domain_parent_id_IgnoreBool; + int get_domain_parent_id_FinalReturn; + char get_domain_parent_id_CallbackBool; + CMOCK_get_domain_parent_id_CALLBACK get_domain_parent_id_CallbackFunctionPointer; + int get_domain_parent_id_CallbackCalls; + CMOCK_MEM_INDEX_TYPE get_domain_parent_id_CallInstance; + char set_state_IgnoreBool; + int set_state_FinalReturn; + char set_state_CallbackBool; + CMOCK_set_state_CALLBACK set_state_CallbackFunctionPointer; + int set_state_CallbackCalls; + CMOCK_MEM_INDEX_TYPE set_state_CallInstance; + char get_state_IgnoreBool; + int get_state_FinalReturn; + char get_state_CallbackBool; + CMOCK_get_state_CALLBACK get_state_CallbackFunctionPointer; + int get_state_CallbackCalls; + CMOCK_MEM_INDEX_TYPE get_state_CallInstance; + char reset_IgnoreBool; + int reset_FinalReturn; + char reset_CallbackBool; + CMOCK_reset_CALLBACK reset_CallbackFunctionPointer; + int reset_CallbackCalls; + CMOCK_MEM_INDEX_TYPE reset_CallInstance; + char system_suspend_IgnoreBool; + int system_suspend_FinalReturn; + char system_suspend_CallbackBool; + CMOCK_system_suspend_CALLBACK system_suspend_CallbackFunctionPointer; + int system_suspend_CallbackCalls; + CMOCK_MEM_INDEX_TYPE system_suspend_CallInstance; + char system_shutdown_IgnoreBool; + int system_shutdown_FinalReturn; + char system_shutdown_CallbackBool; + CMOCK_system_shutdown_CALLBACK system_shutdown_CallbackFunctionPointer; + int system_shutdown_CallbackCalls; + CMOCK_MEM_INDEX_TYPE system_shutdown_CallInstance; + char mod_scmi_from_protocol_api_get_agent_count_IgnoreBool; + int mod_scmi_from_protocol_api_get_agent_count_FinalReturn; + char mod_scmi_from_protocol_api_get_agent_count_CallbackBool; + CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALLBACK mod_scmi_from_protocol_api_get_agent_count_CallbackFunctionPointer; + int mod_scmi_from_protocol_api_get_agent_count_CallbackCalls; + CMOCK_MEM_INDEX_TYPE mod_scmi_from_protocol_api_get_agent_count_CallInstance; + char mod_scmi_from_protocol_api_get_agent_id_IgnoreBool; + int mod_scmi_from_protocol_api_get_agent_id_FinalReturn; + char mod_scmi_from_protocol_api_get_agent_id_CallbackBool; + CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALLBACK mod_scmi_from_protocol_api_get_agent_id_CallbackFunctionPointer; + int mod_scmi_from_protocol_api_get_agent_id_CallbackCalls; + CMOCK_MEM_INDEX_TYPE mod_scmi_from_protocol_api_get_agent_id_CallInstance; + char mod_scmi_from_protocol_api_get_agent_type_IgnoreBool; + int mod_scmi_from_protocol_api_get_agent_type_FinalReturn; + char mod_scmi_from_protocol_api_get_agent_type_CallbackBool; + CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALLBACK mod_scmi_from_protocol_api_get_agent_type_CallbackFunctionPointer; + int mod_scmi_from_protocol_api_get_agent_type_CallbackCalls; + CMOCK_MEM_INDEX_TYPE mod_scmi_from_protocol_api_get_agent_type_CallInstance; + char mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool; + int mod_scmi_from_protocol_api_get_max_payload_size_FinalReturn; + char mod_scmi_from_protocol_api_get_max_payload_size_CallbackBool; + CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALLBACK mod_scmi_from_protocol_api_get_max_payload_size_CallbackFunctionPointer; + int mod_scmi_from_protocol_api_get_max_payload_size_CallbackCalls; + CMOCK_MEM_INDEX_TYPE mod_scmi_from_protocol_api_get_max_payload_size_CallInstance; + char mod_scmi_from_protocol_api_write_payload_IgnoreBool; + int mod_scmi_from_protocol_api_write_payload_FinalReturn; + char mod_scmi_from_protocol_api_write_payload_CallbackBool; + CMOCK_mod_scmi_from_protocol_api_write_payload_CALLBACK mod_scmi_from_protocol_api_write_payload_CallbackFunctionPointer; + int mod_scmi_from_protocol_api_write_payload_CallbackCalls; + CMOCK_MEM_INDEX_TYPE mod_scmi_from_protocol_api_write_payload_CallInstance; + char mod_scmi_from_protocol_api_respond_IgnoreBool; + int mod_scmi_from_protocol_api_respond_FinalReturn; + char mod_scmi_from_protocol_api_respond_CallbackBool; + CMOCK_mod_scmi_from_protocol_api_respond_CALLBACK mod_scmi_from_protocol_api_respond_CallbackFunctionPointer; + int mod_scmi_from_protocol_api_respond_CallbackCalls; + CMOCK_MEM_INDEX_TYPE mod_scmi_from_protocol_api_respond_CallInstance; + char mod_scmi_from_protocol_api_notify_IgnoreBool; + char mod_scmi_from_protocol_api_notify_CallbackBool; + CMOCK_mod_scmi_from_protocol_api_notify_CALLBACK mod_scmi_from_protocol_api_notify_CallbackFunctionPointer; + int mod_scmi_from_protocol_api_notify_CallbackCalls; + CMOCK_MEM_INDEX_TYPE mod_scmi_from_protocol_api_notify_CallInstance; +} Mock; + +extern jmp_buf AbortFrame; + +void Mockmod_scmi_power_domain_extra_Verify(void) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_MEM_INDEX_TYPE call_instance; + call_instance = Mock.get_domain_type_CallInstance; + if (Mock.get_domain_type_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_get_domain_type); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.get_domain_type_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.get_domain_parent_id_CallInstance; + if (Mock.get_domain_parent_id_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_get_domain_parent_id); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.get_domain_parent_id_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.set_state_CallInstance; + if (Mock.set_state_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_set_state); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.set_state_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.get_state_CallInstance; + if (Mock.get_state_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_get_state); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.get_state_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.reset_CallInstance; + if (Mock.reset_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_reset); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.reset_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.system_suspend_CallInstance; + if (Mock.system_suspend_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_system_suspend); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.system_suspend_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.system_shutdown_CallInstance; + if (Mock.system_shutdown_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_system_shutdown); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.system_shutdown_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance; + if (Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_get_agent_count); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance; + if (Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_get_agent_id); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance; + if (Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_get_agent_type); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance; + if (Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_get_max_payload_size); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.mod_scmi_from_protocol_api_write_payload_CallInstance; + if (Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_write_payload); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.mod_scmi_from_protocol_api_write_payload_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.mod_scmi_from_protocol_api_respond_CallInstance; + if (Mock.mod_scmi_from_protocol_api_respond_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_respond); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.mod_scmi_from_protocol_api_respond_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } + call_instance = Mock.mod_scmi_from_protocol_api_notify_CallInstance; + if (Mock.mod_scmi_from_protocol_api_notify_IgnoreBool) + call_instance = CMOCK_GUTS_NONE; + if (CMOCK_GUTS_NONE != call_instance) + { + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_notify); + UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); + } + if (Mock.mod_scmi_from_protocol_api_notify_CallbackFunctionPointer != NULL) + { + call_instance = CMOCK_GUTS_NONE; + (void)call_instance; + } +} + +void Mockmod_scmi_power_domain_extra_Init(void) +{ + Mockmod_scmi_power_domain_extra_Destroy(); +} + +void Mockmod_scmi_power_domain_extra_Destroy(void) +{ + CMock_Guts_MemFreeAll(); + memset(&Mock, 0, sizeof(Mock)); +} + +int get_domain_type(fwk_id_t pd_id, enum mod_pd_type* type) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_get_domain_type); + cmock_call_instance = (CMOCK_get_domain_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.get_domain_type_CallInstance); + Mock.get_domain_type_CallInstance = CMock_Guts_MemNext(Mock.get_domain_type_CallInstance); + if (Mock.get_domain_type_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.get_domain_type_FinalReturn; + Mock.get_domain_type_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.get_domain_type_CallbackBool && + Mock.get_domain_type_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.get_domain_type_CallbackFunctionPointer(pd_id, type, Mock.get_domain_type_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_pd_id) + { + UNITY_SET_DETAILS(CMockString_get_domain_type,CMockString_pd_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_type) + { + UNITY_SET_DETAILS(CMockString_get_domain_type,CMockString_type); + if (cmock_call_instance->Expected_type == NULL) + { UNITY_TEST_ASSERT_NULL(type, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_type), (void*)(type), sizeof(enum mod_pd_type), cmock_call_instance->Expected_type_Depth, cmock_line, CMockStringMismatch); } + } + } + if (Mock.get_domain_type_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.get_domain_type_CallbackFunctionPointer(pd_id, type, Mock.get_domain_type_CallbackCalls++); + } + if (cmock_call_instance->ReturnThruPtr_type_Used) + { + UNITY_TEST_ASSERT_NOT_NULL(type, cmock_line, CMockStringPtrIsNULL); + memcpy((void*)type, (void*)cmock_call_instance->ReturnThruPtr_type_Val, + cmock_call_instance->ReturnThruPtr_type_Size); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_get_domain_type(CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, enum mod_pd_type* type, int type_Depth); +void CMockExpectParameters_get_domain_type(CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, enum mod_pd_type* type, int type_Depth) +{ + memcpy((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), + sizeof(fwk_id_t[sizeof(pd_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_pd_id = 0; + cmock_call_instance->Expected_type = type; + cmock_call_instance->Expected_type_Depth = type_Depth; + cmock_call_instance->IgnoreArg_type = 0; + cmock_call_instance->ReturnThruPtr_type_Used = 0; +} + +void get_domain_type_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_domain_type_CALL_INSTANCE)); + CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_domain_type_CallInstance = CMock_Guts_MemChain(Mock.get_domain_type_CallInstance, cmock_guts_index); + Mock.get_domain_type_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.get_domain_type_IgnoreBool = (char)1; +} + +void get_domain_type_CMockStopIgnore(void) +{ + if(Mock.get_domain_type_IgnoreBool) + Mock.get_domain_type_CallInstance = CMock_Guts_MemNext(Mock.get_domain_type_CallInstance); + Mock.get_domain_type_IgnoreBool = (char)0; +} + +void get_domain_type_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_domain_type_CALL_INSTANCE)); + CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_domain_type_CallInstance = CMock_Guts_MemChain(Mock.get_domain_type_CallInstance, cmock_guts_index); + Mock.get_domain_type_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void get_domain_type_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, enum mod_pd_type* type, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_domain_type_CALL_INSTANCE)); + CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_domain_type_CallInstance = CMock_Guts_MemChain(Mock.get_domain_type_CallInstance, cmock_guts_index); + Mock.get_domain_type_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_get_domain_type(cmock_call_instance, pd_id, type, 1); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void get_domain_type_AddCallback(CMOCK_get_domain_type_CALLBACK Callback) +{ + Mock.get_domain_type_IgnoreBool = (char)0; + Mock.get_domain_type_CallbackBool = (char)1; + Mock.get_domain_type_CallbackFunctionPointer = Callback; +} + +void get_domain_type_Stub(CMOCK_get_domain_type_CALLBACK Callback) +{ + Mock.get_domain_type_IgnoreBool = (char)0; + Mock.get_domain_type_CallbackBool = (char)0; + Mock.get_domain_type_CallbackFunctionPointer = Callback; +} + +void get_domain_type_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, enum mod_pd_type* type, int type_Depth, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_domain_type_CALL_INSTANCE)); + CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_domain_type_CallInstance = CMock_Guts_MemChain(Mock.get_domain_type_CallInstance, cmock_guts_index); + Mock.get_domain_type_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_get_domain_type(cmock_call_instance, pd_id, type, type_Depth); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void get_domain_type_CMockReturnMemThruPtr_type(UNITY_LINE_TYPE cmock_line, enum mod_pd_type* type, size_t cmock_size) +{ + CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.get_domain_type_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp); + cmock_call_instance->ReturnThruPtr_type_Used = 1; + cmock_call_instance->ReturnThruPtr_type_Val = type; + cmock_call_instance->ReturnThruPtr_type_Size = cmock_size; +} + +void get_domain_type_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.get_domain_type_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_pd_id = 1; +} + +void get_domain_type_CMockIgnoreArg_type(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_get_domain_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.get_domain_type_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_type = 1; +} + +int get_domain_parent_id(fwk_id_t pd_id, fwk_id_t* parent_pd_id) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_get_domain_parent_id); + cmock_call_instance = (CMOCK_get_domain_parent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.get_domain_parent_id_CallInstance); + Mock.get_domain_parent_id_CallInstance = CMock_Guts_MemNext(Mock.get_domain_parent_id_CallInstance); + if (Mock.get_domain_parent_id_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.get_domain_parent_id_FinalReturn; + Mock.get_domain_parent_id_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.get_domain_parent_id_CallbackBool && + Mock.get_domain_parent_id_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.get_domain_parent_id_CallbackFunctionPointer(pd_id, parent_pd_id, Mock.get_domain_parent_id_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_pd_id) + { + UNITY_SET_DETAILS(CMockString_get_domain_parent_id,CMockString_pd_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_parent_pd_id) + { + UNITY_SET_DETAILS(CMockString_get_domain_parent_id,CMockString_parent_pd_id); + if (cmock_call_instance->Expected_parent_pd_id == NULL) + { UNITY_TEST_ASSERT_NULL(parent_pd_id, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_parent_pd_id), (void*)(parent_pd_id), sizeof(fwk_id_t), cmock_call_instance->Expected_parent_pd_id_Depth, cmock_line, CMockStringMismatch); } + } + } + if (Mock.get_domain_parent_id_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.get_domain_parent_id_CallbackFunctionPointer(pd_id, parent_pd_id, Mock.get_domain_parent_id_CallbackCalls++); + } + if (cmock_call_instance->ReturnThruPtr_parent_pd_id_Used) + { + UNITY_TEST_ASSERT_NOT_NULL(parent_pd_id, cmock_line, CMockStringPtrIsNULL); + memcpy((void*)parent_pd_id, (void*)cmock_call_instance->ReturnThruPtr_parent_pd_id_Val, + cmock_call_instance->ReturnThruPtr_parent_pd_id_Size); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_get_domain_parent_id(CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, fwk_id_t* parent_pd_id, int parent_pd_id_Depth); +void CMockExpectParameters_get_domain_parent_id(CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, fwk_id_t* parent_pd_id, int parent_pd_id_Depth) +{ + memcpy((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), + sizeof(fwk_id_t[sizeof(pd_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_pd_id = 0; + cmock_call_instance->Expected_parent_pd_id = parent_pd_id; + cmock_call_instance->Expected_parent_pd_id_Depth = parent_pd_id_Depth; + cmock_call_instance->IgnoreArg_parent_pd_id = 0; + cmock_call_instance->ReturnThruPtr_parent_pd_id_Used = 0; +} + +void get_domain_parent_id_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_domain_parent_id_CALL_INSTANCE)); + CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_parent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_domain_parent_id_CallInstance = CMock_Guts_MemChain(Mock.get_domain_parent_id_CallInstance, cmock_guts_index); + Mock.get_domain_parent_id_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.get_domain_parent_id_IgnoreBool = (char)1; +} + +void get_domain_parent_id_CMockStopIgnore(void) +{ + if(Mock.get_domain_parent_id_IgnoreBool) + Mock.get_domain_parent_id_CallInstance = CMock_Guts_MemNext(Mock.get_domain_parent_id_CallInstance); + Mock.get_domain_parent_id_IgnoreBool = (char)0; +} + +void get_domain_parent_id_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_domain_parent_id_CALL_INSTANCE)); + CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_parent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_domain_parent_id_CallInstance = CMock_Guts_MemChain(Mock.get_domain_parent_id_CallInstance, cmock_guts_index); + Mock.get_domain_parent_id_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void get_domain_parent_id_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, fwk_id_t* parent_pd_id, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_domain_parent_id_CALL_INSTANCE)); + CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_parent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_domain_parent_id_CallInstance = CMock_Guts_MemChain(Mock.get_domain_parent_id_CallInstance, cmock_guts_index); + Mock.get_domain_parent_id_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_get_domain_parent_id(cmock_call_instance, pd_id, parent_pd_id, 1); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void get_domain_parent_id_AddCallback(CMOCK_get_domain_parent_id_CALLBACK Callback) +{ + Mock.get_domain_parent_id_IgnoreBool = (char)0; + Mock.get_domain_parent_id_CallbackBool = (char)1; + Mock.get_domain_parent_id_CallbackFunctionPointer = Callback; +} + +void get_domain_parent_id_Stub(CMOCK_get_domain_parent_id_CALLBACK Callback) +{ + Mock.get_domain_parent_id_IgnoreBool = (char)0; + Mock.get_domain_parent_id_CallbackBool = (char)0; + Mock.get_domain_parent_id_CallbackFunctionPointer = Callback; +} + +void get_domain_parent_id_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, fwk_id_t* parent_pd_id, int parent_pd_id_Depth, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_domain_parent_id_CALL_INSTANCE)); + CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_parent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_domain_parent_id_CallInstance = CMock_Guts_MemChain(Mock.get_domain_parent_id_CallInstance, cmock_guts_index); + Mock.get_domain_parent_id_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_get_domain_parent_id(cmock_call_instance, pd_id, parent_pd_id, parent_pd_id_Depth); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void get_domain_parent_id_CMockReturnMemThruPtr_parent_pd_id(UNITY_LINE_TYPE cmock_line, fwk_id_t* parent_pd_id, size_t cmock_size) +{ + CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_parent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.get_domain_parent_id_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp); + cmock_call_instance->ReturnThruPtr_parent_pd_id_Used = 1; + cmock_call_instance->ReturnThruPtr_parent_pd_id_Val = parent_pd_id; + cmock_call_instance->ReturnThruPtr_parent_pd_id_Size = cmock_size; +} + +void get_domain_parent_id_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_parent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.get_domain_parent_id_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_pd_id = 1; +} + +void get_domain_parent_id_CMockIgnoreArg_parent_pd_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_get_domain_parent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_domain_parent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.get_domain_parent_id_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_parent_pd_id = 1; +} + +int set_state(fwk_id_t pd_id, bool resp_requested, uint32_t state) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_set_state_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_set_state); + cmock_call_instance = (CMOCK_set_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.set_state_CallInstance); + Mock.set_state_CallInstance = CMock_Guts_MemNext(Mock.set_state_CallInstance); + if (Mock.set_state_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.set_state_FinalReturn; + Mock.set_state_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.set_state_CallbackBool && + Mock.set_state_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.set_state_CallbackFunctionPointer(pd_id, resp_requested, state, Mock.set_state_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_pd_id) + { + UNITY_SET_DETAILS(CMockString_set_state,CMockString_pd_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_resp_requested) + { + UNITY_SET_DETAILS(CMockString_set_state,CMockString_resp_requested); + UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_resp_requested, resp_requested, cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_state) + { + UNITY_SET_DETAILS(CMockString_set_state,CMockString_state); + UNITY_TEST_ASSERT_EQUAL_HEX32(cmock_call_instance->Expected_state, state, cmock_line, CMockStringMismatch); + } + } + if (Mock.set_state_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.set_state_CallbackFunctionPointer(pd_id, resp_requested, state, Mock.set_state_CallbackCalls++); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_set_state(CMOCK_set_state_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, bool resp_requested, uint32_t state); +void CMockExpectParameters_set_state(CMOCK_set_state_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, bool resp_requested, uint32_t state) +{ + memcpy((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), + sizeof(fwk_id_t[sizeof(pd_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_pd_id = 0; + cmock_call_instance->Expected_resp_requested = resp_requested; + cmock_call_instance->IgnoreArg_resp_requested = 0; + cmock_call_instance->Expected_state = state; + cmock_call_instance->IgnoreArg_state = 0; +} + +void set_state_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_set_state_CALL_INSTANCE)); + CMOCK_set_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_set_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.set_state_CallInstance = CMock_Guts_MemChain(Mock.set_state_CallInstance, cmock_guts_index); + Mock.set_state_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.set_state_IgnoreBool = (char)1; +} + +void set_state_CMockStopIgnore(void) +{ + if(Mock.set_state_IgnoreBool) + Mock.set_state_CallInstance = CMock_Guts_MemNext(Mock.set_state_CallInstance); + Mock.set_state_IgnoreBool = (char)0; +} + +void set_state_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_set_state_CALL_INSTANCE)); + CMOCK_set_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_set_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.set_state_CallInstance = CMock_Guts_MemChain(Mock.set_state_CallInstance, cmock_guts_index); + Mock.set_state_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void set_state_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, bool resp_requested, uint32_t state, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_set_state_CALL_INSTANCE)); + CMOCK_set_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_set_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.set_state_CallInstance = CMock_Guts_MemChain(Mock.set_state_CallInstance, cmock_guts_index); + Mock.set_state_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_set_state(cmock_call_instance, pd_id, resp_requested, state); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void set_state_AddCallback(CMOCK_set_state_CALLBACK Callback) +{ + Mock.set_state_IgnoreBool = (char)0; + Mock.set_state_CallbackBool = (char)1; + Mock.set_state_CallbackFunctionPointer = Callback; +} + +void set_state_Stub(CMOCK_set_state_CALLBACK Callback) +{ + Mock.set_state_IgnoreBool = (char)0; + Mock.set_state_CallbackBool = (char)0; + Mock.set_state_CallbackFunctionPointer = Callback; +} + +void set_state_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_set_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_set_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.set_state_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_pd_id = 1; +} + +void set_state_CMockIgnoreArg_resp_requested(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_set_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_set_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.set_state_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_resp_requested = 1; +} + +void set_state_CMockIgnoreArg_state(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_set_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_set_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.set_state_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_state = 1; +} + +int get_state(fwk_id_t pd_id, unsigned int* state) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_get_state_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_get_state); + cmock_call_instance = (CMOCK_get_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.get_state_CallInstance); + Mock.get_state_CallInstance = CMock_Guts_MemNext(Mock.get_state_CallInstance); + if (Mock.get_state_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.get_state_FinalReturn; + Mock.get_state_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.get_state_CallbackBool && + Mock.get_state_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.get_state_CallbackFunctionPointer(pd_id, state, Mock.get_state_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_pd_id) + { + UNITY_SET_DETAILS(CMockString_get_state,CMockString_pd_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_state) + { + UNITY_SET_DETAILS(CMockString_get_state,CMockString_state); + if (cmock_call_instance->Expected_state == NULL) + { UNITY_TEST_ASSERT_NULL(state, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(cmock_call_instance->Expected_state, state, cmock_call_instance->Expected_state_Depth, cmock_line, CMockStringMismatch); } + } + } + if (Mock.get_state_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.get_state_CallbackFunctionPointer(pd_id, state, Mock.get_state_CallbackCalls++); + } + if (cmock_call_instance->ReturnThruPtr_state_Used) + { + UNITY_TEST_ASSERT_NOT_NULL(state, cmock_line, CMockStringPtrIsNULL); + memcpy((void*)state, (void*)cmock_call_instance->ReturnThruPtr_state_Val, + cmock_call_instance->ReturnThruPtr_state_Size); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_get_state(CMOCK_get_state_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, unsigned int* state, int state_Depth); +void CMockExpectParameters_get_state(CMOCK_get_state_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, unsigned int* state, int state_Depth) +{ + memcpy((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), + sizeof(fwk_id_t[sizeof(pd_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_pd_id = 0; + cmock_call_instance->Expected_state = state; + cmock_call_instance->Expected_state_Depth = state_Depth; + cmock_call_instance->IgnoreArg_state = 0; + cmock_call_instance->ReturnThruPtr_state_Used = 0; +} + +void get_state_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_state_CALL_INSTANCE)); + CMOCK_get_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_state_CallInstance = CMock_Guts_MemChain(Mock.get_state_CallInstance, cmock_guts_index); + Mock.get_state_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.get_state_IgnoreBool = (char)1; +} + +void get_state_CMockStopIgnore(void) +{ + if(Mock.get_state_IgnoreBool) + Mock.get_state_CallInstance = CMock_Guts_MemNext(Mock.get_state_CallInstance); + Mock.get_state_IgnoreBool = (char)0; +} + +void get_state_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_state_CALL_INSTANCE)); + CMOCK_get_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_state_CallInstance = CMock_Guts_MemChain(Mock.get_state_CallInstance, cmock_guts_index); + Mock.get_state_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void get_state_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, unsigned int* state, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_state_CALL_INSTANCE)); + CMOCK_get_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_state_CallInstance = CMock_Guts_MemChain(Mock.get_state_CallInstance, cmock_guts_index); + Mock.get_state_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_get_state(cmock_call_instance, pd_id, state, 1); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void get_state_AddCallback(CMOCK_get_state_CALLBACK Callback) +{ + Mock.get_state_IgnoreBool = (char)0; + Mock.get_state_CallbackBool = (char)1; + Mock.get_state_CallbackFunctionPointer = Callback; +} + +void get_state_Stub(CMOCK_get_state_CALLBACK Callback) +{ + Mock.get_state_IgnoreBool = (char)0; + Mock.get_state_CallbackBool = (char)0; + Mock.get_state_CallbackFunctionPointer = Callback; +} + +void get_state_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, unsigned int* state, int state_Depth, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_get_state_CALL_INSTANCE)); + CMOCK_get_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.get_state_CallInstance = CMock_Guts_MemChain(Mock.get_state_CallInstance, cmock_guts_index); + Mock.get_state_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_get_state(cmock_call_instance, pd_id, state, state_Depth); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void get_state_CMockReturnMemThruPtr_state(UNITY_LINE_TYPE cmock_line, unsigned int* state, size_t cmock_size) +{ + CMOCK_get_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.get_state_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp); + cmock_call_instance->ReturnThruPtr_state_Used = 1; + cmock_call_instance->ReturnThruPtr_state_Val = state; + cmock_call_instance->ReturnThruPtr_state_Size = cmock_size; +} + +void get_state_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_get_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.get_state_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_pd_id = 1; +} + +void get_state_CMockIgnoreArg_state(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_get_state_CALL_INSTANCE* cmock_call_instance = (CMOCK_get_state_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.get_state_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_state = 1; +} + +int reset(fwk_id_t pd_id, bool resp_requested) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_reset_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_reset); + cmock_call_instance = (CMOCK_reset_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.reset_CallInstance); + Mock.reset_CallInstance = CMock_Guts_MemNext(Mock.reset_CallInstance); + if (Mock.reset_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.reset_FinalReturn; + Mock.reset_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.reset_CallbackBool && + Mock.reset_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.reset_CallbackFunctionPointer(pd_id, resp_requested, Mock.reset_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_pd_id) + { + UNITY_SET_DETAILS(CMockString_reset,CMockString_pd_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_resp_requested) + { + UNITY_SET_DETAILS(CMockString_reset,CMockString_resp_requested); + UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_resp_requested, resp_requested, cmock_line, CMockStringMismatch); + } + } + if (Mock.reset_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.reset_CallbackFunctionPointer(pd_id, resp_requested, Mock.reset_CallbackCalls++); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_reset(CMOCK_reset_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, bool resp_requested); +void CMockExpectParameters_reset(CMOCK_reset_CALL_INSTANCE* cmock_call_instance, fwk_id_t pd_id, bool resp_requested) +{ + memcpy((void*)(&cmock_call_instance->Expected_pd_id), (void*)(&pd_id), + sizeof(fwk_id_t[sizeof(pd_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_pd_id = 0; + cmock_call_instance->Expected_resp_requested = resp_requested; + cmock_call_instance->IgnoreArg_resp_requested = 0; +} + +void reset_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_reset_CALL_INSTANCE)); + CMOCK_reset_CALL_INSTANCE* cmock_call_instance = (CMOCK_reset_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.reset_CallInstance = CMock_Guts_MemChain(Mock.reset_CallInstance, cmock_guts_index); + Mock.reset_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.reset_IgnoreBool = (char)1; +} + +void reset_CMockStopIgnore(void) +{ + if(Mock.reset_IgnoreBool) + Mock.reset_CallInstance = CMock_Guts_MemNext(Mock.reset_CallInstance); + Mock.reset_IgnoreBool = (char)0; +} + +void reset_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_reset_CALL_INSTANCE)); + CMOCK_reset_CALL_INSTANCE* cmock_call_instance = (CMOCK_reset_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.reset_CallInstance = CMock_Guts_MemChain(Mock.reset_CallInstance, cmock_guts_index); + Mock.reset_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void reset_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, bool resp_requested, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_reset_CALL_INSTANCE)); + CMOCK_reset_CALL_INSTANCE* cmock_call_instance = (CMOCK_reset_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.reset_CallInstance = CMock_Guts_MemChain(Mock.reset_CallInstance, cmock_guts_index); + Mock.reset_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_reset(cmock_call_instance, pd_id, resp_requested); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void reset_AddCallback(CMOCK_reset_CALLBACK Callback) +{ + Mock.reset_IgnoreBool = (char)0; + Mock.reset_CallbackBool = (char)1; + Mock.reset_CallbackFunctionPointer = Callback; +} + +void reset_Stub(CMOCK_reset_CALLBACK Callback) +{ + Mock.reset_IgnoreBool = (char)0; + Mock.reset_CallbackBool = (char)0; + Mock.reset_CallbackFunctionPointer = Callback; +} + +void reset_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_reset_CALL_INSTANCE* cmock_call_instance = (CMOCK_reset_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.reset_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_pd_id = 1; +} + +void reset_CMockIgnoreArg_resp_requested(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_reset_CALL_INSTANCE* cmock_call_instance = (CMOCK_reset_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.reset_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_resp_requested = 1; +} + +int system_suspend(unsigned int state) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_system_suspend_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_system_suspend); + cmock_call_instance = (CMOCK_system_suspend_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.system_suspend_CallInstance); + Mock.system_suspend_CallInstance = CMock_Guts_MemNext(Mock.system_suspend_CallInstance); + if (Mock.system_suspend_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.system_suspend_FinalReturn; + Mock.system_suspend_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.system_suspend_CallbackBool && + Mock.system_suspend_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.system_suspend_CallbackFunctionPointer(state, Mock.system_suspend_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_state) + { + UNITY_SET_DETAILS(CMockString_system_suspend,CMockString_state); + UNITY_TEST_ASSERT_EQUAL_HEX32(cmock_call_instance->Expected_state, state, cmock_line, CMockStringMismatch); + } + } + if (Mock.system_suspend_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.system_suspend_CallbackFunctionPointer(state, Mock.system_suspend_CallbackCalls++); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_system_suspend(CMOCK_system_suspend_CALL_INSTANCE* cmock_call_instance, unsigned int state); +void CMockExpectParameters_system_suspend(CMOCK_system_suspend_CALL_INSTANCE* cmock_call_instance, unsigned int state) +{ + cmock_call_instance->Expected_state = state; + cmock_call_instance->IgnoreArg_state = 0; +} + +void system_suspend_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_system_suspend_CALL_INSTANCE)); + CMOCK_system_suspend_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_suspend_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.system_suspend_CallInstance = CMock_Guts_MemChain(Mock.system_suspend_CallInstance, cmock_guts_index); + Mock.system_suspend_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.system_suspend_IgnoreBool = (char)1; +} + +void system_suspend_CMockStopIgnore(void) +{ + if(Mock.system_suspend_IgnoreBool) + Mock.system_suspend_CallInstance = CMock_Guts_MemNext(Mock.system_suspend_CallInstance); + Mock.system_suspend_IgnoreBool = (char)0; +} + +void system_suspend_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_system_suspend_CALL_INSTANCE)); + CMOCK_system_suspend_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_suspend_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.system_suspend_CallInstance = CMock_Guts_MemChain(Mock.system_suspend_CallInstance, cmock_guts_index); + Mock.system_suspend_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void system_suspend_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, unsigned int state, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_system_suspend_CALL_INSTANCE)); + CMOCK_system_suspend_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_suspend_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.system_suspend_CallInstance = CMock_Guts_MemChain(Mock.system_suspend_CallInstance, cmock_guts_index); + Mock.system_suspend_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_system_suspend(cmock_call_instance, state); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void system_suspend_AddCallback(CMOCK_system_suspend_CALLBACK Callback) +{ + Mock.system_suspend_IgnoreBool = (char)0; + Mock.system_suspend_CallbackBool = (char)1; + Mock.system_suspend_CallbackFunctionPointer = Callback; +} + +void system_suspend_Stub(CMOCK_system_suspend_CALLBACK Callback) +{ + Mock.system_suspend_IgnoreBool = (char)0; + Mock.system_suspend_CallbackBool = (char)0; + Mock.system_suspend_CallbackFunctionPointer = Callback; +} + +void system_suspend_CMockIgnoreArg_state(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_system_suspend_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_suspend_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.system_suspend_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_state = 1; +} + +int system_shutdown(enum mod_pd_system_shutdown system_shsutdown) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_system_shutdown_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_system_shutdown); + cmock_call_instance = (CMOCK_system_shutdown_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.system_shutdown_CallInstance); + Mock.system_shutdown_CallInstance = CMock_Guts_MemNext(Mock.system_shutdown_CallInstance); + if (Mock.system_shutdown_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.system_shutdown_FinalReturn; + Mock.system_shutdown_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.system_shutdown_CallbackBool && + Mock.system_shutdown_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.system_shutdown_CallbackFunctionPointer(system_shsutdown, Mock.system_shutdown_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_system_shsutdown) + { + UNITY_SET_DETAILS(CMockString_system_shutdown,CMockString_system_shsutdown); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_system_shsutdown), (void*)(&system_shsutdown), sizeof(enum mod_pd_system_shutdown), cmock_line, CMockStringMismatch); + } + } + if (Mock.system_shutdown_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.system_shutdown_CallbackFunctionPointer(system_shsutdown, Mock.system_shutdown_CallbackCalls++); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_system_shutdown(CMOCK_system_shutdown_CALL_INSTANCE* cmock_call_instance, enum mod_pd_system_shutdown system_shsutdown); +void CMockExpectParameters_system_shutdown(CMOCK_system_shutdown_CALL_INSTANCE* cmock_call_instance, enum mod_pd_system_shutdown system_shsutdown) +{ + memcpy((void*)(&cmock_call_instance->Expected_system_shsutdown), (void*)(&system_shsutdown), + sizeof(enum mod_pd_system_shutdown[sizeof(system_shsutdown) == sizeof(enum mod_pd_system_shutdown) ? 1 : -1])); /* add enum mod_pd_system_shutdown to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_system_shsutdown = 0; +} + +void system_shutdown_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_system_shutdown_CALL_INSTANCE)); + CMOCK_system_shutdown_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_shutdown_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.system_shutdown_CallInstance = CMock_Guts_MemChain(Mock.system_shutdown_CallInstance, cmock_guts_index); + Mock.system_shutdown_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.system_shutdown_IgnoreBool = (char)1; +} + +void system_shutdown_CMockStopIgnore(void) +{ + if(Mock.system_shutdown_IgnoreBool) + Mock.system_shutdown_CallInstance = CMock_Guts_MemNext(Mock.system_shutdown_CallInstance); + Mock.system_shutdown_IgnoreBool = (char)0; +} + +void system_shutdown_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_system_shutdown_CALL_INSTANCE)); + CMOCK_system_shutdown_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_shutdown_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.system_shutdown_CallInstance = CMock_Guts_MemChain(Mock.system_shutdown_CallInstance, cmock_guts_index); + Mock.system_shutdown_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void system_shutdown_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, enum mod_pd_system_shutdown system_shsutdown, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_system_shutdown_CALL_INSTANCE)); + CMOCK_system_shutdown_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_shutdown_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.system_shutdown_CallInstance = CMock_Guts_MemChain(Mock.system_shutdown_CallInstance, cmock_guts_index); + Mock.system_shutdown_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_system_shutdown(cmock_call_instance, system_shsutdown); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void system_shutdown_AddCallback(CMOCK_system_shutdown_CALLBACK Callback) +{ + Mock.system_shutdown_IgnoreBool = (char)0; + Mock.system_shutdown_CallbackBool = (char)1; + Mock.system_shutdown_CallbackFunctionPointer = Callback; +} + +void system_shutdown_Stub(CMOCK_system_shutdown_CALLBACK Callback) +{ + Mock.system_shutdown_IgnoreBool = (char)0; + Mock.system_shutdown_CallbackBool = (char)0; + Mock.system_shutdown_CallbackFunctionPointer = Callback; +} + +void system_shutdown_CMockIgnoreArg_system_shsutdown(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_system_shutdown_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_shutdown_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.system_shutdown_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_system_shsutdown = 1; +} + +int mod_scmi_from_protocol_api_get_agent_count(unsigned int* agent_count) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_get_agent_count); + cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance); + Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance); + if (Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.mod_scmi_from_protocol_api_get_agent_count_FinalReturn; + Mock.mod_scmi_from_protocol_api_get_agent_count_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackBool && + Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackFunctionPointer(agent_count, Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_agent_count) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_get_agent_count,CMockString_agent_count); + if (cmock_call_instance->Expected_agent_count == NULL) + { UNITY_TEST_ASSERT_NULL(agent_count, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(cmock_call_instance->Expected_agent_count, agent_count, cmock_call_instance->Expected_agent_count_Depth, cmock_line, CMockStringMismatch); } + } + } + if (Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackFunctionPointer(agent_count, Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackCalls++); + } + if (cmock_call_instance->ReturnThruPtr_agent_count_Used) + { + UNITY_TEST_ASSERT_NOT_NULL(agent_count, cmock_line, CMockStringPtrIsNULL); + memcpy((void*)agent_count, (void*)cmock_call_instance->ReturnThruPtr_agent_count_Val, + cmock_call_instance->ReturnThruPtr_agent_count_Size); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_count(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE* cmock_call_instance, unsigned int* agent_count, int agent_count_Depth); +void CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_count(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE* cmock_call_instance, unsigned int* agent_count, int agent_count_Depth) +{ + cmock_call_instance->Expected_agent_count = agent_count; + cmock_call_instance->Expected_agent_count_Depth = agent_count_Depth; + cmock_call_instance->IgnoreArg_agent_count = 0; + cmock_call_instance->ReturnThruPtr_agent_count_Used = 0; +} + +void mod_scmi_from_protocol_api_get_agent_count_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool = (char)1; +} + +void mod_scmi_from_protocol_api_get_agent_count_CMockStopIgnore(void) +{ + if(Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool) + Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance); + Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool = (char)0; +} + +void mod_scmi_from_protocol_api_get_agent_count_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void mod_scmi_from_protocol_api_get_agent_count_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, unsigned int* agent_count, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_count(cmock_call_instance, agent_count, 1); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_get_agent_count_AddCallback(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackBool = (char)1; + Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_get_agent_count_Stub(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_agent_count_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_get_agent_count_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, unsigned int* agent_count, int agent_count_Depth, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_count_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_count(cmock_call_instance, agent_count, agent_count_Depth); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_get_agent_count_CMockReturnMemThruPtr_agent_count(UNITY_LINE_TYPE cmock_line, unsigned int* agent_count, size_t cmock_size) +{ + CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp); + cmock_call_instance->ReturnThruPtr_agent_count_Used = 1; + cmock_call_instance->ReturnThruPtr_agent_count_Val = agent_count; + cmock_call_instance->ReturnThruPtr_agent_count_Size = cmock_size; +} + +void mod_scmi_from_protocol_api_get_agent_count_CMockIgnoreArg_agent_count(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_agent_count_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_agent_count = 1; +} + +int mod_scmi_from_protocol_api_get_agent_id(fwk_id_t service_id, unsigned int* agent_id) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_get_agent_id); + cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance); + Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance); + if (Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.mod_scmi_from_protocol_api_get_agent_id_FinalReturn; + Mock.mod_scmi_from_protocol_api_get_agent_id_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackBool && + Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackFunctionPointer(service_id, agent_id, Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_service_id) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_get_agent_id,CMockString_service_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_agent_id) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_get_agent_id,CMockString_agent_id); + if (cmock_call_instance->Expected_agent_id == NULL) + { UNITY_TEST_ASSERT_NULL(agent_id, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_HEX32_ARRAY(cmock_call_instance->Expected_agent_id, agent_id, cmock_call_instance->Expected_agent_id_Depth, cmock_line, CMockStringMismatch); } + } + } + if (Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackFunctionPointer(service_id, agent_id, Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackCalls++); + } + if (cmock_call_instance->ReturnThruPtr_agent_id_Used) + { + UNITY_TEST_ASSERT_NOT_NULL(agent_id, cmock_line, CMockStringPtrIsNULL); + memcpy((void*)agent_id, (void*)cmock_call_instance->ReturnThruPtr_agent_id_Val, + cmock_call_instance->ReturnThruPtr_agent_id_Size); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_id(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, unsigned int* agent_id, int agent_id_Depth); +void CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_id(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, unsigned int* agent_id, int agent_id_Depth) +{ + memcpy((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), + sizeof(fwk_id_t[sizeof(service_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_service_id = 0; + cmock_call_instance->Expected_agent_id = agent_id; + cmock_call_instance->Expected_agent_id_Depth = agent_id_Depth; + cmock_call_instance->IgnoreArg_agent_id = 0; + cmock_call_instance->ReturnThruPtr_agent_id_Used = 0; +} + +void mod_scmi_from_protocol_api_get_agent_id_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool = (char)1; +} + +void mod_scmi_from_protocol_api_get_agent_id_CMockStopIgnore(void) +{ + if(Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool) + Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance); + Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool = (char)0; +} + +void mod_scmi_from_protocol_api_get_agent_id_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void mod_scmi_from_protocol_api_get_agent_id_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, unsigned int* agent_id, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_id(cmock_call_instance, service_id, agent_id, 1); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_get_agent_id_AddCallback(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackBool = (char)1; + Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_get_agent_id_Stub(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_agent_id_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_get_agent_id_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, unsigned int* agent_id, int agent_id_Depth, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_id_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_id(cmock_call_instance, service_id, agent_id, agent_id_Depth); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_get_agent_id_CMockReturnMemThruPtr_agent_id(UNITY_LINE_TYPE cmock_line, unsigned int* agent_id, size_t cmock_size) +{ + CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp); + cmock_call_instance->ReturnThruPtr_agent_id_Used = 1; + cmock_call_instance->ReturnThruPtr_agent_id_Val = agent_id; + cmock_call_instance->ReturnThruPtr_agent_id_Size = cmock_size; +} + +void mod_scmi_from_protocol_api_get_agent_id_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_service_id = 1; +} + +void mod_scmi_from_protocol_api_get_agent_id_CMockIgnoreArg_agent_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_agent_id_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_agent_id = 1; +} + +int mod_scmi_from_protocol_api_get_agent_type(uint32_t agent_id, enum scmi_agent_type* agent_type) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_get_agent_type); + cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance); + Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance); + if (Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.mod_scmi_from_protocol_api_get_agent_type_FinalReturn; + Mock.mod_scmi_from_protocol_api_get_agent_type_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackBool && + Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackFunctionPointer(agent_id, agent_type, Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_agent_id) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_get_agent_type,CMockString_agent_id); + UNITY_TEST_ASSERT_EQUAL_HEX32(cmock_call_instance->Expected_agent_id, agent_id, cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_agent_type) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_get_agent_type,CMockString_agent_type); + if (cmock_call_instance->Expected_agent_type == NULL) + { UNITY_TEST_ASSERT_NULL(agent_type, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_agent_type), (void*)(agent_type), sizeof(enum scmi_agent_type), cmock_call_instance->Expected_agent_type_Depth, cmock_line, CMockStringMismatch); } + } + } + if (Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackFunctionPointer(agent_id, agent_type, Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackCalls++); + } + if (cmock_call_instance->ReturnThruPtr_agent_type_Used) + { + UNITY_TEST_ASSERT_NOT_NULL(agent_type, cmock_line, CMockStringPtrIsNULL); + memcpy((void*)agent_type, (void*)cmock_call_instance->ReturnThruPtr_agent_type_Val, + cmock_call_instance->ReturnThruPtr_agent_type_Size); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_type(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance, uint32_t agent_id, enum scmi_agent_type* agent_type, int agent_type_Depth); +void CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_type(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance, uint32_t agent_id, enum scmi_agent_type* agent_type, int agent_type_Depth) +{ + cmock_call_instance->Expected_agent_id = agent_id; + cmock_call_instance->IgnoreArg_agent_id = 0; + cmock_call_instance->Expected_agent_type = agent_type; + cmock_call_instance->Expected_agent_type_Depth = agent_type_Depth; + cmock_call_instance->IgnoreArg_agent_type = 0; + cmock_call_instance->ReturnThruPtr_agent_type_Used = 0; +} + +void mod_scmi_from_protocol_api_get_agent_type_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool = (char)1; +} + +void mod_scmi_from_protocol_api_get_agent_type_CMockStopIgnore(void) +{ + if(Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool) + Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance); + Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool = (char)0; +} + +void mod_scmi_from_protocol_api_get_agent_type_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void mod_scmi_from_protocol_api_get_agent_type_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, uint32_t agent_id, enum scmi_agent_type* agent_type, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_type(cmock_call_instance, agent_id, agent_type, 1); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_get_agent_type_AddCallback(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackBool = (char)1; + Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_get_agent_type_Stub(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_agent_type_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_get_agent_type_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, uint32_t agent_id, enum scmi_agent_type* agent_type, int agent_type_Depth, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_agent_type_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_get_agent_type(cmock_call_instance, agent_id, agent_type, agent_type_Depth); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_get_agent_type_CMockReturnMemThruPtr_agent_type(UNITY_LINE_TYPE cmock_line, enum scmi_agent_type* agent_type, size_t cmock_size) +{ + CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp); + cmock_call_instance->ReturnThruPtr_agent_type_Used = 1; + cmock_call_instance->ReturnThruPtr_agent_type_Val = agent_type; + cmock_call_instance->ReturnThruPtr_agent_type_Size = cmock_size; +} + +void mod_scmi_from_protocol_api_get_agent_type_CMockIgnoreArg_agent_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_agent_id = 1; +} + +void mod_scmi_from_protocol_api_get_agent_type_CMockIgnoreArg_agent_type(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_agent_type_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_agent_type = 1; +} + +int mod_scmi_from_protocol_api_get_max_payload_size(fwk_id_t service_id, size_t* size) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_get_max_payload_size); + cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance); + if (Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.mod_scmi_from_protocol_api_get_max_payload_size_FinalReturn; + Mock.mod_scmi_from_protocol_api_get_max_payload_size_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackBool && + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackFunctionPointer(service_id, size, Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_service_id) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_get_max_payload_size,CMockString_service_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_size) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_get_max_payload_size,CMockString_size); + if (cmock_call_instance->Expected_size == NULL) + { UNITY_TEST_ASSERT_NULL(size, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_size), (void*)(size), sizeof(size_t), cmock_call_instance->Expected_size_Depth, cmock_line, CMockStringMismatch); } + } + } + if (Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackFunctionPointer(service_id, size, Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackCalls++); + } + if (cmock_call_instance->ReturnThruPtr_size_Used) + { + UNITY_TEST_ASSERT_NOT_NULL(size, cmock_line, CMockStringPtrIsNULL); + memcpy((void*)size, (void*)cmock_call_instance->ReturnThruPtr_size_Val, + cmock_call_instance->ReturnThruPtr_size_Size); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_mod_scmi_from_protocol_api_get_max_payload_size(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, size_t* size, int size_Depth); +void CMockExpectParameters_mod_scmi_from_protocol_api_get_max_payload_size(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, size_t* size, int size_Depth) +{ + memcpy((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), + sizeof(fwk_id_t[sizeof(service_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_service_id = 0; + cmock_call_instance->Expected_size = size; + cmock_call_instance->Expected_size_Depth = size_Depth; + cmock_call_instance->IgnoreArg_size = 0; + cmock_call_instance->ReturnThruPtr_size_Used = 0; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool = (char)1; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_CMockStopIgnore(void) +{ + if(Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool) + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool = (char)0; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, size_t* size, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_get_max_payload_size(cmock_call_instance, service_id, size, 1); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_AddCallback(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackBool = (char)1; + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_Stub(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackBool = (char)0; + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, size_t* size, int size_Depth, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_get_max_payload_size_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_get_max_payload_size(cmock_call_instance, service_id, size, size_Depth); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_CMockReturnMemThruPtr_size(UNITY_LINE_TYPE cmock_line, size_t* size, size_t cmock_size) +{ + CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp); + cmock_call_instance->ReturnThruPtr_size_Used = 1; + cmock_call_instance->ReturnThruPtr_size_Val = size; + cmock_call_instance->ReturnThruPtr_size_Size = cmock_size; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_service_id = 1; +} + +void mod_scmi_from_protocol_api_get_max_payload_size_CMockIgnoreArg_size(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_get_max_payload_size_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_size = 1; +} + +int mod_scmi_from_protocol_api_write_payload(fwk_id_t service_id, size_t offset, const void* payload, size_t size) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_write_payload); + cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance); + Mock.mod_scmi_from_protocol_api_write_payload_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance); + if (Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.mod_scmi_from_protocol_api_write_payload_FinalReturn; + Mock.mod_scmi_from_protocol_api_write_payload_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.mod_scmi_from_protocol_api_write_payload_CallbackBool && + Mock.mod_scmi_from_protocol_api_write_payload_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.mod_scmi_from_protocol_api_write_payload_CallbackFunctionPointer(service_id, offset, payload, size, Mock.mod_scmi_from_protocol_api_write_payload_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_service_id) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_write_payload,CMockString_service_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_offset) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_write_payload,CMockString_offset); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_offset), (void*)(&offset), sizeof(size_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_payload) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_write_payload,CMockString_payload); + if (cmock_call_instance->Expected_payload == NULL) + { UNITY_TEST_ASSERT_NULL(payload, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(cmock_call_instance->Expected_payload, payload, cmock_call_instance->Expected_payload_Depth, cmock_line, CMockStringMismatch); } + } + if (!cmock_call_instance->IgnoreArg_size) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_write_payload,CMockString_size); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_size), (void*)(&size), sizeof(size_t), cmock_line, CMockStringMismatch); + } + } + if (Mock.mod_scmi_from_protocol_api_write_payload_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.mod_scmi_from_protocol_api_write_payload_CallbackFunctionPointer(service_id, offset, payload, size, Mock.mod_scmi_from_protocol_api_write_payload_CallbackCalls++); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_mod_scmi_from_protocol_api_write_payload(CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, size_t offset, const void* payload, int payload_Depth, size_t size); +void CMockExpectParameters_mod_scmi_from_protocol_api_write_payload(CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, size_t offset, const void* payload, int payload_Depth, size_t size) +{ + memcpy((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), + sizeof(fwk_id_t[sizeof(service_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_service_id = 0; + memcpy((void*)(&cmock_call_instance->Expected_offset), (void*)(&offset), + sizeof(size_t[sizeof(offset) == sizeof(size_t) ? 1 : -1])); /* add size_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_offset = 0; + cmock_call_instance->Expected_payload = payload; + cmock_call_instance->Expected_payload_Depth = payload_Depth; + cmock_call_instance->IgnoreArg_payload = 0; + memcpy((void*)(&cmock_call_instance->Expected_size), (void*)(&size), + sizeof(size_t[sizeof(size) == sizeof(size_t) ? 1 : -1])); /* add size_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_size = 0; +} + +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_write_payload_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool = (char)1; +} + +void mod_scmi_from_protocol_api_write_payload_CMockStopIgnore(void) +{ + if(Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool) + Mock.mod_scmi_from_protocol_api_write_payload_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance); + Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool = (char)0; +} + +void mod_scmi_from_protocol_api_write_payload_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_write_payload_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void mod_scmi_from_protocol_api_write_payload_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, size_t offset, const void* payload, size_t size, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_write_payload_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_write_payload(cmock_call_instance, service_id, offset, payload, size, size); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_write_payload_AddCallback(CMOCK_mod_scmi_from_protocol_api_write_payload_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_write_payload_CallbackBool = (char)1; + Mock.mod_scmi_from_protocol_api_write_payload_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_write_payload_Stub(CMOCK_mod_scmi_from_protocol_api_write_payload_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_write_payload_CallbackBool = (char)0; + Mock.mod_scmi_from_protocol_api_write_payload_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_write_payload_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, size_t offset, const void* payload, int payload_Depth, size_t size, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_write_payload_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_write_payload_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_write_payload(cmock_call_instance, service_id, offset, payload, payload_Depth, size); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_service_id = 1; +} + +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_offset(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_offset = 1; +} + +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_payload(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_payload = 1; +} + +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_size(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_write_payload_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_write_payload_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_size = 1; +} + +int mod_scmi_from_protocol_api_respond(fwk_id_t service_id, const void* payload, size_t size) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_respond); + cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.mod_scmi_from_protocol_api_respond_CallInstance); + Mock.mod_scmi_from_protocol_api_respond_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_respond_CallInstance); + if (Mock.mod_scmi_from_protocol_api_respond_IgnoreBool) + { + UNITY_CLR_DETAILS(); + if (cmock_call_instance == NULL) + return Mock.mod_scmi_from_protocol_api_respond_FinalReturn; + Mock.mod_scmi_from_protocol_api_respond_FinalReturn = cmock_call_instance->ReturnVal; + return cmock_call_instance->ReturnVal; + } + if (!Mock.mod_scmi_from_protocol_api_respond_CallbackBool && + Mock.mod_scmi_from_protocol_api_respond_CallbackFunctionPointer != NULL) + { + int cmock_cb_ret = Mock.mod_scmi_from_protocol_api_respond_CallbackFunctionPointer(service_id, payload, size, Mock.mod_scmi_from_protocol_api_respond_CallbackCalls++); + UNITY_CLR_DETAILS(); + return cmock_cb_ret; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_service_id) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_respond,CMockString_service_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_payload) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_respond,CMockString_payload); + if (cmock_call_instance->Expected_payload == NULL) + { UNITY_TEST_ASSERT_NULL(payload, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(cmock_call_instance->Expected_payload, payload, cmock_call_instance->Expected_payload_Depth, cmock_line, CMockStringMismatch); } + } + if (!cmock_call_instance->IgnoreArg_size) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_respond,CMockString_size); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_size), (void*)(&size), sizeof(size_t), cmock_line, CMockStringMismatch); + } + } + if (Mock.mod_scmi_from_protocol_api_respond_CallbackFunctionPointer != NULL) + { + cmock_call_instance->ReturnVal = Mock.mod_scmi_from_protocol_api_respond_CallbackFunctionPointer(service_id, payload, size, Mock.mod_scmi_from_protocol_api_respond_CallbackCalls++); + } + UNITY_CLR_DETAILS(); + return cmock_call_instance->ReturnVal; +} + +void CMockExpectParameters_mod_scmi_from_protocol_api_respond(CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, const void* payload, int payload_Depth, size_t size); +void CMockExpectParameters_mod_scmi_from_protocol_api_respond(CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, const void* payload, int payload_Depth, size_t size) +{ + memcpy((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), + sizeof(fwk_id_t[sizeof(service_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_service_id = 0; + cmock_call_instance->Expected_payload = payload; + cmock_call_instance->Expected_payload_Depth = payload_Depth; + cmock_call_instance->IgnoreArg_payload = 0; + memcpy((void*)(&cmock_call_instance->Expected_size), (void*)(&size), + sizeof(size_t[sizeof(size) == sizeof(size_t) ? 1 : -1])); /* add size_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_size = 0; +} + +void mod_scmi_from_protocol_api_respond_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_respond_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_respond_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_respond_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + Mock.mod_scmi_from_protocol_api_respond_IgnoreBool = (char)1; +} + +void mod_scmi_from_protocol_api_respond_CMockStopIgnore(void) +{ + if(Mock.mod_scmi_from_protocol_api_respond_IgnoreBool) + Mock.mod_scmi_from_protocol_api_respond_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_respond_CallInstance); + Mock.mod_scmi_from_protocol_api_respond_IgnoreBool = (char)0; +} + +void mod_scmi_from_protocol_api_respond_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_respond_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_respond_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_respond_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ReturnVal = cmock_to_return; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void mod_scmi_from_protocol_api_respond_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, const void* payload, size_t size, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_respond_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_respond_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_respond_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_respond(cmock_call_instance, service_id, payload, size, size); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_respond_AddCallback(CMOCK_mod_scmi_from_protocol_api_respond_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_respond_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_respond_CallbackBool = (char)1; + Mock.mod_scmi_from_protocol_api_respond_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_respond_Stub(CMOCK_mod_scmi_from_protocol_api_respond_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_respond_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_respond_CallbackBool = (char)0; + Mock.mod_scmi_from_protocol_api_respond_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_respond_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, const void* payload, int payload_Depth, size_t size, int cmock_to_return) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_respond_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_respond_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_respond_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_respond(cmock_call_instance, service_id, payload, payload_Depth, size); + cmock_call_instance->ReturnVal = cmock_to_return; +} + +void mod_scmi_from_protocol_api_respond_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_respond_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_service_id = 1; +} + +void mod_scmi_from_protocol_api_respond_CMockIgnoreArg_payload(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_respond_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_payload = 1; +} + +void mod_scmi_from_protocol_api_respond_CMockIgnoreArg_size(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_respond_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_respond_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_size = 1; +} + +void mod_scmi_from_protocol_api_notify(fwk_id_t service_id, int protocol_id, int message_id, const void* payload, size_t size) +{ + UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; + CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance; + UNITY_SET_DETAIL(CMockString_mod_scmi_from_protocol_api_notify); + cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.mod_scmi_from_protocol_api_notify_CallInstance); + Mock.mod_scmi_from_protocol_api_notify_CallInstance = CMock_Guts_MemNext(Mock.mod_scmi_from_protocol_api_notify_CallInstance); + if (Mock.mod_scmi_from_protocol_api_notify_IgnoreBool) + { + UNITY_CLR_DETAILS(); + return; + } + if (!Mock.mod_scmi_from_protocol_api_notify_CallbackBool && + Mock.mod_scmi_from_protocol_api_notify_CallbackFunctionPointer != NULL) + { + Mock.mod_scmi_from_protocol_api_notify_CallbackFunctionPointer(service_id, protocol_id, message_id, payload, size, Mock.mod_scmi_from_protocol_api_notify_CallbackCalls++); + UNITY_CLR_DETAILS(); + return; + } + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); + cmock_line = cmock_call_instance->LineNumber; + if (!cmock_call_instance->ExpectAnyArgsBool) + { + if (!cmock_call_instance->IgnoreArg_service_id) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_notify,CMockString_service_id); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), sizeof(fwk_id_t), cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_protocol_id) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_notify,CMockString_protocol_id); + UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_protocol_id, protocol_id, cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_message_id) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_notify,CMockString_message_id); + UNITY_TEST_ASSERT_EQUAL_INT(cmock_call_instance->Expected_message_id, message_id, cmock_line, CMockStringMismatch); + } + if (!cmock_call_instance->IgnoreArg_payload) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_notify,CMockString_payload); + if (cmock_call_instance->Expected_payload == NULL) + { UNITY_TEST_ASSERT_NULL(payload, cmock_line, CMockStringExpNULL); } + else + { UNITY_TEST_ASSERT_EQUAL_HEX8_ARRAY(cmock_call_instance->Expected_payload, payload, cmock_call_instance->Expected_payload_Depth, cmock_line, CMockStringMismatch); } + } + if (!cmock_call_instance->IgnoreArg_size) + { + UNITY_SET_DETAILS(CMockString_mod_scmi_from_protocol_api_notify,CMockString_size); + UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_size), (void*)(&size), sizeof(size_t), cmock_line, CMockStringMismatch); + } + } + if (Mock.mod_scmi_from_protocol_api_notify_CallbackFunctionPointer != NULL) + { + Mock.mod_scmi_from_protocol_api_notify_CallbackFunctionPointer(service_id, protocol_id, message_id, payload, size, Mock.mod_scmi_from_protocol_api_notify_CallbackCalls++); + } + UNITY_CLR_DETAILS(); +} + +void CMockExpectParameters_mod_scmi_from_protocol_api_notify(CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, int protocol_id, int message_id, const void* payload, int payload_Depth, size_t size); +void CMockExpectParameters_mod_scmi_from_protocol_api_notify(CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance, fwk_id_t service_id, int protocol_id, int message_id, const void* payload, int payload_Depth, size_t size) +{ + memcpy((void*)(&cmock_call_instance->Expected_service_id), (void*)(&service_id), + sizeof(fwk_id_t[sizeof(service_id) == sizeof(fwk_id_t) ? 1 : -1])); /* add fwk_id_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_service_id = 0; + cmock_call_instance->Expected_protocol_id = protocol_id; + cmock_call_instance->IgnoreArg_protocol_id = 0; + cmock_call_instance->Expected_message_id = message_id; + cmock_call_instance->IgnoreArg_message_id = 0; + cmock_call_instance->Expected_payload = payload; + cmock_call_instance->Expected_payload_Depth = payload_Depth; + cmock_call_instance->IgnoreArg_payload = 0; + memcpy((void*)(&cmock_call_instance->Expected_size), (void*)(&size), + sizeof(size_t[sizeof(size) == sizeof(size_t) ? 1 : -1])); /* add size_t to :treat_as_array if this causes an error */ + cmock_call_instance->IgnoreArg_size = 0; +} + +void mod_scmi_from_protocol_api_notify_CMockIgnore(void) +{ + Mock.mod_scmi_from_protocol_api_notify_IgnoreBool = (char)1; +} + +void mod_scmi_from_protocol_api_notify_CMockStopIgnore(void) +{ + Mock.mod_scmi_from_protocol_api_notify_IgnoreBool = (char)0; +} + +void mod_scmi_from_protocol_api_notify_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_notify_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_notify_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_notify_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + cmock_call_instance->ExpectAnyArgsBool = (char)1; +} + +void mod_scmi_from_protocol_api_notify_CMockExpect(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, int protocol_id, int message_id, const void* payload, size_t size) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_notify_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_notify_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_notify_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_notify(cmock_call_instance, service_id, protocol_id, message_id, payload, size, size); +} + +void mod_scmi_from_protocol_api_notify_AddCallback(CMOCK_mod_scmi_from_protocol_api_notify_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_notify_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_notify_CallbackBool = (char)1; + Mock.mod_scmi_from_protocol_api_notify_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_notify_Stub(CMOCK_mod_scmi_from_protocol_api_notify_CALLBACK Callback) +{ + Mock.mod_scmi_from_protocol_api_notify_IgnoreBool = (char)0; + Mock.mod_scmi_from_protocol_api_notify_CallbackBool = (char)0; + Mock.mod_scmi_from_protocol_api_notify_CallbackFunctionPointer = Callback; +} + +void mod_scmi_from_protocol_api_notify_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, int protocol_id, int message_id, const void* payload, int payload_Depth, size_t size) +{ + CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE)); + CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE*)CMock_Guts_GetAddressFor(cmock_guts_index); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringOutOfMemory); + memset(cmock_call_instance, 0, sizeof(*cmock_call_instance)); + Mock.mod_scmi_from_protocol_api_notify_CallInstance = CMock_Guts_MemChain(Mock.mod_scmi_from_protocol_api_notify_CallInstance, cmock_guts_index); + Mock.mod_scmi_from_protocol_api_notify_IgnoreBool = (char)0; + cmock_call_instance->LineNumber = cmock_line; + cmock_call_instance->ExpectAnyArgsBool = (char)0; + CMockExpectParameters_mod_scmi_from_protocol_api_notify(cmock_call_instance, service_id, protocol_id, message_id, payload, payload_Depth, size); +} + +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_notify_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_service_id = 1; +} + +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_protocol_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_notify_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_protocol_id = 1; +} + +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_message_id(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_notify_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_message_id = 1; +} + +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_payload(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_notify_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_payload = 1; +} + +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_size(UNITY_LINE_TYPE cmock_line) +{ + CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE* cmock_call_instance = (CMOCK_mod_scmi_from_protocol_api_notify_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.mod_scmi_from_protocol_api_notify_CallInstance)); + UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); + cmock_call_instance->IgnoreArg_size = 1; +} + diff --git a/module/scmi_power_domain/test/mocks/Mockmod_scmi_power_domain_extra.h b/module/scmi_power_domain/test/mocks/Mockmod_scmi_power_domain_extra.h new file mode 100644 index 000000000..f238a0485 --- /dev/null +++ b/module/scmi_power_domain/test/mocks/Mockmod_scmi_power_domain_extra.h @@ -0,0 +1,314 @@ +/* AUTOGENERATED FILE. DO NOT EDIT. */ +#ifndef _MOCKMOD_SCMI_POWER_DOMAIN_EXTRA_H +#define _MOCKMOD_SCMI_POWER_DOMAIN_EXTRA_H + +#include "unity.h" +#include "mod_scmi_power_domain_extra.h" + +/* Ignore the following warnings, since we are copying code */ +#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__) +#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0))) +#pragma GCC diagnostic push +#endif +#if !defined(__clang__) +#pragma GCC diagnostic ignored "-Wpragmas" +#endif +#pragma GCC diagnostic ignored "-Wunknown-pragmas" +#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier" +#endif + +void Mockmod_scmi_power_domain_extra_Init(void); +void Mockmod_scmi_power_domain_extra_Destroy(void); +void Mockmod_scmi_power_domain_extra_Verify(void); + + + + +#define get_domain_type_IgnoreAndReturn(cmock_retval) get_domain_type_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void get_domain_type_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define get_domain_type_StopIgnore() get_domain_type_CMockStopIgnore() +void get_domain_type_CMockStopIgnore(void); +#define get_domain_type_ExpectAnyArgsAndReturn(cmock_retval) get_domain_type_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void get_domain_type_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define get_domain_type_ExpectAndReturn(pd_id, type, cmock_retval) get_domain_type_CMockExpectAndReturn(__LINE__, pd_id, type, cmock_retval) +void get_domain_type_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, enum mod_pd_type* type, int cmock_to_return); +typedef int (* CMOCK_get_domain_type_CALLBACK)(fwk_id_t pd_id, enum mod_pd_type* type, int cmock_num_calls); +void get_domain_type_AddCallback(CMOCK_get_domain_type_CALLBACK Callback); +void get_domain_type_Stub(CMOCK_get_domain_type_CALLBACK Callback); +#define get_domain_type_StubWithCallback get_domain_type_Stub +#define get_domain_type_ExpectWithArrayAndReturn(pd_id, type, type_Depth, cmock_retval) get_domain_type_CMockExpectWithArrayAndReturn(__LINE__, pd_id, type, type_Depth, cmock_retval) +void get_domain_type_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, enum mod_pd_type* type, int type_Depth, int cmock_to_return); +#define get_domain_type_ReturnThruPtr_type(type) get_domain_type_CMockReturnMemThruPtr_type(__LINE__, type, sizeof(enum mod_pd_type)) +#define get_domain_type_ReturnArrayThruPtr_type(type, cmock_len) get_domain_type_CMockReturnMemThruPtr_type(__LINE__, type, cmock_len * sizeof(*type)) +#define get_domain_type_ReturnMemThruPtr_type(type, cmock_size) get_domain_type_CMockReturnMemThruPtr_type(__LINE__, type, cmock_size) +void get_domain_type_CMockReturnMemThruPtr_type(UNITY_LINE_TYPE cmock_line, enum mod_pd_type* type, size_t cmock_size); +#define get_domain_type_IgnoreArg_pd_id() get_domain_type_CMockIgnoreArg_pd_id(__LINE__) +void get_domain_type_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line); +#define get_domain_type_IgnoreArg_type() get_domain_type_CMockIgnoreArg_type(__LINE__) +void get_domain_type_CMockIgnoreArg_type(UNITY_LINE_TYPE cmock_line); +#define get_domain_parent_id_IgnoreAndReturn(cmock_retval) get_domain_parent_id_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void get_domain_parent_id_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define get_domain_parent_id_StopIgnore() get_domain_parent_id_CMockStopIgnore() +void get_domain_parent_id_CMockStopIgnore(void); +#define get_domain_parent_id_ExpectAnyArgsAndReturn(cmock_retval) get_domain_parent_id_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void get_domain_parent_id_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define get_domain_parent_id_ExpectAndReturn(pd_id, parent_pd_id, cmock_retval) get_domain_parent_id_CMockExpectAndReturn(__LINE__, pd_id, parent_pd_id, cmock_retval) +void get_domain_parent_id_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, fwk_id_t* parent_pd_id, int cmock_to_return); +typedef int (* CMOCK_get_domain_parent_id_CALLBACK)(fwk_id_t pd_id, fwk_id_t* parent_pd_id, int cmock_num_calls); +void get_domain_parent_id_AddCallback(CMOCK_get_domain_parent_id_CALLBACK Callback); +void get_domain_parent_id_Stub(CMOCK_get_domain_parent_id_CALLBACK Callback); +#define get_domain_parent_id_StubWithCallback get_domain_parent_id_Stub +#define get_domain_parent_id_ExpectWithArrayAndReturn(pd_id, parent_pd_id, parent_pd_id_Depth, cmock_retval) get_domain_parent_id_CMockExpectWithArrayAndReturn(__LINE__, pd_id, parent_pd_id, parent_pd_id_Depth, cmock_retval) +void get_domain_parent_id_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, fwk_id_t* parent_pd_id, int parent_pd_id_Depth, int cmock_to_return); +#define get_domain_parent_id_ReturnThruPtr_parent_pd_id(parent_pd_id) get_domain_parent_id_CMockReturnMemThruPtr_parent_pd_id(__LINE__, parent_pd_id, sizeof(fwk_id_t)) +#define get_domain_parent_id_ReturnArrayThruPtr_parent_pd_id(parent_pd_id, cmock_len) get_domain_parent_id_CMockReturnMemThruPtr_parent_pd_id(__LINE__, parent_pd_id, cmock_len * sizeof(*parent_pd_id)) +#define get_domain_parent_id_ReturnMemThruPtr_parent_pd_id(parent_pd_id, cmock_size) get_domain_parent_id_CMockReturnMemThruPtr_parent_pd_id(__LINE__, parent_pd_id, cmock_size) +void get_domain_parent_id_CMockReturnMemThruPtr_parent_pd_id(UNITY_LINE_TYPE cmock_line, fwk_id_t* parent_pd_id, size_t cmock_size); +#define get_domain_parent_id_IgnoreArg_pd_id() get_domain_parent_id_CMockIgnoreArg_pd_id(__LINE__) +void get_domain_parent_id_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line); +#define get_domain_parent_id_IgnoreArg_parent_pd_id() get_domain_parent_id_CMockIgnoreArg_parent_pd_id(__LINE__) +void get_domain_parent_id_CMockIgnoreArg_parent_pd_id(UNITY_LINE_TYPE cmock_line); +#define set_state_IgnoreAndReturn(cmock_retval) set_state_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void set_state_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define set_state_StopIgnore() set_state_CMockStopIgnore() +void set_state_CMockStopIgnore(void); +#define set_state_ExpectAnyArgsAndReturn(cmock_retval) set_state_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void set_state_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define set_state_ExpectAndReturn(pd_id, resp_requested, state, cmock_retval) set_state_CMockExpectAndReturn(__LINE__, pd_id, resp_requested, state, cmock_retval) +void set_state_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, bool resp_requested, uint32_t state, int cmock_to_return); +typedef int (* CMOCK_set_state_CALLBACK)(fwk_id_t pd_id, bool resp_requested, uint32_t state, int cmock_num_calls); +void set_state_AddCallback(CMOCK_set_state_CALLBACK Callback); +void set_state_Stub(CMOCK_set_state_CALLBACK Callback); +#define set_state_StubWithCallback set_state_Stub +#define set_state_IgnoreArg_pd_id() set_state_CMockIgnoreArg_pd_id(__LINE__) +void set_state_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line); +#define set_state_IgnoreArg_resp_requested() set_state_CMockIgnoreArg_resp_requested(__LINE__) +void set_state_CMockIgnoreArg_resp_requested(UNITY_LINE_TYPE cmock_line); +#define set_state_IgnoreArg_state() set_state_CMockIgnoreArg_state(__LINE__) +void set_state_CMockIgnoreArg_state(UNITY_LINE_TYPE cmock_line); +#define get_state_IgnoreAndReturn(cmock_retval) get_state_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void get_state_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define get_state_StopIgnore() get_state_CMockStopIgnore() +void get_state_CMockStopIgnore(void); +#define get_state_ExpectAnyArgsAndReturn(cmock_retval) get_state_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void get_state_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define get_state_ExpectAndReturn(pd_id, state, cmock_retval) get_state_CMockExpectAndReturn(__LINE__, pd_id, state, cmock_retval) +void get_state_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, unsigned int* state, int cmock_to_return); +typedef int (* CMOCK_get_state_CALLBACK)(fwk_id_t pd_id, unsigned int* state, int cmock_num_calls); +void get_state_AddCallback(CMOCK_get_state_CALLBACK Callback); +void get_state_Stub(CMOCK_get_state_CALLBACK Callback); +#define get_state_StubWithCallback get_state_Stub +#define get_state_ExpectWithArrayAndReturn(pd_id, state, state_Depth, cmock_retval) get_state_CMockExpectWithArrayAndReturn(__LINE__, pd_id, state, state_Depth, cmock_retval) +void get_state_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, unsigned int* state, int state_Depth, int cmock_to_return); +#define get_state_ReturnThruPtr_state(state) get_state_CMockReturnMemThruPtr_state(__LINE__, state, sizeof(unsigned int)) +#define get_state_ReturnArrayThruPtr_state(state, cmock_len) get_state_CMockReturnMemThruPtr_state(__LINE__, state, cmock_len * sizeof(*state)) +#define get_state_ReturnMemThruPtr_state(state, cmock_size) get_state_CMockReturnMemThruPtr_state(__LINE__, state, cmock_size) +void get_state_CMockReturnMemThruPtr_state(UNITY_LINE_TYPE cmock_line, unsigned int* state, size_t cmock_size); +#define get_state_IgnoreArg_pd_id() get_state_CMockIgnoreArg_pd_id(__LINE__) +void get_state_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line); +#define get_state_IgnoreArg_state() get_state_CMockIgnoreArg_state(__LINE__) +void get_state_CMockIgnoreArg_state(UNITY_LINE_TYPE cmock_line); +#define reset_IgnoreAndReturn(cmock_retval) reset_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void reset_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define reset_StopIgnore() reset_CMockStopIgnore() +void reset_CMockStopIgnore(void); +#define reset_ExpectAnyArgsAndReturn(cmock_retval) reset_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void reset_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define reset_ExpectAndReturn(pd_id, resp_requested, cmock_retval) reset_CMockExpectAndReturn(__LINE__, pd_id, resp_requested, cmock_retval) +void reset_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t pd_id, bool resp_requested, int cmock_to_return); +typedef int (* CMOCK_reset_CALLBACK)(fwk_id_t pd_id, bool resp_requested, int cmock_num_calls); +void reset_AddCallback(CMOCK_reset_CALLBACK Callback); +void reset_Stub(CMOCK_reset_CALLBACK Callback); +#define reset_StubWithCallback reset_Stub +#define reset_IgnoreArg_pd_id() reset_CMockIgnoreArg_pd_id(__LINE__) +void reset_CMockIgnoreArg_pd_id(UNITY_LINE_TYPE cmock_line); +#define reset_IgnoreArg_resp_requested() reset_CMockIgnoreArg_resp_requested(__LINE__) +void reset_CMockIgnoreArg_resp_requested(UNITY_LINE_TYPE cmock_line); +#define system_suspend_IgnoreAndReturn(cmock_retval) system_suspend_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void system_suspend_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define system_suspend_StopIgnore() system_suspend_CMockStopIgnore() +void system_suspend_CMockStopIgnore(void); +#define system_suspend_ExpectAnyArgsAndReturn(cmock_retval) system_suspend_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void system_suspend_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define system_suspend_ExpectAndReturn(state, cmock_retval) system_suspend_CMockExpectAndReturn(__LINE__, state, cmock_retval) +void system_suspend_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, unsigned int state, int cmock_to_return); +typedef int (* CMOCK_system_suspend_CALLBACK)(unsigned int state, int cmock_num_calls); +void system_suspend_AddCallback(CMOCK_system_suspend_CALLBACK Callback); +void system_suspend_Stub(CMOCK_system_suspend_CALLBACK Callback); +#define system_suspend_StubWithCallback system_suspend_Stub +#define system_suspend_IgnoreArg_state() system_suspend_CMockIgnoreArg_state(__LINE__) +void system_suspend_CMockIgnoreArg_state(UNITY_LINE_TYPE cmock_line); +#define system_shutdown_IgnoreAndReturn(cmock_retval) system_shutdown_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void system_shutdown_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define system_shutdown_StopIgnore() system_shutdown_CMockStopIgnore() +void system_shutdown_CMockStopIgnore(void); +#define system_shutdown_ExpectAnyArgsAndReturn(cmock_retval) system_shutdown_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void system_shutdown_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define system_shutdown_ExpectAndReturn(system_shsutdown, cmock_retval) system_shutdown_CMockExpectAndReturn(__LINE__, system_shsutdown, cmock_retval) +void system_shutdown_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, enum mod_pd_system_shutdown system_shsutdown, int cmock_to_return); +typedef int (* CMOCK_system_shutdown_CALLBACK)(enum mod_pd_system_shutdown system_shsutdown, int cmock_num_calls); +void system_shutdown_AddCallback(CMOCK_system_shutdown_CALLBACK Callback); +void system_shutdown_Stub(CMOCK_system_shutdown_CALLBACK Callback); +#define system_shutdown_StubWithCallback system_shutdown_Stub +#define system_shutdown_IgnoreArg_system_shsutdown() system_shutdown_CMockIgnoreArg_system_shsutdown(__LINE__) +void system_shutdown_CMockIgnoreArg_system_shsutdown(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_get_agent_count_IgnoreAndReturn(cmock_retval) mod_scmi_from_protocol_api_get_agent_count_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_count_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_agent_count_StopIgnore() mod_scmi_from_protocol_api_get_agent_count_CMockStopIgnore() +void mod_scmi_from_protocol_api_get_agent_count_CMockStopIgnore(void); +#define mod_scmi_from_protocol_api_get_agent_count_ExpectAnyArgsAndReturn(cmock_retval) mod_scmi_from_protocol_api_get_agent_count_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_count_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_agent_count_ExpectAndReturn(agent_count, cmock_retval) mod_scmi_from_protocol_api_get_agent_count_CMockExpectAndReturn(__LINE__, agent_count, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_count_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, unsigned int* agent_count, int cmock_to_return); +typedef int (* CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALLBACK)(unsigned int* agent_count, int cmock_num_calls); +void mod_scmi_from_protocol_api_get_agent_count_AddCallback(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALLBACK Callback); +void mod_scmi_from_protocol_api_get_agent_count_Stub(CMOCK_mod_scmi_from_protocol_api_get_agent_count_CALLBACK Callback); +#define mod_scmi_from_protocol_api_get_agent_count_StubWithCallback mod_scmi_from_protocol_api_get_agent_count_Stub +#define mod_scmi_from_protocol_api_get_agent_count_ExpectWithArrayAndReturn(agent_count, agent_count_Depth, cmock_retval) mod_scmi_from_protocol_api_get_agent_count_CMockExpectWithArrayAndReturn(__LINE__, agent_count, agent_count_Depth, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_count_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, unsigned int* agent_count, int agent_count_Depth, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_agent_count_ReturnThruPtr_agent_count(agent_count) mod_scmi_from_protocol_api_get_agent_count_CMockReturnMemThruPtr_agent_count(__LINE__, agent_count, sizeof(unsigned int)) +#define mod_scmi_from_protocol_api_get_agent_count_ReturnArrayThruPtr_agent_count(agent_count, cmock_len) mod_scmi_from_protocol_api_get_agent_count_CMockReturnMemThruPtr_agent_count(__LINE__, agent_count, cmock_len * sizeof(*agent_count)) +#define mod_scmi_from_protocol_api_get_agent_count_ReturnMemThruPtr_agent_count(agent_count, cmock_size) mod_scmi_from_protocol_api_get_agent_count_CMockReturnMemThruPtr_agent_count(__LINE__, agent_count, cmock_size) +void mod_scmi_from_protocol_api_get_agent_count_CMockReturnMemThruPtr_agent_count(UNITY_LINE_TYPE cmock_line, unsigned int* agent_count, size_t cmock_size); +#define mod_scmi_from_protocol_api_get_agent_count_IgnoreArg_agent_count() mod_scmi_from_protocol_api_get_agent_count_CMockIgnoreArg_agent_count(__LINE__) +void mod_scmi_from_protocol_api_get_agent_count_CMockIgnoreArg_agent_count(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_get_agent_id_IgnoreAndReturn(cmock_retval) mod_scmi_from_protocol_api_get_agent_id_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_id_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_agent_id_StopIgnore() mod_scmi_from_protocol_api_get_agent_id_CMockStopIgnore() +void mod_scmi_from_protocol_api_get_agent_id_CMockStopIgnore(void); +#define mod_scmi_from_protocol_api_get_agent_id_ExpectAnyArgsAndReturn(cmock_retval) mod_scmi_from_protocol_api_get_agent_id_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_id_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_agent_id_ExpectAndReturn(service_id, agent_id, cmock_retval) mod_scmi_from_protocol_api_get_agent_id_CMockExpectAndReturn(__LINE__, service_id, agent_id, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_id_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, unsigned int* agent_id, int cmock_to_return); +typedef int (* CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALLBACK)(fwk_id_t service_id, unsigned int* agent_id, int cmock_num_calls); +void mod_scmi_from_protocol_api_get_agent_id_AddCallback(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALLBACK Callback); +void mod_scmi_from_protocol_api_get_agent_id_Stub(CMOCK_mod_scmi_from_protocol_api_get_agent_id_CALLBACK Callback); +#define mod_scmi_from_protocol_api_get_agent_id_StubWithCallback mod_scmi_from_protocol_api_get_agent_id_Stub +#define mod_scmi_from_protocol_api_get_agent_id_ExpectWithArrayAndReturn(service_id, agent_id, agent_id_Depth, cmock_retval) mod_scmi_from_protocol_api_get_agent_id_CMockExpectWithArrayAndReturn(__LINE__, service_id, agent_id, agent_id_Depth, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_id_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, unsigned int* agent_id, int agent_id_Depth, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_agent_id_ReturnThruPtr_agent_id(agent_id) mod_scmi_from_protocol_api_get_agent_id_CMockReturnMemThruPtr_agent_id(__LINE__, agent_id, sizeof(unsigned int)) +#define mod_scmi_from_protocol_api_get_agent_id_ReturnArrayThruPtr_agent_id(agent_id, cmock_len) mod_scmi_from_protocol_api_get_agent_id_CMockReturnMemThruPtr_agent_id(__LINE__, agent_id, cmock_len * sizeof(*agent_id)) +#define mod_scmi_from_protocol_api_get_agent_id_ReturnMemThruPtr_agent_id(agent_id, cmock_size) mod_scmi_from_protocol_api_get_agent_id_CMockReturnMemThruPtr_agent_id(__LINE__, agent_id, cmock_size) +void mod_scmi_from_protocol_api_get_agent_id_CMockReturnMemThruPtr_agent_id(UNITY_LINE_TYPE cmock_line, unsigned int* agent_id, size_t cmock_size); +#define mod_scmi_from_protocol_api_get_agent_id_IgnoreArg_service_id() mod_scmi_from_protocol_api_get_agent_id_CMockIgnoreArg_service_id(__LINE__) +void mod_scmi_from_protocol_api_get_agent_id_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_get_agent_id_IgnoreArg_agent_id() mod_scmi_from_protocol_api_get_agent_id_CMockIgnoreArg_agent_id(__LINE__) +void mod_scmi_from_protocol_api_get_agent_id_CMockIgnoreArg_agent_id(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_get_agent_type_IgnoreAndReturn(cmock_retval) mod_scmi_from_protocol_api_get_agent_type_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_type_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_agent_type_StopIgnore() mod_scmi_from_protocol_api_get_agent_type_CMockStopIgnore() +void mod_scmi_from_protocol_api_get_agent_type_CMockStopIgnore(void); +#define mod_scmi_from_protocol_api_get_agent_type_ExpectAnyArgsAndReturn(cmock_retval) mod_scmi_from_protocol_api_get_agent_type_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_type_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_agent_type_ExpectAndReturn(agent_id, agent_type, cmock_retval) mod_scmi_from_protocol_api_get_agent_type_CMockExpectAndReturn(__LINE__, agent_id, agent_type, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_type_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, uint32_t agent_id, enum scmi_agent_type* agent_type, int cmock_to_return); +typedef int (* CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALLBACK)(uint32_t agent_id, enum scmi_agent_type* agent_type, int cmock_num_calls); +void mod_scmi_from_protocol_api_get_agent_type_AddCallback(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALLBACK Callback); +void mod_scmi_from_protocol_api_get_agent_type_Stub(CMOCK_mod_scmi_from_protocol_api_get_agent_type_CALLBACK Callback); +#define mod_scmi_from_protocol_api_get_agent_type_StubWithCallback mod_scmi_from_protocol_api_get_agent_type_Stub +#define mod_scmi_from_protocol_api_get_agent_type_ExpectWithArrayAndReturn(agent_id, agent_type, agent_type_Depth, cmock_retval) mod_scmi_from_protocol_api_get_agent_type_CMockExpectWithArrayAndReturn(__LINE__, agent_id, agent_type, agent_type_Depth, cmock_retval) +void mod_scmi_from_protocol_api_get_agent_type_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, uint32_t agent_id, enum scmi_agent_type* agent_type, int agent_type_Depth, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_agent_type_ReturnThruPtr_agent_type(agent_type) mod_scmi_from_protocol_api_get_agent_type_CMockReturnMemThruPtr_agent_type(__LINE__, agent_type, sizeof(enum scmi_agent_type)) +#define mod_scmi_from_protocol_api_get_agent_type_ReturnArrayThruPtr_agent_type(agent_type, cmock_len) mod_scmi_from_protocol_api_get_agent_type_CMockReturnMemThruPtr_agent_type(__LINE__, agent_type, cmock_len * sizeof(*agent_type)) +#define mod_scmi_from_protocol_api_get_agent_type_ReturnMemThruPtr_agent_type(agent_type, cmock_size) mod_scmi_from_protocol_api_get_agent_type_CMockReturnMemThruPtr_agent_type(__LINE__, agent_type, cmock_size) +void mod_scmi_from_protocol_api_get_agent_type_CMockReturnMemThruPtr_agent_type(UNITY_LINE_TYPE cmock_line, enum scmi_agent_type* agent_type, size_t cmock_size); +#define mod_scmi_from_protocol_api_get_agent_type_IgnoreArg_agent_id() mod_scmi_from_protocol_api_get_agent_type_CMockIgnoreArg_agent_id(__LINE__) +void mod_scmi_from_protocol_api_get_agent_type_CMockIgnoreArg_agent_id(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_get_agent_type_IgnoreArg_agent_type() mod_scmi_from_protocol_api_get_agent_type_CMockIgnoreArg_agent_type(__LINE__) +void mod_scmi_from_protocol_api_get_agent_type_CMockIgnoreArg_agent_type(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_get_max_payload_size_IgnoreAndReturn(cmock_retval) mod_scmi_from_protocol_api_get_max_payload_size_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_get_max_payload_size_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_max_payload_size_StopIgnore() mod_scmi_from_protocol_api_get_max_payload_size_CMockStopIgnore() +void mod_scmi_from_protocol_api_get_max_payload_size_CMockStopIgnore(void); +#define mod_scmi_from_protocol_api_get_max_payload_size_ExpectAnyArgsAndReturn(cmock_retval) mod_scmi_from_protocol_api_get_max_payload_size_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_get_max_payload_size_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_max_payload_size_ExpectAndReturn(service_id, size, cmock_retval) mod_scmi_from_protocol_api_get_max_payload_size_CMockExpectAndReturn(__LINE__, service_id, size, cmock_retval) +void mod_scmi_from_protocol_api_get_max_payload_size_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, size_t* size, int cmock_to_return); +typedef int (* CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALLBACK)(fwk_id_t service_id, size_t* size, int cmock_num_calls); +void mod_scmi_from_protocol_api_get_max_payload_size_AddCallback(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALLBACK Callback); +void mod_scmi_from_protocol_api_get_max_payload_size_Stub(CMOCK_mod_scmi_from_protocol_api_get_max_payload_size_CALLBACK Callback); +#define mod_scmi_from_protocol_api_get_max_payload_size_StubWithCallback mod_scmi_from_protocol_api_get_max_payload_size_Stub +#define mod_scmi_from_protocol_api_get_max_payload_size_ExpectWithArrayAndReturn(service_id, size, size_Depth, cmock_retval) mod_scmi_from_protocol_api_get_max_payload_size_CMockExpectWithArrayAndReturn(__LINE__, service_id, size, size_Depth, cmock_retval) +void mod_scmi_from_protocol_api_get_max_payload_size_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, size_t* size, int size_Depth, int cmock_to_return); +#define mod_scmi_from_protocol_api_get_max_payload_size_ReturnThruPtr_size(size) mod_scmi_from_protocol_api_get_max_payload_size_CMockReturnMemThruPtr_size(__LINE__, size, sizeof(size_t)) +#define mod_scmi_from_protocol_api_get_max_payload_size_ReturnArrayThruPtr_size(size, cmock_len) mod_scmi_from_protocol_api_get_max_payload_size_CMockReturnMemThruPtr_size(__LINE__, size, cmock_len * sizeof(*size)) +#define mod_scmi_from_protocol_api_get_max_payload_size_ReturnMemThruPtr_size(size, cmock_size) mod_scmi_from_protocol_api_get_max_payload_size_CMockReturnMemThruPtr_size(__LINE__, size, cmock_size) +void mod_scmi_from_protocol_api_get_max_payload_size_CMockReturnMemThruPtr_size(UNITY_LINE_TYPE cmock_line, size_t* size, size_t cmock_size); +#define mod_scmi_from_protocol_api_get_max_payload_size_IgnoreArg_service_id() mod_scmi_from_protocol_api_get_max_payload_size_CMockIgnoreArg_service_id(__LINE__) +void mod_scmi_from_protocol_api_get_max_payload_size_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_get_max_payload_size_IgnoreArg_size() mod_scmi_from_protocol_api_get_max_payload_size_CMockIgnoreArg_size(__LINE__) +void mod_scmi_from_protocol_api_get_max_payload_size_CMockIgnoreArg_size(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_write_payload_IgnoreAndReturn(cmock_retval) mod_scmi_from_protocol_api_write_payload_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_write_payload_StopIgnore() mod_scmi_from_protocol_api_write_payload_CMockStopIgnore() +void mod_scmi_from_protocol_api_write_payload_CMockStopIgnore(void); +#define mod_scmi_from_protocol_api_write_payload_ExpectAnyArgsAndReturn(cmock_retval) mod_scmi_from_protocol_api_write_payload_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_write_payload_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_write_payload_ExpectAndReturn(service_id, offset, payload, size, cmock_retval) mod_scmi_from_protocol_api_write_payload_CMockExpectAndReturn(__LINE__, service_id, offset, payload, size, cmock_retval) +void mod_scmi_from_protocol_api_write_payload_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, size_t offset, const void* payload, size_t size, int cmock_to_return); +typedef int (* CMOCK_mod_scmi_from_protocol_api_write_payload_CALLBACK)(fwk_id_t service_id, size_t offset, const void* payload, size_t size, int cmock_num_calls); +void mod_scmi_from_protocol_api_write_payload_AddCallback(CMOCK_mod_scmi_from_protocol_api_write_payload_CALLBACK Callback); +void mod_scmi_from_protocol_api_write_payload_Stub(CMOCK_mod_scmi_from_protocol_api_write_payload_CALLBACK Callback); +#define mod_scmi_from_protocol_api_write_payload_StubWithCallback mod_scmi_from_protocol_api_write_payload_Stub +#define mod_scmi_from_protocol_api_write_payload_ExpectWithArrayAndReturn(service_id, offset, payload, payload_Depth, size, cmock_retval) mod_scmi_from_protocol_api_write_payload_CMockExpectWithArrayAndReturn(__LINE__, service_id, offset, payload, payload_Depth, size, cmock_retval) +void mod_scmi_from_protocol_api_write_payload_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, size_t offset, const void* payload, int payload_Depth, size_t size, int cmock_to_return); +#define mod_scmi_from_protocol_api_write_payload_IgnoreArg_service_id() mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_service_id(__LINE__) +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_write_payload_IgnoreArg_offset() mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_offset(__LINE__) +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_offset(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_write_payload_IgnoreArg_payload() mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_payload(__LINE__) +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_payload(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_write_payload_IgnoreArg_size() mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_size(__LINE__) +void mod_scmi_from_protocol_api_write_payload_CMockIgnoreArg_size(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_respond_IgnoreAndReturn(cmock_retval) mod_scmi_from_protocol_api_respond_CMockIgnoreAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_respond_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_respond_StopIgnore() mod_scmi_from_protocol_api_respond_CMockStopIgnore() +void mod_scmi_from_protocol_api_respond_CMockStopIgnore(void); +#define mod_scmi_from_protocol_api_respond_ExpectAnyArgsAndReturn(cmock_retval) mod_scmi_from_protocol_api_respond_CMockExpectAnyArgsAndReturn(__LINE__, cmock_retval) +void mod_scmi_from_protocol_api_respond_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return); +#define mod_scmi_from_protocol_api_respond_ExpectAndReturn(service_id, payload, size, cmock_retval) mod_scmi_from_protocol_api_respond_CMockExpectAndReturn(__LINE__, service_id, payload, size, cmock_retval) +void mod_scmi_from_protocol_api_respond_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, const void* payload, size_t size, int cmock_to_return); +typedef int (* CMOCK_mod_scmi_from_protocol_api_respond_CALLBACK)(fwk_id_t service_id, const void* payload, size_t size, int cmock_num_calls); +void mod_scmi_from_protocol_api_respond_AddCallback(CMOCK_mod_scmi_from_protocol_api_respond_CALLBACK Callback); +void mod_scmi_from_protocol_api_respond_Stub(CMOCK_mod_scmi_from_protocol_api_respond_CALLBACK Callback); +#define mod_scmi_from_protocol_api_respond_StubWithCallback mod_scmi_from_protocol_api_respond_Stub +#define mod_scmi_from_protocol_api_respond_ExpectWithArrayAndReturn(service_id, payload, payload_Depth, size, cmock_retval) mod_scmi_from_protocol_api_respond_CMockExpectWithArrayAndReturn(__LINE__, service_id, payload, payload_Depth, size, cmock_retval) +void mod_scmi_from_protocol_api_respond_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, const void* payload, int payload_Depth, size_t size, int cmock_to_return); +#define mod_scmi_from_protocol_api_respond_IgnoreArg_service_id() mod_scmi_from_protocol_api_respond_CMockIgnoreArg_service_id(__LINE__) +void mod_scmi_from_protocol_api_respond_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_respond_IgnoreArg_payload() mod_scmi_from_protocol_api_respond_CMockIgnoreArg_payload(__LINE__) +void mod_scmi_from_protocol_api_respond_CMockIgnoreArg_payload(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_respond_IgnoreArg_size() mod_scmi_from_protocol_api_respond_CMockIgnoreArg_size(__LINE__) +void mod_scmi_from_protocol_api_respond_CMockIgnoreArg_size(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_notify_Ignore() mod_scmi_from_protocol_api_notify_CMockIgnore() +void mod_scmi_from_protocol_api_notify_CMockIgnore(void); +#define mod_scmi_from_protocol_api_notify_StopIgnore() mod_scmi_from_protocol_api_notify_CMockStopIgnore() +void mod_scmi_from_protocol_api_notify_CMockStopIgnore(void); +#define mod_scmi_from_protocol_api_notify_ExpectAnyArgs() mod_scmi_from_protocol_api_notify_CMockExpectAnyArgs(__LINE__) +void mod_scmi_from_protocol_api_notify_CMockExpectAnyArgs(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_notify_Expect(service_id, protocol_id, message_id, payload, size) mod_scmi_from_protocol_api_notify_CMockExpect(__LINE__, service_id, protocol_id, message_id, payload, size) +void mod_scmi_from_protocol_api_notify_CMockExpect(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, int protocol_id, int message_id, const void* payload, size_t size); +typedef void (* CMOCK_mod_scmi_from_protocol_api_notify_CALLBACK)(fwk_id_t service_id, int protocol_id, int message_id, const void* payload, size_t size, int cmock_num_calls); +void mod_scmi_from_protocol_api_notify_AddCallback(CMOCK_mod_scmi_from_protocol_api_notify_CALLBACK Callback); +void mod_scmi_from_protocol_api_notify_Stub(CMOCK_mod_scmi_from_protocol_api_notify_CALLBACK Callback); +#define mod_scmi_from_protocol_api_notify_StubWithCallback mod_scmi_from_protocol_api_notify_Stub +#define mod_scmi_from_protocol_api_notify_ExpectWithArray(service_id, protocol_id, message_id, payload, payload_Depth, size) mod_scmi_from_protocol_api_notify_CMockExpectWithArray(__LINE__, service_id, protocol_id, message_id, payload, payload_Depth, size) +void mod_scmi_from_protocol_api_notify_CMockExpectWithArray(UNITY_LINE_TYPE cmock_line, fwk_id_t service_id, int protocol_id, int message_id, const void* payload, int payload_Depth, size_t size); +#define mod_scmi_from_protocol_api_notify_IgnoreArg_service_id() mod_scmi_from_protocol_api_notify_CMockIgnoreArg_service_id(__LINE__) +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_service_id(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_notify_IgnoreArg_protocol_id() mod_scmi_from_protocol_api_notify_CMockIgnoreArg_protocol_id(__LINE__) +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_protocol_id(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_notify_IgnoreArg_message_id() mod_scmi_from_protocol_api_notify_CMockIgnoreArg_message_id(__LINE__) +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_message_id(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_notify_IgnoreArg_payload() mod_scmi_from_protocol_api_notify_CMockIgnoreArg_payload(__LINE__) +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_payload(UNITY_LINE_TYPE cmock_line); +#define mod_scmi_from_protocol_api_notify_IgnoreArg_size() mod_scmi_from_protocol_api_notify_CMockIgnoreArg_size(__LINE__) +void mod_scmi_from_protocol_api_notify_CMockIgnoreArg_size(UNITY_LINE_TYPE cmock_line); + +#if defined(__GNUC__) && !defined(__ICC) && !defined(__TMS470__) +#if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 6 || (__GNUC_MINOR__ == 6 && __GNUC_PATCHLEVEL__ > 0))) +#pragma GCC diagnostic pop +#endif +#endif + +#endif diff --git a/module/scmi_power_domain/test/mod_scmi_power_domain_extra.h b/module/scmi_power_domain/test/mod_scmi_power_domain_extra.h new file mode 100644 index 000000000..75fdd6e61 --- /dev/null +++ b/module/scmi_power_domain/test/mod_scmi_power_domain_extra.h @@ -0,0 +1,66 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + * + * Description: + * SCMI Power Domain unit test support. + */ + +#ifndef MOD_SCMI_POWER_DOMAIN_EXTRA_H +#define MOD_SCMI_POWER_DOMAIN_EXTRA_H + +#include "mod_power_domain.h" + +#include + +#include + +int get_domain_type(fwk_id_t pd_id, enum mod_pd_type *type); + +int get_domain_parent_id(fwk_id_t pd_id, fwk_id_t *parent_pd_id); + +int set_state(fwk_id_t pd_id, bool resp_requested, uint32_t state); + +int get_state(fwk_id_t pd_id, unsigned int *state); + +int reset(fwk_id_t pd_id, bool resp_requested); + +int system_suspend(unsigned int state); + +int system_shutdown(enum mod_pd_system_shutdown system_shsutdown); + +int mod_scmi_from_protocol_api_get_agent_count(unsigned int *agent_count); + +int mod_scmi_from_protocol_api_get_agent_id( + fwk_id_t service_id, + unsigned int *agent_id); + +int mod_scmi_from_protocol_api_get_agent_type( + uint32_t agent_id, + enum scmi_agent_type *agent_type); + +int mod_scmi_from_protocol_api_get_max_payload_size( + fwk_id_t service_id, + size_t *size); + +int mod_scmi_from_protocol_api_write_payload( + fwk_id_t service_id, + size_t offset, + const void *payload, + size_t size); + +int mod_scmi_from_protocol_api_respond( + fwk_id_t service_id, + const void *payload, + size_t size); + +void mod_scmi_from_protocol_api_notify( + fwk_id_t service_id, + int protocol_id, + int message_id, + const void *payload, + size_t size); + +#endif /* MOD_SCMI_POWER_DOMAIN_EXTRA_H */ diff --git a/module/scmi_power_domain/test/mod_scmi_power_domain_unit_test.c b/module/scmi_power_domain/test/mod_scmi_power_domain_unit_test.c new file mode 100644 index 000000000..377e883ea --- /dev/null +++ b/module/scmi_power_domain/test/mod_scmi_power_domain_unit_test.c @@ -0,0 +1,124 @@ +/* + * Arm SCP/MCP Software + * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "config_scmi_power_domain_ut.h" +#include "scp_unity.h" +#include "unity.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include UNIT_TEST_SRC + +void setUp(void) +{ + memset(&scmi_pd_ctx, 0, sizeof(scmi_pd_ctx)); + scmi_pd_ctx.pd_api = &pd_api_ut; + scmi_pd_ctx.scmi_api = &from_protocol_api; + scmi_pd_ctx.domain_count = 2; + + scmi_pd_ctx.ops = fwk_mm_calloc( + scmi_pd_ctx.domain_count, sizeof(struct scmi_pd_operations)); + + for (unsigned int i = 0; i < scmi_pd_ctx.domain_count; i++) { + scmi_pd_ctx.ops[i].service_id = + FWK_ID_ELEMENT(FWK_MODULE_IDX_SCMI_POWER_DOMAIN, i); + scmi_pd_ctx.ops[i].agent_id = i; + } +} + +void tearDown(void) +{ +} + +void test_scmi_power_domain_pass(void) +{ + TEST_ASSERT_EQUAL(0, FWK_SUCCESS); +} + +void test_process_request_event_successful_set_state(void) +{ + int status; + struct fwk_event event; + + fwk_id_get_event_idx_ExpectAnyArgsAndReturn(SCMI_PD_EVENT_IDX_SET_STATE); + set_state_ExpectAnyArgsAndReturn(FWK_SUCCESS); + status = process_request_event(&event); + + TEST_ASSERT_EQUAL(status, FWK_SUCCESS); +} + +void test_process_request_event_failed_set_state(void) +{ + int status; + struct fwk_event event; + struct scmi_pd_power_state_set_p2a retval_set = { .status = + SCMI_GENERIC_ERROR }; + + fwk_id_get_event_idx_ExpectAnyArgsAndReturn(SCMI_PD_EVENT_IDX_SET_STATE); + set_state_ExpectAnyArgsAndReturn(FWK_E_PARAM); + fwk_id_get_element_idx_ExpectAnyArgsAndReturn(0); + + mod_scmi_from_protocol_api_respond_ExpectAndReturn( + scmi_pd_ctx.ops[0].service_id, + &retval_set, + sizeof(retval_set.status), + FWK_SUCCESS); + + status = process_request_event(&event); + + TEST_ASSERT_EQUAL(status, FWK_E_PARAM); +} + +void test_process_request_event_failed_set_state_failed_respond(void) +{ + int status; + struct fwk_event event; + struct scmi_pd_power_state_set_p2a retval_set = { .status = + SCMI_GENERIC_ERROR }; + + fwk_id_get_event_idx_ExpectAnyArgsAndReturn(SCMI_PD_EVENT_IDX_SET_STATE); + set_state_ExpectAnyArgsAndReturn(FWK_E_PARAM); + fwk_id_get_element_idx_ExpectAnyArgsAndReturn(0); + + mod_scmi_from_protocol_api_respond_ExpectAndReturn( + scmi_pd_ctx.ops[0].service_id, + &retval_set, + sizeof(retval_set.status), + FWK_E_SUPPORT); + + status = process_request_event(&event); + + TEST_ASSERT_EQUAL(status, FWK_E_SUPPORT); +} + +int scmi_power_domain_test_main(void) +{ + UNITY_BEGIN(); + RUN_TEST(test_scmi_power_domain_pass); + RUN_TEST(test_process_request_event_successful_set_state); + RUN_TEST(test_process_request_event_failed_set_state); + RUN_TEST(test_process_request_event_failed_set_state_failed_respond); + return UNITY_END(); +} + +int main(void) +{ + return scmi_power_domain_test_main(); +} diff --git a/unit_test/CMakeLists.txt b/unit_test/CMakeLists.txt index 94912f043..25b269785 100644 --- a/unit_test/CMakeLists.txt +++ b/unit_test/CMakeLists.txt @@ -122,6 +122,7 @@ list(APPEND UNIT_MODULE scmi) list(APPEND UNIT_MODULE scmi_clock) list(APPEND UNIT_MODULE scmi_perf) list(APPEND UNIT_MODULE scmi_power_capping) +list(APPEND UNIT_MODULE scmi_power_domain) list(APPEND UNIT_MODULE scmi_sensor) list(APPEND UNIT_MODULE scmi_sensor_req) list(APPEND UNIT_MODULE scmi_system_power)