diff options
author | Alexander Kutsan <akutsan@luxoft.com> | 2017-11-13 17:13:47 +0200 |
---|---|---|
committer | Alexander Kutsan <akutsan@luxoft.com> | 2017-11-13 19:43:53 +0200 |
commit | 5642aef2980e3f39d98dd645e6b17110283fbe6c (patch) | |
tree | 8db62fb05b6cc6c6711502d03827a0e5afdf0281 | |
parent | 23500b21cc69010af572ed2b7c0b7a9fcf940b4f (diff) | |
download | sdl_core-5642aef2980e3f39d98dd645e6b17110283fbe6c.tar.gz |
Unify Converting HMI to Mobile result code in unit test
Mapping
Fix converion HMI to mobile result in GetVehicleDataRequestTest
28 files changed, 54 insertions, 206 deletions
diff --git a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc index 1916bb7150..cd9d6999a8 100644 --- a/src/components/application_manager/test/commands/mobile/add_command_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/add_command_request_test.cc @@ -517,9 +517,6 @@ TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) { utils::SharedPtr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); request_ptr->Run(); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); request_ptr->on_event(event); } @@ -531,9 +528,6 @@ TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) { Event event(hmi_apis::FunctionID::VR_AddCommand); event.set_smart_object(*msg); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL(*mock_app_, AddCommand(kCmdId, (*msg_)[msg_params])); am::CommandsMap commands_map; @@ -620,9 +614,6 @@ TEST_F(AddCommandRequestTest, utils::SharedPtr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); request_ptr->Run(); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::REJECTED)) - .WillOnce(Return(mobile_apis::Result::REJECTED)); EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); EXPECT_CALL(app_mngr_, ManageMobileCommand( @@ -696,9 +687,6 @@ TEST_F( .WillOnce(Return(true)); } - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::GENERIC_ERROR)) - .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR)); EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); utils::SharedPtr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); @@ -743,9 +731,6 @@ TEST_F( .WillOnce(Return(true)); } - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::GENERIC_ERROR)) - .WillRepeatedly(Return(mobile_apis::Result::GENERIC_ERROR)); EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); utils::SharedPtr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); @@ -974,9 +959,6 @@ TEST_F(AddCommandRequestTest, event_ui.set_smart_object(*msg_ui); Event event_vr(hmi_apis::FunctionID::VR_AddCommand); event_vr.set_smart_object(*msg_); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::ABORTED)) - .WillOnce(Return(mobile_apis::Result::ABORTED)); EXPECT_CALL( app_mngr_, ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_DeleteCommand))) @@ -1016,9 +998,6 @@ TEST_F(AddCommandRequestTest, utils::SharedPtr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); request_ptr->Run(); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::ABORTED)) - .WillOnce(Return(mobile_apis::Result::ABORTED)); Event event_ui(hmi_apis::FunctionID::UI_AddCommand); event_ui.set_smart_object(*msg_); diff --git a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc index 9617f91016..fede3c5c68 100644 --- a/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/add_sub_menu_request_test.cc @@ -97,10 +97,6 @@ TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { Event event(hmi_apis::FunctionID::UI_AddSubMenu); event.set_smart_object(*ev_msg); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - MessageSharedPtr ui_command_result; EXPECT_CALL( app_mngr_, diff --git a/src/components/application_manager/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/test/commands/mobile/alert_request_test.cc index 80838ffbbf..1ca561a94c 100644 --- a/src/components/application_manager/test/commands/mobile/alert_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/alert_request_test.cc @@ -248,9 +248,6 @@ TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) { (*msg)[am::strings::msg_params][am::strings::info] = "UI is not supported by system"; - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); - MessageSharedPtr msg_tts = CreateMessage(); (*msg_tts)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::SUCCESS; @@ -263,9 +260,6 @@ TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) { event.set_smart_object(*msg); MessageSharedPtr ui_command_result; - ON_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillByDefault(Return(am::mobile_api::Result::UNSUPPORTED_RESOURCE)); EXPECT_CALL( app_mngr_, ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) @@ -442,8 +436,6 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_UI_OnResetTimeout_SUCCESS) { Event event(hmi_apis::FunctionID::UI_OnResetTimeout); event.set_smart_object(*msg_); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); command->on_event(event); } @@ -504,8 +496,6 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarnings_SUCCESS) { Event event(hmi_apis::FunctionID::TTS_Speak); event.set_smart_object(*msg_); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); command->on_event(event); } @@ -574,16 +564,12 @@ TEST_F(AlertRequestTest, Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking); tts_stop_event.set_smart_object(*msg_); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); command->on_event(tts_stop_event); ExpectManageMobileCommandWithResultCode(mobile_apis::Result::WARNINGS); Event event(hmi_apis::FunctionID::TTS_Speak); event.set_smart_object(*msg_); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); command->on_event(event); } @@ -711,8 +697,6 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) { Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking); tts_stop_event.set_smart_object(*msg_); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); command->on_event(tts_stop_event); (*msg_)[am::strings::params][am::hmi_response::code] = @@ -722,8 +706,6 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSAbortedUiAlertNotSent_SUCCESS) { Event event(hmi_apis::FunctionID::TTS_Speak); event.set_smart_object(*msg_); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); command->on_event(event); } @@ -750,8 +732,6 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarningUiAlertWarning_SUCCESS) { Event ui_event(hmi_apis::FunctionID::UI_Alert); ui_event.set_smart_object(*msg_); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); command->on_event(ui_event); Event tts_stop_event(hmi_apis::FunctionID::TTS_StopSpeaking); @@ -762,8 +742,6 @@ TEST_F(AlertRequestTest, DISABLED_OnEvent_TTSWarningUiAlertWarning_SUCCESS) { Event event(hmi_apis::FunctionID::TTS_Speak); event.set_smart_object(*msg_); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); command->on_event(event); } diff --git a/src/components/application_manager/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/test/commands/mobile/change_registration_test.cc index 432e4fadc1..68eea31188 100644 --- a/src/components/application_manager/test/commands/mobile/change_registration_test.cc +++ b/src/components/application_manager/test/commands/mobile/change_registration_test.cc @@ -152,9 +152,6 @@ class ChangeRegistrationRequestTest hmi_apis::Common_Result::UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_from_mobile = CreateMsgFromMobile(); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_response)); - utils::SharedPtr<ChangeRegistrationRequest> command = CreateCommand<ChangeRegistrationRequest>(msg_from_mobile); MockAppPtr mock_app = CreateMockApp(); diff --git a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc index a627740588..6854ff0a9e 100644 --- a/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc +++ b/src/components/application_manager/test/commands/mobile/create_interaction_choice_set_test.cc @@ -230,9 +230,6 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) { ON_CALL(*mock_app_, FindCommand(kCmdId)).WillByDefault(Return(ptr)); EXPECT_EQ(NULL, ptr); - ON_CALL(message_helper_mock_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); - am::CommandsMap commands_map; ON_CALL(*mock_app_, commands_map()) .WillByDefault( diff --git a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc index b7f1e146b4..1222e36836 100644 --- a/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_command_request_test.cc @@ -250,9 +250,6 @@ TEST_F(DeleteCommandRequestTest, EXPECT_CALL(*app, RemoveCommand(kCommandId)); EXPECT_CALL(*app, UpdateHash()); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::eType::SUCCESS)) - .WillRepeatedly(Return(am::mobile_api::Result::SUCCESS)); MessageSharedPtr result_msg( CatchMobileCommandResult(CallOnEvent(*command, event_ui))); diff --git a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc index beff4c3584..61adc05681 100644 --- a/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc +++ b/src/components/application_manager/test/commands/mobile/delete_sub_menu_test.cc @@ -149,10 +149,6 @@ TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) { GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillOnce(Return(am::HmiInterfaces::STATE_AVAILABLE)); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - am::CommandsMap commands_map; smart_objects::SmartObject commands_msg(smart_objects::SmartType_Map); commands_map.insert(std::pair<uint32_t, SmartObject*>(1u, &commands_msg)); @@ -243,9 +239,6 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_InvalidApp_UNSUCCESS) { (*message_)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::eType::SUCCESS; event.set_smart_object(*message_); - ON_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::eType::SUCCESS)) - .WillByDefault(Return(am::mobile_api::Result::SUCCESS)); MockAppPtr invalid_app; EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app)); EXPECT_CALL(*app_, RemoveSubMenu(_)).Times(0); @@ -265,8 +258,6 @@ TEST_F(DeleteSubMenuRequestTest, OnEvent_DeleteSubmenu_SUCCESS) { const hmi_apis::Common_Result::eType result_code = hmi_apis::Common_Result::SUCCESS; (*message_)[am::strings::params][am::hmi_response::code] = result_code; - ON_CALL(mock_message_helper_, HMIToMobileResult(result_code)) - .WillByDefault(Return(am::mobile_api::Result::SUCCESS)); event.set_smart_object(*message_); commands_map_.insert( @@ -318,10 +309,6 @@ TEST_F(DeleteSubMenuRequestTest, commands_map_.insert( std::make_pair(0, &((*message_)[am::strings::msg_params]))); - ON_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillByDefault(Return(am::mobile_api::Result::SUCCESS)); - EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0); EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_)); @@ -345,9 +332,6 @@ TEST_F(DeleteSubMenuRequestTest, commands_map_.insert( std::make_pair(0, &((*message_)[am::strings::msg_params]))); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillRepeatedly(Return(am::mobile_api::Result::SUCCESS)); - EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)).Times(0); EXPECT_CALL(*app_, commands_map()).Times(2).WillRepeatedly(Return(accessor_)); diff --git a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc index 60697446f2..a041f921d7 100644 --- a/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/diagnostic_message_request_test.cc @@ -181,10 +181,6 @@ TEST_F(DiagnosticMessageRequestTest, OnEvent_SUCCESS) { DiagnosticMessageRequestPtr command( CreateCommand<DiagnosticMessageRequest>()); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); diff --git a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc index b8c0ed23f3..27788622e6 100644 --- a/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/end_audio_pass_thru_request_test.cc @@ -89,10 +89,6 @@ TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) { Event event(hmi_apis::FunctionID::UI_EndAudioPassThru); event.set_smart_object(*event_msg); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - EXPECT_CALL(app_mngr_, EndAudioPassThrough()).WillOnce(Return(false)); MessageSharedPtr ui_command_result; diff --git a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc index dfa38a758b..e6b419329d 100644 --- a/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/get_dtcs_request_test.cc @@ -125,11 +125,7 @@ TEST_F(GetDTCsRequestTest, OnEvent_SUCCESS) { Event event(hmi_apis::FunctionID::VehicleInfo_GetDTCs); event.set_smart_object(*event_msg); - MockMessageHelper& mock_message_helper = - *MockMessageHelper::message_helper_mock(); - ON_CALL(mock_message_helper, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _)); diff --git a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc index a851a72f8e..41d9ea99c1 100644 --- a/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/get_vehicle_data_request_test.cc @@ -235,7 +235,7 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) { const hmi_apis::Common_Result::eType hmi_response_code = hmi_apis::Common_Result::DATA_NOT_AVAILABLE; const mobile_result::eType mobile_response_code = - mobile_result::VEHICLE_DATA_NOT_AVAILABLE; + mobile_result::DATA_NOT_AVAILABLE; MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[am::strings::params][am::strings::connection_key] = @@ -251,10 +251,6 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) { Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData); event.set_smart_object(*event_msg); - - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_response_code)) - .WillOnce(Return(mobile_response_code)); - EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _)); diff --git a/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc index e660723b1e..838a544cac 100644 --- a/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/get_way_points_request_test.cc @@ -129,8 +129,6 @@ class GetWayPointsRequestOnEventTest event.set_smart_object(*event_msg); const MobileResult mobile_result = static_cast<MobileResult>(ResultCode); - ON_CALL(message_helper_mock_, HMIToMobileResult(ResultCode)) - .WillByDefault(Return(mobile_result)); MessageSharedPtr result_msg( CatchMobileCommandResult(CallOnEvent(*command, event))); @@ -207,8 +205,6 @@ TEST_F(GetWayPointsRequestTest, hmi_apis::Common_Result::SUCCESS; event.set_smart_object(*message_); - EXPECT_CALL(message_helper_mock_, HMIToMobileResult(_)) - .WillOnce(Return(MobileResult::SUCCESS)); CallOnEvent caller(*command_sptr_, event); diff --git a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/test/commands/mobile/read_did_request_test.cc index 7e46f6942f..72b79f2114 100644 --- a/src/components/application_manager/test/commands/mobile/read_did_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/read_did_request_test.cc @@ -92,8 +92,6 @@ TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) { am::MockMessageHelper& mock_message_helper( *am::MockMessageHelper::message_helper_mock()); - EXPECT_CALL(mock_message_helper, HMIToMobileResult(hmi_response_code)) - .WillOnce(Return(mobile_response_code)); EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _)); diff --git a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc index 7f5c623226..4a655076b7 100644 --- a/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc +++ b/src/components/application_manager/test/commands/mobile/reset_global_properties_test.cc @@ -272,8 +272,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, const hmi_apis::Common_Result::eType result_code = hmi_apis::Common_Result::SUCCESS; (*msg_)[am::strings::params][am::hmi_response::code] = result_code; - ON_CALL(*mock_message_helper_, HMIToMobileResult(result_code)) - .WillByDefault(Return(am::mobile_api::Result::SUCCESS)); (*msg_)[am::strings::msg_params][am::strings::properties][0] = mobile_apis::GlobalProperty::VRHELPTITLE; @@ -346,16 +344,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, command_->on_event(event); } -TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) { - Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); - event.set_smart_object(*msg_); - - EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)).Times(0); - EXPECT_CALL(*mock_app_, UpdateHash()).Times(0); - - command_->on_event(event); -} - TEST_F(ResetGlobalPropertiesResponseTest, Run_Sendmsg_SUCCESS) { MessageSharedPtr message(CreateMessage()); ResetGlobalPropertiesResponsePtr command( @@ -389,9 +377,6 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) { CreateCommand<ResetGlobalPropertiesRequest>(msg_); command->Run(); - EXPECT_CALL(*mock_message_helper_, HMIToMobileResult(_)) - .WillRepeatedly(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL(app_mngr_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), diff --git a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc index d9fac769e5..f4a84181e2 100644 --- a/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc +++ b/src/components/application_manager/test/commands/mobile/scrollable_message_test.cc @@ -159,10 +159,6 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { Event event(hmi_apis::FunctionID::UI_ScrollableMessage); event.set_smart_object(*msg); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - MessageSharedPtr ui_command_result; EXPECT_CALL( app_mngr_, @@ -274,8 +270,6 @@ TEST_F(ScrollableMessageRequestTest, DISABLED_OnEvent_ReceivedUIScrollableMessage_SUCCESS) { (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS; - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), _)); @@ -289,9 +283,6 @@ TEST_F(ScrollableMessageRequestTest, (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::UNSUPPORTED_RESOURCE; - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - EXPECT_CALL( app_mngr_, ManageMobileCommand( diff --git a/src/components/application_manager/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/test/commands/mobile/send_location_request_test.cc index 03cc715188..80f8cb0f38 100644 --- a/src/components/application_manager/test/commands/mobile/send_location_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/send_location_request_test.cc @@ -356,10 +356,6 @@ TEST_F(SendLocationRequestTest, OnEvent_Success) { Event event(hmi_apis::FunctionID::Navigation_SendLocation); event.set_smart_object(*message_); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); - MockAppPtr app(CreateMockApp()); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillRepeatedly(Return(app)); diff --git a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc index 60b01f2cfa..7be7b41a26 100644 --- a/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_app_icon_test.cc @@ -134,10 +134,6 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { Event event(hmi_apis::FunctionID::UI_SetAppIcon); event.set_smart_object(*msg); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - MessageSharedPtr ui_command_result; EXPECT_CALL( app_mngr_, diff --git a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc index ff3d686642..26f2239275 100644 --- a/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_display_layout_test.cc @@ -164,9 +164,6 @@ TEST_F(SetDisplayLayoutRequestTest, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - ON_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillByDefault(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); MessageSharedPtr ui_command_result; EXPECT_CALL( app_mngr_, @@ -250,9 +247,6 @@ TEST_F(SetDisplayLayoutRequestTest, OnEvent_SUCCESS) { EXPECT_CALL(hmi_capabilities, display_capabilities()) .WillOnce(Return(dispaly_capabilities_msg.get())); - ON_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillByDefault(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL( app_mngr_, diff --git a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc index a0027adba2..4496aa0f41 100644 --- a/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_global_properties_test.cc @@ -355,9 +355,6 @@ TEST_F(SetGlobalPropertiesRequestTest, utils::SharedPtr<SetGlobalPropertiesRequest> command = CreateCommand<SetGlobalPropertiesRequest>(response); - ON_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillByDefault(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); @@ -1039,8 +1036,6 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) { SharedPtr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)).Times(0); - Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); event.set_smart_object(*msg); @@ -1068,8 +1063,6 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) { Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); event.set_smart_object(*msg); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -1151,7 +1144,6 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidEventID_Canceled) { SharedPtr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(_)).Times(0); EXPECT_CALL(app_mngr_, application(kConnectionKey)).Times(0); EXPECT_CALL(*mock_app_, UpdateHash()).Times(0); @@ -1185,8 +1177,6 @@ TEST_F(SetGlobalPropertiesRequestTest, ManageMobileCommand(_, am::commands::Command::ORIGIN_SDL)) .WillOnce(Return(true)); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(response_code)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); diff --git a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc index 5ee92cae72..4fd6f0e170 100644 --- a/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc +++ b/src/components/application_manager/test/commands/mobile/set_media_clock_timer_test.cc @@ -140,10 +140,6 @@ TEST_F(SetMediaClockRequestTest, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillRepeatedly(Return(am::HmiInterfaces::STATE_NOT_RESPONSE)); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - MessageSharedPtr ui_command_result; EXPECT_CALL( app_mngr_, @@ -331,10 +327,6 @@ TEST_F(SetMediaClockRequestTest, OnEvent_Success) { hmi_apis::Common_Result::SUCCESS; (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Null); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)); MockAppPtr app(CreateMockApp()); diff --git a/src/components/application_manager/test/commands/mobile/show_test.cc b/src/components/application_manager/test/commands/mobile/show_test.cc index d1e3c14181..085f83b626 100644 --- a/src/components/application_manager/test/commands/mobile/show_test.cc +++ b/src/components/application_manager/test/commands/mobile/show_test.cc @@ -238,10 +238,6 @@ TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { Event event(hmi_apis::FunctionID::UI_Show); event.set_smart_object(*msg); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - MessageSharedPtr vr_command_result; EXPECT_CALL( app_mngr_, @@ -745,10 +741,6 @@ TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) { Event event(hmi_apis::FunctionID::UI_Show); event.set_smart_object(*ev_msg); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); - MessageSharedPtr ui_command_result; EXPECT_CALL( app_mngr_, @@ -943,9 +935,6 @@ TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) { SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg)); - ON_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::eType::SUCCESS)) - .WillByDefault(Return(am::mobile_api::Result::SUCCESS)); EXPECT_CALL(app_mngr_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), _)); @@ -967,9 +956,6 @@ TEST_F(ShowRequestTest, OnEvent_WarningsResultCode_SUCCESS) { SharedPtr<ShowRequest> command(CreateCommand<ShowRequest>(msg)); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::WARNINGS)) - .WillOnce(Return(mobile_apis::Result::WARNINGS)); EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)); Event event(hmi_apis::FunctionID::UI_Show); diff --git a/src/components/application_manager/test/commands/mobile/slider_test.cc b/src/components/application_manager/test/commands/mobile/slider_test.cc index 20262ed35a..0c78304855 100644 --- a/src/components/application_manager/test/commands/mobile/slider_test.cc +++ b/src/components/application_manager/test/commands/mobile/slider_test.cc @@ -167,10 +167,6 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { Event event(hmi_apis::FunctionID::UI_Slider); event.set_smart_object(*msg); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::UNSUPPORTED_RESOURCE)) - .WillOnce(Return(mobile_apis::Result::UNSUPPORTED_RESOURCE)); - MessageSharedPtr ui_command_result; EXPECT_CALL( app_mngr_, @@ -325,9 +321,6 @@ TEST_F(SliderRequestTest, OnEvent_UISliderPositionExists_SUCCESS) { (*msg_)[am::strings::params][am::strings::data] [am::strings::slider_position] = "position"; - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::TIMED_OUT)) - .WillOnce(Return(mobile_apis::Result::TIMED_OUT)); ExpectManageMobileCommandWithResultCode(mobile_apis::Result::TIMED_OUT); Event event(hmi_apis::FunctionID::UI_Slider); @@ -343,9 +336,6 @@ TEST_F(SliderRequestTest, OnEvent_UISliderAborted_SUCCESS) { (*msg_)[am::strings::params][am::hmi_response::code] = hmi_apis::Common_Result::ABORTED; - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::ABORTED)) - .WillOnce(Return(mobile_apis::Result::ABORTED)); ExpectManageMobileCommandWithResultCode(mobile_apis::Result::ABORTED); Event event(hmi_apis::FunctionID::UI_Slider); diff --git a/src/components/application_manager/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/test/commands/mobile/speak_request_test.cc index f8a7d22b40..5d8955535b 100644 --- a/src/components/application_manager/test/commands/mobile/speak_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/speak_request_test.cc @@ -114,10 +114,6 @@ class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { MessageSharedPtr response_to_mobile; EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillRepeatedly(Return(state)); - MockMessageHelper* mock_message_helper = - MockMessageHelper::message_helper_mock(); - EXPECT_CALL(*mock_message_helper, HMIToMobileResult(_)) - .WillOnce(Return(mobile_response)); EXPECT_CALL(app_mngr_, ManageMobileCommand( @@ -156,9 +152,6 @@ TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) { MessageSharedPtr response_to_mobile; - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL( app_mngr_, ManageMobileCommand(_, am::commands::Command::CommandOrigin::ORIGIN_SDL)) @@ -349,8 +342,6 @@ TEST_F(SpeakRequestTest, OnEvent_TTS_Speak_SUCCESS) { ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_)); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_result)) - .WillOnce(Return(am::mobile_api::Result::SUCCESS)); EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); @@ -369,8 +360,6 @@ TEST_F(SpeakRequestTest, OnEvent_TTS_SpeakWithWarning_WarningWithSuccess) { ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app_)); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_result)) - .WillOnce(Return(am::mobile_api::Result::WARNINGS)); EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::WARNINGS), _)); diff --git a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc index 4546293172..26f5ee224f 100644 --- a/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/subscribe_way_points_request_test.cc @@ -115,8 +115,6 @@ TEST_F(SubscribeWayPointsRequestTest, OnEvent_SUCCESS) { { InSequence dummy; EXPECT_CALL(app_mngr_, SubscribeAppForWayPoints(_)); - EXPECT_CALL(*mock_message_helper, HMIToMobileResult(result_code)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); EXPECT_CALL(app_mngr_, ManageMobileCommand(_, _)); EXPECT_CALL(*app, UpdateHash()); } diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc index 9652364646..a3cad29b73 100644 --- a/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unsubscribe_vehicle_request_test.cc @@ -243,12 +243,9 @@ TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataNotSubscribed_IGNORED) { SmartObject message(smart_objects::SmartType_Map); const hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::SUCCESS; - const mobile_apis::Result::eType mob_result = mobile_apis::Result::SUCCESS; message[am::strings::params][am::hmi_response::code] = hmi_result; message[am::strings::msg_params][kMsgParamKey] = true; test_event.set_smart_object(message); - EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), - HMIToMobileResult(hmi_result)).WillOnce(Return(mob_result)); EXPECT_CALL( app_mngr_, @@ -272,14 +269,10 @@ TEST_F(UnsubscribeVehicleRequestTest, OnEvent_DataUnsubscribed_SUCCESS) { SmartObject message(smart_objects::SmartType_Map); const hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::SUCCESS; - const mobile_apis::Result::eType mob_result = mobile_apis::Result::SUCCESS; message[am::strings::params][am::hmi_response::code] = hmi_result; message[am::strings::msg_params][kMsgParamKey] = true; test_event.set_smart_object(message); - EXPECT_CALL(*(am::MockMessageHelper::message_helper_mock()), - HMIToMobileResult(hmi_result)).WillOnce(Return(mob_result)); - EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); diff --git a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc index 50567a7c62..edba1b01bd 100644 --- a/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/unsubscribe_way_points_request_test.cc @@ -165,10 +165,6 @@ TEST_F(UnSubscribeWayPointsRequestTest, EXPECT_CALL(app_mngr_, UnsubscribeAppFromWayPoints(kAppId)); - EXPECT_CALL(mock_message_helper_, - HMIToMobileResult(hmi_apis::Common_Result::SUCCESS)) - .WillOnce(Return(mobile_apis::Result::SUCCESS)); - EXPECT_CALL( app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_result::SUCCESS), _)); diff --git a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc index cab67e641c..027231f529 100644 --- a/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc +++ b/src/components/application_manager/test/commands/mobile/update_turn_list_request_test.cc @@ -275,9 +275,6 @@ TEST_F(UpdateTurnListRequestTest, OnEvent_UnsupportedResource_SUCCESS) { Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList); event.set_smart_object(*event_msg); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_response_code)) - .WillOnce(Return(mobile_response_code)); - EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _)); @@ -297,9 +294,6 @@ TEST_F(UpdateTurnListRequestTest, Event event(hmi_apis::FunctionID::Navigation_UpdateTurnList); event.set_smart_object(*event_msg); - EXPECT_CALL(mock_message_helper_, HMIToMobileResult(hmi_response_code)) - .WillOnce(Return(mobile_response_code)); - EXPECT_CALL(app_mngr_, ManageMobileCommand(MobileResultCodeIs(mobile_response_code), _)); diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h index b6733b5818..6c85d67b52 100644 --- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h +++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h @@ -44,7 +44,7 @@ #include "test/application_manager/mock_application_manager_settings.h" #include "application_manager/mock_hmi_interface.h" #include "application_manager/mock_application.h" - +#include "application_manager/mock_message_helper.h" namespace test { namespace components { namespace commands_test { @@ -63,6 +63,7 @@ using ::test::components::application_manager_test::MockApplicationManager; using ::test::components::application_manager_test:: MockApplicationManagerSettings; using am::ApplicationSharedPtr; +using am::MockMessageHelper; using ::test::components::application_manager_test::MockApplication; // Depending on the value type will be selected @@ -152,6 +153,57 @@ class CommandsTest : public ::testing::Test { .WillByDefault(Return(am::HmiInterfaces::HMI_INTERFACE_SDL)); ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); + InitHMIToMobileResultConverter(); + } + + void InitHMIToMobileResultConverter() { + namespace MobileResult = mobile_apis::Result; + namespace HMIResult = hmi_apis::Common_Result; + MockMessageHelper& mock_message_helper = + *MockMessageHelper::message_helper_mock(); + auto link_hmi_to_mob_result = [&mock_message_helper]( + HMIResult::eType hmi_result, MobileResult::eType mobile_result) { + ON_CALL(mock_message_helper, HMIToMobileResult(hmi_result)) + .WillByDefault(Return(mobile_result)); + }; + link_hmi_to_mob_result(HMIResult::INVALID_ENUM, MobileResult::INVALID_ENUM); + link_hmi_to_mob_result(HMIResult::SUCCESS, MobileResult::SUCCESS); + link_hmi_to_mob_result(HMIResult::UNSUPPORTED_REQUEST, + MobileResult::UNSUPPORTED_REQUEST); + link_hmi_to_mob_result(HMIResult::UNSUPPORTED_RESOURCE, + MobileResult::UNSUPPORTED_RESOURCE); + link_hmi_to_mob_result(HMIResult::DISALLOWED, MobileResult::DISALLOWED); + link_hmi_to_mob_result(HMIResult::REJECTED, MobileResult::REJECTED); + link_hmi_to_mob_result(HMIResult::ABORTED, MobileResult::ABORTED); + link_hmi_to_mob_result(HMIResult::IGNORED, MobileResult::IGNORED); + link_hmi_to_mob_result(HMIResult::RETRY, MobileResult::RETRY); + link_hmi_to_mob_result(HMIResult::IN_USE, MobileResult::IN_USE); + link_hmi_to_mob_result(HMIResult::TIMED_OUT, MobileResult::TIMED_OUT); + link_hmi_to_mob_result(HMIResult::INVALID_DATA, MobileResult::INVALID_DATA); + link_hmi_to_mob_result(HMIResult::CHAR_LIMIT_EXCEEDED, + MobileResult::CHAR_LIMIT_EXCEEDED); + link_hmi_to_mob_result(HMIResult::INVALID_ID, MobileResult::INVALID_ID); + link_hmi_to_mob_result(HMIResult::DUPLICATE_NAME, + MobileResult::DUPLICATE_NAME); + link_hmi_to_mob_result(HMIResult::APPLICATION_NOT_REGISTERED, + MobileResult::APPLICATION_NOT_REGISTERED); + link_hmi_to_mob_result(HMIResult::WRONG_LANGUAGE, + MobileResult::WRONG_LANGUAGE); + link_hmi_to_mob_result(HMIResult::OUT_OF_MEMORY, + MobileResult::OUT_OF_MEMORY); + link_hmi_to_mob_result(HMIResult::TOO_MANY_PENDING_REQUESTS, + MobileResult::TOO_MANY_PENDING_REQUESTS); + link_hmi_to_mob_result(HMIResult::WARNINGS, MobileResult::WARNINGS); + link_hmi_to_mob_result(HMIResult::GENERIC_ERROR, + MobileResult::GENERIC_ERROR); + link_hmi_to_mob_result(HMIResult::USER_DISALLOWED, + MobileResult::USER_DISALLOWED); + link_hmi_to_mob_result(HMIResult::TRUNCATED_DATA, + MobileResult::TRUNCATED_DATA); + link_hmi_to_mob_result(HMIResult::SAVED, MobileResult::SAVED); + link_hmi_to_mob_result(HMIResult::DATA_NOT_AVAILABLE, + MobileResult::DATA_NOT_AVAILABLE); + link_hmi_to_mob_result(HMIResult::READ_ONLY, MobileResult::READ_ONLY); } }; |