diff options
author | ypostolov <ypostolov@luxoft.com> | 2020-01-09 19:33:14 +0200 |
---|---|---|
committer | yurii <ypostolov> | 2020-03-26 14:08:10 +0200 |
commit | d564ff424f71ba958816176d210fb793eb81cd10 (patch) | |
tree | 89f9ce7a9f038a59364cfa97b0c2943722094623 | |
parent | bc563c4b8475c23153b59c9dfab55eb46bf55744 (diff) | |
download | sdl_core-d564ff424f71ba958816176d210fb793eb81cd10.tar.gz |
fix cppcheck issues in component application_manager
227 files changed, 278 insertions, 39 deletions
diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc index 1c3a9c77c5..5fe5441495 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/src/app_service_rpc_plugin.cc @@ -109,10 +109,12 @@ void AppServiceRpcPlugin::DeleteSubscriptions( extern "C" __attribute__((visibility("default"))) application_manager::plugin_manager::RPCPlugin* +// cppcheck-suppress unusedFunction Create() { return new app_service_rpc_plugin::AppServiceRpcPlugin(); } +// cppcheck-suppress unusedFunction extern "C" __attribute__((visibility("default"))) void Delete( application_manager::plugin_manager::RPCPlugin* data) { delete data; diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/app_service_plugin/app_service_app_extension_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/app_service_plugin/app_service_app_extension_test.cc index 785cdd5200..eac2b346ff 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/app_service_plugin/app_service_app_extension_test.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/app_service_plugin/app_service_app_extension_test.cc @@ -79,6 +79,7 @@ class AppServiceAppExtensionTest : public ::testing::Test { std::unique_ptr<AppServiceAppExtension> app_service_app_extension_; }; +// cppcheck-suppress syntaxError TEST_F(AppServiceAppExtensionTest, SubscribeToAppService_SUCCESS) { EXPECT_TRUE( app_service_app_extension_->SubscribeToAppService(kAppServiceType1)); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc index 4236ac23f9..d61d005e70 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc @@ -142,6 +142,7 @@ typedef Types<commands::ASAppServiceActivationRequest, TYPED_TEST_CASE(HMICommandsTestFirst, HMICommandsListFirst); +// cppcheck-suppress syntaxError TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc index 69bff3ad76..536d184570 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc @@ -127,6 +127,7 @@ typedef Types<commands::GetAppServiceDataRequest, TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst); +// cppcheck-suppress syntaxError TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); diff --git a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc index 6949a3aff0..d6f0711988 100644 --- a/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/app_service_rpc_plugin/test/commands/mobile/on_app_service_data_notification_test.cc @@ -116,6 +116,7 @@ class OnAppServiceDataNotificationTest MockAppServiceManager app_service_manager_; }; +// cppcheck-suppress syntaxError TEST_F(OnAppServiceDataNotificationTest, Run_SendMessageToMobile_Notification) { MessageSharedPtr mobile_message = CreateBasicMessage(); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc index 45b0d13582..f82b64dcfb 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/hmi/rc_on_remote_control_settings_notification.cc @@ -65,6 +65,7 @@ RCOnRemoteControlSettingsNotification::RCOnRemoteControlSettingsNotification( RCOnRemoteControlSettingsNotification:: ~RCOnRemoteControlSettingsNotification() {} +// cppcheck-suppress unusedFunction hmi_apis::Common_RCAccessMode::eType AccessModeFromString( const std::string& access_mode) { std::map<std::string, hmi_apis::Common_RCAccessMode::eType>::const_iterator diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc index c3e5e807d7..3c8874b2fa 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/set_interior_vehicle_data_request.cc @@ -104,7 +104,8 @@ mobile_apis::Result::eType PrepareResultCodeAndInfo( info = "Accessing not supported module data."; } return result_code; - LOG4CXX_WARN(logger_, info); + // cppcheck-suppress unreachableCode + LOG4CXX_WARN(logger_, "The requested LightName info"); } void SetInteriorVehicleDataRequest::Execute() { diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc index 885c5ac0dd..6bbcbd8d39 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/rc_command_request.cc @@ -246,7 +246,7 @@ void RCCommandRequest::ProcessAccessResponse( result_code, mobile_apis::Result::SUCCESS, mobile_apis::Result::WARNINGS); - + // cppcheck-suppress variableScope bool is_allowed = false; if (result) { if (message[app_mngr::strings::msg_params].keyExists( diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc index 4ca2cf5182..96b8d1ab9e 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_command_factory.cc @@ -71,6 +71,7 @@ using rc_rpc_plugin::ResourceAllocationManager; template <typename RCCommandType> class RCCommandCreator : public CommandCreator { public: + // cppcheck-suppress noExplicitConstructor RCCommandCreator(const RCCommandParams& params) : params_(params) {} private: @@ -92,6 +93,7 @@ struct RCInvalidCommand {}; template <> class RCCommandCreator<RCInvalidCommand> : public CommandCreator { public: + // cppcheck-suppress unusedFunction RCCommandCreator(const RCCommandParams& params) { UNUSED(params); } @@ -109,6 +111,7 @@ class RCCommandCreator<RCInvalidCommand> : public CommandCreator { }; struct RCCommandCreatorFactory { + // cppcheck-suppress noExplicitConstructor RCCommandCreatorFactory(const RCCommandParams& params) : params_(params) {} template <typename RCCommandType> diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc index fb8de0bb9c..6de4bf77ec 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/button_press_request_test.cc @@ -156,6 +156,7 @@ class ButtonPressRequestTest testing::NiceMock<MockRCConsentManager> mock_rc_consent_manger_; }; +// cppcheck-suppress syntaxError TEST_F(ButtonPressRequestTest, Execute_ButtonNameMatchesModuleType_ExpectCorrectMessageSentToHMI) { // Arrange diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_consent_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_consent_request_test.cc index 29708d05bd..4e57c943ff 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_consent_request_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_consent_request_test.cc @@ -169,6 +169,7 @@ class GetInteriorVehicleDataConsentRequestTest NiceMock<MockRCConsentManager> mock_rc_consent_manger_; }; +// cppcheck-suppress syntaxError TEST_F(GetInteriorVehicleDataConsentRequestTest, ModuleIDReturnsEmptyString_SUCCESS) { std::string empty_str; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc index 532a62df3b..2bb7f349eb 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/get_interior_vehicle_data_request_test.cc @@ -199,6 +199,7 @@ class GetInteriorVehicleDataRequestTest testing::NiceMock<MockRCConsentManager> mock_rc_consent_manger_; }; +// cppcheck-suppress syntaxError TEST_F(GetInteriorVehicleDataRequestTest, Execute_ExpectCorrectMessageSentToHMI_NoSubscriptionNoCache) { // Arrange diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc index d6771c534d..4a7b590585 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_interior_vehicle_data_notification_test.cc @@ -135,6 +135,7 @@ class OnInteriorVehicleDataNotificationTest testing::NiceMock<MockRCConsentManager> mock_rc_consent_manger_; }; +// cppcheck-suppress syntaxError TEST_F(OnInteriorVehicleDataNotificationTest, Run_SendMessageToMobile_Notification) { // Arrange diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc index 62b726ac60..a257217fc8 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/on_remote_control_settings_test.cc @@ -116,6 +116,7 @@ class RCOnRemoteControlSettingsNotificationTest testing::NiceMock<MockRCConsentManager> mock_rc_consent_manger_; }; +// cppcheck-suppress syntaxError TEST_F(RCOnRemoteControlSettingsNotificationTest, Run_Allowed_SetAccessMode) { // Arrange MessageSharedPtr mobile_message = CreateBasicMessage(); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc index 55be43f37b..110ee89284 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/rc_get_interior_vehicle_data_consent_test.cc @@ -228,6 +228,7 @@ class RCGetInteriorVehicleDataConsentTest testing::NiceMock<MockRCConsentManager> mock_rc_consent_manger_; }; +// cppcheck-suppress syntaxError TEST_F(RCGetInteriorVehicleDataConsentTest, Run_MobileSendButtonPressMessage_HMISendASKDRIVERModeToMobile) { // Arrange diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/release_interior_vehicle_data_module_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/release_interior_vehicle_data_module_request_test.cc index 200e458c17..4ae85d82c5 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/release_interior_vehicle_data_module_request_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/release_interior_vehicle_data_module_request_test.cc @@ -145,6 +145,7 @@ class ReleaseInteriorVehicleDataModuleRequestTest MockRCConsentManager mock_rc_consent_manger_; }; +// cppcheck-suppress syntaxError TEST_F(ReleaseInteriorVehicleDataModuleRequestTest, ModuleIDIsAbsnetInMessage_ReturnsDefaultFromCapabilities) { (*message_)[application_manager::strings::msg_params].erase( diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc index 5a822a2fe4..0da95bdddf 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/commands/set_interior_vehicle_data_request_test.cc @@ -153,6 +153,7 @@ class SetInteriorVehicleDataRequestTest testing::NiceMock<MockRCConsentManager> mock_rc_consent_manger_; }; +// cppcheck-suppress syntaxError TEST_F(SetInteriorVehicleDataRequestTest, Execute_ValidWithoutReadOnlyParams_ExpectResendToHMI) { // Arrange diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/grid_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/grid_test.cc index b8a0d71203..ea7512e973 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/grid_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/grid_test.cc @@ -38,6 +38,7 @@ namespace rc_rpc_plugin_test { namespace grid_test { using namespace rc_rpc_plugin; +// cppcheck-suppress syntaxError TEST(Grid, IsLevelIntersectionExists) { Grid grid_level0{1, 1, 0, 1, 1, 1}; Grid grid_level1{1, 1, 1, 1, 1, 1}; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc index 40a6bdf41d..6f18e72e70 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/interior_data_cache_test.cc @@ -43,6 +43,7 @@ const std::string kValueKey = "value"; const std::string kArray = "array"; } // namespace +// cppcheck-suppress syntaxError TEST_F(InteriorDataCacheTest, InteriorDataCacheDoesNotContainRandomDataInitialy) { rc_rpc_plugin::InteriorDataCacheImpl cache; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_consent_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_consent_manager_impl_test.cc index a2e9f6d83b..0c04f42d18 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_consent_manager_impl_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_consent_manager_impl_test.cc @@ -120,6 +120,7 @@ class RCConsentManagerImplTest : public ::testing::Test { std::unique_ptr<rc_rpc_plugin::RCConsentManagerImpl> rc_consent_manager_; }; +// cppcheck-suppress syntaxError TEST_F(RCConsentManagerImplTest, SaveAndGetModuleConsents_SUCCESS) { const std::string radio_moduleId = "eb7739ea-b263-4fe1-af9c-9311d1acac2d"; const std::string climate_moduleId = "34045662-a9dc-4823-8435-91056d4c26cb"; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_helpers_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_helpers_test.cc index 21876c4c19..8e30b1b187 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_helpers_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/rc_helpers_test.cc @@ -80,6 +80,7 @@ class RCHelpersTest : public ::testing::Test { } }; +// cppcheck-suppress syntaxError TEST_F(RCHelpersTest, MergeModuleData_OneOfParamsNotSmartMap_ExpectDataReplacedWithNewOne) { SmartObject data1(SmartType_Map); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/resource_allocation_manager_impl_test.cc index 70ed832cb1..f71afed712 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/resource_allocation_manager_impl_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager/resource_allocation_manager_impl_test.cc @@ -219,6 +219,7 @@ void RAManagerTest::OnRCStatusNotificationExpectations() { ON_CALL(mock_app_mngr_, applications()).WillByDefault(Return(apps_da_)); } +// cppcheck-suppress syntaxError TEST_F(RAManagerTest, AcquireResource_NoAppRegistered_Expect_InUse) { // Arrange EXPECT_CALL(mock_app_mngr_, application(kAppId1)) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc index 0033b392d2..45d8aa03f3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_app_permission_consent_notification.cc @@ -50,6 +50,7 @@ namespace { struct PermissionsAppender : public std::unary_function<void, const smart_objects::SmartArray::value_type&> { + // cppcheck-suppress noExplicitConstructor PermissionsAppender(policy::PermissionConsent& consents) : allowed_key_(application_manager::hmi_response::allowed) , consents_(consents) {} @@ -82,6 +83,7 @@ struct PermissionsAppender */ struct ExternalConsentStatusAppender : std::unary_function<void, const smart_objects::SmartArray::value_type&> { + // cppcheck-suppress noExplicitConstructor ExternalConsentStatusAppender( policy::ExternalConsentStatus& external_consent_status) : external_consent_status_(external_consent_status) {} diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc index 0a6632fca8..8a1641d0a0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc @@ -43,6 +43,7 @@ namespace commands { namespace { struct ProtoV4AppsOnDevice : std::unary_function<ApplicationSharedPtr, bool> { connection_handler::DeviceHandle handle_; + // cppcheck-suppress noExplicitConstructor ProtoV4AppsOnDevice(const connection_handler::DeviceHandle handle) : handle_(handle) {} bool operator()(const ApplicationSharedPtr app) const { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc index 89ccfb8bd7..207e7dd62a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_sub_menu_request.cc @@ -197,6 +197,7 @@ bool AddSubMenuRequest::CheckSubMenuName() { LOG4CXX_AUTO_TRACE(logger_); const char* str = NULL; + // cppcheck-suppress redundantAssignment str = (*message_)[strings::msg_params][strings::menu_name].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_INFO(logger_, "Invalid subMenu name."); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc index 57912e7087..5136db6bc5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc @@ -410,6 +410,7 @@ void AlertRequest::SendSpeakRequest(int32_t app_id, if (tts_chunks_exists && length_tts_chunks) { msg_params[hmi_request::tts_chunks] = smart_objects::SmartObject(SmartType_Array); + // cppcheck-suppress redundantAssignment msg_params[hmi_request::tts_chunks] = (*message_)[strings::msg_params][strings::tts_chunks]; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc index 50217a9c8a..d3f877b8b6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/change_registration_request.cc @@ -44,6 +44,7 @@ namespace { namespace custom_str = utils::custom_string; struct IsSameNickname { + // cppcheck-suppress noExplicitConstructor IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {} bool operator()(const policy::StringArray::value_type& nickname) const { return app_id_.CompareIgnoreCase(nickname.c_str()); @@ -515,7 +516,6 @@ bool ChangeRegistrationRequest::IsLanguageSupportedByTTS( for (size_t i = 0; i < tts_languages->length(); ++i) { if (hmi_display_lang == tts_languages->getElement(i).asInt()) { return true; - break; } } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc index 258aefd63f..5067eb437a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc @@ -238,6 +238,7 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( LOG4CXX_AUTO_TRACE(logger_); const char* str = NULL; + // cppcheck-suppress redundantAssignment str = choice_set[strings::menu_name].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid menu_name syntax check failed"); @@ -321,6 +322,7 @@ void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests( choice_set[strings::choice_set][chs_num][strings::choice_id]; msg_params[strings::vr_commands] = smart_objects::SmartObject(smart_objects::SmartType_Array); + // cppcheck-suppress redundantAssignment msg_params[strings::vr_commands] = choice_set[strings::choice_set][chs_num][strings::vr_commands]; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc index 363b14f92f..879f3f769f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/delete_command_request.cc @@ -100,6 +100,7 @@ void DeleteCommandRequest::Run() { ++chaining_counter; } + // cppcheck-suppress unreadVariable if ((*command).keyExists(strings::vr_commands)) { ++chaining_counter; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc index cd7d7a37b7..2058db13a6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc @@ -70,6 +70,7 @@ void GetWayPointsRequest::Run() { smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); + // cppcheck-suppress redundantAssignment msg_params = (*message_)[strings::msg_params]; msg_params[strings::app_id] = app->app_id(); StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc index b340055c50..346479ef1f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc @@ -173,6 +173,7 @@ void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const { } char timeout_str[24]; + // cppcheck-suppress invalidPrintfArgType_sint if (0 > sprintf(timeout_str, "%d", timeout)) { memset(timeout_str, 0, sizeof(timeout_str)); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc index 881c838c1a..80c6eb557c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc @@ -873,6 +873,7 @@ bool PerformInteractionRequest::IsWhiteSpaceExist() { LOG4CXX_AUTO_TRACE(logger_); const char* str = NULL; + // cppcheck-suppress redundantAssignment str = (*message_)[strings::msg_params][strings::initial_text].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid initial_text syntax check failed"); @@ -1041,8 +1042,10 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( const smart_objects::SmartObject& choice_set_id_list) const { LOG4CXX_AUTO_TRACE(logger_); + // cppcheck-suppress variableScope size_t choice_list_length = 0; std::set<uint32_t> choice_id_set; + // cppcheck-suppress variableScope smart_objects::SmartObject* choice_set = 0; std::pair<std::set<uint32_t>::iterator, bool> ins_res; @@ -1089,6 +1092,7 @@ void PerformInteractionRequest::SendBothModeResponse( vr_result_code_, HmiInterfaces::HMI_INTERFACE_VR, application_manager_); const bool result = PrepareResultForMobileResponse(ui_perform_info, vr_perform_info); + // cppcheck-suppress redundantAssignment perform_interaction_result_code = PrepareResultCodeForResponse(ui_perform_info, vr_perform_info); const smart_objects::SmartObject* response_params = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc index e25215fb48..b6916b8aa3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/put_file_request.cc @@ -164,6 +164,7 @@ void PutFileRequest::Run() { is_persistent_file_ = false; bool is_system_file = false; length_ = binary_data.size(); + // cppcheck-suppress variableScope bool is_download_complete = true; bool offset_exist = (*message_)[strings::msg_params].keyExists(strings::offset); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc index 54649980c6..58ea576537 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/register_app_interface_request.cc @@ -108,6 +108,7 @@ std::string AppHMITypeToString(mobile_apis::AppHMIType::eType type) { } struct AppHMITypeInserter { + // cppcheck-suppress noExplicitConstructor AppHMITypeInserter(smart_objects::SmartObject& so_array) : index_(0), so_array_(so_array) {} @@ -159,6 +160,7 @@ class SmartArrayValueExtractor { }; struct IsSameNickname { + // cppcheck-suppress noExplicitConstructor IsSameNickname(const custom_str::CustomString app_name) : app_name_(app_name) {} bool operator()(const policy::StringArray::value_type& nickname) const { @@ -1266,6 +1268,7 @@ bool RegisterAppInterfaceRequest::IsWhiteSpaceExist() { LOG4CXX_AUTO_TRACE(logger_); const char* str = NULL; + // cppcheck-suppress redundantAssignment str = (*message_)[strings::msg_params][strings::app_name].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid app_name syntax check failed"); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc index 805c0f0e41..d9c56159a0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/send_location_request.cc @@ -120,6 +120,7 @@ void SendLocationRequest::Run() { if (msg_params.keyExists(strings::location_image)) { mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS; + // cppcheck-suppress redundantAssignment verification_result = MessageHelper::VerifyImage( (*message_)[strings::msg_params][strings::location_image], app, @@ -132,6 +133,7 @@ void SendLocationRequest::Run() { } SmartObject request_msg_params = SmartObject(smart_objects::SmartType_Map); + // cppcheck-suppress redundantAssignment request_msg_params = msg_params; request_msg_params[strings::app_id] = app->hmi_app_id(); StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc index d610090aa4..6b5abfb41b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_media_clock_timer_request.cc @@ -78,6 +78,7 @@ void SetMediaClockRequest::Run() { smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); // copy entirely msg + // cppcheck-suppress redundantAssignment msg_params = (*message_)[strings::msg_params]; msg_params[strings::app_id] = app->app_id(); StartAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc index b439c1cb16..cd681269e9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_constant_tbt_request.cc @@ -80,6 +80,7 @@ void ShowConstantTBTRequest::Run() { smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); + // cppcheck-suppress redundantAssignment msg_params = (*message_)[strings::msg_params]; if (IsWhiteSpaceExist()) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc index dd7b426b40..4141d0c085 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc @@ -109,6 +109,7 @@ void SliderRequest::Run() { smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); + // cppcheck-suppress redundantAssignment msg_params = (*message_)[strings::msg_params]; msg_params[strings::app_id] = application->app_id(); @@ -184,6 +185,7 @@ bool SliderRequest::IsWhiteSpaceExist() { LOG4CXX_AUTO_TRACE(logger_); const char* str = NULL; + // cppcheck-suppress redundantAssignment str = (*message_)[strings::msg_params][strings::slider_header].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid slider_header value syntax check failed"); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc index 033e70a29c..5efc3b9812 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/system_request.cc @@ -319,6 +319,7 @@ class QueryAppsDataValidator { return true; } + // cppcheck-suppress functionStatic bool ValidateSynonymsAtLanguage(const smart_objects::SmartObject& language, const std::string& language_name, SynonymsMap& synonyms_map) const { @@ -390,6 +391,7 @@ class QueryAppsDataValidator { return true; } + // cppcheck-suppress functionStatic bool CheckMandatoryParametersPresent( const smart_objects::SmartObject& app_data) const { if (!app_data.keyExists(json::android) && !app_data.keyExists(json::ios)) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc index 8c2cce9765..351a89bc35 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/update_turn_list_request.cc @@ -114,6 +114,7 @@ void UpdateTurnListRequest::Run() { smart_objects::SmartObject msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); + // cppcheck-suppress redundantAssignment msg_params = (*message_)[strings::msg_params]; if ((*message_)[strings::msg_params].keyExists(strings::turn_list)) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc index 7dadad59fe..89beee9d9c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc @@ -56,6 +56,7 @@ using ::test::components::application_manager_test::MockApplication; typedef std::shared_ptr<MockApplication> MockAppPtr; typedef std::shared_ptr<ActivateAppRequest> ActivateAppRequestPtr; +// cppcheck-suppress syntaxError MATCHER_P(CheckMessage, level, "") { return level == static_cast<mobile_apis::HMILevel::eType>( diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc index 01487284a4..aa980cd964 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/add_statistics_info_notification_test.cc @@ -67,6 +67,7 @@ const uint32_t kStatisticType = 1u; class AddStatisticsInfoNotificationTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(AddStatisticsInfoNotificationTest, Run_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[am::strings::msg_params][am::hmi_notification::statistic_type] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc index 251fe230fc..ffbf52bb32 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_all_apps_response_test.cc @@ -58,6 +58,7 @@ const bool kResponseIsAllowed = true; class AllowAllAppsResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(AllowAllAppsResponseTest, Run_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::msg_params][hmi_response::allowed] = kResponseIsAllowed; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc index a0e23d7b9d..f9ab1ef300 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/allow_app_response_test.cc @@ -59,6 +59,7 @@ typedef std::shared_ptr<AllowAppResponse> ResponsePtr; class AllowAppResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(AllowAppResponseTest, Run_AppCreated_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::params][strings::connection_key] = kConnectionKey; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc index 9cd87b053d..a3db409d5c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_request_test.cc @@ -52,6 +52,7 @@ using namespace ::protocol_handler; class BasicCommunicationGetSystemTimeRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(BasicCommunicationGetSystemTimeRequestTest, OnTimeout) { MessageSharedPtr msg = CreateMessage(); protocol_handler_test::MockProtocolHandler mock_protocol_handler; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc index 0c8e986fc6..a853b8c24c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/basic_communication_get_system_time_response_test.cc @@ -48,6 +48,7 @@ using sdl_rpc_plugin::commands::BasicCommunicationGetSystemTimeResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::ReturnRef; +// cppcheck-suppress syntaxError ACTION_P(GetEventId, event_id) { *event_id = arg0.id(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_get_app_properties_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_get_app_properties_request_test.cc index 0d70226645..90c2b9ee47 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_get_app_properties_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_get_app_properties_request_test.cc @@ -94,6 +94,7 @@ bool CompareNicknames(const smart_objects::SmartObject& nicknames_so, return true; } +// cppcheck-suppress syntaxError ACTION_P(SetTestAppProperties, app_properties) { arg1 = app_properties; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_get_app_properties_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_get_app_properties_response_test.cc index f9df8db1e3..b9f20b0022 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_get_app_properties_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_get_app_properties_response_test.cc @@ -47,6 +47,7 @@ using sdl_rpc_plugin::commands::BCGetAppPropertiesResponse; class BCGetAppPropertiesResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(BCGetAppPropertiesResponseTest, RUN_SUCCESS) { MessageSharedPtr msg = CreateMessage(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_set_app_properties_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_set_app_properties_request_test.cc index 5804476649..bde8c37b62 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_set_app_properties_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_set_app_properties_request_test.cc @@ -90,6 +90,7 @@ class BCSetAppPropertiesRequestTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError TEST_F(BCSetAppPropertiesRequestTest, Run_NoAppPropertyChanges_AppIsSame_FailToUpdateAppList) { smart_objects::SmartObject properties(smart_objects::SmartType_Map); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_set_app_properties_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_set_app_properties_response_test.cc index d4b7447d0d..4ecb9feb37 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_set_app_properties_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/bc_set_app_properties_response_test.cc @@ -47,6 +47,7 @@ using sdl_rpc_plugin::commands::BCSetAppPropertiesResponse; class BCSetAppPropertiesResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(BCSetAppPropertiesResponseTest, RUN_SUCCESS) { MessageSharedPtr msg = CreateMessage(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc index 7d9ed899a6..b0ee69630a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/button_get_capabilities_response_test.cc @@ -76,6 +76,7 @@ class ButtonGetCapabilitiesResponseTest SmartObject preset_bank_capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(ButtonGetCapabilitiesResponseTest, Run_CodeSuccess_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); (*msg)[strings::params][hmi_response::code] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc index 087109c871..6068fc3c09 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/close_popup_response_test.cc @@ -59,6 +59,7 @@ typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; class ClosePopupResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { }; +// cppcheck-suppress syntaxError TEST_F(ClosePopupResponseTest, RUN_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); ResponseFromHMIPtr command(CreateCommand<ClosePopupResponse>(command_msg)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc index c66cb81141..6d6e36b484 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc @@ -508,6 +508,7 @@ TYPED_TEST_CASE(HMICommandsTestThird, HMICommandsListThird); TYPED_TEST_CASE(HMICommandsTestFourth, HMICommandsListFourth); TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth); +// cppcheck-suppress syntaxError TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc index 5b860499dd..343c669d97 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_request_test.cc @@ -65,6 +65,7 @@ const uint32_t kCorrelationId = 1u; class GetSystemInfoRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(GetSystemInfoRequestTest, RUN_SendRequest_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[strings::msg_params][strings::number] = "123"; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc index 11589683be..e935cfc051 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc @@ -90,6 +90,7 @@ class GetSystemInfoResponseTest SmartObject capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(GetSystemInfoResponseTest, GetSystemInfo_SUCCESS) { MessageSharedPtr command_msg = CreateCommandMsg(); (*command_msg)[strings::params][hmi_response::code] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc index 26f7a63872..aca37c4554 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc @@ -153,6 +153,7 @@ const am::WindowID kDefaultWindowId = mobile_apis::PredefinedWindows::DEFAULT_WINDOW; } +// cppcheck-suppress syntaxError ACTION_P(GetEventId, event_id) { *event_id = arg0.id(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc index 64bf167f83..f9c616d763 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_request_test.cc @@ -64,6 +64,7 @@ const uint32_t kConnectionKey = 2u; class MixingAudioSupportedRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(MixingAudioSupportedRequestTest, RUN_SendRequest_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[am::strings::msg_params][am::strings::number] = "123"; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc index 8c2f07a1d6..bd300f01cc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/mixing_audio_supported_response_test.cc @@ -75,6 +75,7 @@ const uint32_t kConnectionKey = 2u; class MixingAudioSupportedResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(MixingAudioSupportedResponseTest, RUN_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[am::strings::msg_params][am::strings::number] = "123"; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc index 926e51446f..de0273bc0e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_audio_start_stream_request_test.cc @@ -79,6 +79,7 @@ class AudioStartStreamRequestTest std::shared_ptr<AudioStartStreamRequest> command_; }; +// cppcheck-suppress syntaxError TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) { EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface)) .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc index 5e13755a32..c6e920ace2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_request_test.cc @@ -72,6 +72,7 @@ class NaviIsReadyRequestTest NaviIsReadyRequestPtr command_; }; +// cppcheck-suppress syntaxError TEST_F(NaviIsReadyRequestTest, OnEvent_HmiInterfaceIsAvailable_NaviCooperatingIsAvailable) { const bool is_hmi_interface_available = true; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc index e166928348..d3c5657da9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc @@ -59,6 +59,7 @@ typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; class NaviIsReadyResponseTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(NaviIsReadyResponseTest, NaviIsReadyResponse_Run_SUCCESS) { ResponseFromHMIPtr command(CreateCommand<commands::NaviIsReadyResponse>()); MockEventDispatcher mock_event_dispatcher; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc index d6ef540bc0..258bc8bba4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_request_test.cc @@ -88,6 +88,7 @@ class NaviSetVideoConfigRequestTest MockEventDispatcher mock_event_dispatcher_; }; +// cppcheck-suppress syntaxError TEST_F(NaviSetVideoConfigRequestTest, OnEventWithSuccessResponse) { MessageSharedPtr request_msg = CreateMessage(); (*request_msg)[am::strings::msg_params][am::strings::app_id] = kAppId; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc index c4e7976bde..3c617a9c1a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_set_video_config_response_test.cc @@ -57,6 +57,7 @@ typedef NiceMock< class NaviSetVideoConfigResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(NaviSetVideoConfigResponseTest, RUN_SUCCESS) { MessageSharedPtr msg = CreateMessage(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc index 232d5ab628..b46a2bc266 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_start_stream_request_test.cc @@ -78,6 +78,7 @@ class NaviStartStreamRequestTest std::shared_ptr<NaviStartStreamRequest> command_; }; +// cppcheck-suppress syntaxError TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) { EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(kHmiInterface)) .WillOnce(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc index b32189ce1a..ea00bb1f01 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/navi_stop_stream_requests_test.cc @@ -80,6 +80,7 @@ typedef testing::Types<commands::AudioStopStreamRequest, RequestCommandsList; TYPED_TEST_CASE(NaviStopStreamRequestsTest, RequestCommandsList); +// cppcheck-suppress syntaxError TYPED_TEST(NaviStopStreamRequestsTest, Run_HmiInterfaceNotAvailable_NoRequest) { EXPECT_CALL(TestFixture::mock_hmi_interfaces_, GetInterfaceState(kHmiInterface)) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_app_properties_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_app_properties_change_notification_test.cc index 0ab0bc5a35..12ea6383a9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_app_properties_change_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_app_properties_change_notification_test.cc @@ -68,6 +68,7 @@ class OnAppPropertiesChangeNotificationTest NotificationPtr command_; }; +// cppcheck-suppress syntaxError TEST_F(OnAppPropertiesChangeNotificationTest, SendNotificationToHMI) { (*message_)[strings::msg_params][strings::app_id] = kConnectionKey; command_ = CreateCommand<OnAppPropertiesChangeNotification>(message_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_from_hmi_test.cc index f3ed480180..144009b538 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_from_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_from_hmi_test.cc @@ -53,6 +53,7 @@ namespace { const uint32_t kAppId = 1u; } // namespace +// cppcheck-suppress syntaxError MATCHER(CheckMessageToMobile, "") { const auto function_id = mobile_apis::FunctionID::OnSystemCapabilityUpdatedID; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_test.cc index cb8894749f..e1b8558cce 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_bc_system_capability_updated_notification_test.cc @@ -53,6 +53,7 @@ namespace { const uint32_t kConnectionKey = 1u; } +// cppcheck-suppress syntaxError MATCHER_P(CheckDisplayCapabilities, display_capabilities, "") { return display_capabilities == (*arg)[strings::msg_params][strings::system_capability] diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc index fe6ba7c4e3..026490f5a9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_driver_distraction_notification_test.cc @@ -113,6 +113,7 @@ class HMIOnDriverDistractionNotificationTest } }; +// cppcheck-suppress syntaxError MATCHER_P2(CheckNotificationParams, function_id, state, "") { bool is_function_id_matched = function_id == diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_service_status_update_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_service_status_update_notification_test.cc index a9bc97f842..50feb4d749 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_service_status_update_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_service_status_update_notification_test.cc @@ -68,6 +68,7 @@ class OnServiceUpdateNotificationTest NotificationPtr command_; }; +// cppcheck-suppress syntaxError TEST_F(OnServiceUpdateNotificationTest, SendNotificationToHMI) { (*message_)[strings::msg_params][hmi_notification::service_type] = ServiceType::AUDIO; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc index f9dbbf259f..8e82e2b8b5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/on_system_time_ready_notification_test.cc @@ -51,6 +51,7 @@ using testing::ReturnRef; class OnSystemTimeReadyNotificationTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError ACTION_P(GetEventId, event_id) { *event_id = arg0.id(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc index 67c36dce9c..c04b656914 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_get_capabilities_response_test.cc @@ -82,6 +82,7 @@ class RCGetCapabilitiesResponseTest SmartObject capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(RCGetCapabilitiesResponseTest, RUN_SUCCESSS) { MessageSharedPtr command_msg = CreateCommandMsg(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc index 539c0efeb3..b8c6a4abf6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_request_test.cc @@ -117,6 +117,7 @@ class RCIsReadyRequestTest am::MockHmiInterfaces mock_hmi_interfaces_; }; +// cppcheck-suppress syntaxError TEST_F(RCIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) { const bool is_rc_cooperating_available = false; const bool is_send_message_to_hmi = true; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc index 4224e82b5f..293f39860a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/rc_is_ready_response_test.cc @@ -61,6 +61,7 @@ typedef std::shared_ptr<RCIsReadyResponse> RCIsReadyResponsePtr; class RCIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { }; +// cppcheck-suppress syntaxError TEST_F(RCIsReadyResponseTest, RUN_SUCCESS) { RCIsReadyResponsePtr command(CreateCommand<RCIsReadyResponse>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc index 3e7e6e6f59..d9dd2830a2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc @@ -58,6 +58,7 @@ typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; class ResponseFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(ResponseFromHMITest, BasicMethodsOverloads_SUCCESS) { ResponseFromHMIPtr command(CreateCommand<ResponseFromHMI>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc index 93344f1a0d..219b2f618d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc @@ -74,6 +74,7 @@ const uint32_t kAppIDFirst = 1u; const connection_handler::DeviceHandle kHandle = 2u; } // namespace +// cppcheck-suppress syntaxError MATCHER_P2(CheckMsgParams, result, corr_id, "") { const bool is_func_id_valid = hmi_apis::FunctionID::SDL_ActivateApp == diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc index b35ccde314..d34c365ac4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc @@ -61,6 +61,7 @@ const std::string kStrNumber = "123"; class SDLActivateAppResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(SDLActivateAppResponseTest, RUN_SendRequest_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[strings::msg_params][strings::number] = kStrNumber; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc index c8cc4bb18c..78d07ac4e3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_list_of_permisssions_request_test.cc @@ -74,6 +74,7 @@ class SDLGetListOfPermissionsRequestTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError TEST_F(SDLGetListOfPermissionsRequestTest, Run_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::params][strings::correlation_id] = kCorrelationID; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_policy_configuration_data_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_policy_configuration_data_request_test.cc index b5263ece7d..292eb7aeaa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_policy_configuration_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_policy_configuration_data_request_test.cc @@ -52,6 +52,7 @@ namespace hmi_response = ::app_mngr::hmi_response; class SDLGetPolicyConfigurationDataRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError MATCHER_P(GetPolicyConfigurationDataFirstElementMatches, string_first_element_value, "") { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc index 021dfc8b1d..811eb16260 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_status_update_request_test.cc @@ -60,6 +60,7 @@ namespace hmi_response = ::application_manager::hmi_response; class SDLGetStatusUpdateRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(SDLGetStatusUpdateRequestTest, Run_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::params][strings::correlation_id] = kCorrelationID; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc index 5cac1c823f..dd9af031aa 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_get_user_friendly_message_request_test.cc @@ -87,6 +87,7 @@ class SDLGetUserFriendlyMessageRequestTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::params][strings::correlation_id] = kCorrelationID; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc index 57bb018273..b848d2c876 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_notifications_test.cc @@ -59,6 +59,7 @@ typedef Types<commands::CommandNotificationImpl, NotificationToHMI> TYPED_TEST_CASE(SimpleNotificationsTest, CommandsList); +// cppcheck-suppress syntaxError TYPED_TEST(SimpleNotificationsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc index fc2cd1cca4..1c1e660e09 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc @@ -63,6 +63,7 @@ class RequestFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> { NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_; }; +// cppcheck-suppress syntaxError TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) { std::shared_ptr<commands::RequestFromHMI> command( CreateCommand<commands::RequestFromHMI>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc index 162e832e9f..6f76b5329b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc @@ -112,6 +112,7 @@ using event_engine_test::MockEventDispatcher; class RequestToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) { std::shared_ptr<am_commands::RequestToHMI> command( CreateCommand<am_commands::RequestToHMI>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc index f232240c28..a2a08e2deb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc @@ -225,6 +225,7 @@ TYPED_TEST_CASE(ResponseFromHMICommandsTest, ResponseCommandsList); TYPED_TEST_CASE(EmptyResponseFromHMICommandsTest, EmptyResponseCommandsList); +// cppcheck-suppress syntaxError MATCHER_P(EventIdIsEqualTo, function_id, "") { return static_cast<hmi_apis::FunctionID::eType>(function_id) == arg.id(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc index 910c3f2873..9962d269c4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc @@ -68,6 +68,7 @@ typedef Types<commands::SDLActivateAppResponse, TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList); +// cppcheck-suppress syntaxError TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc index c7b96f1acf..a249ae1515 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_capabilities_response_test.cc @@ -60,6 +60,7 @@ const std::string kText = "TEXT"; class TTSGetCapabilitiesResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(TTSGetCapabilitiesResponseTest, Run_BothExist_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::msg_params][hmi_response::speech_capabilities] = kText; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc index c0d23cb34b..ae19f5de99 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_language_response_test.cc @@ -60,6 +60,7 @@ const Common_Language::eType kLanguage = Common_Language::EN_GB; class TTSGetLanguageResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::msg_params][hmi_response::language] = kLanguage; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc index c0f187a85f..943a9d5517 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_get_supported_languages_response_test.cc @@ -76,6 +76,7 @@ class TTSGetSupportedLanguageResponseTest SmartObject capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(TTSGetSupportedLanguageResponseTest, RUN_SUCCESS) { smart_objects::SmartObject supported_languages("EN_US"); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc index a2f4440c86..0584d9eba0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc @@ -80,6 +80,7 @@ class TTSIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { SmartObject capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(TTSIsReadyResponseTest, RUN_SUCCESS) { ResponseFromHMIPtr command(CreateCommand<TTSIsReadyResponse>()); MockEventDispatcher mock_event_dispatcher; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc index 4683fc62c7..4f1529684d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_capabilities_response_test.cc @@ -82,6 +82,7 @@ class UIGetCapabilitiesResponseTest SmartObject capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(UIGetCapabilitiesResponseTest, RUN_SetDisplay_SUCCESSS) { MessageSharedPtr command_msg = CreateCommandMsg(); (*command_msg)[strings::msg_params][hmi_response::display_capabilities] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc index 7e8040543d..5159a55836 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_language_response_test.cc @@ -65,6 +65,7 @@ const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB; class UIGetLanguageResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::msg_params][hmi_response::language] = kLanguage; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc index 10cf244bcf..1fbe9bd96d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_get_supported_languages_response_test.cc @@ -75,6 +75,7 @@ class UIGetSupportedLanguagesResponseTest SmartObject capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(UIGetSupportedLanguagesResponseTest, RUN_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[strings::msg_params][strings::number] = kStringNum; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc index 837b8438dc..3fa2a40b7f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_request_test.cc @@ -145,6 +145,7 @@ class UIIsReadyRequestTest policy_test::MockPolicyHandlerInterface mock_policy_handler_interface_; }; +// cppcheck-suppress syntaxError TEST_F(UIIsReadyRequestTest, OnEvent_NoKeyAvailableInMessage_HmiInterfacesIgnored) { const bool is_ui_cooperating_available = false; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc index 44b9504055..a1617b54b5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc @@ -72,6 +72,7 @@ class UIIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { SmartObject capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(UIIsReadyResponseTest, RUN_SUCCESS) { UIIsReadyResponsePtr command(CreateCommand<UIIsReadyResponse>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc index 31c03a7ed5..d64741e5c4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_device_list_request_test.cc @@ -89,6 +89,7 @@ class UpdateDeviceListRequestTest MockEventDispatcher mock_event_dispatcher_; }; +// cppcheck-suppress syntaxError TEST_F(UpdateDeviceListRequestTest, RUN_LaunchHMIReturnsFalse) { MessageSharedPtr command_msg = CreateCommandMsg(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc index 96f3b38fbf..15d2a56ec8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc @@ -63,6 +63,7 @@ const std::string kStrNumber = "123"; class UpdateSDLRequestTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(UpdateSDLRequestTest, RUN_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[strings::msg_params][strings::number] = kStrNumber; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc index 62ffc6be4d..061357e43c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc @@ -61,6 +61,7 @@ const std::string kStrNumber = "123"; class UpdateSDLResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { }; +// cppcheck-suppress syntaxError TEST_F(UpdateSDLResponseTest, RUN_SendRequest_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[strings::msg_params][strings::number] = kStrNumber; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc index 21acf2bb70..f00a345ac6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_capabilities_response_test.cc @@ -81,6 +81,7 @@ class VRGetCapabilitiesResponseTest SmartObject capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(VRGetCapabilitiesResponseTest, RUN_SUCCESSS) { MessageSharedPtr command_msg = CreateCommandMsg(); (*command_msg)[strings::msg_params][strings::vr_capabilities] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc index 8b00b4dded..921934bfe8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_language_response_test.cc @@ -65,6 +65,7 @@ const hmi_apis::Common_Language::eType kLanguage = Common_Language::EN_GB; class VRGetLanguageResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::msg_params][hmi_response::language] = kLanguage; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc index b81823624c..3b09424a40 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_get_supported_languages_response_test.cc @@ -75,6 +75,7 @@ class VRGetSupportedLanguagesResponseTest SmartObject capabilities_; }; +// cppcheck-suppress syntaxError TEST_F(VRGetSupportedLanguagesResponseTest, RUN_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[strings::msg_params][strings::number] = kStringNum; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc index 9bb8e4c2d5..bf3595f7f8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_request_test.cc @@ -130,6 +130,7 @@ class VRIsReadyRequestTest VRIsReadyRequestPtr command_; }; +// cppcheck-suppress syntaxError TEST_F(VRIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) { const bool is_vr_cooperating_available = false; const bool is_send_message_to_hmi = true; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc index 8b7b0a94f4..d2c286b8a9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc @@ -59,6 +59,7 @@ typedef std::shared_ptr<VRIsReadyResponse> VRIsReadyResponsePtr; class VRIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { }; +// cppcheck-suppress syntaxError TEST_F(VRIsReadyResponseTest, RUN_SUCCESS) { VRIsReadyResponsePtr command(CreateCommand<VRIsReadyResponse>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc index b11312eb33..9c41065209 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_command_request_test.cc @@ -234,6 +234,7 @@ class AddCommandRequestTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError TEST_F(AddCommandRequestTest, Run_AppNotExisted_EXPECT_AppNotRegistered) { CreateBasicParamsUIRequest(); EXPECT_CALL(app_mngr_, application(kConnectionKey)) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc index a88a1ade69..7cf2f2b2e8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/add_sub_menu_request_test.cc @@ -82,6 +82,7 @@ class AddSubMenuRequestTest } }; +// cppcheck-suppress syntaxError TEST_F(AddSubMenuRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) { const uint32_t menu_id = 10u; MessageSharedPtr msg = CreateMsgParams(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc index e726616345..0d150e6dfc 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_maneuver_request_test.cc @@ -107,6 +107,7 @@ class AlertManeuverRequestTest } }; +// cppcheck-suppress syntaxError TEST_F(AlertManeuverRequestTest, Run_RequiredFieldsDoesNotExist_UNSUCCESS) { CommandPtr command(CreateCommand<AlertManeuverRequest>()); EXPECT_CALL(app_mngr_, application(_)).Times(0); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc index dc7731bfc8..5d5af3d275 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc @@ -185,6 +185,7 @@ class AlertRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { MessageSharedPtr msg_; }; +// cppcheck-suppress syntaxError TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) { PreConditions(); MessageSharedPtr command_msg = CreateMessage(smart_objects::SmartType_Map); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc index 4394c6fe5e..81eb7f463b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc @@ -273,6 +273,7 @@ class ChangeRegistrationRequestTest typedef ChangeRegistrationRequestTest::MockHMICapabilities MockHMICapabilities; +// cppcheck-suppress syntaxError TEST_F(ChangeRegistrationRequestTest, OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_from_mobile = CreateMsgFromMobile(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc index 73a0008624..9cadc15a7f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc @@ -162,6 +162,7 @@ class CreateInteractionChoiceSetRequestTest class CreateInteractionChoiceSetResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) { MessageSharedPtr msg_vr = CreateMessage(smart_objects::SmartType_Map); (*msg_vr)[strings::msg_params][strings::result_code] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_window_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_window_request_test.cc index 905c6ceb72..a2c82f55b9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_window_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_window_request_test.cc @@ -78,6 +78,7 @@ const char* const kWindowName = "WindowName"; const utils::custom_string::CustomString kAppName("TestApp"); } // namespace +// cppcheck-suppress syntaxError MATCHER_P2(CheckMessageToMobile, result_code, success, "") { const bool is_success = (*arg)[am::strings::msg_params][am::strings::success].asBool() == success; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc index 081058f05a..a83eb858cb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_command_request_test.cc @@ -141,6 +141,7 @@ class DeleteCommandRequestTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError TEST_F(DeleteCommandRequestTest, OnEvent_VrHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) { MessageSharedPtr command_msg = CreateFullParamsVRSO(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc index cce53bb480..210ec0be19 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_file_test.cc @@ -83,6 +83,7 @@ typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; +// cppcheck-suppress syntaxError ACTION_TEMPLATE(SetArgPointer, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(vec)) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc index fa96b21ca7..009434215e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_interaction_choice_set_test.cc @@ -68,6 +68,7 @@ typedef std::shared_ptr<DeleteInteractionChoiceSetRequest> typedef std::shared_ptr<DeleteInteractionChoiceSetResponse> DeleteInteractionChoiceSetResponsePtr; +// cppcheck-suppress syntaxError MATCHER_P(CheckMessageSuccess, success, "") { return success == (*arg)[am::strings::msg_params][am::strings::success].asBool(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc index 04f12568b4..62d7f41bb9 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_sub_menu_test.cc @@ -68,6 +68,7 @@ using sdl_rpc_plugin::commands::DeleteSubMenuResponse; typedef std::shared_ptr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr; typedef std::shared_ptr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr; +// cppcheck-suppress syntaxError MATCHER_P(CheckMessageResultCode, result_code, "") { return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() == result_code; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_window_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_window_request_test.cc index f951d5c2a7..c66c942182 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_window_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/delete_window_request_test.cc @@ -74,6 +74,7 @@ const int32_t kFunctionID = mobile_apis::FunctionID::DeleteWindowID; const WindowID kTestWindowId = 12; } // namespace +// cppcheck-suppress syntaxError MATCHER_P2(CheckMessageToMobile, result_code, success, "") { const bool is_success = (*arg)[am::strings::msg_params][am::strings::success].asBool() == success; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc index cf2634b37c..e7124c5731 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dial_number_request_test.cc @@ -70,6 +70,7 @@ const uint32_t kConnectionKey = 2u; class DialNumberRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(DialNumberRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { DialNumberRequestPtr command(CreateCommand<DialNumberRequest>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc index 8f83a2dd10..85bb965c38 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc @@ -299,6 +299,7 @@ TYPED_TEST_CASE(MobileCommandsTestFirst, MobileCommandsListFirst); TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond); TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird); +// cppcheck-suppress syntaxError TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc index ba09e0dabe..2e05fc91ef 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/end_audio_pass_thru_request_test.cc @@ -65,6 +65,7 @@ typedef std::shared_ptr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr; class EndAudioPassThruRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(EndAudioPassThruRequestTest, OnEvent_UI_UNSUPPORTED_RESOUCRE) { const uint32_t kConnectionKey = 2u; const uint32_t app_id = kConnectionKey; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_system_capability_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_system_capability_request_test.cc index 74c61410e8..f98ebc1567 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_system_capability_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_system_capability_request_test.cc @@ -73,6 +73,7 @@ class GetSystemCapabilityRequestTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError TEST_F( GetSystemCapabilityRequestTest, Run_GetSystemDisplayCapabilities_SendMessageToMobileWithSUCCESSResultCode) { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc index 7f7a8b55bd..af75d4f497 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc @@ -127,6 +127,7 @@ class GetWayPointsRequestOnEventTest MockHmiInterfaces hmi_interfaces_; }; +// cppcheck-suppress syntaxError TEST_F(GetWayPointsRequestTest, Run_InvalidApp_ApplicationNotRegisteredResponce) { (*message_)[am::strings::params][am::strings::connection_key] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc index 06ecc1116e..0506208262 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/list_files_request_test.cc @@ -73,6 +73,7 @@ class ListFilesRequestTest const uint32_t kResponseSize_; }; +// cppcheck-suppress syntaxError TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) { std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc index aa48e8916b..9460e53309 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_button_notification_commands_test.cc @@ -87,6 +87,7 @@ typedef Types<NotificationData<OnButtonEventNotification, mobile_apis::FunctionID::OnButtonPressID> > OnButtonNotificationCommandsList; +// cppcheck-suppress syntaxError MATCHER_P(CheckNotificationMessage, function_id, "") { const bool kIsMobileProtocolTypeCorrect = (*arg)[am::strings::params][am::strings::protocol_type].asInt() == diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc index 1356b1c5fa..133cf40a3c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_command_notification_test.cc @@ -65,6 +65,7 @@ const uint32_t kCommandId = 5u; class OnCommandNotificationTest : public CommandsTest<CommandsTestMocks::kNotNice> {}; +// cppcheck-suppress syntaxError TEST_F(OnCommandNotificationTest, Run_AppNotRegistered_UNSUCCESS) { CommandPtr command(CreateCommand<OnCommandNotification>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc index 15faa5c13f..ecf954f4ff 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hash_change_notification_test.cc @@ -58,6 +58,7 @@ using testing::ReturnRef; class OnHashChangeNotificationTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(OnHashChangeNotificationTest, Run_ValidApp_SUCCESS) { const uint32_t kConnectionKey = 1u; MessageSharedPtr msg = CreateMessage(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc index 528f1d8618..a034f77a35 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_from_mobile_test.cc @@ -74,6 +74,7 @@ class OnHMIStatusNotificationFromMobileTest std::shared_ptr<sync_primitives::Lock> lock_; }; +// cppcheck-suppress syntaxError TEST_F(OnHMIStatusNotificationFromMobileTest, Run_CurrentStateForeground_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc index 5bf68414e5..ed8f88ed32 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_hmi_status_notification_test.cc @@ -82,6 +82,7 @@ class OnHMIStatusNotificationTest } }; +// cppcheck-suppress syntaxError TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc index b7b827bb4c..6f737a4509 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_keyboard_input_notification_test.cc @@ -94,6 +94,7 @@ class OnKeyBoardInputNotificationTest std::shared_ptr<sync_primitives::Lock> lock_; }; +// cppcheck-suppress syntaxError TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) { MessageSharedPtr msg = CreateMessage(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_capability_updated_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_capability_updated_notification_test.cc index 349ada66a2..517e917614 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_capability_updated_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_capability_updated_notification_test.cc @@ -57,6 +57,7 @@ const uint32_t kConnectionKey = 1u; const uint32_t kAppId = 2u; } // namespace +// cppcheck-suppress syntaxError MATCHER_P(CheckDisplayCapabilities, display_capabilities, "") { return *display_capabilities == (*arg)[strings::msg_params][strings::system_capability] diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc index ffa7203f1f..94f2f4cbcd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_system_request_notification_test.cc @@ -81,6 +81,7 @@ class OnSystemRequestNotificationTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) { const mobile_apis::RequestType::eType request_type = mobile_apis::RequestType::PROPRIETARY; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc index c43dea76e1..b48ab7301a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_tbt_client_state_notification_test.cc @@ -73,6 +73,7 @@ class OnTBTClientStateNotificationTest NotificationPtr command_; }; +// cppcheck-suppress syntaxError TEST_F(OnTBTClientStateNotificationTest, Run_HmiLevelNone_UNSUCCESS) { MockAppPtr mock_app(CreateMockApp()); std::vector<ApplicationSharedPtr> applications_with_navi; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc index 95020328b4..e574538984 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_touch_event_notification_test.cc @@ -71,6 +71,7 @@ class OnTouchEventNotificationTest NotificationPtr command_; }; +// cppcheck-suppress syntaxError TEST_F(OnTouchEventNotificationTest, Run_AppIsNotFullscreen_UNSUCCESS) { MockAppPtr mock_app(CreateMockApp()); std::vector<ApplicationSharedPtr> applications_with_navi; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc index 83958954cd..d7ae1fcc1d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/on_way_point_change_notification_test.cc @@ -71,6 +71,7 @@ class OnWayPointChangeNotificationTest NotificationPtr command_; }; +// cppcheck-suppress syntaxError MATCHER(CheckMessageData, "") { const bool kIsMobileProtocolTypeCorrect = (*arg)[am::strings::params][am::strings::protocol_type].asInt() == diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc index 2915418d43..54fdb9074b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc @@ -156,6 +156,7 @@ class PerformAudioPassThruRequestTest MockAppPtr application_sptr_; }; +// cppcheck-suppress syntaxError TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) { MessageSharedPtr msg_ui = CreateMessage(smart_objects::SmartType_Map); (*msg_ui)[am::strings::msg_params][am::strings::result_code] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc index 193229eeb0..be480c17c5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc @@ -173,6 +173,7 @@ class PerformInteractionRequestTest performinteraction_choice_set_lock_ptr_; }; +// cppcheck-suppress syntaxError TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) { MessageSharedPtr response_msg_vr = CreateMessage(smart_objects::SmartType_Map); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc index 8db533f446..8c0716a550 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/put_file_test.cc @@ -135,6 +135,7 @@ class PutFileResponceTest : public CommandsTest<CommandsTestMocks::kIsNice> { std::shared_ptr<PutFileResponse> command_sptr_; }; +// cppcheck-suppress syntaxError TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) { ::smart_objects::SmartObject& message_ref = *message_; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc index 6376570106..d76f431e35 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc @@ -314,6 +314,7 @@ class RegisterAppInterfaceRequestTest application_manager_test::MockApplicationHelper& mock_application_helper_; }; +// cppcheck-suppress syntaxError TEST_F(RegisterAppInterfaceRequestTest, Init_SUCCESS) { EXPECT_TRUE(command_->Init()); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc index 98c0ad098a..776fa07198 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/reset_global_properties_test.cc @@ -104,6 +104,7 @@ class ResetGlobalPropertiesRequestTest class ResetGlobalPropertiesResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(ResetGlobalPropertiesRequestTest, Run_InvalidApp_UNSUCCESS) { MockAppPtr invalid_app; EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(invalid_app)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc index 6b17aa238d..8794129d17 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc @@ -120,6 +120,7 @@ class ScrollableMessageRequestTest typedef ScrollableMessageRequestTest::MockHMICapabilities MockHMICapabilities; +// cppcheck-suppress syntaxError TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_ui = CreateFullParamsUISO(); (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc index 3cb9642021..18c87d0a4b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_haptic_data_test.cc @@ -94,6 +94,7 @@ class SendHapticDataResponseTest std::shared_ptr<SendHapticDataResponse> command_sptr_; }; +// cppcheck-suppress syntaxError TEST_F(SendHapticDataRequestTest, Run_SUCCESS) { EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc index 968c91b5ce..6dbce6f3ca 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/send_location_request_test.cc @@ -165,6 +165,7 @@ class SendLocationRequestTest CommandSPrt command_; }; +// cppcheck-suppress syntaxError TEST_F(SendLocationRequestTest, Run_InvalidApp_Success) { (*message_)[strings::params][strings::connection_key] = kConnectionKey; EXPECT_CALL(app_mngr_, application(kConnectionKey)) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc index 116a796312..bc7ed75490 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc @@ -98,6 +98,7 @@ class SetAppIconRequestTest mock_protocol_handler_settings_; }; +// cppcheck-suppress syntaxError TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { const std::string file_path = "file_path"; MessageSharedPtr msg_vr = CreateFullParamsUISO(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc index cc3b5925ce..7cf9dbfaa7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc @@ -71,6 +71,7 @@ const uint32_t kCorrelationKey = 2u; const std::string kLayout = "media"; } // namespace +// cppcheck-suppress syntaxError MATCHER_P(CheckMshCorrId, corr_id, "") { return (*arg)[am::strings::params][am::strings::correlation_id].asUInt() == corr_id; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc index 9b72d41f7e..682da3dcd4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc @@ -404,6 +404,7 @@ class SetGlobalPropertiesRequestTest NiceMock<MockApplicationManager> mock_app_manager_; }; +// cppcheck-suppress syntaxError TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_vr = CreateFullParamsUISO(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc index 86d15e76f2..25c592060e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/set_media_clock_timer_test.cc @@ -112,6 +112,7 @@ class SetMediaClockRequestTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError TEST_F(SetMediaClockRequestTest, OnEvent_UIHmiSendUnsupportedResource_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc index b8cfdd4bfc..0a7ecbf645 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc @@ -81,6 +81,7 @@ const am::WindowID kDefaultWindowId = mobile_apis::PredefinedWindows::DEFAULT_WINDOW; } // namespace +// cppcheck-suppress syntaxError MATCHER_P2(CheckMessageToMobile, result_code, success, "") { const bool is_success = (*arg)[am::strings::msg_params][am::strings::success].asBool() == success; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc index 6e85aff281..d40464054f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_notification_commands_test.cc @@ -73,6 +73,7 @@ typedef Types<commands::OnAppInterfaceUnregisteredNotification, commands::mobile::OnDriverDistractionNotification> NotificationCommandsList; +// cppcheck-suppress syntaxError MATCHER(CheckNotificationMessage, "") { return (*arg)[am::strings::params][am::strings::protocol_type].asInt() == am::commands::CommandImpl::mobile_protocol_type_ && diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc index 0034dcf916..6cffa8549a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/simple_response_commands_test.cc @@ -124,6 +124,7 @@ typedef Types<commands::ListFilesResponse, TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList); +// cppcheck-suppress syntaxError TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) { std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc index 0450f06ee1..bc1e4b7aae 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc @@ -135,6 +135,7 @@ class SliderRequestTest MockPolicyHandlerInterface mock_policy_handler_; }; +// cppcheck-suppress syntaxError TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_ui = CreateFullParamsUISO(); (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc index 87320d3a7a..766fa8c2a5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc @@ -128,6 +128,7 @@ class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { MockAppPtr app_; }; +// cppcheck-suppress syntaxError TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) { std::shared_ptr<SpeakRequest> command = CreateCommand<SpeakRequest>(request_); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc index f3bfe12ab1..adcb0fcea5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_button_request_test.cc @@ -76,6 +76,7 @@ typedef SubscribeButtonRequestTest::MockHMICapabilities MockHMICapabilities; const utils::SemanticVersion mock_semantic_version(5, 0, 0); const utils::SemanticVersion mock_base_rpc_version(4, 5, 1); +// cppcheck-suppress syntaxError TEST_F(SubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) { CommandPtr command(CreateCommand<SubscribeButtonRequest>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc index 56e4e05d48..03efac4331 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/subscribe_way_points_request_test.cc @@ -66,6 +66,7 @@ typedef std::shared_ptr<SubscribeWayPointsRequest> CommandPtr; class SubscribeWayPointsRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(SubscribeWayPointsRequestTest, Run_SUCCESS) { CommandPtr command(CreateCommand<SubscribeWayPointsRequest>()); MockAppPtr app(CreateMockApp()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc index 211888d6be..a9e45aa3b6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/system_request_test.cc @@ -123,6 +123,7 @@ class SystemRequestTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError TEST_F(SystemRequestTest, Run_HTTP_FileName_no_binary_data_REJECTED) { PreConditions(); MessageSharedPtr msg = CreateIVSUMessage(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc index f244acb8d6..47639305f1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unregister_app_interface_request_test.cc @@ -59,6 +59,7 @@ typedef std::shared_ptr<UnregisterAppInterfaceRequest> CommandPtr; class UnregisterAppInterfaceRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(UnregisterAppInterfaceRequestTest, Run_AppNotRegistered_UNSUCCESS) { CommandPtr command(CreateCommand<UnregisterAppInterfaceRequest>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc index 5735610051..a704ab8a62 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_button_request_test.cc @@ -41,6 +41,7 @@ class UnsubscribeButtonRequestTest MockHMICapabilities; }; +// cppcheck-suppress syntaxError TEST_F(UnsubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) { CommandPtr command(CreateCommand<UnsubscribeButtonRequest>()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc index 3165d57d44..c3a3f7f92d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/unsubscribe_way_points_request_test.cc @@ -81,6 +81,7 @@ class UnsubscribeWayPointsRequestTest std::shared_ptr<UnsubscribeWayPointsRequest> command_; }; +// cppcheck-suppress syntaxError TEST_F(UnsubscribeWayPointsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { EXPECT_CALL(app_mngr_, application(_)) diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc index 44628a8e89..bcf2b701d3 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/update_turn_list_request_test.cc @@ -91,6 +91,7 @@ class UpdateTurnListRequestTest std::shared_ptr<UpdateTurnListRequest> command_; }; +// cppcheck-suppress syntaxError TEST_F(UpdateTurnListRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(ApplicationSharedPtr())); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc index b125a7de7d..54da1785c2 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/mobile/subscribe_vehicle_data_request.cc @@ -241,7 +241,8 @@ void SubscribeVehicleDataRequest::AddAlreadySubscribedVI( struct SubscribedToIVIPredicate { std::string vehicle_info_; - SubscribedToIVIPredicate(std::string vehicle_info) + // cppcheck-suppress noExplicitConstructor + SubscribedToIVIPredicate(const std::string& vehicle_info) : vehicle_info_(vehicle_info) {} bool operator()(const ApplicationSharedPtr app) const { DCHECK_OR_RETURN(app, false); @@ -374,6 +375,7 @@ void SubscribeVehicleDataRequest::CheckVISubscriptions( return; } + // cppcheck-suppress knownConditionTrueFalse if (0 == subscribed_items && !is_interface_not_available) { out_result_code = mobile_apis::Result::IGNORED; out_info = "Already subscribed on provided VehicleData."; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc index e8d852b612..4e056eb862 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_hmi_command_factory.cc @@ -60,6 +60,7 @@ namespace strings = app_mngr::strings; template <typename VehicleInfoCommandType> class VehicleInfoCommandCreator : public application_manager::CommandCreator { public: + // cppcheck-suppress noExplicitConstructor VehicleInfoCommandCreator(const VehicleInfoCommandParams& params) : params_(params) {} @@ -85,6 +86,7 @@ template <> class VehicleInfoCommandCreator<VehicleInfoInvalidCommand> : public application_manager::CommandCreator { public: + // cppcheck-suppress unusedFunction VehicleInfoCommandCreator(const VehicleInfoCommandParams& params) { UNUSED(params); } @@ -103,6 +105,7 @@ class VehicleInfoCommandCreator<VehicleInfoInvalidCommand> }; struct VehicleInfoCommandCreatorFactory { + // cppcheck-suppress noExplicitConstructor VehicleInfoCommandCreatorFactory(const VehicleInfoCommandParams& params) : params_(params) {} diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc index c3c8d9c8d7..247edf44bc 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_mobile_command_factory.cc @@ -60,6 +60,7 @@ namespace strings = app_mngr::strings; template <typename VehicleInfoCommandType> class VehicleInfoCommandCreator : public application_manager::CommandCreator { public: + // cppcheck-suppress noExplicitConstructor VehicleInfoCommandCreator(const VehicleInfoCommandParams& params) : params_(params) {} @@ -103,6 +104,7 @@ class VehicleInfoCommandCreator<VehicleInfoInvalidCommand> }; struct VehicleInfoCommandCreatorFactory { + // cppcheck-suppress noExplicitConstructor VehicleInfoCommandCreatorFactory(const VehicleInfoCommandParams& params) : params_(params) {} diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_request_test.cc index 6bc956f65f..cdacd4ca6f 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_request_test.cc @@ -58,6 +58,7 @@ const std::string kHMIParam = "hmi_param"; class VIGetVehicleDataRequestTest : public VICommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError MATCHER_P(EqualMsgParams, msg_params, "") { using namespace app_mngr; auto message = static_cast<smart_objects::SmartObject>(*arg); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc index 45bc748df4..2c0b109e80 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_get_vehicle_data_response_test.cc @@ -76,6 +76,7 @@ const std::string kStrNumber = "123"; class VIGetVehicleDataResponseTest : public VICommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(VIGetVehicleDataResponseTest, RUN_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[strings::msg_params][strings::number] = kStrNumber; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc index c083bf4d60..a425783c38 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_is_ready_request_test.cc @@ -118,6 +118,7 @@ class VIIsReadyRequestTest VIIsReadyRequestPtr command_; }; +// cppcheck-suppress syntaxError TEST_F(VIIsReadyRequestTest, Run_NoKeyAvailableInMessage_HmiInterfacesIgnored) { const bool is_vi_cooperating_available = false; const bool is_send_message_to_hmi = true; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_subscribe_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_subscribe_vehicle_data_request_test.cc index fbaabfed06..875145d4e2 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_subscribe_vehicle_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_subscribe_vehicle_data_request_test.cc @@ -58,6 +58,7 @@ const std::string kHMIParam = "hmi_param"; class VISubscribeVehicleDataRequestTest : public VICommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError MATCHER_P(EqualMsgParams, msg_params, "") { using namespace app_mngr; auto message = static_cast<smart_objects::SmartObject>(*arg); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_unsubscribe_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_unsubscribe_vehicle_data_request_test.cc index 2ce04aa21a..53ade51dcd 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_unsubscribe_vehicle_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/hmi/vi_unsubscribe_vehicle_data_request_test.cc @@ -58,6 +58,7 @@ const std::string kHMIParam = "hmi_param"; class VIUnsubscribeVehicleDataRequestTest : public VICommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError MATCHER_P(EqualMsgParams, msg_params, "") { using namespace app_mngr; auto message = static_cast<smart_objects::SmartObject>(*arg); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc index afafd1c6c6..540c52f91f 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/diagnostic_message_request_test.cc @@ -73,6 +73,7 @@ const uint32_t kDiagnosticMode = 5u; class DiagnosticMessageRequestTest : public VICommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(DiagnosticMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[am::strings::params][am::strings::connection_key] = diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc index e4613feb83..4093b519f2 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_dtcs_request_test.cc @@ -71,6 +71,7 @@ class GetDTCsRequestTest GetDTCsRequestTest() : VICommandRequestTest<CommandsTestMocks::kIsNice>() {} }; +// cppcheck-suppress syntaxError TEST_F(GetDTCsRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { GetDTCsRequestPtr command(CreateCommandVI<GetDTCsRequest>()); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc index d27e332601..4b6ffac1c1 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_request_test.cc @@ -86,6 +86,7 @@ class UnwrappedGetVehicleDataRequest : public GetVehicleDataRequest { using GetVehicleDataRequest::on_event; }; +// cppcheck-suppress syntaxError TEST_F(GetVehicleDataRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { GetVehicleDataRequestPtr command(CreateCommandVI<GetVehicleDataRequest>()); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc index ad7a14ce40..bbce67dd6a 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/get_vehicle_data_response_test.cc @@ -53,6 +53,7 @@ typedef std::shared_ptr<GetVehicleDataResponse> GetVehicleDataResponsePtr; class GetVehicleDataResponseTest : public VICommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(GetVehicleDataResponseTest, GetVehicleDataResponse_SUCCESS) { MessageSharedPtr message(CreateMessage(smart_objects::SmartType_Map)); GetVehicleDataResponsePtr command( diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc index 82eb19c45f..df7ef75a87 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/on_vehicle_data_notification_test.cc @@ -88,6 +88,7 @@ class OnVehicleDataNotificationTest MockAppPtr mock_app_; }; +// cppcheck-suppress syntaxError MATCHER_P(SmartObjectCheck, checker, "") { return checker(arg); } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc index 372d562965..f7510a9298 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/read_did_request_test.cc @@ -65,6 +65,7 @@ using vehicle_info_plugin::commands::ReadDIDRequest; class ReadDIDRequestTest : public VICommandRequestTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) { Event event(Event::EventID::INVALID_ENUM); std::shared_ptr<ReadDIDRequest> command(CreateCommandVI<ReadDIDRequest>()); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc index 450bb5ac26..165ad28b4b 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_request_test.cc @@ -113,6 +113,7 @@ class UnsubscribeVehicleRequestTest resumption::LastStateWrapperPtr mock_last_state_; }; +// cppcheck-suppress syntaxError TEST_F(UnsubscribeVehicleRequestTest, Run_AppNotRegistered_UNSUCCESS) { CommandPtr command(CreateCommandVI<UnsubscribeVehicleDataRequest>()); EXPECT_CALL(app_mngr_, application(_)) diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc index 7c610c8adb..0ab307d606 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/commands/mobile/unsubscribe_vehicle_response_test.cc @@ -59,6 +59,7 @@ namespace am = ::application_manager; class UnsubscribeVehicleResponseTest : public VICommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError MATCHER_P(ResultCodeIs, result_code, "") { return result_code == static_cast<mobile_apis::Result::eType>( diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/custom_vehicle_data_manager_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/custom_vehicle_data_manager_test.cc index 7d65d989bf..07e967c133 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/custom_vehicle_data_manager_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/custom_vehicle_data_manager_test.cc @@ -77,6 +77,7 @@ class CustomVehicleDataManagerTest : public ::testing::Test { MockMessageHelper& mock_message_helper_; }; +// cppcheck-suppress syntaxError TEST_F(CustomVehicleDataManagerTest, CreateHMIMessageParamsEmptyItems) { policy_table::VehicleDataItems schema_items; InitValidationManager(schema_items); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/vehicle_data_item_schema_test.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/vehicle_data_item_schema_test.cc index 2443310409..7e3aa35c28 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/vehicle_data_item_schema_test.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/test/vehicle_data_item_schema_test.cc @@ -230,6 +230,7 @@ class VehicleDataItemSchemaTest : public ::testing::Test { int key_number_; }; +// cppcheck-suppress syntaxError TEST_F(VehicleDataItemSchemaTest, ValidatePOD_SUCCESS) { rpc::ValidationReport report("RPC"); auto valid_pod_objects = generatePODObjects(SetValidItemValue::YES); diff --git a/src/components/application_manager/src/app_launch/app_launch_data_db.cc b/src/components/application_manager/src/app_launch/app_launch_data_db.cc index a931b96fa1..46a3ccfe6e 100644 --- a/src/components/application_manager/src/app_launch/app_launch_data_db.cc +++ b/src/components/application_manager/src/app_launch/app_launch_data_db.cc @@ -293,6 +293,7 @@ bool AppLaunchDataDB::Clear() { bool retVal = false; utils::dbms::SQLQuery query(db()); + // cppcheck-suppress redundantAssignment retVal = query.Exec(kDropSchema); if (retVal) { diff --git a/src/components/application_manager/src/app_launch/apps_launcher.cc b/src/components/application_manager/src/app_launch/apps_launcher.cc index 993a57364e..3de36d4eac 100644 --- a/src/components/application_manager/src/app_launch/apps_launcher.cc +++ b/src/components/application_manager/src/app_launch/apps_launcher.cc @@ -56,6 +56,7 @@ void AppsLauncher::StartLaunching(ApplicationDataPtr app_data) { } struct AppLauncherFinder { + // cppcheck-suppress noExplicitConstructor AppLauncherFinder(const ApplicationDataPtr& app_data) : app_data_(app_data) {} bool operator()(const AppsLauncher::LauncherPtr& launcher) const { DCHECK_OR_RETURN(launcher->app_data_ && app_data_, false) diff --git a/src/components/application_manager/src/app_launch/device_apps_launcher.cc b/src/components/application_manager/src/app_launch/device_apps_launcher.cc index 9a7a6658fe..80a72d4939 100644 --- a/src/components/application_manager/src/app_launch/device_apps_launcher.cc +++ b/src/components/application_manager/src/app_launch/device_apps_launcher.cc @@ -69,6 +69,7 @@ class Launcher { LaunchNext(); } + // cppcheck-suppress unusedFunction void OnAppRegistered(const ApplicationDataPtr& app_data) { std::vector<ApplicationDataPtr>& apps = apps_on_device_->second; std::vector<ApplicationDataPtr>::iterator it = diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 11d038fee2..558ee0f343 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -296,8 +296,9 @@ bool ApplicationImpl::mobile_projection_enabled() const { struct StateIDComparator { HmiState::StateID state_id_; + // cppcheck-suppress noExplicitConstructor StateIDComparator(HmiState::StateID state_id) : state_id_(state_id) {} - bool operator()(const HmiStatePtr cur) { + bool operator()(const HmiStatePtr cur) const { return cur->state_id() == state_id_; } }; @@ -461,6 +462,7 @@ void ApplicationImpl::set_is_media_application(bool is_media) { is_media_ = is_media; } +// cppcheck-suppress unusedFunction bool IsTTSState(const HmiStatePtr state) { return state->state_id() == HmiState::STATE_ID_TTS_SESSION; } @@ -924,8 +926,6 @@ bool ApplicationImpl::AreCommandLimitsExceeded( limit.second = 1; return false; - - break; } // In case of policy table values, there is EVEN limitation for number of // commands per minute, e.g. 10 command per minute i.e. 1 command per 6 sec @@ -963,7 +963,6 @@ bool ApplicationImpl::AreCommandLimitsExceeded( cmd_number_to_time_limits_[cmd_id] = {current, dummy_limit}; return false; - break; } default: { LOG4CXX_WARN(logger_, "Limit source is not implemented."); @@ -1142,11 +1141,11 @@ void ApplicationImpl::SubscribeToSoftButtons( struct FindSoftButtonId { uint32_t soft_button_id_; - + // cppcheck-suppress noExplicitConstructor FindSoftButtonId(const uint32_t soft_button_id) : soft_button_id_(soft_button_id) {} - bool operator()(const std::pair<uint32_t, WindowID>& element) { + bool operator()(const std::pair<uint32_t, WindowID>& element) const { return soft_button_id_ == element.first; } }; diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 344240add9..711836f04a 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -3093,6 +3093,7 @@ void ApplicationManagerImpl::UnregisterAllApplications() { using namespace mobile_api::AppInterfaceUnregisteredReason; using namespace helpers; + // cppcheck-suppress redundantAssignment is_ignition_off = Compare<eType, EQ, ONE>(unregister_reason_, IGNITION_OFF, INVALID_ENUM); @@ -3814,16 +3815,20 @@ void ApplicationManagerImpl::ClearTimerPool() { LOG4CXX_AUTO_TRACE(logger_); { sync_primitives::AutoLock lock(close_app_timer_pool_lock_); - std::remove_if(close_app_timer_pool_.begin(), - close_app_timer_pool_.end(), - [](TimerSPtr timer) { return !timer->is_running(); }); + auto rezult = + std::remove_if(close_app_timer_pool_.begin(), + close_app_timer_pool_.end(), + [](TimerSPtr timer) { return !timer->is_running(); }); + close_app_timer_pool_.erase(rezult, close_app_timer_pool_.end()); } { sync_primitives::AutoLock lock(end_stream_timer_pool_lock_); - std::remove_if(end_stream_timer_pool_.begin(), - end_stream_timer_pool_.end(), - [](TimerSPtr timer) { return !timer->is_running(); }); + auto rezult = + std::remove_if(end_stream_timer_pool_.begin(), + end_stream_timer_pool_.end(), + [](TimerSPtr timer) { return !timer->is_running(); }); + end_stream_timer_pool_.erase(rezult, end_stream_timer_pool_.end()); } } @@ -4432,6 +4437,7 @@ void ApplicationManagerImpl::SendGetIconUrlNotifications( continue; } + // cppcheck-suppress unreadVariable std::string endpoint = app_icon_it->second.endpoint; bool pending_request = app_icon_it->second.pending_request; @@ -4743,6 +4749,7 @@ void ApplicationManagerImpl::SetMockMediaManager( #endif // BUILD_TESTS struct MobileAppIdPredicate { std::string policy_app_id_; + // cppcheck-suppress noExplicitConstructor MobileAppIdPredicate(const std::string& policy_app_id) : policy_app_id_(policy_app_id) {} bool operator()(const ApplicationSharedPtr app) const { @@ -4752,6 +4759,7 @@ struct MobileAppIdPredicate { struct TakeDeviceHandle { public: + // cppcheck-suppress noExplicitConstructor TakeDeviceHandle(const ApplicationManager& app_mngr) : app_mngr_(app_mngr) {} std::string operator()(ApplicationSharedPtr& app) { DCHECK_OR_RETURN(app, ""); diff --git a/src/components/application_manager/src/application_state.cc b/src/components/application_manager/src/application_state.cc index 6ed784424a..83b16a7fca 100644 --- a/src/components/application_manager/src/application_state.cc +++ b/src/components/application_manager/src/application_state.cc @@ -42,6 +42,7 @@ namespace { struct StateIDComparator { application_manager::HmiState::StateID state_id_; + // cppcheck-suppress noExplicitConstructor StateIDComparator(application_manager::HmiState::StateID state_id) : state_id_(state_id) {} bool operator()(const application_manager::HmiStatePtr cur) const { @@ -205,8 +206,8 @@ void ApplicationState::RemoveHMIState(const WindowID window_id, DCHECK_OR_RETURN_VOID(hmi_states.begin() != it); HmiStates::iterator next = it; HmiStates::iterator prev = it; - next++; - prev--; + ++next; + --prev; if (next != hmi_states.end()) { HmiStatePtr next_state = *next; diff --git a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc index 30b1b83e79..54d0868103 100644 --- a/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc +++ b/src/components/application_manager/src/event_engine/event_dispatcher_impl.cc @@ -78,6 +78,7 @@ void EventDispatcherImpl::add_observer(const Event::EventID& event_id, } struct IdCheckFunctor { + // cppcheck-suppress noExplicitConstructor IdCheckFunctor(const unsigned long id) : target_id(id) {} bool operator()(const EventObserver* obs) const { diff --git a/src/components/application_manager/src/hmi_capabilities_impl.cc b/src/components/application_manager/src/hmi_capabilities_impl.cc index 6a0fbf78e3..3825fcacf1 100644 --- a/src/components/application_manager/src/hmi_capabilities_impl.cc +++ b/src/components/application_manager/src/hmi_capabilities_impl.cc @@ -1104,6 +1104,7 @@ bool HMICapabilitiesImpl::load_capabilities_from_file() { if (check_existing_json_member(ui, "hmiZoneCapabilities")) { smart_objects::SmartObject hmi_zone_capabilities_so = smart_objects::SmartObject(smart_objects::SmartType_Array); + // cppcheck-suppress redundantAssignment hmi_zone_capabilities_so = hmi_zone_enum.find(ui.get("hmiZoneCapabilities", "").asString()) ->second; diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc index 844d0254cf..fdf0889ed8 100644 --- a/src/components/application_manager/src/hmi_state.cc +++ b/src/components/application_manager/src/hmi_state.cc @@ -293,6 +293,7 @@ const StateID2StrMap kStateID2StrMap = HmiState::StateID::STATE_ID_EMBEDDED_NAVI, "EMBEDDED_NAVI"); } // anonymous namespace +// cppcheck-suppress unusedFunction std::ostream& operator<<(std::ostream& os, const HmiState::StateID src) { try { os << kStateID2StrMap.left.at(src); diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc index 4a64fdb128..9cdad77080 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -107,6 +107,7 @@ bool ValidateSoftButtons(smart_objects::SmartObject& soft_buttons) { struct GroupsAppender : std::unary_function<void, const PermissionsList::value_type&> { + // cppcheck-suppress noExplicitConstructor GroupsAppender(smart_objects::SmartObject& groups) : groups_(groups), index_(0) {} @@ -135,6 +136,7 @@ struct GroupsAppender struct ExternalConsentStatusAppender : std::unary_function<void, const policy::ExternalConsentStatus::value_type&> { + // cppcheck-suppress noExplicitConstructor ExternalConsentStatusAppender(smart_objects::SmartObject& status) : status_(status), index_(0) {} @@ -660,6 +662,7 @@ void MessageHelper::SendResetPropertiesRequest(ApplicationSharedPtr application, { SmartObject msg_params = SmartObject(smart_objects::SmartType_Map); + // cppcheck-suppress redundantAssignment msg_params = *MessageHelper::CreateAppVrHelp(application); msg_params[hmi_request::menu_title] = ""; @@ -955,7 +958,7 @@ void MessageHelper::CreateGetVehicleDataRequest( smart_objects::SmartObject(smart_objects::SmartType_Map); for (std::vector<std::string>::const_iterator it = params.begin(); it != params.end(); - it++) { + ++it) { (*request)[strings::msg_params][*it] = true; } app_mngr.GetRPCService().ManageHMICommand(request); @@ -1499,6 +1502,7 @@ MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI( (*(it->second))[strings::choice_set][j][strings::choice_id]; msg_params[strings::vr_commands] = smart_objects::SmartObject(smart_objects::SmartType_Array); + // cppcheck-suppress redundantAssignment msg_params[strings::vr_commands] = (*(it->second))[strings::choice_set][j][strings::vr_commands]; msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice; @@ -3221,10 +3225,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons( } break; } - default: { - continue; - break; - } + default: { continue; } } soft_buttons[j++] = request_soft_buttons[i]; diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 9c0f5da73c..7b5fa64281 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -2348,8 +2348,6 @@ bool PolicyHandler::CheckAppServiceParameters( const std::string& requested_service_name, const std::string& requested_service_type, smart_objects::SmartArray* requested_handled_rpcs) const { - std::string service_name = std::string(); - std::string service_type = std::string(); std::vector<int32_t> handled_rpcs = {}; policy_table::AppServiceParameters app_service_parameters = diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc index eaebaf4861..aea31a0bff 100644 --- a/src/components/application_manager/src/request_controller.cc +++ b/src/components/application_manager/src/request_controller.cc @@ -81,6 +81,7 @@ void RequestController::InitializeThreadpool() { pool_state_ = TPoolState::STARTED; char name[50]; for (uint32_t i = 0; i < pool_size_; i++) { + // cppcheck-suppress invalidPrintfArgType_sint snprintf(name, sizeof(name) / sizeof(name[0]), "AM Pool %d", i); pool_.push_back(threads::CreateThread(name, new Worker(this))); pool_[i]->start(); diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc index 4f1e0a8f07..1c9253d5de 100644 --- a/src/components/application_manager/src/request_info.cc +++ b/src/components/application_manager/src/request_info.cc @@ -212,7 +212,7 @@ bool RequestInfoSet::Erase(const RequestInfoPtr request_info) { DCHECK(request_info == found); time_sorted_pending_requests_.erase(it); CheckSetSizes(); - return 1 == erased_count; + return true; } CheckSetSizes(); return false; diff --git a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc index 486cb76369..1f81b5aa78 100644 --- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc +++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc @@ -59,7 +59,8 @@ static mobile_api::HMILevel::eType PickHigherHmiLevel( mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2); static mobile_api::HMILevel::eType PickLowerHmiLevel( mobile_api::HMILevel::eType val1, mobile_api::HMILevel::eType val2); -static mobile_api::HMILevel::eType ConvertHmiLevelString(const std::string str); +static mobile_api::HMILevel::eType ConvertHmiLevelString( + const std::string& str); CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption") @@ -1350,7 +1351,7 @@ static mobile_api::HMILevel::eType PickLowerHmiLevel( } static mobile_api::HMILevel::eType ConvertHmiLevelString( - const std::string str) { + const std::string& str) { using namespace mobile_apis; if ("BACKGROUND" == str) { @@ -1359,8 +1360,6 @@ static mobile_api::HMILevel::eType ConvertHmiLevelString( return HMILevel::HMI_FULL; } else if ("LIMITED" == str) { return HMILevel::HMI_LIMITED; - } else if ("NONE" == str) { - return HMILevel::HMI_NONE; } else { return HMILevel::HMI_NONE; } diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc index 9046fe35ad..bd0a8e34b0 100644 --- a/src/components/application_manager/src/resumption/resumption_data.cc +++ b/src/components/application_manager/src/resumption/resumption_data.cc @@ -183,7 +183,7 @@ smart_objects::SmartObject ResumptionData::GetApplicationFiles( int i = 0; for (AppFilesMap::const_iterator file_it = app_files.begin(); file_it != app_files.end(); - file_it++) { + ++file_it) { const AppFile& file = file_it->second; if (file.is_persistent) { smart_objects::SmartObject file_data = diff --git a/src/components/application_manager/src/resumption/resumption_data_db.cc b/src/components/application_manager/src/resumption/resumption_data_db.cc index 9188a47bf9..f629f87f40 100644 --- a/src/components/application_manager/src/resumption/resumption_data_db.cc +++ b/src/components/application_manager/src/resumption/resumption_data_db.cc @@ -1787,7 +1787,6 @@ bool ResumptionDataDB::ExecInsertChoice( field "idimage" from table "choice" = 4 field "idsecondaryImage" from table "choice" = 5*/ int64_t image_primary_key = 0; - int64_t choice_primary_key = 0; size_t length_choice_array = choice_array.length(); for (size_t i = 0; i < length_choice_array; ++i) { insert_choice.Bind(0, (choice_array[i][strings::choice_id]).asInt()); @@ -1820,7 +1819,7 @@ bool ResumptionDataDB::ExecInsertChoice( LOG4CXX_WARN(logger_, "Problem with execution insert_choice query"); return false; } - choice_primary_key = insert_choice.LastInsertId(); + int64_t choice_primary_key = insert_choice.LastInsertId(); if ((!ExecInsertVrCommands(choice_primary_key, choice_array[i][strings::vr_commands], @@ -2115,7 +2114,6 @@ bool ResumptionDataDB::InsertCommandsData( } utils::dbms::SQLQuery query_insert_command(db()); int64_t image_primary_key = 0; - int64_t command_primary_key = 0; if (!query_insert_command.Prepare(kInsertToCommand)) { LOG4CXX_WARN(logger_, @@ -2155,7 +2153,7 @@ bool ResumptionDataDB::InsertCommandsData( LOG4CXX_WARN(logger_, "Incorrect insertion of command data to DB"); return false; } - command_primary_key = query_insert_command.LastInsertId(); + int64_t command_primary_key = query_insert_command.LastInsertId(); if (commands[i].keyExists(strings::vr_commands)) { if (!ExecInsertVrCommands(command_primary_key, commands[i][strings::vr_commands], diff --git a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc index b3bb8dd705..6c33fa34a7 100644 --- a/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc +++ b/src/components/application_manager/test/app_launch/app_launch_ctrl_test.cc @@ -185,6 +185,7 @@ struct AppDataComparator { } }; +// cppcheck-suppress syntaxError TEST_F(AppLaunchCtrlTest, AddRegisteredApplicationToDataStorage) { MockAppPtr app = GetTestApp(0); EXPECT_CALL(app_launch_data_mock_, diff --git a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc index d0f2e21f4c..cb604bbd12 100644 --- a/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc +++ b/src/components/application_manager/test/app_launch/app_launch_data_db_test.cc @@ -194,6 +194,7 @@ std::string AppLaunchDataDBTest::AddCounter(const std::string& inp, return ss.str(); } +// cppcheck-suppress syntaxError TEST_F(AppLaunchDataDBTest, Init) { utils::dbms::SQLQuery query_checks(test_db()); EXPECT_TRUE(query_checks.Prepare(kCheckTablesExist)); diff --git a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc index f7bd636a66..749b6336a6 100644 --- a/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc +++ b/src/components/application_manager/test/app_launch/app_launch_data_json_test.cc @@ -205,6 +205,7 @@ std::string AppLaunchDataJsonTest::AddCounter(const std::string& inp, return ss.str(); } +// cppcheck-suppress syntaxError TEST_F(AppLaunchDataJsonTest, SaveAndGetData) { ApplicationData data("mobile_app_id", "bundle_id", "device_mac"); AddApplicationDataWithIncreaseTable(data); diff --git a/src/components/application_manager/test/app_service_manager_test.cc b/src/components/application_manager/test/app_service_manager_test.cc index c2e48c3eda..0e64e0eee0 100644 --- a/src/components/application_manager/test/app_service_manager_test.cc +++ b/src/components/application_manager/test/app_service_manager_test.cc @@ -65,6 +65,7 @@ const std::string kPolicyAppId2 = "p_app_id2"; const uint32_t kConnectionKey = 43629; const uint32_t kHMIConnectionKey = 0; +// cppcheck-suppress syntaxError MATCHER_P(CapabilityUpdateMatcher, reason, "") { smart_objects::SmartObject& services_updated = arg[am::strings::system_capability] diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc index ec84acc697..718274fa8f 100644 --- a/src/components/application_manager/test/application_helper_test.cc +++ b/src/components/application_manager/test/application_helper_test.cc @@ -145,6 +145,7 @@ class ApplicationHelperTest : public testing::Test { ApplicationSharedPtr app_impl_; }; +// cppcheck-suppress syntaxError TEST_F(ApplicationHelperTest, RecallApplicationData_ExpectAppDataReset) { const uint32_t cmd_id = 1; const uint32_t menu_id = 2; diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index 11578f19d6..5a61ec67bd 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -177,6 +177,7 @@ void ApplicationImplTest::CheckCurrentHMIState() { EXPECT_EQ(state_id, current_state->state_id()); } +// cppcheck-suppress syntaxError TEST_F(ApplicationImplTest, AddHmiState_GetCurrentState) { TestAddHmiState(HMILevel::HMI_FULL, HmiState::STATE_ID_PHONE_CALL, diff --git a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc index f8dddcfe27..5aadb615a3 100644 --- a/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc +++ b/src/components/application_manager/test/application_manager_impl_mock_hmi_test.cc @@ -157,6 +157,7 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test { std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_; }; +// cppcheck-suppress syntaxError TEST_F(ApplicationManagerImplMockHmiTest, PostponeCommandsDuringSwitching_ExpectSendingOnSwitchingEnd) { const uint32_t application_id = 1u; diff --git a/src/components/application_manager/test/application_manager_impl_test.cc b/src/components/application_manager/test/application_manager_impl_test.cc index 2c16048e97..90bb437482 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -98,6 +98,7 @@ using test::components::policy_test::MockPolicyHandlerInterface; using namespace application_manager; // custom action to call a member function with 4 arguments +// cppcheck-suppress syntaxError ACTION_P6(InvokeMemberFuncWithArg4, ptr, memberFunc, a, b, c, d) { (ptr->*memberFunc)(a, b, c, d); } diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc index 22d111f926..2b63b9e3f0 100644 --- a/src/components/application_manager/test/application_state_test.cc +++ b/src/components/application_manager/test/application_state_test.cc @@ -85,6 +85,7 @@ class ApplicationStateTest : public ::testing::Test { std::vector<StateID> ApplicationStateTest::added_states_ = GenerateCurrentStates(); +// cppcheck-suppress syntaxError TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) { std::vector<StateID>::iterator new_state = added_states_.begin(); for (; new_state != added_states_.end(); ++new_state) { diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc index acde0bfd86..6b1fca0f5a 100644 --- a/src/components/application_manager/test/command_holder_test.cc +++ b/src/components/application_manager/test/command_holder_test.cc @@ -78,6 +78,7 @@ class CommandHolderImplTest : public testing::Test { application_manager_test::MockRPCService mock_rpc_service_; }; +// cppcheck-suppress syntaxError TEST_F(CommandHolderImplTest, HoldOne_ExpectReleaseOne) { am::CommandHolderImpl cmd_holder(mock_app_manager_); cmd_holder.Suspend(mock_app_ptr_, diff --git a/src/components/application_manager/test/commands/command_impl_test.cc b/src/components/application_manager/test/commands/command_impl_test.cc index 734a7d91b8..4cc8388b0b 100644 --- a/src/components/application_manager/test/commands/command_impl_test.cc +++ b/src/components/application_manager/test/commands/command_impl_test.cc @@ -127,6 +127,7 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> { typedef CommandImplTest::UnwrappedCommandImpl UCommandImpl; typedef std::shared_ptr<UCommandImpl> UCommandImplPtr; +// cppcheck-suppress syntaxError TEST_F(CommandImplTest, GetMethods_SUCCESS) { MessageSharedPtr msg; std::shared_ptr<CommandImpl> command = diff --git a/src/components/application_manager/test/commands/command_request_impl_test.cc b/src/components/application_manager/test/commands/command_request_impl_test.cc index 2b3231ba98..a185d86c08 100644 --- a/src/components/application_manager/test/commands/command_request_impl_test.cc +++ b/src/components/application_manager/test/commands/command_request_impl_test.cc @@ -158,6 +158,7 @@ class CommandRequestImplTest typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl; typedef std::shared_ptr<UCommandRequestImpl> CommandPtr; +// cppcheck-suppress syntaxError TEST_F(CommandRequestImplTest, WindowID_ExpectDefaultWindowID) { auto msg = CreateMessage(); const auto command = CreateCommand<UCommandRequestImpl>(msg); diff --git a/src/components/application_manager/test/commands/command_response_impl_test.cc b/src/components/application_manager/test/commands/command_response_impl_test.cc index 6362ea702e..f44e947ac9 100644 --- a/src/components/application_manager/test/commands/command_response_impl_test.cc +++ b/src/components/application_manager/test/commands/command_response_impl_test.cc @@ -56,6 +56,7 @@ using ::application_manager::commands::MessageSharedPtr; class CommandResponseImplTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; +// cppcheck-suppress syntaxError TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) { std::shared_ptr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>(); diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc index 6746e0d5ec..d2ca37678e 100644 --- a/src/components/application_manager/test/event_engine_test.cc +++ b/src/components/application_manager/test/event_engine_test.cc @@ -131,6 +131,7 @@ class EventEngineTest : public testing::Test { } }; +// cppcheck-suppress syntaxError TEST_F(EventEngineTest, EventObserverTest_ExpectObserversEmpty) { // Arrange EventObserver* event_observer_ptr = diff --git a/src/components/application_manager/test/help_prompt_manager_test.cc b/src/components/application_manager/test/help_prompt_manager_test.cc index caff56f675..23efd4028a 100644 --- a/src/components/application_manager/test/help_prompt_manager_test.cc +++ b/src/components/application_manager/test/help_prompt_manager_test.cc @@ -253,6 +253,7 @@ void HelpPromptManagerTest::CreateApplication( kDefaultWindowId, kDefaultWindowName, initial_state); } +// cppcheck-suppress syntaxError TEST_F(HelpPromptManagerTest, AddCommand_OnVrCommandAdded) { CreateApplication(*mock_help_prompt_manager_.get()); MessageSharedPtr msg = diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 6234830f50..7c515c8ca3 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -181,6 +181,7 @@ hmi_apis::Common_Language::eType TestCommonLanguageFromString( return hmi_apis::Common_Language::INVALID_ENUM; } +// cppcheck-suppress syntaxError TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { const std::string hmi_capabilities_file = "hmi_capabilities.json"; EXPECT_CALL(mock_application_manager_settings_, hmi_capabilities_file_name()) diff --git a/src/components/application_manager/test/hmi_language_handler_test.cc b/src/components/application_manager/test/hmi_language_handler_test.cc index 59913b19be..fd276f890f 100644 --- a/src/components/application_manager/test/hmi_language_handler_test.cc +++ b/src/components/application_manager/test/hmi_language_handler_test.cc @@ -139,6 +139,7 @@ class HmiLanguageHandlerTest : public ::testing::Test { MockRPCService mock_rpc_service_; }; +// cppcheck-suppress syntaxError TEST_F(HmiLanguageHandlerTest, OnEvent_AllLanguageIsReceivedAndSame_SUCCESS) { // Repeatedly add events to set `is_*_language_received_` flags up diff --git a/src/components/application_manager/test/message_helper/message_helper_test.cc b/src/components/application_manager/test/message_helper/message_helper_test.cc index f85c569bdb..7532d0f3c5 100644 --- a/src/components/application_manager/test/message_helper/message_helper_test.cc +++ b/src/components/application_manager/test/message_helper/message_helper_test.cc @@ -77,6 +77,7 @@ using testing::ReturnRef; using testing::ReturnRefOfCopy; using testing::SaveArg; +// cppcheck-suppress syntaxError TEST(MessageHelperTestCreate, CreateBlockedByPoliciesResponse_SmartObject_Equal) { mobile_apis::FunctionID::eType function_id = diff --git a/src/components/application_manager/test/mobile_event_engine_test.cc b/src/components/application_manager/test/mobile_event_engine_test.cc index cad1ff14ff..7e4ac14924 100644 --- a/src/components/application_manager/test/mobile_event_engine_test.cc +++ b/src/components/application_manager/test/mobile_event_engine_test.cc @@ -122,6 +122,7 @@ class MobileEventEngineTest : public testing::Test { } }; +// cppcheck-suppress syntaxError TEST_F(MobileEventEngineTest, EventObserverTest_ExpectObserversEmpty) { // Arrange EventObserver* event_observer_ptr = diff --git a/src/components/application_manager/test/mobile_message_handler_test.cc b/src/components/application_manager/test/mobile_message_handler_test.cc index 3ae79ce8ce..a889fbf520 100644 --- a/src/components/application_manager/test/mobile_message_handler_test.cc +++ b/src/components/application_manager/test/mobile_message_handler_test.cc @@ -251,6 +251,7 @@ class MobileMessageHandlerTest : public testing::Test { } }; +// cppcheck-suppress syntaxError TEST(mobile_message_test, basic_test) { // Example message MobileMessage message = diff --git a/src/components/application_manager/test/mobile_message_handler_v1_test.cc b/src/components/application_manager/test/mobile_message_handler_v1_test.cc index ab37694c28..ce7b686bd5 100644 --- a/src/components/application_manager/test/mobile_message_handler_v1_test.cc +++ b/src/components/application_manager/test/mobile_message_handler_v1_test.cc @@ -67,6 +67,7 @@ const unsigned char binary[PROTOCOL_HEADER_V1_SIZE] = { const unsigned char* data_v1 = reinterpret_cast<const unsigned char*>(data_json.c_str()); +// cppcheck-suppress syntaxError TEST(MobileMessageHandlerTestV1Test, HandleIncomingMessageProtocolV1_SendJSONData_ExpectEqual) { RawMessagePtr message = std::make_shared<RawMessage>(connection_key_p1, diff --git a/src/components/application_manager/test/policy_event_observer_test.cc b/src/components/application_manager/test/policy_event_observer_test.cc index a74b12071c..34aa756500 100644 --- a/src/components/application_manager/test/policy_event_observer_test.cc +++ b/src/components/application_manager/test/policy_event_observer_test.cc @@ -99,6 +99,7 @@ class PolicyEventObserverTest : public ::testing::Test { } }; +// cppcheck-suppress syntaxError TEST_F(PolicyEventObserverTest, OnEvent_EventInvalid_ExpectNoProcessingEvent) { // Arrange CreateEvent(Event::EventID::INVALID_ENUM); diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc index 2b1fc6de1d..f7bbc72a6d 100644 --- a/src/components/application_manager/test/policy_handler_test.cc +++ b/src/components/application_manager/test/policy_handler_test.cc @@ -323,6 +323,7 @@ class WaitAsync { }; } // namespace +// cppcheck-suppress syntaxError TEST_F(PolicyHandlerTest, LoadPolicyLibrary_Method_ExpectLibraryLoaded) { // Check before policy enabled from ini file EXPECT_CALL(policy_settings_, enable_policy()).WillRepeatedly(Return(false)); diff --git a/src/components/application_manager/test/rc_policy_handler_test.cc b/src/components/application_manager/test/rc_policy_handler_test.cc index 818a014a3f..9104f2b475 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -151,6 +151,7 @@ class RCPolicyHandlerTest : public ::testing::Test { } }; +// cppcheck-suppress syntaxError TEST_F(RCPolicyHandlerTest, SendMessageToSDK_RemoteControlInvalidMobileAppId_UNSUCCESS) { // Precondition diff --git a/src/components/application_manager/test/request_controller/request_controller_test.cc b/src/components/application_manager/test/request_controller/request_controller_test.cc index 71e12b2825..1e123a679a 100644 --- a/src/components/application_manager/test/request_controller/request_controller_test.cc +++ b/src/components/application_manager/test/request_controller/request_controller_test.cc @@ -159,6 +159,7 @@ class RequestControllerTestClass : public ::testing::Test { const TestSettings default_settings_; }; +// cppcheck-suppress syntaxError TEST_F(RequestControllerTestClass, AddMobileRequest_DuplicateCorrelationId_INVALID_ID) { RequestPtr request_valid = GetMockRequest(); diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc index a0b1793cf5..033f8fdaa6 100644 --- a/src/components/application_manager/test/request_info_test.cc +++ b/src/components/application_manager/test/request_info_test.cc @@ -89,6 +89,7 @@ class RequestInfoTest : public ::testing::Test { } }; +// cppcheck-suppress syntaxError TEST_F(RequestInfoTest, RequestInfoEqualEndTime) { std::vector<std::shared_ptr<TestRequestInfo> > requests; const date_time::TimeDuration& time = date_time::getCurrentTime(); diff --git a/src/components/application_manager/test/request_tracker_test.cc b/src/components/application_manager/test/request_tracker_test.cc index 9175652da6..afa65e6ad7 100644 --- a/src/components/application_manager/test/request_tracker_test.cc +++ b/src/components/application_manager/test/request_tracker_test.cc @@ -78,6 +78,7 @@ class RequestTrackerTestClass : public ::testing::Test { const uint32_t kDefaultAppRequestsTimeScale = 200u; }; +// cppcheck-suppress syntaxError TEST_F(RequestTrackerTestClass, TrackAppRequestInNone_ExpectSuccessTillLimit) { const uint32_t app_id = 1u; const mobile_apis::HMILevel::eType none_level = diff --git a/src/components/application_manager/test/resumption/resume_ctrl_test.cc b/src/components/application_manager/test/resumption/resume_ctrl_test.cc index da3cd934e4..c434caff26 100644 --- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc +++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc @@ -239,6 +239,7 @@ class ResumeCtrlTest : public ::testing::Test { * @brief Group of tests which check starting resumption with different data */ +// cppcheck-suppress syntaxError TEST_F(ResumeCtrlTest, StartResumption_AppWithGrammarId) { smart_objects::SmartObject saved_app; saved_app[application_manager::strings::hash_id] = kHash_; diff --git a/src/components/application_manager/test/resumption/resumption_data_db_test.cc b/src/components/application_manager/test/resumption/resumption_data_db_test.cc index d67c229cc3..f0b8a688cf 100644 --- a/src/components/application_manager/test/resumption/resumption_data_db_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_db_test.cc @@ -542,6 +542,7 @@ void ResumptionDataDBTest::BindId(utils::dbms::SQLQuery& query) { query.Bind(1, kMacAddress_); } +// cppcheck-suppress syntaxError TEST_F(ResumptionDataDBTest, Init) { utils::dbms::SQLQuery query_checks(test_db()); diff --git a/src/components/application_manager/test/resumption/resumption_data_json_test.cc b/src/components/application_manager/test/resumption/resumption_data_json_test.cc index 9d348ecbb7..cf6a361415 100644 --- a/src/components/application_manager/test/resumption/resumption_data_json_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_json_test.cc @@ -117,6 +117,7 @@ class ResumptionDataJsonTest : public ResumptionDataTest { ResumptionDataJson res_json; }; +// cppcheck-suppress syntaxError TEST_F(ResumptionDataJsonTest, SaveApplication) { PrepareData(); EXPECT_CALL(*mock_app_extension_, SaveResumptionData(_)); diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc index e362064a78..96e6d390dd 100644 --- a/src/components/application_manager/test/resumption/resumption_data_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_test.cc @@ -149,6 +149,7 @@ void ResumptionDataTest::CheckChoiceSet(sm::SmartObject& res_list) { sm::SmartObject command = res_list[i][am::strings::choice_set][j]; EXPECT_EQ(i + j, command[am::strings::choice_id].asUInt()); char numb[12]; + // cppcheck-suppress invalidPrintfArgType_sint std::snprintf(numb, 12, "%d", i + j); std::string test_choice = (*test_choiceset_map[i])[am::strings::choice_set][j] @@ -313,11 +314,10 @@ void ResumptionDataTest::CheckTimeoutPrompt( void ResumptionDataTest::CheckVRHelp(sm::SmartObject& res_list) { std::string text; - int position; for (uint i = 0; i < kCountOfVrhelptitle_; ++i) { text = (*vr_help_)[i][am::strings::text].asString(); EXPECT_EQ(text, res_list[i][am::strings::text].asString()); - position = (*vr_help_)[i][am::strings::position].asInt(); + int position = (*vr_help_)[i][am::strings::position].asInt(); EXPECT_EQ(position, res_list[i][am::strings::position].asInt()); } } @@ -490,6 +490,7 @@ void ResumptionDataTest::SetCommands() { sm::SmartObject sm_icon; for (uint32_t i = 0; i < kCountOfCommands_; ++i) { char numb[12]; + // cppcheck-suppress invalidPrintfArgType_sint std::snprintf(numb, 12, "%d", i); sm_comm[am::strings::cmd_id] = i; sm_comm[am::strings::menu_params][am::strings::position] = i; @@ -499,6 +500,7 @@ void ResumptionDataTest::SetCommands() { for (uint32_t j = 0; j < kCountOfChoice_; ++j) { char vr[12]; + // cppcheck-suppress invalidPrintfArgType_sint std::snprintf(vr, 12, "%d", i + j); vr_commandsvector[j] = "VrCommand " + std::string(vr); } @@ -517,6 +519,7 @@ void ResumptionDataTest::SetSubmenues() { sm::SmartObject sm_comm; for (uint32_t i = 10; i < kCountOfSubmenues_ + 10; ++i) { char numb[12]; + // cppcheck-suppress invalidPrintfArgType_sint std::snprintf(numb, 12, "%d", i); sm_comm[am::strings::menu_id] = i; sm_comm[am::strings::position] = i; @@ -536,6 +539,7 @@ void ResumptionDataTest::SetChoiceSet() { for (uint32_t i = 0; i < kCountOfChoiceSets_; ++i) { for (uint32_t j = 0; j < kCountOfChoice_; ++j) { char numb[12]; + // cppcheck-suppress invalidPrintfArgType_sint std::snprintf(numb, 12, "%d", i + j); choice[am::strings::choice_id] = i + j; @@ -569,11 +573,10 @@ void ResumptionDataTest::SetChoiceSet() { void ResumptionDataTest::SetAppFiles() { am::AppFile test_file; - int file_types; for (uint i = 0; i < kCountOfFiles_; ++i) { char numb[12]; std::snprintf(numb, 12, "%d", i); - file_types = i; + int file_types = i; test_file.is_persistent = true; test_file.is_download_complete = true; test_file.file_type = static_cast<FileType::eType>(file_types); diff --git a/src/components/application_manager/test/resumption_sql_queries_test.cc b/src/components/application_manager/test/resumption_sql_queries_test.cc index 61490ae4af..98b7b229c6 100644 --- a/src/components/application_manager/test/resumption_sql_queries_test.cc +++ b/src/components/application_manager/test/resumption_sql_queries_test.cc @@ -732,6 +732,7 @@ SQLQuery& ResumptionSqlQueriesTest::FillApplicationFilesArrayTable( return query; } +// cppcheck-suppress syntaxError TEST_F(ResumptionSqlQueriesTest, kCreateSchemaTest_ExpectSchemaCreated) { // Arrange SQLQuery query(db()); diff --git a/src/components/application_manager/test/rpc_handler_impl_test.cc b/src/components/application_manager/test/rpc_handler_impl_test.cc index 47c6cd73be..101eddd111 100644 --- a/src/components/application_manager/test/rpc_handler_impl_test.cc +++ b/src/components/application_manager/test/rpc_handler_impl_test.cc @@ -61,6 +61,7 @@ class RPCHandlerImplTest : public ::testing::Test { NiceMock<MockApplicationManager> mock_app_mngr_; }; +// cppcheck-suppress syntaxError TEST_F(RPCHandlerImplTest, GetMessageVersion_SUCCESS) { namespace json_str = ns_smart_device_link::ns_json_handler::strings; namespace app_str = application_manager::strings; diff --git a/src/components/application_manager/test/rpc_passing_handler_test.cc b/src/components/application_manager/test/rpc_passing_handler_test.cc index 6eac6ca0b1..dad78c8fa5 100644 --- a/src/components/application_manager/test/rpc_passing_handler_test.cc +++ b/src/components/application_manager/test/rpc_passing_handler_test.cc @@ -230,6 +230,7 @@ class RPCPassingHandlerTest : public ::testing::Test { const uint32_t MAX_TEST_DURATION = 1000; // 1 second }; +// cppcheck-suppress syntaxError TEST_F(RPCPassingHandlerTest, RPCPassingTest_REQUEST_ForwardToMobile) { app_services_.push_back(CreateAppService( kConnectionKey_NAV_ASP, "Navigation service", "NAVIGATION")); diff --git a/src/components/application_manager/test/state_controller/state_controller_test.cc b/src/components/application_manager/test/state_controller/state_controller_test.cc index 93565b8719..ab6c5c74dd 100644 --- a/src/components/application_manager/test/state_controller/state_controller_test.cc +++ b/src/components/application_manager/test/state_controller/state_controller_test.cc @@ -1363,6 +1363,7 @@ class StateControllerImplTest : public ::testing::Test { } }; +// cppcheck-suppress syntaxError TEST_F(StateControllerImplTest, OnStateChangedWithEqualStates) { EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_)).Times(0); EXPECT_CALL(app_manager_mock_, OnHMIStateChanged(_, _, _)).Times(0); diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc index b494afb68e..3ba5cab121 100644 --- a/src/components/application_manager/test/usage_statistics_test.cc +++ b/src/components/application_manager/test/usage_statistics_test.cc @@ -80,6 +80,7 @@ class UsageStatisticsTest : public testing::Test { const std::string language_; }; +// cppcheck-suppress syntaxError TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) { // Arrange std::unique_ptr<MockAppStopwatch> mock_app_stopwatch_object( diff --git a/src/components/application_manager/test/zero_request_amount_test.cc b/src/components/application_manager/test/zero_request_amount_test.cc index 0166c036c1..9c713454d1 100644 --- a/src/components/application_manager/test/zero_request_amount_test.cc +++ b/src/components/application_manager/test/zero_request_amount_test.cc @@ -89,6 +89,7 @@ commands::Command* PutFileCommand(uint32_t& correlation_id, return testCommand; } +// cppcheck-suppress syntaxError TEST(RequestControlTest, ZeroValuePendingRequestsAmount) { // Default value const uint32_t big_count_of_requests_for_test_ = |