From 88a1d59e32547307edf35a0ec439a9ce4386cddc Mon Sep 17 00:00:00 2001 From: "Dmitrii Trunov (GitHub)" Date: Wed, 12 Oct 2016 21:27:01 +0300 Subject: Fix problem with incorrect success result (#895) * Fix problem with incorrect success result HMI send erronius result code and after that SDL answers with success=true. I fix this problem. Fix UT according to new implementation. Closes bug [APPLINK-28762](https://adc.luxoft.com/jira/browse/APPLINK-28762) --- .../application_manager/src/commands/command_request_impl.cc | 7 ++----- .../application_manager/src/commands/mobile/add_command_request.cc | 2 +- .../test/commands/mobile/delete_command_request_test.cc | 6 +----- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index 16f4b9e35a..d1f223bc8b 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -102,11 +102,8 @@ const std::string CreateInfoForUnsupportedResult( } bool CheckResultCode(const ResponseInfo& first, const ResponseInfo& second) { - if (first.is_ok && second.is_unsupported_resource) { - return true; - } - if (first.is_invalid_enum && second.is_unsupported_resource && - HmiInterfaces::STATE_NOT_AVAILABLE != second.interface_state) { + if (first.is_ok && second.is_unsupported_resource && + second.interface_state == HmiInterfaces::STATE_NOT_AVAILABLE) { return true; } return false; diff --git a/src/components/application_manager/src/commands/mobile/add_command_request.cc b/src/components/application_manager/src/commands/mobile/add_command_request.cc index 9d46f67aee..267a9c3149 100644 --- a/src/components/application_manager/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/src/commands/mobile/add_command_request.cc @@ -1,6 +1,6 @@ /* - Copyright (c) 2013, Ford Motor Company + Copyright (c) 2016, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without 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 729696b660..420e6c839f 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 @@ -134,10 +134,6 @@ TEST_F(DeleteCommandRequestTest, OnEvent_VrDeleteCommand_UNSUPPORTED_RESOURCE) { Event event_vr(hmi_apis::FunctionID::VR_DeleteCommand); event_vr.set_smart_object(*event_msg); - EXPECT_CALL(*app, RemoveCommand(kCommandId)); - - EXPECT_CALL(*app, UpdateHash()); - MessageSharedPtr result_msg( CatchMobileCommandResult(CallOnEvent(*command, event_vr))); @@ -145,7 +141,7 @@ TEST_F(DeleteCommandRequestTest, OnEvent_VrDeleteCommand_UNSUPPORTED_RESOURCE) { EXPECT_EQ( (*result_msg)[am::strings::msg_params][am::strings::success].asBool(), - true); + false); EXPECT_EQ( hmi_apis::Common_Result::UNSUPPORTED_RESOURCE, (*result_msg)[am::strings::msg_params][am::strings::result_code].asInt()); -- cgit v1.2.1