qeo_util_retcode_t qeo_platform_get_key_value(const char* key, char** value) { UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; CMOCK_qeo_platform_get_key_value_CALL_INSTANCE* cmock_call_instance = (CMOCK_qeo_platform_get_key_value_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.qeo_platform_get_key_value_CallInstance); Mock.qeo_platform_get_key_value_CallInstance = CMock_Guts_MemNext(Mock.qeo_platform_get_key_value_CallInstance); if (Mock.qeo_platform_get_key_value_IgnoreBool) { if (cmock_call_instance == NULL) return Mock.qeo_platform_get_key_value_FinalReturn; memcpy(&Mock.qeo_platform_get_key_value_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(qeo_util_retcode_t)); return cmock_call_instance->ReturnVal; } if (Mock.qeo_platform_get_key_value_CallbackFunctionPointer != NULL) { return Mock.qeo_platform_get_key_value_CallbackFunctionPointer(key, value, Mock.qeo_platform_get_key_value_CallbackCalls++); } UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'qeo_platform_get_key_value' called more times than expected."); cmock_line = cmock_call_instance->LineNumber; UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_key, key, cmock_line, "Function 'qeo_platform_get_key_value' called with unexpected value for argument 'key'."); if (cmock_call_instance->Expected_value == NULL) { UNITY_TEST_ASSERT_NULL(value, cmock_line, "Expected NULL. Function 'qeo_platform_get_key_value' called with unexpected value for argument 'value'."); } else { UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(cmock_call_instance->Expected_value, value, 1, cmock_line, "Function 'qeo_platform_get_key_value' called with unexpected value for argument 'value'."); } return cmock_call_instance->ReturnVal; }
qeo_retcode_t qeo_security_policy_get_fine_grained_rules(qeo_security_policy_hndl qeoSecPol, uintptr_t cookie, const char* topic_name, unsigned int selector_mask, qeo_security_policy_update_fine_grained_rules_cb update_cb) { UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; CMOCK_qeo_security_policy_get_fine_grained_rules_CALL_INSTANCE* cmock_call_instance = (CMOCK_qeo_security_policy_get_fine_grained_rules_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.qeo_security_policy_get_fine_grained_rules_CallInstance); Mock.qeo_security_policy_get_fine_grained_rules_CallInstance = CMock_Guts_MemNext(Mock.qeo_security_policy_get_fine_grained_rules_CallInstance); if (Mock.qeo_security_policy_get_fine_grained_rules_IgnoreBool) { if (cmock_call_instance == NULL) return Mock.qeo_security_policy_get_fine_grained_rules_FinalReturn; memcpy(&Mock.qeo_security_policy_get_fine_grained_rules_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(qeo_retcode_t)); return cmock_call_instance->ReturnVal; } if (Mock.qeo_security_policy_get_fine_grained_rules_CallbackFunctionPointer != NULL) { return Mock.qeo_security_policy_get_fine_grained_rules_CallbackFunctionPointer(qeoSecPol, cookie, topic_name, selector_mask, update_cb, Mock.qeo_security_policy_get_fine_grained_rules_CallbackCalls++); } UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called more times than expected."); cmock_line = cmock_call_instance->LineNumber; UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_qeoSecPol), (void*)(&qeoSecPol), sizeof(qeo_security_policy_hndl), cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'qeoSecPol'."); UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_cookie), (void*)(&cookie), sizeof(uintptr_t), cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'cookie'."); if (cmock_call_instance->Expected_topic_name == NULL) { UNITY_TEST_ASSERT_NULL(topic_name, cmock_line, "Expected NULL. Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'topic_name'."); } else { UNITY_TEST_ASSERT_EQUAL_INT8_ARRAY(cmock_call_instance->Expected_topic_name, topic_name, 1, cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'topic_name'."); } UNITY_TEST_ASSERT_EQUAL_HEX32(cmock_call_instance->Expected_selector_mask, selector_mask, cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'selector_mask'."); UNITY_TEST_ASSERT_EQUAL_MEMORY((void*)(&cmock_call_instance->Expected_update_cb), (void*)(&update_cb), sizeof(qeo_security_policy_update_fine_grained_rules_cb), cmock_line, "Function 'qeo_security_policy_get_fine_grained_rules' called with unexpected value for argument 'update_cb'."); return cmock_call_instance->ReturnVal; }
qeo_util_retcode_t qeo_platform_get_device_storage_path(const char* file_name, char** full_storage_path) { UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; CMOCK_qeo_platform_get_device_storage_path_CALL_INSTANCE* cmock_call_instance = (CMOCK_qeo_platform_get_device_storage_path_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.qeo_platform_get_device_storage_path_CallInstance); Mock.qeo_platform_get_device_storage_path_CallInstance = CMock_Guts_MemNext(Mock.qeo_platform_get_device_storage_path_CallInstance); if (Mock.qeo_platform_get_device_storage_path_IgnoreBool) { if (cmock_call_instance == NULL) return Mock.qeo_platform_get_device_storage_path_FinalReturn; memcpy(&Mock.qeo_platform_get_device_storage_path_FinalReturn, &cmock_call_instance->ReturnVal, sizeof(qeo_util_retcode_t)); return cmock_call_instance->ReturnVal; } if (Mock.qeo_platform_get_device_storage_path_CallbackFunctionPointer != NULL) { return Mock.qeo_platform_get_device_storage_path_CallbackFunctionPointer(file_name, full_storage_path, Mock.qeo_platform_get_device_storage_path_CallbackCalls++); } UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, "Function 'qeo_platform_get_device_storage_path' called more times than expected."); cmock_line = cmock_call_instance->LineNumber; UNITY_TEST_ASSERT_EQUAL_STRING(cmock_call_instance->Expected_file_name, file_name, cmock_line, "Function 'qeo_platform_get_device_storage_path' called with unexpected value for argument 'file_name'."); if (cmock_call_instance->Expected_full_storage_path == NULL) { UNITY_TEST_ASSERT_NULL(full_storage_path, cmock_line, "Expected NULL. Function 'qeo_platform_get_device_storage_path' called with unexpected value for argument 'full_storage_path'."); } else { UNITY_TEST_ASSERT_EQUAL_STRING_ARRAY(cmock_call_instance->Expected_full_storage_path, full_storage_path, 1, cmock_line, "Function 'qeo_platform_get_device_storage_path' called with unexpected value for argument 'full_storage_path'."); } return cmock_call_instance->ReturnVal; }
void* system_init(void* base_address, uint32_t type_size) { UNITY_LINE_TYPE cmock_line = TEST_LINE_NUM; UNITY_SET_DETAIL(CMockString_system_init); CMOCK_system_init_CALL_INSTANCE* cmock_call_instance = (CMOCK_system_init_CALL_INSTANCE*)CMock_Guts_GetAddressFor(Mock.system_init_CallInstance); Mock.system_init_CallInstance = CMock_Guts_MemNext(Mock.system_init_CallInstance); UNITY_TEST_ASSERT_NOT_NULL(cmock_call_instance, cmock_line, CMockStringCalledMore); cmock_line = cmock_call_instance->LineNumber; { UNITY_SET_DETAILS(CMockString_system_init,CMockString_base_address); if (cmock_call_instance->Expected_base_address == NULL) { UNITY_TEST_ASSERT_NULL(base_address, cmock_line, CMockStringExpNULL); } else { // Autogenerated mock tests equality of data. // We are using specific HW addresses, just test addresses. UNITY_TEST_ASSERT_EQUAL_HEX32( cmock_call_instance->Expected_base_address, base_address, cmock_line, CMockStringMismatch); } } { UNITY_SET_DETAILS(CMockString_system_init,CMockString_type_size); UNITY_TEST_ASSERT_EQUAL_HEX32(cmock_call_instance->Expected_type_size, type_size, cmock_line, CMockStringMismatch); } UNITY_CLR_DETAILS(); return cmock_call_instance->ReturnVal; }