/* AUTOGENERATED FILE. DO NOT EDIT. */ #include #include #include #include "cmock.h" #include "Mockmod_scmi_perf_ph_extra.h" static const char* CMockString_data = "data"; static const char* CMockString_plugin_report = "plugin_report"; static const char* CMockString_plugin_update = "plugin_update"; typedef struct _CMOCK_plugin_update_CALL_INSTANCE { UNITY_LINE_TYPE LineNumber; char ExpectAnyArgsBool; int ReturnVal; struct perf_plugins_perf_update* Expected_data; int Expected_data_Depth; char ReturnThruPtr_data_Used; struct perf_plugins_perf_update* ReturnThruPtr_data_Val; size_t ReturnThruPtr_data_Size; char IgnoreArg_data; } CMOCK_plugin_update_CALL_INSTANCE; typedef struct _CMOCK_plugin_report_CALL_INSTANCE { UNITY_LINE_TYPE LineNumber; char ExpectAnyArgsBool; int ReturnVal; struct perf_plugins_perf_report* Expected_data; int Expected_data_Depth; char ReturnThruPtr_data_Used; struct perf_plugins_perf_report* ReturnThruPtr_data_Val; size_t ReturnThruPtr_data_Size; char IgnoreArg_data; } CMOCK_plugin_report_CALL_INSTANCE; static struct Mockmod_scmi_perf_ph_extraInstance { char plugin_update_IgnoreBool; int plugin_update_FinalReturn; char plugin_update_CallbackBool; CMOCK_plugin_update_CALLBACK plugin_update_CallbackFunctionPointer; int plugin_update_CallbackCalls; CMOCK_MEM_INDEX_TYPE plugin_update_CallInstance; char plugin_report_IgnoreBool; int plugin_report_FinalReturn; char plugin_report_CallbackBool; CMOCK_plugin_report_CALLBACK plugin_report_CallbackFunctionPointer; int plugin_report_CallbackCalls; CMOCK_MEM_INDEX_TYPE plugin_report_CallInstance; } Mock; extern jmp_buf AbortFrame; void Mockmod_scmi_perf_ph_extra_Verify(void) { UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; CMOCK_MEM_INDEX_TYPE call_instance; call_instance = Mock.plugin_update_CallInstance; if (Mock.plugin_update_IgnoreBool) call_instance = CMOCK_GUTS_NONE; if (CMOCK_GUTS_NONE != call_instance) { UNITY_SET_DETAIL(CMockString_plugin_update); UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); } if (Mock.plugin_update_CallbackFunctionPointer != NULL) { call_instance = CMOCK_GUTS_NONE; (void)call_instance; } call_instance = Mock.plugin_report_CallInstance; if (Mock.plugin_report_IgnoreBool) call_instance = CMOCK_GUTS_NONE; if (CMOCK_GUTS_NONE != call_instance) { UNITY_SET_DETAIL(CMockString_plugin_report); UNITY_TEST_FAIL(cmock_line, CMockStringCalledLess); } if (Mock.plugin_report_CallbackFunctionPointer != NULL) { call_instance = CMOCK_GUTS_NONE; (void)call_instance; } } void Mockmod_scmi_perf_ph_extra_Init(void) { Mockmod_scmi_perf_ph_extra_Destroy(); } void Mockmod_scmi_perf_ph_extra_Destroy(void) { CMock_Guts_MemFreeAll(); memset(&Mock, 0, sizeof(Mock)); } int plugin_update(struct perf_plugins_perf_update* data) { UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; CMOCK_plugin_update_CALL_INSTANCE* cmock_call_instance; UNITY_SET_DETAIL(CMockString_plugin_update); cmock_call_instance = (CMOCK_plugin_update_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.plugin_update_CallInstance); Mock.plugin_update_CallInstance = CMock_Guts_MemNext(Mock.plugin_update_CallInstance); if (Mock.plugin_update_IgnoreBool) { UNITY_CLR_DETAILS(); if (cmock_call_instance == NULL) return Mock.plugin_update_FinalReturn; Mock.plugin_update_FinalReturn = cmock_call_instance->ReturnVal; return cmock_call_instance->ReturnVal; } if (!Mock.plugin_update_CallbackBool && Mock.plugin_update_CallbackFunctionPointer != NULL) { int cmock_cb_ret = Mock.plugin_update_CallbackFunctionPointer(data, Mock.plugin_update_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_data) { UNITY_SET_DETAILS(CMockString_plugin_update,CMockString_data); if (cmock_call_instance->Expected_data == NULL) { UNITY_TEST_ASSERT_NULL(data, cmock_line, CMockStringExpNULL); } else { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_data), (void*)(data), sizeof(struct perf_plugins_perf_update), cmock_call_instance->Expected_data_Depth, cmock_line, CMockStringMismatch); } } } if (Mock.plugin_update_CallbackFunctionPointer != NULL) { cmock_call_instance->ReturnVal = Mock.plugin_update_CallbackFunctionPointer(data, Mock.plugin_update_CallbackCalls++); } if (cmock_call_instance->ReturnThruPtr_data_Used) { UNITY_TEST_ASSERT_NOT_NULL(data, cmock_line, CMockStringPtrIsNULL); memcpy((void*)data, (void*)cmock_call_instance->ReturnThruPtr_data_Val, cmock_call_instance->ReturnThruPtr_data_Size); } UNITY_CLR_DETAILS(); return cmock_call_instance->ReturnVal; } void CMockExpectParameters_plugin_update(CMOCK_plugin_update_CALL_INSTANCE* cmock_call_instance, struct perf_plugins_perf_update* data, int data_Depth); void CMockExpectParameters_plugin_update(CMOCK_plugin_update_CALL_INSTANCE* cmock_call_instance, struct perf_plugins_perf_update* data, int data_Depth) { cmock_call_instance->Expected_data = data; cmock_call_instance->Expected_data_Depth = data_Depth; cmock_call_instance->IgnoreArg_data = 0; cmock_call_instance->ReturnThruPtr_data_Used = 0; } void plugin_update_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) { CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_plugin_update_CALL_INSTANCE)); CMOCK_plugin_update_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_update_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.plugin_update_CallInstance = CMock_Guts_MemChain(Mock.plugin_update_CallInstance, cmock_guts_index); Mock.plugin_update_IgnoreBool = (char)0; cmock_call_instance->LineNumber = cmock_line; cmock_call_instance->ExpectAnyArgsBool = (char)0; cmock_call_instance->ReturnVal = cmock_to_return; Mock.plugin_update_IgnoreBool = (char)1; } void plugin_update_CMockStopIgnore(void) { if(Mock.plugin_update_IgnoreBool) Mock.plugin_update_CallInstance = CMock_Guts_MemNext(Mock.plugin_update_CallInstance); Mock.plugin_update_IgnoreBool = (char)0; } void plugin_update_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) { CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_plugin_update_CALL_INSTANCE)); CMOCK_plugin_update_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_update_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.plugin_update_CallInstance = CMock_Guts_MemChain(Mock.plugin_update_CallInstance, cmock_guts_index); Mock.plugin_update_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 plugin_update_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, struct perf_plugins_perf_update* data, int cmock_to_return) { CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_plugin_update_CALL_INSTANCE)); CMOCK_plugin_update_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_update_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.plugin_update_CallInstance = CMock_Guts_MemChain(Mock.plugin_update_CallInstance, cmock_guts_index); Mock.plugin_update_IgnoreBool = (char)0; cmock_call_instance->LineNumber = cmock_line; cmock_call_instance->ExpectAnyArgsBool = (char)0; CMockExpectParameters_plugin_update(cmock_call_instance, data, 1); cmock_call_instance->ReturnVal = cmock_to_return; } void plugin_update_AddCallback(CMOCK_plugin_update_CALLBACK Callback) { Mock.plugin_update_IgnoreBool = (char)0; Mock.plugin_update_CallbackBool = (char)1; Mock.plugin_update_CallbackFunctionPointer = Callback; } void plugin_update_Stub(CMOCK_plugin_update_CALLBACK Callback) { Mock.plugin_update_IgnoreBool = (char)0; Mock.plugin_update_CallbackBool = (char)0; Mock.plugin_update_CallbackFunctionPointer = Callback; } void plugin_update_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, struct perf_plugins_perf_update* data, int data_Depth, int cmock_to_return) { CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_plugin_update_CALL_INSTANCE)); CMOCK_plugin_update_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_update_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.plugin_update_CallInstance = CMock_Guts_MemChain(Mock.plugin_update_CallInstance, cmock_guts_index); Mock.plugin_update_IgnoreBool = (char)0; cmock_call_instance->LineNumber = cmock_line; cmock_call_instance->ExpectAnyArgsBool = (char)0; CMockExpectParameters_plugin_update(cmock_call_instance, data, data_Depth); cmock_call_instance->ReturnVal = cmock_to_return; } void plugin_update_CMockReturnMemThruPtr_data(UNITY_LINE_TYPE cmock_line, struct perf_plugins_perf_update* data, size_t cmock_size) { CMOCK_plugin_update_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_update_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.plugin_update_CallInstance)); UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp); cmock_call_instance->ReturnThruPtr_data_Used = 1; cmock_call_instance->ReturnThruPtr_data_Val = data; cmock_call_instance->ReturnThruPtr_data_Size = cmock_size; } void plugin_update_CMockIgnoreArg_data(UNITY_LINE_TYPE cmock_line) { CMOCK_plugin_update_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_update_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.plugin_update_CallInstance)); UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); cmock_call_instance->IgnoreArg_data = 1; } int plugin_report(struct perf_plugins_perf_report* data) { UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; CMOCK_plugin_report_CALL_INSTANCE* cmock_call_instance; UNITY_SET_DETAIL(CMockString_plugin_report); cmock_call_instance = (CMOCK_plugin_report_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.plugin_report_CallInstance); Mock.plugin_report_CallInstance = CMock_Guts_MemNext(Mock.plugin_report_CallInstance); if (Mock.plugin_report_IgnoreBool) { UNITY_CLR_DETAILS(); if (cmock_call_instance == NULL) return Mock.plugin_report_FinalReturn; Mock.plugin_report_FinalReturn = cmock_call_instance->ReturnVal; return cmock_call_instance->ReturnVal; } if (!Mock.plugin_report_CallbackBool && Mock.plugin_report_CallbackFunctionPointer != NULL) { int cmock_cb_ret = Mock.plugin_report_CallbackFunctionPointer(data, Mock.plugin_report_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_data) { UNITY_SET_DETAILS(CMockString_plugin_report,CMockString_data); if (cmock_call_instance->Expected_data == NULL) { UNITY_TEST_ASSERT_NULL(data, cmock_line, CMockStringExpNULL); } else { UNITY_TEST_ASSERT_EQUAL_MEMORY_ARRAY((void*)(cmock_call_instance->Expected_data), (void*)(data), sizeof(struct perf_plugins_perf_report), cmock_call_instance->Expected_data_Depth, cmock_line, CMockStringMismatch); } } } if (Mock.plugin_report_CallbackFunctionPointer != NULL) { cmock_call_instance->ReturnVal = Mock.plugin_report_CallbackFunctionPointer(data, Mock.plugin_report_CallbackCalls++); } if (cmock_call_instance->ReturnThruPtr_data_Used) { UNITY_TEST_ASSERT_NOT_NULL(data, cmock_line, CMockStringPtrIsNULL); memcpy((void*)data, (void*)cmock_call_instance->ReturnThruPtr_data_Val, cmock_call_instance->ReturnThruPtr_data_Size); } UNITY_CLR_DETAILS(); return cmock_call_instance->ReturnVal; } void CMockExpectParameters_plugin_report(CMOCK_plugin_report_CALL_INSTANCE* cmock_call_instance, struct perf_plugins_perf_report* data, int data_Depth); void CMockExpectParameters_plugin_report(CMOCK_plugin_report_CALL_INSTANCE* cmock_call_instance, struct perf_plugins_perf_report* data, int data_Depth) { cmock_call_instance->Expected_data = data; cmock_call_instance->Expected_data_Depth = data_Depth; cmock_call_instance->IgnoreArg_data = 0; cmock_call_instance->ReturnThruPtr_data_Used = 0; } void plugin_report_CMockIgnoreAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) { CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_plugin_report_CALL_INSTANCE)); CMOCK_plugin_report_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_report_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.plugin_report_CallInstance = CMock_Guts_MemChain(Mock.plugin_report_CallInstance, cmock_guts_index); Mock.plugin_report_IgnoreBool = (char)0; cmock_call_instance->LineNumber = cmock_line; cmock_call_instance->ExpectAnyArgsBool = (char)0; cmock_call_instance->ReturnVal = cmock_to_return; Mock.plugin_report_IgnoreBool = (char)1; } void plugin_report_CMockStopIgnore(void) { if(Mock.plugin_report_IgnoreBool) Mock.plugin_report_CallInstance = CMock_Guts_MemNext(Mock.plugin_report_CallInstance); Mock.plugin_report_IgnoreBool = (char)0; } void plugin_report_CMockExpectAnyArgsAndReturn(UNITY_LINE_TYPE cmock_line, int cmock_to_return) { CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_plugin_report_CALL_INSTANCE)); CMOCK_plugin_report_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_report_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.plugin_report_CallInstance = CMock_Guts_MemChain(Mock.plugin_report_CallInstance, cmock_guts_index); Mock.plugin_report_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 plugin_report_CMockExpectAndReturn(UNITY_LINE_TYPE cmock_line, struct perf_plugins_perf_report* data, int cmock_to_return) { CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_plugin_report_CALL_INSTANCE)); CMOCK_plugin_report_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_report_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.plugin_report_CallInstance = CMock_Guts_MemChain(Mock.plugin_report_CallInstance, cmock_guts_index); Mock.plugin_report_IgnoreBool = (char)0; cmock_call_instance->LineNumber = cmock_line; cmock_call_instance->ExpectAnyArgsBool = (char)0; CMockExpectParameters_plugin_report(cmock_call_instance, data, 1); cmock_call_instance->ReturnVal = cmock_to_return; } void plugin_report_AddCallback(CMOCK_plugin_report_CALLBACK Callback) { Mock.plugin_report_IgnoreBool = (char)0; Mock.plugin_report_CallbackBool = (char)1; Mock.plugin_report_CallbackFunctionPointer = Callback; } void plugin_report_Stub(CMOCK_plugin_report_CALLBACK Callback) { Mock.plugin_report_IgnoreBool = (char)0; Mock.plugin_report_CallbackBool = (char)0; Mock.plugin_report_CallbackFunctionPointer = Callback; } void plugin_report_CMockExpectWithArrayAndReturn(UNITY_LINE_TYPE cmock_line, struct perf_plugins_perf_report* data, int data_Depth, int cmock_to_return) { CMOCK_MEM_INDEX_TYPE cmock_guts_index = CMock_Guts_MemNew(sizeof(CMOCK_plugin_report_CALL_INSTANCE)); CMOCK_plugin_report_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_report_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.plugin_report_CallInstance = CMock_Guts_MemChain(Mock.plugin_report_CallInstance, cmock_guts_index); Mock.plugin_report_IgnoreBool = (char)0; cmock_call_instance->LineNumber = cmock_line; cmock_call_instance->ExpectAnyArgsBool = (char)0; CMockExpectParameters_plugin_report(cmock_call_instance, data, data_Depth); cmock_call_instance->ReturnVal = cmock_to_return; } void plugin_report_CMockReturnMemThruPtr_data(UNITY_LINE_TYPE cmock_line, struct perf_plugins_perf_report* data, size_t cmock_size) { CMOCK_plugin_report_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_report_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.plugin_report_CallInstance)); UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringPtrPreExp); cmock_call_instance->ReturnThruPtr_data_Used = 1; cmock_call_instance->ReturnThruPtr_data_Val = data; cmock_call_instance->ReturnThruPtr_data_Size = cmock_size; } void plugin_report_CMockIgnoreArg_data(UNITY_LINE_TYPE cmock_line) { CMOCK_plugin_report_CALL_INSTANCE* cmock_call_instance = (CMOCK_plugin_report_CALL_INSTANCE*)CMock_Guts_GetAddressFor(CMock_Guts_MemEndOfChain(Mock.plugin_report_CallInstance)); UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringIgnPreExp); cmock_call_instance->IgnoreArg_data = 1; }