From d4e8005dfae5f864b51a700f0b022c4cb75cbec3 Mon Sep 17 00:00:00 2001 From: Ashwin Karemore Date: Wed, 6 Jun 2018 16:33:43 +0200 Subject: Added parameter in SetMediaClockTimer RPC --- src/components/interfaces/HMI_API.xml | 17 +++++++++++++++++ src/components/interfaces/MOBILE_API.xml | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'src/components') diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml index ec4eb73adf..5e0df64c67 100644 --- a/src/components/interfaces/HMI_API.xml +++ b/src/components/interfaces/HMI_API.xml @@ -335,6 +335,20 @@ Clears the media clock timer (previously done through Show->mediaClock) + + + Default playback indicator. + + + Indicates that a button press of the Play/Pause button would start the playback. + + + Indicates that a button press of the Play/Pause button would pause the current playback. + + + Indicates that a button press of the Play/Pause button would stop the current playback. + + Enumeration that describes possible contexts the application might be in on HU. @@ -3656,6 +3670,9 @@ The update method of the media clock. In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused. + + Indicates that a button press of the Play/Pause button would play, pause or Stop the current playback. + ID of application that requested this RPC. diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml index 310bbc34f4..67dc6a6a3a 100644 --- a/src/components/interfaces/MOBILE_API.xml +++ b/src/components/interfaces/MOBILE_API.xml @@ -302,6 +302,20 @@ Clears the media clock timer (previously done through Show->mediaClock) + + + Default playback indicator. + + + Indicates that a button press of the Play/Pause button would start the playback. + + + Indicates that a button press of the Play/Pause button would pause the current playback. + + + Indicates that a button press of the Play/Pause button would stop the current playback. + + @@ -3970,6 +3984,9 @@ In case of pause, resume, or clear, the start time value is ignored and shall be left out. For resume, the time continues with the same value as it was when paused. + + Indicates that a button press of the Play/Pause button would play, pause or Stop the current playback. + -- cgit v1.2.1 From 2d0aa6375d13a03f399f8ea0abba862543f55cf4 Mon Sep 17 00:00:00 2001 From: Ashwin Karemore Date: Tue, 12 Jun 2018 15:16:25 +0200 Subject: UT changes --- .../include/application_manager/smart_object_keys.h | 1 + .../test/commands/mobile/set_media_clock_timer_test.cc | 9 +++++++++ src/components/application_manager/src/smart_object_keys.cc | 1 + 3 files changed, 11 insertions(+) (limited to 'src/components') diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h index 50d70591c9..07160c7927 100644 --- a/src/components/application_manager/include/application_manager/smart_object_keys.h +++ b/src/components/application_manager/include/application_manager/smart_object_keys.h @@ -160,6 +160,7 @@ extern const char* hours; extern const char* minutes; extern const char* seconds; extern const char* update_mode; +extern const char* audioStreamingIndicator; extern const char* trigger_source; extern const char* hmi_level; extern const char* activate_app_hmi_level; 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 9d2dd996bc..8e3278a23a 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 @@ -59,6 +59,7 @@ using ::testing::Return; using ::testing::ReturnRef; namespace UpdateMode = mobile_apis::UpdateMode; +namespace AudioStreamingIndicator = mobile_apis::AudioStreamingIndicator; typedef SharedPtr SetMediaClockRequestPtr; @@ -159,6 +160,8 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) { kMinutes; (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] = kSeconds; + (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] = + AudioStreamingIndicator::PLAY; SharedPtr command( CreateCommand(msg)); @@ -195,6 +198,8 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) { kHours; (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] = kMinutes; + (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] = + AudioStreamingIndicator::PLAY; SharedPtr command( CreateCommand(msg)); @@ -231,6 +236,8 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountUpWrongTime_Canceled) { kHours; (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] = kMinutes; + (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] = + AudioStreamingIndicator::PLAY_PAUSE; SharedPtr command( CreateCommand(msg)); @@ -254,6 +261,8 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountDownWrongTime_Canceled) { kMinutes; (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] = kSeconds; + (*msg)[am::strings::msg_params][am::strings::audioStreamingIndicator] = + AudioStreamingIndicator::PLAY_PAUSE; SharedPtr command( CreateCommand(msg)); diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc index e4e89c6e1f..42f94469d7 100644 --- a/src/components/application_manager/src/smart_object_keys.cc +++ b/src/components/application_manager/src/smart_object_keys.cc @@ -124,6 +124,7 @@ const char* hours = "hours"; const char* minutes = "minutes"; const char* seconds = "seconds"; const char* update_mode = "updateMode"; +const char* audioStreamingIndicator = "audioStreamingIndicator"; const char* trigger_source = "triggerSource"; const char* hmi_level = "hmiLevel"; const char* activate_app_hmi_level = "level"; -- cgit v1.2.1 From e12d82c35caba86854e30e5c0f83b8810af62804 Mon Sep 17 00:00:00 2001 From: ZhdanovP Date: Wed, 4 Jul 2018 17:05:47 +0300 Subject: Remove commented code --- .../commands/mobile/dial_number_request_test.cc | 45 ---------------------- .../application_manager/test/CMakeLists.txt | 1 - .../test/commands/CMakeLists.txt | 11 ------ .../application_manager/mock_command_factory.h | 3 -- src/components/protocol_handler/CMakeLists.txt | 1 - 5 files changed, 61 deletions(-) (limited to 'src/components') 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 bf689629b4..7cdcdb03f7 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 @@ -138,51 +138,6 @@ TEST_F(DialNumberRequestTest, Run_SUCCESS) { command->Run(); } -TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) { - // MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); - // (*command_msg)[am::strings::params][am::strings::connection_key] = - // kConnectionKey; - - // DialNumberRequestPtr - // command(CreateCommand(command_msg)); - - // MockAppPtr app(CreateMockApp()); - // EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app)); - - // Event event(hmi_apis::FunctionID::INVALID_ENUM); - // EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); - - // command->on_event(event); -} - -TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) { - // MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map)); - // (*event_msg)[am::strings::params][am::hmi_response::code] = - // mobile_apis::Result::SUCCESS; - // (*event_msg)[am::strings::params][am::strings::info] = "test_info"; - - // Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber); - // event.set_smart_object(*event_msg); - - // MockAppPtr app(CreateMockApp()); - // EXPECT_CALL(app_mngr_, application(kConnectionKey)) - // .WillRepeatedly(Return(app)); - // ON_CALL(app_mngr_, - // GetRPCService()).WillByDefault(ReturnRef(mock_rpc_service_)); - // EXPECT_CALL( - // mock_rpc_service_, - // ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), - // _)); - - // MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); - // (*command_msg)[am::strings::params][am::strings::connection_key] = - // kConnectionKey; - - // DialNumberRequestPtr - // command(CreateCommand(command_msg)); - // command->on_event(event); -} - } // namespace dial_number_request } // namespace mobile_commands_test } // namespace commands_test diff --git a/src/components/application_manager/test/CMakeLists.txt b/src/components/application_manager/test/CMakeLists.txt index 579ffe8c1b..39d4082cfa 100644 --- a/src/components/application_manager/test/CMakeLists.txt +++ b/src/components/application_manager/test/CMakeLists.txt @@ -129,7 +129,6 @@ set(CMAKE_EXE_LINKER_FLAGS ) create_test("application_manager_test" "${testSources}" "${LIBRARIES}") create_test("application_manager_mock_hmi_test" "${testSourcesMockHmi}" "${LIBRARIES}") -#add_dependencies("application_manager_test" libbson) create_test("request_controller_test" "${RequestController_SOURCES}" "${LIBRARIES}") diff --git a/src/components/application_manager/test/commands/CMakeLists.txt b/src/components/application_manager/test/commands/CMakeLists.txt index ab412c7e4e..165b5fc0fb 100644 --- a/src/components/application_manager/test/commands/CMakeLists.txt +++ b/src/components/application_manager/test/commands/CMakeLists.txt @@ -36,9 +36,6 @@ include_directories( ${COMPONENTS_DIR}/application_manager/include/application_manager/ ${COMPONENTS_DIR}/application_manager/include/application_manager/commands/ ) -#${COMPONENTS_DIR}/application_manager/test/include/ -#${COMPONENTS_DIR}/application_manager/test/include/application_manager/ -#${COMPONENTS_DIR}/application_manager/src/commands/ set(COMMANDS_TEST_DIR ${AM_TEST_DIR}/commands) @@ -51,8 +48,6 @@ file(GLOB SOURCES ${COMPONENTS_DIR}/application_manager/test/commands/command_response_impl_test.cc ) -#${COMPONENTS_DIR}/application_manager/src/smart_object_keys.cc -#${COMPONENTS_DIR}/application_manager/src/message.cc set(LIBRARIES gmock Utils @@ -66,9 +61,3 @@ set(LIBRARIES ) create_test("commands_test" "${SOURCES}" "${LIBRARIES}") -#${COMMANDS_TEST_DIR}/hmi/* -#${COMMANDS_TEST_DIR}/hmi/hmi_notifications/* -#${COMMANDS_TEST_DIR}/mobile/* -#ApplicationManager -#AMHMICommandsLibrary -#AMMobileCommandsLibrary diff --git a/src/components/application_manager/test/include/application_manager/mock_command_factory.h b/src/components/application_manager/test/include/application_manager/mock_command_factory.h index a55183e341..8b4c3851bf 100644 --- a/src/components/application_manager/test/include/application_manager/mock_command_factory.h +++ b/src/components/application_manager/test/include/application_manager/mock_command_factory.h @@ -53,9 +53,6 @@ class MockCommandFactory : public application_manager::CommandFactory { IsAbleToProcess, bool(const int32_t, const application_manager::commands::Command::CommandSource)); - - // const commands::MessageSharedPtr& message, - // application_manager::commands::Command::CommandSource)); }; } // namespace application_manager_test diff --git a/src/components/protocol_handler/CMakeLists.txt b/src/components/protocol_handler/CMakeLists.txt index d57211040a..ff8678b826 100644 --- a/src/components/protocol_handler/CMakeLists.txt +++ b/src/components/protocol_handler/CMakeLists.txt @@ -65,7 +65,6 @@ endforeach() add_library(ProtocolHandler ${SOURCES}) -#add_dependencies(ProtocolHandler libbson) target_link_libraries(ProtocolHandler ${LIBRARIES}) if(BUILD_TESTS) -- cgit v1.2.1 From b170a58794cb605ac8b681abe9db80ad581d3094 Mon Sep 17 00:00:00 2001 From: v-malko4 Date: Wed, 11 Jul 2018 17:45:25 +0300 Subject: Uncomment UT's Uncomment UT's in `dial_number_request_test.cc` --- .../commands/mobile/dial_number_request_test.cc | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/components') 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 7cdcdb03f7..cb43828970 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 @@ -138,6 +138,51 @@ TEST_F(DialNumberRequestTest, Run_SUCCESS) { command->Run(); } +TEST_F(DialNumberRequestTest, OnEvent_UnknownEvent_UNSUCCESS) { + MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); + (*command_msg)[am::strings::params][am::strings::connection_key] = + kConnectionKey; + + DialNumberRequestPtr + command(CreateCommand(command_msg)); + + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(kConnectionKey)).WillOnce(Return(app)); + + Event event(hmi_apis::FunctionID::INVALID_ENUM); + EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); + + command->on_event(event); +} + +TEST_F(DialNumberRequestTest, OnEvent_SUCCESS) { + MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map)); + (*event_msg)[am::strings::params][am::hmi_response::code] = + mobile_apis::Result::SUCCESS; + (*event_msg)[am::strings::params][am::strings::info] = "test_info"; + + Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber); + event.set_smart_object(*event_msg); + + MockAppPtr app(CreateMockApp()); + EXPECT_CALL(app_mngr_, application(kConnectionKey)) + .WillRepeatedly(Return(app)); + ON_CALL(app_mngr_, + GetRPCService()).WillByDefault(ReturnRef(mock_rpc_service_)); + EXPECT_CALL( + mock_rpc_service_, + ManageMobileCommand(MobileResultCodeIs(mobile_apis::Result::SUCCESS), + _)); + + MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); + (*command_msg)[am::strings::params][am::strings::connection_key] = + kConnectionKey; + + DialNumberRequestPtr + command(CreateCommand(command_msg)); + command->on_event(event); +} + } // namespace dial_number_request } // namespace mobile_commands_test } // namespace commands_test -- cgit v1.2.1 From 5019af50b9a2236dd75e630aae5b82e440be9620 Mon Sep 17 00:00:00 2001 From: Conlain Kelly Date: Wed, 18 Jul 2018 11:13:50 -0400 Subject: Replace utils::SharedPtr with std::shared_ptr, remove non-standard usage --- .../include/application_manager/app_extension.h | 4 +- .../app_launch/app_launch_ctrl.h | 4 +- .../app_launch/app_launch_ctrl_impl.h | 2 +- .../app_launch/app_launch_data.h | 4 +- .../app_launch/app_launch_data_impl.h | 2 + .../app_launch/app_launch_data_json.h | 1 + .../application_manager/app_launch/apps_launcher.h | 3 +- .../app_launch/device_apps_launcher.h | 6 +- .../include/application_manager/application.h | 7 +- .../include/application_manager/application_impl.h | 4 +- .../application_manager/application_manager_impl.h | 12 +- .../include/application_manager/command_factory.h | 2 +- .../include/application_manager/command_holder.h | 2 +- .../application_manager/command_holder_impl.h | 4 +- .../include/application_manager/commands/command.h | 2 +- .../include/application_manager/hmi_state.h | 28 +- .../include/application_manager/message.h | 6 +- .../application_manager/mobile_message_handler.h | 2 +- .../application_manager/policies/policy_handler.h | 10 +- .../application_manager/request_controller.h | 2 +- .../include/application_manager/request_info.h | 6 +- .../application_manager/resumption/resume_ctrl.h | 8 +- .../resumption/resume_ctrl_impl.h | 4 +- .../include/application_manager/rpc_handler_impl.h | 22 +- .../include/application_manager/rpc_service_impl.h | 12 +- .../application_manager/state_controller_impl.h | 2 +- .../application_manager/telemetry_observer.h | 6 +- .../include/application_manager/usage_statistics.h | 6 +- .../include/rc_rpc_plugin/rc_app_extension.h | 4 +- .../rc_rpc_plugin/resource_allocation_manager.h | 2 +- .../rc_on_remote_control_settings_notification.cc | 2 +- .../on_interior_vehicle_data_notification.cc | 2 +- .../rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc | 3 +- .../src/resource_allocation_manager_impl.cc | 12 +- .../test/commands/button_press_request_test.cc | 24 +- .../get_interior_vehicle_data_request_test.cc | 24 +- .../on_interior_vehicle_data_notification_test.cc | 14 +- .../commands/on_remote_control_settings_test.cc | 14 +- .../rc_get_interior_vehicle_data_consent_test.cc | 20 +- .../set_interior_vehicle_data_request_test.cc | 18 +- .../test/resource_allocation_manager_impl_test.cc | 28 +- .../sdl_rpc_plugin/src/commands/hmi/get_urls.cc | 2 +- .../hmi/on_app_permission_consent_notification.cc | 2 +- .../hmi/on_driver_distraction_notification.cc | 4 +- .../hmi/on_exit_all_applications_notification.cc | 2 +- .../hmi/on_exit_application_notification.cc | 2 +- .../commands/hmi/on_system_request_notification.cc | 2 +- .../src/commands/hmi/rc_is_ready_request.cc | 2 +- .../src/commands/hmi/tts_is_ready_request.cc | 6 +- .../src/commands/hmi/ui_is_ready_request.cc | 6 +- .../src/commands/hmi/vr_is_ready_request.cc | 6 +- .../src/commands/mobile/add_command_request.cc | 2 +- .../mobile/on_button_event_notification.cc | 2 +- .../mobile/on_button_press_notification.cc | 4 +- .../commands/mobile/on_hmi_status_notification.cc | 2 +- .../on_hmi_status_notification_from_mobile.cc | 2 +- .../mobile/on_keyboard_input_notification.cc | 2 +- .../mobile/on_system_request_notification.cc | 2 +- .../src/commands/mobile/put_file_request.cc | 2 +- .../mobile/register_app_interface_request.cc | 5 +- .../src/commands/mobile/set_app_icon_request.cc | 2 +- .../mobile/set_global_properties_request.cc | 4 +- .../src/commands/mobile/show_request.cc | 2 +- .../src/commands/mobile/system_request.cc | 4 +- .../sdl_rpc_plugin/src/mobile_command_factory.cc | 2 +- .../test/commands/hmi/activate_app_request_test.cc | 8 +- .../hmi/add_statistics_info_notification_test.cc | 4 +- .../commands/hmi/allow_all_apps_response_test.cc | 4 +- .../test/commands/hmi/allow_app_response_test.cc | 4 +- ...c_communication_get_system_time_request_test.cc | 2 +- .../hmi/button_get_capabilities_response_test.cc | 4 +- .../test/commands/hmi/close_popup_response_test.cc | 6 +- .../test/commands/hmi/dummy_hmi_commands_test.cc | 10 +- .../commands/hmi/get_system_info_request_test.cc | 6 +- .../commands/hmi/get_system_info_response_test.cc | 6 +- .../test/commands/hmi/get_urls_response_test.cc | 6 +- .../test/commands/hmi/get_urls_test.cc | 6 +- .../test/commands/hmi/hmi_notifications_test.cc | 156 +++--- .../hmi/mixing_audio_supported_request_test.cc | 6 +- .../hmi/mixing_audio_supported_response_test.cc | 6 +- .../hmi/navi_audio_start_stream_request_test.cc | 4 +- .../commands/hmi/navi_is_ready_request_test.cc | 4 +- .../commands/hmi/navi_is_ready_response_test.cc | 4 +- .../hmi/navi_set_video_config_request_test.cc | 4 +- .../hmi/navi_set_video_config_response_test.cc | 4 +- .../commands/hmi/navi_start_stream_request_test.cc | 4 +- .../commands/hmi/navi_stop_stream_requests_test.cc | 4 +- .../hmi/on_driver_distraction_notification_test.cc | 8 +- .../hmi/rc_get_capabilities_response_test.cc | 6 +- .../test/commands/hmi/rc_is_ready_request_test.cc | 4 +- .../test/commands/hmi/rc_is_ready_response_test.cc | 6 +- .../test/commands/hmi/response_from_hmi_test.cc | 8 +- .../commands/hmi/sdl_activate_app_request_test.cc | 28 +- .../commands/hmi/sdl_activate_app_response_test.cc | 6 +- .../sdl_get_list_of_permisssions_request_test.cc | 4 +- .../hmi/sdl_get_status_update_request_test.cc | 2 +- .../sdl_get_user_friendly_message_request_test.cc | 6 +- .../test/commands/hmi/simple_notifications_test.cc | 2 +- .../commands/hmi/simple_request_from_hmi_test.cc | 8 +- .../commands/hmi/simple_requests_to_hmi_test.cc | 14 +- .../commands/hmi/simple_response_from_hmi_test.cc | 14 +- .../commands/hmi/simple_response_to_hmi_test.cc | 10 +- .../hmi/tts_get_capabilities_response_test.cc | 10 +- .../commands/hmi/tts_get_language_response_test.cc | 6 +- .../tts_get_supported_languages_response_test.cc | 6 +- .../commands/hmi/tts_is_ready_response_test.cc | 6 +- .../hmi/ui_get_capabilities_response_test.cc | 8 +- .../commands/hmi/ui_get_language_response_test.cc | 6 +- .../ui_get_supported_languages_response_test.cc | 6 +- .../test/commands/hmi/ui_is_ready_request_test.cc | 4 +- .../test/commands/hmi/ui_is_ready_response_test.cc | 6 +- .../hmi/update_device_list_request_test.cc | 6 +- .../test/commands/hmi/update_sdl_request_test.cc | 6 +- .../test/commands/hmi/update_sdl_response_test.cc | 6 +- .../hmi/vr_get_capabilities_response_test.cc | 6 +- .../commands/hmi/vr_get_language_response_test.cc | 6 +- .../vr_get_supported_languages_response_test.cc | 6 +- .../test/commands/hmi/vr_is_ready_request_test.cc | 4 +- .../test/commands/hmi/vr_is_ready_response_test.cc | 6 +- .../commands/mobile/add_command_request_test.cc | 92 ++-- .../commands/mobile/add_sub_menu_request_test.cc | 6 +- .../commands/mobile/alert_maneuver_request_test.cc | 6 +- .../test/commands/mobile/alert_request_test.cc | 8 +- .../commands/mobile/change_registration_test.cc | 14 +- .../mobile/create_interaction_choice_set_test.cc | 14 +- .../commands/mobile/delete_command_request_test.cc | 6 +- .../test/commands/mobile/delete_file_test.cc | 6 +- .../mobile/delete_interaction_choice_set_test.cc | 6 +- .../test/commands/mobile/delete_sub_menu_test.cc | 6 +- .../commands/mobile/dial_number_request_test.cc | 4 +- .../commands/mobile/dummy_mobile_commands_test.cc | 6 +- .../mobile/end_audio_pass_thru_request_test.cc | 2 +- .../commands/mobile/get_way_points_request_test.cc | 10 +- .../commands/mobile/list_files_request_test.cc | 10 +- .../mobile/on_button_notification_commands_test.cc | 22 +- .../mobile/on_command_notification_test.cc | 4 +- .../mobile/on_hash_change_notification_test.cc | 4 +- .../on_hmi_status_notification_from_mobile_test.cc | 14 +- .../mobile/on_hmi_status_notification_test.cc | 8 +- .../mobile/on_keyboard_input_notification_test.cc | 12 +- .../mobile/on_system_request_notification_test.cc | 8 +- .../on_tbt_client_state_notification_test.cc | 4 +- .../mobile/on_touch_event_notification_test.cc | 4 +- .../on_way_point_change_notification_test.cc | 4 +- .../mobile/perform_audio_pass_thru_test.cc | 14 +- .../commands/mobile/perform_interaction_test.cc | 12 +- .../test/commands/mobile/put_file_test.cc | 14 +- .../mobile/register_app_interface_request_test.cc | 20 +- .../mobile/reset_global_properties_test.cc | 30 +- .../commands/mobile/scrollable_message_test.cc | 6 +- .../test/commands/mobile/send_haptic_data_test.cc | 6 +- .../commands/mobile/send_location_request_test.cc | 10 +- .../test/commands/mobile/set_app_icon_test.cc | 4 +- .../commands/mobile/set_display_layout_test.cc | 6 +- .../commands/mobile/set_global_properties_test.cc | 74 +-- .../commands/mobile/set_media_clock_timer_test.cc | 24 +- .../test/commands/mobile/show_test.cc | 78 +-- .../mobile/simple_notification_commands_test.cc | 4 +- .../mobile/simple_response_commands_test.cc | 8 +- .../test/commands/mobile/slider_test.cc | 6 +- .../test/commands/mobile/speak_request_test.cc | 14 +- .../mobile/subscribe_button_request_test.cc | 6 +- .../mobile/subscribe_way_points_request_test.cc | 4 +- .../test/commands/mobile/system_request_test.cc | 10 +- .../unregister_app_interface_request_test.cc | 4 +- .../mobile/unsubscribe_button_request_test.cc | 4 +- .../mobile/unsubscribe_way_points_request_test.cc | 4 +- .../mobile/update_turn_list_request_test.cc | 6 +- .../src/commands/hmi/vi_is_ready_request.cc | 2 +- .../src/vehicle_info_app_extension.cc | 2 +- .../vehicle_info_plugin/src/vehicle_info_plugin.cc | 2 +- .../hmi/vi_get_vehicle_data_response_test.cc | 4 +- .../test/commands/hmi/vi_is_ready_request_test.cc | 4 +- .../mobile/diagnostic_message_request_test.cc | 4 +- .../test/commands/mobile/get_dtcs_request_test.cc | 4 +- .../mobile/get_vehicle_data_request_test.cc | 10 +- .../mobile/on_vehicle_data_notification_test.cc | 4 +- .../test/commands/mobile/read_did_request_test.cc | 18 +- .../mobile/unsubscribe_vehicle_request_test.cc | 6 +- .../mobile/unsubscribe_vehicle_response_test.cc | 14 +- .../src/app_launch/app_launch_ctrl_impl.cc | 4 +- .../src/app_launch/app_launch_data_db.cc | 4 +- .../src/app_launch/app_launch_data_json.cc | 4 +- .../src/app_launch/apps_launcher.cc | 4 +- .../src/app_launch/device_apps_launcher.cc | 14 +- .../application_manager/src/application_impl.cc | 10 +- .../src/application_manager_impl.cc | 72 +-- .../application_manager/src/command_holder_impl.cc | 2 +- .../src/commands/command_impl.cc | 2 +- .../src/commands/command_request_impl.cc | 10 +- .../src/commands/notification_from_hmi.cc | 2 +- .../src/commands/request_from_hmi.cc | 6 +- .../src/commands/response_from_hmi.cc | 2 +- .../src/help_prompt_manager_impl.cc | 8 +- .../src/hmi_language_handler.cc | 2 +- .../application_manager/src/hmi_state.cc | 22 +- .../src/message_helper/message_helper.cc | 74 +-- .../src/policies/policy_handler.cc | 40 +- .../application_manager/src/request_controller.cc | 10 +- .../application_manager/src/request_info.cc | 2 +- .../src/resumption/resume_ctrl_impl.cc | 4 +- .../application_manager/src/rpc_handler_impl.cc | 22 +- .../application_manager/src/rpc_service_impl.cc | 8 +- .../src/state_controller_impl.cc | 30 +- .../application_manager/src/usage_statistics.cc | 6 +- .../test/app_launch/app_launch_ctrl_test.cc | 12 +- .../test/app_launch/app_launch_data_db_test.cc | 6 +- .../test/app_launch/app_launch_data_json_test.cc | 6 +- .../test/application_helper_test.cc | 8 +- .../test/application_impl_test.cc | 18 +- .../test/application_manager_impl_mock_hmi_test.cc | 30 +- .../test/application_manager_impl_test.cc | 54 +- .../test/application_state_test.cc | 78 +-- .../test/command_holder_test.cc | 16 +- .../test/commands/command_impl_test.cc | 10 +- .../test/commands/command_request_impl_test.cc | 10 +- .../test/commands/command_response_impl_test.cc | 16 +- .../application_manager/test/event_engine_test.cc | 2 +- .../test/help_prompt_manager_test.cc | 36 +- .../test/hmi_capabilities_test.cc | 14 +- .../test/hmi_language_handler_test.cc | 16 +- .../commands/command_request_test.h | 2 +- .../application_manager/commands/commands_test.h | 22 +- .../application_manager/mock_command_factory.h | 2 +- .../include/application_manager/mock_resume_ctrl.h | 2 +- .../application_manager/resumption_data_test.h | 4 +- .../test/message_helper/message_helper_test.cc | 84 ++-- .../test/mobile_message_handler_test.cc | 8 +- .../test/mobile_message_handler_v1_test.cc | 8 +- .../test/policy_handler_test.cc | 88 ++-- .../test/rc_policy_handler_test.cc | 18 +- .../request_controller/request_controller_test.cc | 12 +- .../application_manager/test/request_info_test.cc | 66 +-- .../test/resumption/resume_ctrl_test.cc | 42 +- .../test/resumption/resumption_data_db_test.cc | 4 +- .../test/resumption/resumption_data_json_test.cc | 2 +- .../test/resumption/resumption_data_test.cc | 4 +- .../test/state_controller/state_controller_test.cc | 66 +-- .../test/usage_statistics_test.cc | 8 +- .../include/formatters/SmartFactoryTestHelper.h | 8 +- .../formatters/test/src/SmartFactoryTestHelper.cc | 26 +- .../hmi_message_handler/mock_hmi_message_handler.h | 4 +- .../src/messagebroker_adapter.cc | 2 +- .../test/hmi_message_adapter_test.cc | 10 +- .../test/hmi_message_handler_impl_test.cc | 6 +- .../application_manager/application_manager.h | 8 +- .../policies/policy_handler_interface.h | 4 +- .../hmi_message_handler/hmi_message_observer.h | 6 +- .../hmi_message_handler/hmi_message_sender.h | 2 +- .../policy/policy_external/policy/policy_manager.h | 4 +- .../policy/policy_regular/policy/policy_manager.h | 4 +- src/components/include/protocol/raw_message.h | 4 +- .../include/protocol_handler/telemetry_observer.h | 2 +- .../include/security_manager/security_query.h | 4 +- .../application_manager/mock_application_manager.h | 4 +- .../policies/mock_policy_handler_interface.h | 2 +- .../mock_hmi_message_observer.h | 4 +- .../policy_external/policy/mock_cache_manager.h | 4 +- .../policy_external/policy/mock_policy_manager.h | 2 +- .../policy_regular/policy/mock_cache_manager.h | 4 +- .../policy_regular/policy/mock_policy_manager.h | 2 +- .../protocol_handler/mock_telemetry_observer.h | 2 +- src/components/include/transport_manager/error.h | 4 +- .../transport_manager/transport_adapter/device.h | 5 +- .../transport_adapter/transport_adapter.h | 2 +- src/components/include/utils/data_accessor.h | 4 +- src/components/include/utils/make_shared.h | 191 -------- src/components/include/utils/shared_ptr.h | 390 --------------- .../include/utils/threads/message_loop_thread.h | 2 +- .../include/media_manager/media_adapter_impl.h | 4 +- .../include/media_manager/media_manager_impl.h | 4 +- .../include/media_manager/streamer_adapter.h | 4 +- .../src/audio/audio_stream_sender_thread.cc | 2 +- .../media_manager/src/media_manager_impl.cc | 24 +- .../media_manager/mock_media_adapter_impl.h | 4 +- .../media_manager/test/media_manager_impl_test.cc | 24 +- .../include/policy/access_remote_impl.h | 6 +- .../policy_external/include/policy/cache_manager.h | 14 +- .../include/policy/cache_manager_interface.h | 12 +- .../policy_external/include/policy/policy_helper.h | 10 +- .../include/policy/policy_manager_impl.h | 14 +- .../policy_external/include/policy/policy_table.h | 8 +- .../policy_external/include/policy/policy_types.h | 4 +- .../include/policy/pt_representation.h | 2 +- .../include/policy/sql_pt_representation.h | 2 +- .../include/policy/update_status_manager.h | 10 +- .../include/policy/usage_statistics/counter.h | 20 +- .../policy_external/src/access_remote_impl.cc | 2 +- .../policy/policy_external/src/cache_manager.cc | 12 +- .../policy/policy_external/src/policy_helper.cc | 4 +- .../policy_external/src/policy_manager_impl.cc | 30 +- .../policy/policy_external/src/policy_table.cc | 2 +- .../policy_external/src/sql_pt_representation.cc | 4 +- .../policy/policy_external/src/status.cc | 24 +- .../policy_external/src/update_status_manager.cc | 8 +- .../src/usage_statistics/counter.cc | 12 +- .../test/include/policy/mock_pt_representation.h | 2 +- .../include/policy/policy_manager_impl_test_base.h | 6 +- .../test/policy_manager_impl_ptu_test.cc | 6 +- .../test/policy_manager_impl_snapshot_test.cc | 12 +- .../test/policy_manager_impl_test.cc | 34 +- .../test/policy_manager_impl_test_base.cc | 6 +- .../test/policy_manager_impl_user_consent_test.cc | 4 +- .../test/sql_pt_ext_representation_test.cc | 10 +- .../test/sql_pt_representation_test.cc | 4 +- .../test/update_status_manager_test.cc | 6 +- .../include/policy/access_remote_impl.h | 6 +- .../policy_regular/include/policy/cache_manager.h | 12 +- .../include/policy/cache_manager_interface.h | 12 +- .../policy_regular/include/policy/policy_helper.h | 10 +- .../include/policy/policy_manager_impl.h | 16 +- .../policy_regular/include/policy/policy_table.h | 8 +- .../policy_regular/include/policy/policy_types.h | 5 +- .../include/policy/pt_representation.h | 4 +- .../include/policy/sql_pt_representation.h | 2 +- .../include/policy/update_status_manager.h | 10 +- .../policy/update_status_manager_interface.h | 8 +- .../include/policy/usage_statistics/counter.h | 20 +- .../policy_regular/src/access_remote_impl.cc | 2 +- .../policy/policy_regular/src/cache_manager.cc | 10 +- .../policy/policy_regular/src/policy_helper.cc | 4 +- .../policy_regular/src/policy_manager_impl.cc | 40 +- .../policy/policy_regular/src/policy_table.cc | 2 +- .../policy_regular/src/sql_pt_representation.cc | 4 +- src/components/policy/policy_regular/src/status.cc | 26 +- .../policy_regular/src/update_status_manager.cc | 8 +- .../policy_regular/src/usage_statistics/counter.cc | 12 +- .../policy_regular/test/access_remote_impl_test.cc | 4 +- .../policy/policy_regular/test/counter_test.cc | 18 +- .../test/include/policy/mock_pt_representation.h | 2 +- .../test/policy_manager_impl_test.cc | 18 +- .../test/sql_pt_representation_test.cc | 6 +- .../test/update_status_manager_test.cc | 10 +- .../protocol_handler/protocol_handler_impl.h | 2 +- .../include/protocol_handler/protocol_packet.h | 2 +- .../protocol_handler/src/multiframe_builder.cc | 2 +- .../protocol_handler/src/protocol_handler_impl.cc | 12 +- .../protocol_handler/mock_telemetry_observer.h | 4 +- .../test/incoming_data_handler_test.cc | 56 +-- .../test/multiframe_builder_test.cc | 12 +- .../test/protocol_handler_tm_test.cc | 112 ++--- .../include/security_manager/crypto_manager_impl.h | 6 +- .../security_manager/src/crypto_manager_impl.cc | 2 +- .../security_manager/src/security_manager_impl.cc | 2 +- .../test/crypto_manager_impl_test.cc | 10 +- .../security_manager/test/security_manager_test.cc | 6 +- .../test/ssl_certificate_handshake_test.cc | 4 +- .../security_manager/test/ssl_context_test.cc | 28 +- .../smart_objects/always_false_schema_item.h | 4 +- .../smart_objects/always_true_schema_item.h | 4 +- .../include/smart_objects/array_schema_item.h | 4 +- .../include/smart_objects/bool_schema_item.h | 4 +- .../include/smart_objects/default_shema_item.h | 2 +- .../include/smart_objects/enum_schema_item.h | 8 +- .../include/smart_objects/number_schema_item.h | 8 +- .../include/smart_objects/object_schema_item.h | 3 +- .../include/smart_objects/schema_item.h | 7 +- .../include/smart_objects/smart_object.h | 2 +- .../include/smart_objects/string_schema_item.h | 4 +- .../smart_objects/src/always_false_schema_item.cc | 4 +- .../smart_objects/src/always_true_schema_item.cc | 4 +- .../smart_objects/src/array_schema_item.cc | 4 +- .../smart_objects/src/bool_schema_item.cc | 4 +- .../smart_objects/src/object_schema_item.cc | 4 +- .../smart_objects/src/string_schema_item.cc | 4 +- .../smart_objects/test/BoolSchemaItem_test.cc | 2 +- .../test/SmartObjectConvertionTime_test.cc | 2 +- .../application_manager_metric_wrapper.h | 2 +- .../application_manager_observer.h | 2 +- .../protocol_handler_metric_wrapper.h | 4 +- .../telemetry_monitor/protocol_handler_observer.h | 2 +- .../include/telemetry_monitor/telemetry_monitor.h | 15 +- .../transport_manager_metric_wrapper.h | 2 +- .../src/application_manager_observer.cc | 6 +- .../src/protocol_handler_observer.cc | 4 +- .../telemetry_monitor/src/telemetry_monitor.cc | 14 +- .../src/transport_manager_observer.cc | 4 +- .../test/application_manager_metric_test.cc | 8 +- .../test/application_manager_observer_test.cc | 4 +- .../telemetry_monitor/mock_telemetry_monitor.h | 4 +- .../test/protocol_handler_metric_test.cc | 4 +- .../test/protocol_handler_observer_test.cc | 4 +- .../test/telemetry_monitor_test.cc | 12 +- .../test/transport_manager_metric_test.cc | 4 +- .../transport_adapter/connection.h | 4 +- .../transport_manager/transport_manager_impl.h | 2 +- .../include/transport_manager/usb/common.h | 4 +- .../include/transport_manager/usb/usb_device.h | 3 +- .../src/bluetooth/bluetooth_connection_factory.cc | 6 +- .../src/bluetooth/bluetooth_device_scanner.cc | 4 +- .../src/bluetooth/bluetooth_transport_adapter.cc | 4 +- .../src/tcp/tcp_client_listener.cc | 16 +- .../src/tcp/tcp_connection_factory.cc | 6 +- .../tcp/tcp_server_originated_socket_connection.cc | 2 +- .../src/tcp/tcp_transport_adapter.cc | 4 +- .../transport_adapter/transport_adapter_impl.cc | 8 +- .../transport_adapter_listener_impl.cc | 2 +- .../src/transport_manager_impl.cc | 6 +- .../src/usb/libusb/usb_connection.cc | 4 +- .../src/usb/qnx/usb_connection.cc | 4 +- .../src/usb/usb_connection_factory.cc | 10 +- .../transport_manager/raw_message_matcher.h | 4 +- .../test/tcp_client_listener_test.cc | 4 +- .../test/tcp_transport_adapter_test.cc | 30 +- .../test/transport_adapter_listener_test.cc | 4 +- .../test/transport_adapter_test.cc | 66 +-- .../test/transport_manager_impl_test.cc | 18 +- src/components/utils/test/async_runner_test.cc | 12 +- src/components/utils/test/shared_ptr_test.cc | 542 --------------------- 409 files changed, 2101 insertions(+), 3215 deletions(-) delete mode 100644 src/components/include/utils/make_shared.h delete mode 100644 src/components/include/utils/shared_ptr.h delete mode 100644 src/components/utils/test/shared_ptr_test.cc (limited to 'src/components') diff --git a/src/components/application_manager/include/application_manager/app_extension.h b/src/components/application_manager/include/application_manager/app_extension.h index ee7eca190c..5f193bf331 100644 --- a/src/components/application_manager/include/application_manager/app_extension.h +++ b/src/components/application_manager/include/application_manager/app_extension.h @@ -33,7 +33,7 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_ -#include "utils/shared_ptr.h" + namespace NsSmartDeviceLink { namespace NsSmartObjects { @@ -74,7 +74,7 @@ class AppExtension { const AppExtensionUID kUid_; }; -typedef utils::SharedPtr AppExtensionPtr; +typedef std::shared_ptr AppExtensionPtr; } // namespace application_manager diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h index 9fc85db38c..a10963ad82 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl.h @@ -33,11 +33,11 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_LAUNCH_APP_LAUNCH_CTRL_H_ #include -#include "utils/shared_ptr.h" +#include namespace application_manager { class Application; -typedef utils::SharedPtr ApplicationConstSharedPtr; +typedef std::shared_ptr ApplicationConstSharedPtr; } // namespace application_manager namespace app_launch { diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h index 1f508eebe5..61f3480f77 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_ctrl_impl.h @@ -49,7 +49,7 @@ class ResumeCtrl; namespace app_launch { // TODO(AK) Use unique pointer -typedef utils::SharedPtr TimerPtr; +typedef std::shared_ptr TimerPtr; class MultipleAppsLauncherFactoryImpl; class AppLaunchCtrlImpl : public AppLaunchCtrl { diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h index 0d52384018..73e9623b62 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data.h @@ -36,7 +36,7 @@ #include #include #include -#include "utils/shared_ptr.h" +#include namespace app_launch { @@ -59,7 +59,7 @@ struct ApplicationData { bundle_id_ == app_data.bundle_id_ && device_mac_ == device_mac_; } }; -typedef utils::SharedPtr ApplicationDataPtr; +typedef std::shared_ptr ApplicationDataPtr; /** * @brief class contains interfaces to AppLaunchDataDB and AppLaunchDataJson diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h index 111ff25ab2..a2b8630bcc 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_impl.h @@ -35,6 +35,8 @@ #include "application_manager/app_launch/app_launch_data.h" #include "application_manager/app_launch_settings.h" +#include "utils/macro.h" +#include namespace app_launch { diff --git a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h index 61117e552b..e9166439f8 100644 --- a/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h +++ b/src/components/application_manager/include/application_manager/app_launch/app_launch_data_json.h @@ -38,6 +38,7 @@ #include "resumption/last_state.h" #include "utils/lock.h" #include "utils/macro.h" +#include namespace app_launch { diff --git a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h index 751e04bada..6285514be9 100644 --- a/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h +++ b/src/components/application_manager/include/application_manager/app_launch/apps_launcher.h @@ -3,6 +3,7 @@ #include "application_manager/app_launch/app_launch_data.h" #include "connection_handler/connection_handler.h" #include "utils/timer.h" +#include namespace app_launch { class AppLaunchCtrlImpl; @@ -69,7 +70,7 @@ class AppsLauncher { connection_handler::ConnectionHandler& connection_handler_; AppsLauncher& parent_; }; - typedef utils::SharedPtr LauncherPtr; + typedef std::shared_ptr LauncherPtr; typedef std::vector AppLaunchers; private: diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h index 2a6cdb0745..f156654215 100644 --- a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h +++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h @@ -29,7 +29,7 @@ class DeviceAppsLauncherImpl { struct LauncherFinder { LauncherFinder(const std::string& device_mac) : device_mac_(device_mac) {} - bool operator()(const utils::SharedPtr& launcher) const; + bool operator()(const std::shared_ptr& launcher) const; std::string device_mac_; }; @@ -38,8 +38,8 @@ class DeviceAppsLauncherImpl { private: sync_primitives::Lock launchers_lock_; - std::vector > free_launchers_; - std::vector > works_launchers_; + std::vector > free_launchers_; + std::vector > works_launchers_; DeviceAppsLauncher& interface_; }; diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index cfc3c03a5b..844b08071b 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -38,7 +38,8 @@ #include #include #include -#include "utils/shared_ptr.h" +#include + #include "utils/data_accessor.h" #include "interfaces/MOBILE_API.h" #include "connection_handler/device.h" @@ -948,8 +949,8 @@ class Application : public virtual InitialApplicationData, bool is_greyed_out_; }; -typedef utils::SharedPtr ApplicationSharedPtr; -typedef utils::SharedPtr ApplicationConstSharedPtr; +typedef std::shared_ptr ApplicationSharedPtr; +typedef std::shared_ptr ApplicationConstSharedPtr; typedef uint32_t ApplicationId; } // namespace application_manager diff --git a/src/components/application_manager/include/application_manager/application_impl.h b/src/components/application_manager/include/application_manager/application_impl.h index 46706fad4f..ee0d0cb5ab 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -91,7 +91,7 @@ class ApplicationImpl : public virtual Application, const std::string& mac_address, const connection_handler::DeviceHandle device_id, const custom_str::CustomString& app_name, - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, ApplicationManager& application_manager); DEPRECATED ApplicationImpl( @@ -99,7 +99,7 @@ class ApplicationImpl : public virtual Application, const std::string& policy_app_id, const std::string& mac_address, const custom_str::CustomString& app_name, - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, ApplicationManager& application_manager); ~ApplicationImpl(); diff --git a/src/components/application_manager/include/application_manager/application_manager_impl.h b/src/components/application_manager/include/application_manager/application_manager_impl.h index 399b710286..2b83c2fccd 100644 --- a/src/components/application_manager/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/include/application_manager/application_manager_impl.h @@ -86,7 +86,7 @@ #endif // TELEMETRY_MONITOR #include "utils/macro.h" -#include "utils/shared_ptr.h" + #include "utils/message_queue.h" #include "utils/prioritized_queue.h" #include "utils/threads/thread.h" @@ -118,7 +118,7 @@ typedef std::map DeviceTypes; CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") -typedef utils::SharedPtr TimerSPtr; +typedef std::shared_ptr TimerSPtr; class ApplicationManagerImpl : public ApplicationManager, @@ -186,7 +186,7 @@ class ApplicationManagerImpl mobile_apis::HMILevel::eType to) OVERRIDE; void SendHMIStatusNotification( - const utils::SharedPtr app) OVERRIDE; + const std::shared_ptr app) OVERRIDE; void SendDriverDistractionState(ApplicationSharedPtr application); @@ -321,7 +321,7 @@ class ApplicationManagerImpl void SetTelemetryObserver(AMTelemetryObserver* observer) OVERRIDE; #endif // TELEMETRY_MONITOR - ApplicationSharedPtr RegisterApplication(const utils::SharedPtr< + ApplicationSharedPtr RegisterApplication(const std::shared_ptr< smart_objects::SmartObject>& request_for_registration) OVERRIDE; /* * @brief Closes application by id @@ -475,7 +475,7 @@ class ApplicationManagerImpl * @return new regular HMI state */ HmiStatePtr CreateRegularState( - utils::SharedPtr app, + std::shared_ptr app, mobile_apis::HMILevel::eType hmi_level, mobile_apis::AudioStreamingState::eType audio_state, mobile_apis::VideoStreamingState::eType video_state, @@ -1190,7 +1190,7 @@ class ApplicationManagerImpl uint32_t app_count = NULL == app_array ? 0 : app_array->size(); typename ApplicationList::const_iterator it; for (it = app_list.begin(); it != app_list.end(); ++it) { - if (!it->valid()) { + if (it->use_count() == 0) { LOG4CXX_ERROR(logger_, "Application not found "); continue; } diff --git a/src/components/application_manager/include/application_manager/command_factory.h b/src/components/application_manager/include/application_manager/command_factory.h index ce2706f9a0..b8267ed438 100644 --- a/src/components/application_manager/include/application_manager/command_factory.h +++ b/src/components/application_manager/include/application_manager/command_factory.h @@ -42,7 +42,7 @@ namespace application_manager { using rpc_service::RPCService; using policy::PolicyHandlerInterface; -typedef utils::SharedPtr CommandSharedPtr; +typedef std::shared_ptr CommandSharedPtr; /** * @brief Factory class for command creation diff --git a/src/components/application_manager/include/application_manager/command_holder.h b/src/components/application_manager/include/application_manager/command_holder.h index d3171aedbb..3551a13707 100644 --- a/src/components/application_manager/include/application_manager/command_holder.h +++ b/src/components/application_manager/include/application_manager/command_holder.h @@ -36,7 +36,7 @@ #include #include "application_manager/application.h" #include "smart_objects/smart_object.h" -#include "utils/shared_ptr.h" + namespace application_manager { /** diff --git a/src/components/application_manager/include/application_manager/command_holder_impl.h b/src/components/application_manager/include/application_manager/command_holder_impl.h index c15506ac75..18a1de7526 100644 --- a/src/components/application_manager/include/application_manager/command_holder_impl.h +++ b/src/components/application_manager/include/application_manager/command_holder_impl.h @@ -42,7 +42,7 @@ #include "application_manager/rpc_service.h" #include "smart_objects/smart_object.h" #include "utils/lock.h" -#include "utils/shared_ptr.h" + #include "utils/macro.h" namespace application_manager { @@ -99,7 +99,7 @@ class CommandHolderImpl : public CommandHolder { using AppCommands = std::map > >; + std::vector > >; ApplicationManager& app_manager_; sync_primitives::Lock commands_lock_; diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h index 6524799f45..1bd6441c76 100644 --- a/src/components/application_manager/include/application_manager/commands/command.h +++ b/src/components/application_manager/include/application_manager/commands/command.h @@ -34,7 +34,7 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_COMMAND_H_ #include #include "smart_objects/smart_object.h" -#include "utils/shared_ptr.h" + namespace application_manager { diff --git a/src/components/application_manager/include/application_manager/hmi_state.h b/src/components/application_manager/include/application_manager/hmi_state.h index a22d32920a..e333cb9bbc 100644 --- a/src/components/application_manager/include/application_manager/hmi_state.h +++ b/src/components/application_manager/include/application_manager/hmi_state.h @@ -35,8 +35,8 @@ #include #include +#include #include "interfaces/MOBILE_API.h" -#include "utils/shared_ptr.h" #include "utils/macro.h" namespace application_manager { @@ -45,7 +45,7 @@ class HmiState; class ApplicationManager; class Application; -typedef utils::SharedPtr HmiStatePtr; +typedef std::shared_ptr HmiStatePtr; /** * @brief The HmiState class @@ -81,7 +81,7 @@ class HmiState { * @param app Application pointer * @param app_mngr Application manager */ - HmiState(utils::SharedPtr app, + HmiState(std::shared_ptr app, const ApplicationManager& app_mngr); /** @@ -90,7 +90,7 @@ class HmiState { * @param app_mngr Application manager * @param state_id HMI state to assign */ - HmiState(utils::SharedPtr app, + HmiState(std::shared_ptr app, const ApplicationManager& app_mngr, StateID state_id); @@ -226,7 +226,7 @@ class HmiState { } protected: - utils::SharedPtr app_; + std::shared_ptr app_; StateID state_id_; const ApplicationManager& app_mngr_; HmiStatePtr parent_; @@ -272,7 +272,7 @@ class VRHmiState : public HmiState { public: virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE; - VRHmiState(utils::SharedPtr app, + VRHmiState(std::shared_ptr app, const ApplicationManager& app_mngr); DEPRECATED VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr); @@ -283,7 +283,7 @@ class VRHmiState : public HmiState { */ class TTSHmiState : public HmiState { public: - TTSHmiState(utils::SharedPtr app, + TTSHmiState(std::shared_ptr app, const ApplicationManager& app_mngr); DEPRECATED TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr); @@ -298,7 +298,7 @@ class TTSHmiState : public HmiState { */ class VideoStreamingHmiState : public HmiState { public: - VideoStreamingHmiState(utils::SharedPtr app, + VideoStreamingHmiState(std::shared_ptr app, const ApplicationManager& app_mngr); mobile_apis::VideoStreamingState::eType video_streaming_state() @@ -311,7 +311,7 @@ class VideoStreamingHmiState : public HmiState { */ class NaviStreamingHmiState : public VideoStreamingHmiState { public: - NaviStreamingHmiState(utils::SharedPtr app, + NaviStreamingHmiState(std::shared_ptr app, const ApplicationManager& app_mngr); mobile_apis::AudioStreamingState::eType audio_streaming_state() @@ -324,7 +324,7 @@ class NaviStreamingHmiState : public VideoStreamingHmiState { */ class PhoneCallHmiState : public HmiState { public: - PhoneCallHmiState(utils::SharedPtr app, + PhoneCallHmiState(std::shared_ptr app, const ApplicationManager& app_mngr); DEPRECATED PhoneCallHmiState(uint32_t app_id, @@ -343,7 +343,7 @@ class PhoneCallHmiState : public HmiState { */ class SafetyModeHmiState : public HmiState { public: - SafetyModeHmiState(utils::SharedPtr app, + SafetyModeHmiState(std::shared_ptr app, const ApplicationManager& app_mngr); DEPRECATED SafetyModeHmiState(uint32_t app_id, @@ -365,7 +365,7 @@ class SafetyModeHmiState : public HmiState { */ class DeactivateHMI : public HmiState { public: - DeactivateHMI(utils::SharedPtr app, + DeactivateHMI(std::shared_ptr app, const ApplicationManager& app_mngr); DEPRECATED DeactivateHMI(uint32_t app_id, const ApplicationManager& app_mngr); @@ -387,7 +387,7 @@ class DeactivateHMI : public HmiState { */ class AudioSource : public HmiState { public: - AudioSource(utils::SharedPtr app, + AudioSource(std::shared_ptr app, const ApplicationManager& app_mngr); DEPRECATED AudioSource(uint32_t app_id, const ApplicationManager& app_mngr); @@ -410,7 +410,7 @@ class AudioSource : public HmiState { */ class EmbeddedNavi : public HmiState { public: - EmbeddedNavi(utils::SharedPtr app, + EmbeddedNavi(std::shared_ptr app, const ApplicationManager& app_mngr); DEPRECATED EmbeddedNavi(uint32_t app_id, const ApplicationManager& app_mngr); diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h index 7ca3e59f09..908305015b 100644 --- a/src/components/application_manager/include/application_manager/message.h +++ b/src/components/application_manager/include/application_manager/message.h @@ -36,7 +36,7 @@ #include #include -#include "utils/shared_ptr.h" + #include "protocol/message_priority.h" #include "protocol/rpc_type.h" #include "protocol/common.h" @@ -126,8 +126,8 @@ class Message { protocol_handler::MajorProtocolVersion version_; }; -typedef utils::SharedPtr MobileMessage; -typedef utils::SharedPtr MessagePtr; +typedef std::shared_ptr MobileMessage; +typedef std::shared_ptr MessagePtr; } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_MESSAGE_H_ diff --git a/src/components/application_manager/include/application_manager/mobile_message_handler.h b/src/components/application_manager/include/application_manager/mobile_message_handler.h index ad660d0b66..b2ad963f46 100644 --- a/src/components/application_manager/include/application_manager/mobile_message_handler.h +++ b/src/components/application_manager/include/application_manager/mobile_message_handler.h @@ -38,7 +38,7 @@ #include "application_manager/message.h" namespace application_manager { -typedef utils::SharedPtr MobileMessage; +typedef std::shared_ptr MobileMessage; class MobileMessageHandler { public: static application_manager::Message* HandleIncomingMessageProtocol( diff --git a/src/components/application_manager/include/application_manager/policies/policy_handler.h b/src/components/application_manager/include/application_manager/policies/policy_handler.h index 8d019784fc..14e2841eb5 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_handler.h +++ b/src/components/application_manager/include/application_manager/policies/policy_handler.h @@ -206,7 +206,7 @@ class PolicyHandler : public PolicyHandlerInterface, void add_listener(PolicyHandlerObserver* listener) OVERRIDE; void remove_listener(PolicyHandlerObserver* listener) OVERRIDE; - utils::SharedPtr GetStatisticManager() + std::shared_ptr GetStatisticManager() const OVERRIDE; /** @@ -552,7 +552,7 @@ class PolicyHandler : public PolicyHandlerInterface, int32_t timespan_seconds) OVERRIDE; #ifdef BUILD_TESTS - void SetPolicyManager(utils::SharedPtr pm) { + void SetPolicyManager(std::shared_ptr pm) { policy_manager_ = pm; } #endif // BUILD_TESTS @@ -732,9 +732,9 @@ class PolicyHandler : public PolicyHandlerInterface, private: mutable sync_primitives::RWLock policy_manager_lock_; - utils::SharedPtr policy_manager_; + std::shared_ptr policy_manager_; void* dl_handle_; - utils::SharedPtr event_observer_; + std::shared_ptr event_observer_; uint32_t last_activated_app_id_; /** @@ -758,7 +758,7 @@ class PolicyHandler : public PolicyHandlerInterface, // Lock for app to device list sync_primitives::Lock app_to_device_link_lock_; - utils::SharedPtr statistic_manager_impl_; + std::shared_ptr statistic_manager_impl_; const PolicySettings& settings_; application_manager::ApplicationManager& application_manager_; friend class AppPermissionDelegate; diff --git a/src/components/application_manager/include/application_manager/request_controller.h b/src/components/application_manager/include/application_manager/request_controller.h index c0bae1aac8..ea8d95a92a 100644 --- a/src/components/application_manager/include/application_manager/request_controller.h +++ b/src/components/application_manager/include/application_manager/request_controller.h @@ -38,7 +38,7 @@ #include #include "utils/lock.h" -#include "utils/shared_ptr.h" + #include "utils/threads/thread.h" #include "utils/conditional_variable.h" #include "utils/threads/thread_delegate.h" diff --git a/src/components/application_manager/include/application_manager/request_info.h b/src/components/application_manager/include/application_manager/request_info.h index 95585279ca..db6409bbde 100644 --- a/src/components/application_manager/include/application_manager/request_info.h +++ b/src/components/application_manager/include/application_manager/request_info.h @@ -52,7 +52,7 @@ namespace request_controller { * @brief Typedef for active mobile request * */ -typedef utils::SharedPtr RequestPtr; +typedef std::shared_ptr RequestPtr; struct RequestInfo { enum RequestType { RequestNone, MobileRequest, HMIRequest }; @@ -136,7 +136,7 @@ struct RequestInfo { uint32_t correlation_id_; }; -typedef utils::SharedPtr RequestInfoPtr; +typedef std::shared_ptr RequestInfoPtr; struct MobileRequestInfo : public RequestInfo { MobileRequestInfo(RequestPtr request, const uint64_t timeout_msec); @@ -276,7 +276,7 @@ struct TimeScale { : start_(start), end_(end), app_id_(app_id) {} bool operator()(RequestInfoPtr setEntry) { - if (!setEntry.valid()) { + if (setEntry.use_count() == 0) { return false; } diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h index 6d26b6a617..90c6c5c208 100644 --- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h +++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl.h @@ -34,14 +34,14 @@ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_RESUMPTION_RESUME_CTRL_H_ #include -#include "utils/shared_ptr.h" + #include "application_manager/resumption/resumption_data.h" namespace application_manager { class ApplicationManager; class Application; -typedef utils::SharedPtr ApplicationSharedPtr; -typedef utils::SharedPtr ApplicationConstSharedPtr; +typedef std::shared_ptr ApplicationSharedPtr; +typedef std::shared_ptr ApplicationConstSharedPtr; } namespace app_mngr = application_manager; @@ -270,7 +270,7 @@ class ResumeCtrl { #ifdef BUILD_TESTS virtual void set_resumption_storage( - utils::SharedPtr mock_storage) = 0; + std::shared_ptr mock_storage) = 0; virtual bool get_resumption_active() const = 0; #endif // BUILD_TESTS diff --git a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h index 9e084af66b..17aabb6d60 100644 --- a/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h +++ b/src/components/application_manager/include/application_manager/resumption/resume_ctrl_impl.h @@ -304,7 +304,7 @@ class ResumeCtrlImpl : public ResumeCtrl, #ifdef BUILD_TESTS void set_resumption_storage( - utils::SharedPtr mock_storage) OVERRIDE; + std::shared_ptr mock_storage) OVERRIDE; bool get_resumption_active() const OVERRIDE; #endif // BUILD_TESTS @@ -535,7 +535,7 @@ class ResumeCtrlImpl : public ResumeCtrl, bool is_data_saved_; bool is_suspended_; time_t launch_time_; - utils::SharedPtr resumption_storage_; + std::shared_ptr resumption_storage_; application_manager::ApplicationManager& application_manager_; }; diff --git a/src/components/application_manager/include/application_manager/rpc_handler_impl.h b/src/components/application_manager/include/application_manager/rpc_handler_impl.h index 5e891608c6..515e289400 100644 --- a/src/components/application_manager/include/application_manager/rpc_handler_impl.h +++ b/src/components/application_manager/include/application_manager/rpc_handler_impl.h @@ -57,26 +57,26 @@ #include "interfaces/v4_protocol_v1_2_no_extra_schema.h" #include "utils/threads/message_loop_thread.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + namespace application_manager { namespace rpc_handler { namespace impl { -struct MessageFromMobile : public utils::SharedPtr { +struct MessageFromMobile : public std::shared_ptr { MessageFromMobile() {} - explicit MessageFromMobile(const utils::SharedPtr& message) - : utils::SharedPtr(message) {} + explicit MessageFromMobile(const std::shared_ptr& message) + : std::shared_ptr(message) {} // PrioritizedQueue requires this method to decide which priority to assign size_t PriorityOrder() const { return (*this)->Priority().OrderingValue(); } }; -struct MessageFromHmi : public utils::SharedPtr { +struct MessageFromHmi : public std::shared_ptr { MessageFromHmi() {} - explicit MessageFromHmi(const utils::SharedPtr& message) - : utils::SharedPtr(message) {} + explicit MessageFromHmi(const std::shared_ptr& message) + : std::shared_ptr(message) {} // PrioritizedQueue requires this method to decide which priority to assign size_t PriorityOrder() const { return (*this)->Priority().OrderingValue(); @@ -145,11 +145,11 @@ class RPCHandlerImpl : public RPCHandler, #endif // TELEMETRY_MONITOR private: - void ProcessMessageFromMobile(const utils::SharedPtr message); - void ProcessMessageFromHMI(const utils::SharedPtr message); + void ProcessMessageFromMobile(const std::shared_ptr message); + void ProcessMessageFromHMI(const std::shared_ptr message); bool ConvertMessageToSO(const Message& message, smart_objects::SmartObject& output); - utils::SharedPtr ConvertRawMsgToMessage( + std::shared_ptr ConvertRawMsgToMessage( const ::protocol_handler::RawMessagePtr message); hmi_apis::HMI_API& hmi_so_factory(); mobile_apis::MOBILE_API& mobile_so_factory(); diff --git a/src/components/application_manager/include/application_manager/rpc_service_impl.h b/src/components/application_manager/include/application_manager/rpc_service_impl.h index 6f39e11592..1eaeb46255 100644 --- a/src/components/application_manager/include/application_manager/rpc_service_impl.h +++ b/src/components/application_manager/include/application_manager/rpc_service_impl.h @@ -58,11 +58,11 @@ namespace rpc_service { namespace impl { -struct MessageToMobile : public utils::SharedPtr { +struct MessageToMobile : public std::shared_ptr { MessageToMobile() : is_final(false) {} - explicit MessageToMobile(const utils::SharedPtr& message, + explicit MessageToMobile(const std::shared_ptr& message, bool final_message) - : utils::SharedPtr(message), is_final(final_message) {} + : std::shared_ptr(message), is_final(final_message) {} // PrioritizedQueue requires this method to decide which priority to assign size_t PriorityOrder() const { return (*this)->Priority().OrderingValue(); @@ -71,10 +71,10 @@ struct MessageToMobile : public utils::SharedPtr { bool is_final; }; -struct MessageToHmi : public utils::SharedPtr { +struct MessageToHmi : public std::shared_ptr { MessageToHmi() {} - explicit MessageToHmi(const utils::SharedPtr& message) - : utils::SharedPtr(message) {} + explicit MessageToHmi(const std::shared_ptr& message) + : std::shared_ptr(message) {} // PrioritizedQueue requires this method to decide which priority to assign size_t PriorityOrder() const { return (*this)->Priority().OrderingValue(); diff --git a/src/components/application_manager/include/application_manager/state_controller_impl.h b/src/components/application_manager/include/application_manager/state_controller_impl.h index 58747fdd6e..99113d6d00 100644 --- a/src/components/application_manager/include/application_manager/state_controller_impl.h +++ b/src/components/application_manager/include/application_manager/state_controller_impl.h @@ -420,7 +420,7 @@ class StateControllerImpl : public event_engine::EventObserver, * @param state_id state id * @return */ - HmiStatePtr CreateHmiState(utils::SharedPtr app, + HmiStatePtr CreateHmiState(std::shared_ptr app, HmiState::StateID state_id) const; /** diff --git a/src/components/application_manager/include/application_manager/telemetry_observer.h b/src/components/application_manager/include/application_manager/telemetry_observer.h index 20b3aaca5a..62169e8185 100644 --- a/src/components/application_manager/include/application_manager/telemetry_observer.h +++ b/src/components/application_manager/include/application_manager/telemetry_observer.h @@ -36,7 +36,7 @@ #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "json/json.h" -#include "utils/shared_ptr.h" + #include "utils/date_time.h" namespace application_manager { @@ -46,9 +46,9 @@ class AMTelemetryObserver { struct MessageMetric { TimevalStruct begin; TimevalStruct end; - utils::SharedPtr message; + std::shared_ptr message; }; - typedef utils::SharedPtr MessageMetricSharedPtr; + typedef std::shared_ptr MessageMetricSharedPtr; virtual void OnMessage(MessageMetricSharedPtr) = 0; virtual ~AMTelemetryObserver() {} diff --git a/src/components/application_manager/include/application_manager/usage_statistics.h b/src/components/application_manager/include/application_manager/usage_statistics.h index aa07e41cad..6d0b5cd6bd 100644 --- a/src/components/application_manager/include/application_manager/usage_statistics.h +++ b/src/components/application_manager/include/application_manager/usage_statistics.h @@ -38,7 +38,7 @@ #include "policy/usage_statistics/counter.h" #include "policy/usage_statistics/app_stopwatch.h" #include "utils/macro.h" -#include "utils/shared_ptr.h" + #include "interfaces/MOBILE_API.h" namespace application_manager { @@ -47,10 +47,10 @@ class UsageStatistics { public: UsageStatistics( const std::string& app_id, - utils::SharedPtr statistics_manager); + std::shared_ptr statistics_manager); UsageStatistics( const std::string& app_id, - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, usage_statistics::AppStopwatch* time_in_hmi_state_ptr); void RecordHmiStateChanged(mobile_apis::HMILevel::eType new_hmi_level); void RecordAppRegistrationGuiLanguage( diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h index 05994492c2..72f29c7de1 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/rc_app_extension.h @@ -35,6 +35,8 @@ #include #include +#include +#include "utils/macro.h" #include "application_manager/app_extension.h" namespace rc_rpc_plugin { @@ -78,7 +80,7 @@ class RCAppExtension : public application_manager::AppExtension { resumption_data) OVERRIDE; }; -typedef utils::SharedPtr RCAppExtensionPtr; +typedef std::shared_ptr RCAppExtensionPtr; } // namespace rc_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h index 20bd438494..91d1b09fca 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/include/rc_rpc_plugin/resource_allocation_manager.h @@ -34,7 +34,7 @@ #define SRC_COMPONENTS_REMOTE_CONTROL_INCLUDE_REMOTE_CONTROL_RESOURCE_ALLOCATION_H #include #include "utils/macro.h" -#include "utils/shared_ptr.h" + #include "interfaces/HMI_API.h" #include "application_manager/plugin_manager/rpc_plugin.h" #include "rc_rpc_plugin/rc_app_extension.h" 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 ca96b1cf97..7bc72faced 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 @@ -105,7 +105,7 @@ void RCOnRemoteControlSettingsNotification::DisallowRCFunctionality() { app->app_id(), mobile_apis::HMILevel::eType::HMI_NONE); const RCAppExtensionPtr extension = - application_manager::AppExtensionPtr::static_pointer_cast< + std::static_pointer_cast< RCAppExtension>(app->QueryInterface(RCRPCPlugin::kRCPluginID)); if (extension) { UnsubscribeFromInteriorVehicleDataForAllModules(extension); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc index dfe2feb622..8238e9a943 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc @@ -71,7 +71,7 @@ void OnInteriorVehicleDataNotification::Run() { application_manager::Application& app = **it; RCAppExtensionPtr extension = - application_manager::AppExtensionPtr::static_pointer_cast< + std::static_pointer_cast< RCAppExtension>(app.QueryInterface(RCRPCPlugin::kRCPluginID)); DCHECK(extension); LOG4CXX_TRACE(logger_, diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc index 4378f1ea48..a562e45b1d 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc @@ -35,6 +35,7 @@ #include "rc_rpc_plugin/rc_app_extension.h" #include "rc_rpc_plugin/resource_allocation_manager_impl.h" #include "utils/helpers.h" +#include namespace rc_rpc_plugin { namespace plugins = application_manager::plugin_manager; @@ -90,7 +91,7 @@ void RCRPCPlugin::OnApplicationEvent( } switch (event) { case plugins::kApplicationRegistered: { - application->AddExtension(new RCAppExtension(kRCPluginID)); + application->AddExtension(std::shared_ptr(new RCAppExtension(kRCPluginID))); resource_allocation_manager_->SendOnRCStatusNotifications( NotificationTrigger::APP_REGISTRATION, application); break; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc index 450bf79fe7..01c2e3a7c6 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc @@ -41,7 +41,7 @@ #include "rc_rpc_plugin/rc_module_constants.h" #include "json/json.h" #include "utils/helpers.h" -#include "utils/make_shared.h" + namespace rc_rpc_plugin { @@ -178,7 +178,7 @@ void ResourceAllocationManagerImpl::ProcessApplicationPolicyUpdate() { if (!disallowed_modules.empty()) { SendOnRCStatusNotifications( NotificationTrigger::MODULE_ALLOCATION, - utils::SharedPtr()); + std::shared_ptr()); } } } @@ -198,7 +198,7 @@ RCAppExtensionPtr ResourceAllocationManagerImpl::GetApplicationExtention( } rc_app_extension = - application_manager::AppExtensionPtr::static_pointer_cast( + std::static_pointer_cast( app_extension); return rc_app_extension; @@ -307,7 +307,7 @@ void ResourceAllocationManagerImpl::SetResourceAquired( allocated_resources_[module_type] = app_id; SendOnRCStatusNotifications( NotificationTrigger::MODULE_ALLOCATION, - utils::SharedPtr()); + std::shared_ptr()); } void ResourceAllocationManagerImpl::SendOnRCStatusNotifications( @@ -343,7 +343,7 @@ void ResourceAllocationManagerImpl::set_rc_enabled(const bool value) { is_rc_enabled_ = value; SendOnRCStatusNotifications( NotificationTrigger::RC_STATE_CHANGING, - utils::SharedPtr()); + std::shared_ptr()); } void ResourceAllocationManagerImpl::SetResourceFree( @@ -511,7 +511,7 @@ void ResourceAllocationManagerImpl::OnApplicationEvent( if (!acquired_modules.empty()) { SendOnRCStatusNotifications( NotificationTrigger::MODULE_ALLOCATION, - utils::SharedPtr()); + std::shared_ptr()); } Apps app_list; app_list.push_back(application); 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 7ab4819002..329f4de5a6 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 @@ -41,8 +41,8 @@ #include "application_manager/mock_application_manager.h" #include "application_manager/commands/command_request_test.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" @@ -78,9 +78,9 @@ class ButtonPressRequestTest public: ButtonPressRequestTest() : rc_capabilities_(smart_objects::SmartType_Map) - , mock_app_(utils::MakeShared >()) + , mock_app_(std::make_shared >()) , rc_app_extention_( - utils::MakeShared(kModuleId)) {} + std::make_shared(kModuleId)) {} smart_objects::SmartObject ButtonCapability( const mobile_apis::ButtonName::eType button_name) { @@ -147,10 +147,10 @@ class ButtonPressRequestTest } template - application_manager::SharedPtr CreateRCCommand( + std::shared_ptr CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared(msg ? msg : msg = CreateMessage(), + return std::make_shared(msg ? msg : msg = CreateMessage(), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -160,8 +160,8 @@ class ButtonPressRequestTest protected: smart_objects::SmartObject rc_capabilities_; - utils::SharedPtr mock_app_; - utils::SharedPtr rc_app_extention_; + std::shared_ptr mock_app_; + std::shared_ptr rc_app_extention_; test::components::policy_test::MockPolicyHandlerInterface mock_policy_handler_; testing::NiceMock @@ -195,7 +195,7 @@ TEST_F(ButtonPressRequestTest, .WillOnce(Return(true)); // Act - application_manager::SharedPtr + std::shared_ptr command = CreateRCCommand( mobile_message); ASSERT_TRUE(command->Init()); @@ -234,7 +234,7 @@ TEST_F( .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true))); // Act - application_manager::SharedPtr + std::shared_ptr command = CreateRCCommand( mobile_message); ASSERT_TRUE(command->Init()); @@ -273,7 +273,7 @@ TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) { application_manager::event_engine::Event event( hmi_apis::FunctionID::Buttons_ButtonPress); event.set_smart_object(*hmi_message); - application_manager::SharedPtr + std::shared_ptr command = CreateRCCommand( mobile_message); command->on_event(event); @@ -312,7 +312,7 @@ TEST_F(ButtonPressRequestTest, application_manager::event_engine::Event event( hmi_apis::FunctionID::Buttons_ButtonPress); event.set_smart_object(*hmi_message); - application_manager::SharedPtr + std::shared_ptr command = CreateRCCommand( mobile_message); command->on_event(event); 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 685bc1fd42..8f69b29275 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 @@ -40,8 +40,8 @@ #include "application_manager/event_engine/event_dispatcher.h" #include "application_manager/commands/command_request_test.h" #include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + using ::testing::_; using ::testing::Mock; @@ -76,8 +76,8 @@ class GetInteriorVehicleDataRequestTest : public CommandRequestTest { public: GetInteriorVehicleDataRequestTest() - : mock_app_(utils::MakeShared >()) - , rc_app_extention_(utils::MakeShared(kModuleId)) { + : mock_app_(std::make_shared >()) + , rc_app_extention_(std::make_shared(kModuleId)) { ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId)); ON_CALL(app_mngr_, hmi_interfaces()) .WillByDefault(ReturnRef(mock_hmi_interfaces_)); @@ -116,10 +116,10 @@ class GetInteriorVehicleDataRequestTest return message; } template - application_manager::SharedPtr CreateRCCommand( + std::shared_ptr CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared(msg ? msg : msg = CreateMessage(), + return std::make_shared(msg ? msg : msg = CreateMessage(), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -129,8 +129,8 @@ class GetInteriorVehicleDataRequestTest protected: smart_objects::SmartObject rc_capabilities_; - utils::SharedPtr mock_app_; - utils::SharedPtr rc_app_extention_; + std::shared_ptr mock_app_; + std::shared_ptr rc_app_extention_; testing::NiceMock mock_allocation_manager_; }; @@ -145,7 +145,7 @@ TEST_F(GetInteriorVehicleDataRequestTest, hmi_apis::FunctionID::RC_GetInteriorVehicleData))) .WillOnce(Return(true)); MessageSharedPtr mobile_message = CreateBasicMessage(); - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = CreateRCCommand( mobile_message); @@ -170,7 +170,7 @@ TEST_F( ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::UNSUPPORTED_RESOURCE), _)) .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true))); - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = CreateRCCommand( mobile_message); @@ -201,7 +201,7 @@ TEST_F(GetInteriorVehicleDataRequestTest, application_manager::event_engine::Event event( hmi_apis::FunctionID::RC_GetInteriorVehicleData); event.set_smart_object(*hmi_message); - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = CreateRCCommand( mobile_message); @@ -231,7 +231,7 @@ TEST_F(GetInteriorVehicleDataRequestTest, application_manager::event_engine::Event event( hmi_apis::FunctionID::RC_GetInteriorVehicleData); event.set_smart_object(*hmi_message); - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::GetInteriorVehicleDataRequest> command = CreateRCCommand( mobile_message); 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 78d20c6b13..690586d0e1 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 @@ -66,7 +66,7 @@ class OnInteriorVehicleDataNotificationTest : public CommandsTest { public: OnInteriorVehicleDataNotificationTest() - : mock_app_(utils::MakeShared >()) {} + : mock_app_(std::make_shared >()) {} MessageSharedPtr CreateBasicMessage() { MessageSharedPtr message = CreateMessage(); @@ -85,10 +85,10 @@ class OnInteriorVehicleDataNotificationTest } template - application_manager::SharedPtr CreateRCCommand( + std::shared_ptr CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared(msg ? msg : msg = CreateMessage(), + return std::make_shared(msg ? msg : msg = CreateMessage(), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -97,7 +97,7 @@ class OnInteriorVehicleDataNotificationTest } protected: - utils::SharedPtr mock_app_; + std::shared_ptr mock_app_; testing::NiceMock mock_allocation_manager_; }; @@ -115,7 +115,7 @@ TEST_F(OnInteriorVehicleDataNotificationTest, EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); RCAppExtensionPtr rc_extention_ptr = - utils::MakeShared(application_manager::AppExtensionUID( + std::make_shared(application_manager::AppExtensionUID( rc_rpc_plugin::RCRPCPlugin::kRCPluginID)); rc_extention_ptr->SubscribeToInteriorVehicleData(enums_value::kClimate); ON_CALL(*mock_app_, QueryInterface(_)) @@ -126,14 +126,14 @@ TEST_F(OnInteriorVehicleDataNotificationTest, EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false)) .WillOnce(SaveArg<0>(&message)); // Act - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::OnInteriorVehicleDataNotification> command = CreateRCCommand< rc_rpc_plugin::commands::OnInteriorVehicleDataNotification>( mobile_message); command->Run(); // Assertions - ASSERT_TRUE(message); + ASSERT_TRUE((bool)message); Mock::VerifyAndClearExpectations(&app_mngr_); } 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 f3ac768a4e..907292f150 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 @@ -67,7 +67,7 @@ class RCOnRemoteControlSettingsNotificationTest : public CommandsTest { public: RCOnRemoteControlSettingsNotificationTest() - : mock_app_(utils::MakeShared >()) {} + : mock_app_(std::make_shared >()) {} MessageSharedPtr CreateBasicMessage() { MessageSharedPtr message = CreateMessage(); (*message)[application_manager::strings::params] @@ -85,10 +85,10 @@ class RCOnRemoteControlSettingsNotificationTest } template - application_manager::SharedPtr CreateRCCommand( + std::shared_ptr CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared(msg ? msg : msg = CreateMessage(), + return std::make_shared(msg ? msg : msg = CreateMessage(), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -97,7 +97,7 @@ class RCOnRemoteControlSettingsNotificationTest } protected: - utils::SharedPtr mock_app_; + std::shared_ptr mock_app_; testing::NiceMock mock_allocation_manager_; }; @@ -116,7 +116,7 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest, EXPECT_CALL(mock_allocation_manager_, SetAccessMode(hmi_apis::Common_RCAccessMode::ASK_DRIVER)); // Act - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command = CreateRCCommand< rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>( @@ -141,7 +141,7 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest, EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); RCAppExtensionPtr rc_extention_ptr = - utils::MakeShared(application_manager::AppExtensionUID( + std::make_shared(application_manager::AppExtensionUID( rc_rpc_plugin::RCRPCPlugin::kRCPluginID)); rc_extention_ptr->SubscribeToInteriorVehicleData(enums_value::kClimate); ON_CALL(*mock_app_, QueryInterface(_)) @@ -150,7 +150,7 @@ TEST_F(RCOnRemoteControlSettingsNotificationTest, EXPECT_CALL(mock_allocation_manager_, ResetAllAllocations()); // Act - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification> command = CreateRCCommand< rc_rpc_plugin::commands::RCOnRemoteControlSettingsNotification>( 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 c5a8e54c6d..a1fff199ee 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 @@ -53,7 +53,7 @@ #include "interfaces/MOBILE_API.h" #include "include/test/protocol_handler/mock_protocol_handler.h" #include "test/application_manager/mock_application_manager_settings.h" -#include "utils/make_shared.h" + using ::testing::_; using ::testing::Return; @@ -62,7 +62,7 @@ using ::testing::NiceMock; using ::testing::SaveArg; using ::testing::Mock; using ::testing::NiceMock; -using ::utils::SharedPtr; + namespace am = ::application_manager; using am::ApplicationSet; using am::commands::MessageSharedPtr; @@ -99,7 +99,7 @@ class RCGetInteriorVehicleDataConsentTest : public CommandRequestTest { public: RCGetInteriorVehicleDataConsentTest() - : mock_app_(utils::MakeShared >()) + : mock_app_(std::make_shared >()) , command_holder(app_mngr_) , request_controller(mock_request_controler) , rpc_service(app_mngr_, @@ -107,9 +107,9 @@ class RCGetInteriorVehicleDataConsentTest &mock_protocol_handler, &mock_hmi_handler, command_holder) - , rc_app_extention_(utils::MakeShared(kPluginID)) + , rc_app_extention_(std::make_shared(kPluginID)) , mock_rpc_plugin_manager( - utils::MakeShared >()) + std::make_shared >()) , rpc_plugin(mock_rpc_plugin) , optional_mock_rpc_plugin(mock_rpc_plugin) { ON_CALL(*mock_app_, app_id()).WillByDefault(Return(kAppId)); @@ -146,10 +146,10 @@ class RCGetInteriorVehicleDataConsentTest } template - application_manager::SharedPtr CreateRCCommand( + std::shared_ptr CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared(msg ? msg : msg = CreateMessage(), + return std::make_shared(msg ? msg : msg = CreateMessage(), app_mngr_, rpc_service, mock_hmi_capabilities_, @@ -170,7 +170,7 @@ class RCGetInteriorVehicleDataConsentTest } protected: - utils::SharedPtr mock_app_; + std::shared_ptr mock_app_; MockRequestControlerSettings mock_request_controler; MockProtocolHandler mock_protocol_handler; MockHMIMessageHandler mock_hmi_handler; @@ -182,8 +182,8 @@ class RCGetInteriorVehicleDataConsentTest MockCommandFactory mock_command_factory; am::request_controller::RequestController request_controller; am::rpc_service::RPCServiceImpl rpc_service; - utils::SharedPtr rc_app_extention_; - utils::SharedPtr + std::shared_ptr rc_app_extention_; + std::shared_ptr mock_rpc_plugin_manager; utils::Optional rpc_plugin; utils::Optional optional_mock_rpc_plugin; 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 1d5e63e2df..fdee55a30c 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 @@ -64,8 +64,8 @@ class SetInteriorVehicleDataRequestTest : public CommandRequestTest { public: SetInteriorVehicleDataRequestTest() - : mock_app_(utils::MakeShared >()) - , rc_app_extention_(utils::MakeShared(kModuleId)) {} + : mock_app_(std::make_shared >()) + , rc_app_extention_(std::make_shared(kModuleId)) {} void SetUp() OVERRIDE { ON_CALL(app_mngr_, hmi_interfaces()) @@ -106,10 +106,10 @@ class SetInteriorVehicleDataRequestTest } template - application_manager::SharedPtr CreateRCCommand( + std::shared_ptr CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared(msg ? msg : msg = CreateMessage(), + return std::make_shared(msg ? msg : msg = CreateMessage(), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -120,8 +120,8 @@ class SetInteriorVehicleDataRequestTest protected: testing::NiceMock mock_allocation_manager_; - utils::SharedPtr mock_app_; - utils::SharedPtr rc_app_extention_; + std::shared_ptr mock_app_; + std::shared_ptr rc_app_extention_; }; TEST_F(SetInteriorVehicleDataRequestTest, @@ -147,7 +147,7 @@ TEST_F(SetInteriorVehicleDataRequestTest, mobile_apis::Result::READ_ONLY), application_manager::commands::Command::SOURCE_SDL)); // Act - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command = CreateRCCommand( mobile_message); @@ -186,7 +186,7 @@ TEST_F( application_manager::commands::Command::SOURCE_SDL)); // Act - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command = CreateRCCommand( mobile_message); @@ -217,7 +217,7 @@ TEST_F( application_manager::commands::Command::SOURCE_SDL)); // Act - application_manager::SharedPtr< + std::shared_ptr< rc_rpc_plugin::commands::SetInteriorVehicleDataRequest> command = CreateRCCommand( mobile_message); diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc index 28142f0b4e..3842814f84 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc @@ -39,8 +39,8 @@ #include "application_manager/mock_application_manager.h" #include "application_manager/mock_rpc_service.h" #include "application_manager/policies/mock_policy_handler_interface.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" @@ -83,16 +83,16 @@ using namespace rc_rpc_plugin; class RAManagerTest : public ::testing::Test { public: RAManagerTest() - : message_(utils::MakeShared(MessagePriority::FromServiceType( + : message_(std::make_shared(MessagePriority::FromServiceType( protocol_handler::ServiceType::kRpc))) - , mock_app_1_(utils::MakeShared >()) - , mock_app_2_(utils::MakeShared >()) + , mock_app_1_(std::make_shared >()) + , mock_app_2_(std::make_shared >()) , apps_lock_ptr_(std::make_shared()) , apps_da_(apps_, apps_lock_ptr_) { ON_CALL(mock_app_mngr_, GetPolicyHandler()) .WillByDefault(ReturnRef(mock_policy_handler_)); auto plugin_id = rc_rpc_plugin::RCRPCPlugin::kRCPluginID; - app_ext_ptr_ = utils::MakeShared(plugin_id); + app_ext_ptr_ = std::make_shared(plugin_id); ON_CALL(*mock_app_1_, app_id()).WillByDefault(Return(kAppId1)); OnRCStatusNotificationExpectations(); @@ -114,8 +114,8 @@ class RAManagerTest : public ::testing::Test { application_manager::MessagePtr message_; application_manager::AppExtensionPtr app_ext_ptr_; - utils::SharedPtr > mock_app_1_; - utils::SharedPtr > mock_app_2_; + std::shared_ptr > mock_app_1_; + std::shared_ptr > mock_app_2_; application_manager::ApplicationSet apps_; std::shared_ptr apps_lock_ptr_; DataAccessor apps_da_; @@ -301,7 +301,7 @@ TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) { .WillRepeatedly(Return(mock_app_2_)); RCAppExtensionPtr rc_extention_ptr = - utils::MakeShared(application_manager::AppExtensionUID( + std::make_shared(application_manager::AppExtensionUID( rc_rpc_plugin::RCRPCPlugin::kRCPluginID)); EXPECT_CALL(*mock_app_2_, QueryInterface(_)) @@ -327,7 +327,7 @@ TEST_F(RAManagerTest, AppUnregistered_ReleaseResource) { ra_manager.SetAccessMode(hmi_apis::Common_RCAccessMode::eType::AUTO_DENY); RCAppExtensionPtr rc_extention_ptr = - utils::MakeShared(application_manager::AppExtensionUID( + std::make_shared(application_manager::AppExtensionUID( rc_rpc_plugin::RCRPCPlugin::kRCPluginID)); EXPECT_EQ(rc_rpc_plugin::AcquireResult::ALLOWED, @@ -361,7 +361,7 @@ TEST_F(RAManagerTest, AnotherAppUnregistered_NoReleaseResource) { .WillRepeatedly(Return(mock_app_2_)); RCAppExtensionPtr rc_extention_ptr = - utils::MakeShared(application_manager::AppExtensionUID( + std::make_shared(application_manager::AppExtensionUID( rc_rpc_plugin::RCRPCPlugin::kRCPluginID)); EXPECT_CALL(*mock_app_2_, QueryInterface(_)) @@ -404,7 +404,7 @@ TEST_F(RAManagerTest, AppsDisallowed_ReleaseAllResources) { EXPECT_CALL(mock_app_mngr_, applications()).WillRepeatedly(Return(apps_da)); RCAppExtensionPtr rc_extention_ptr = - utils::MakeShared(application_manager::AppExtensionUID( + std::make_shared(application_manager::AppExtensionUID( rc_rpc_plugin::RCRPCPlugin::kRCPluginID)); EXPECT_CALL(*mock_app_1_, QueryInterface(RCRPCPlugin::kRCPluginID)) @@ -434,7 +434,7 @@ TEST_F(RAManagerTest, AppGotRevokedModulesWithPTU_ReleaseRevokedResource) { .WillRepeatedly(Return(mock_app_1_)); RCAppExtensionPtr rc_extention_ptr = - utils::MakeShared( + std::make_shared( application_manager::AppExtensionUID( rc_rpc_plugin::RCRPCPlugin::kRCPluginID)); @@ -659,7 +659,7 @@ TEST_F(RAManagerTest, OnRCStatus_ModuleAllocation) { // Act ra_manager.SendOnRCStatusNotifications( NotificationTrigger::MODULE_ALLOCATION, - utils::SharedPtr()); + std::shared_ptr()); auto msg_to_mob_params = (*message_to_mob)[application_manager::strings::msg_params]; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc index 52b95d3fa3..ae375e4087 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/get_urls.cc @@ -188,7 +188,7 @@ void GetUrls::ProcessPolicyServiceURLs(const policy::EndpointUrls& endpoints) { ApplicationSharedPtr app = application_manager_.application(app_id_to_send_to); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "There is no registered application with " "connection key '" 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 839c16ca08..ae8806c4eb 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 @@ -40,7 +40,7 @@ #include #include "policy/policy_types.h" #include "smart_objects/smart_object.h" -#include "utils/make_shared.h" + namespace { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc index 16ca48a2d4..32dd8caefd 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc @@ -37,7 +37,7 @@ #include "application_manager/message_helper.h" #include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" -#include "utils/make_shared.h" + namespace sdl_rpc_plugin { using namespace application_manager; @@ -115,7 +115,7 @@ void OnDriverDistractionNotification::Run() { application_manager_.set_driver_distraction_state(state); smart_objects::SmartObjectSPtr on_driver_distraction = - utils::MakeShared(); + std::make_shared(); if (!on_driver_distraction) { LOG4CXX_ERROR(logger_, "NULL pointer"); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc index 9131bf7392..1ba092a446 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc @@ -109,7 +109,7 @@ void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr message = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete; (*message)[strings::params][strings::message_type] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc index d2a149bf94..681390fbf4 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_application_notification.cc @@ -67,7 +67,7 @@ void OnExitApplicationNotification::Run() { uint32_t app_id = (*message_)[strings::msg_params][strings::app_id].asUInt(); ApplicationSharedPtr app_impl = application_manager_.application(app_id); - if (!(app_impl.valid())) { + if (app_impl.use_count() == 0) { LOG4CXX_ERROR(logger_, "Application does not exist"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc index cfb860a1c7..d795896764 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_request_notification.cc @@ -91,7 +91,7 @@ void OnSystemRequestNotification::Run() { app = application_manager_.application(selected_app_id); } - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "No valid application found to forward OnSystemRequest."); return; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc index 4b3d303089..d538878dc8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/rc_is_ready_request.cc @@ -97,7 +97,7 @@ void RCIsReadyRequest::onTimeOut() { } void RCIsReadyRequest::SendMessageToHMI() { - utils::SharedPtr get_capabilities( + std::shared_ptr get_capabilities( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::RC_GetCapabilities, application_manager_)); rpc_service_.ManageHMICommand(get_capabilities); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc index 32d3cba48a..c7e2c0c4cb 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/tts_is_ready_request.cc @@ -94,18 +94,18 @@ void TTSIsReadyRequest::onTimeOut() { } void TTSIsReadyRequest::SendMessageToHMI() { - utils::SharedPtr get_language( + std::shared_ptr get_language( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage, application_manager_)); HMICapabilities& hmi_capabilities = hmi_capabilities_; hmi_capabilities.set_handle_response_for(*get_language); rpc_service_.ManageHMICommand(get_language); - utils::SharedPtr get_all_languages( + std::shared_ptr get_all_languages( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::TTS_GetSupportedLanguages, application_manager_)); rpc_service_.ManageHMICommand(get_all_languages); - utils::SharedPtr get_capabilities( + std::shared_ptr get_capabilities( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::TTS_GetCapabilities, application_manager_)); rpc_service_.ManageHMICommand(get_capabilities); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc index 3b2c77f16e..2eab211690 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/ui_is_ready_request.cc @@ -93,18 +93,18 @@ void UIIsReadyRequest::onTimeOut() { } void UIIsReadyRequest::SendMessageToHMI() { - utils::SharedPtr get_language( + std::shared_ptr get_language( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage, application_manager_)); HMICapabilities& hmi_capabilities = hmi_capabilities_; hmi_capabilities.set_handle_response_for(*get_language); rpc_service_.ManageHMICommand(get_language); - utils::SharedPtr get_all_languages( + std::shared_ptr get_all_languages( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::UI_GetSupportedLanguages, application_manager_)); rpc_service_.ManageHMICommand(get_all_languages); - utils::SharedPtr get_capabilities( + std::shared_ptr get_capabilities( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::UI_GetCapabilities, application_manager_)); rpc_service_.ManageHMICommand(get_capabilities); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc index dcf7f35e90..22afb03945 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/vr_is_ready_request.cc @@ -93,18 +93,18 @@ void VRIsReadyRequest::onTimeOut() { } void VRIsReadyRequest::SendMessageToHMI() { - utils::SharedPtr get_language( + std::shared_ptr get_language( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, application_manager_)); HMICapabilities& hmi_capabilities = hmi_capabilities_; hmi_capabilities.set_handle_response_for(*get_language); rpc_service_.ManageHMICommand(get_language); - utils::SharedPtr get_all_languages( + std::shared_ptr get_all_languages( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::VR_GetSupportedLanguages, application_manager_)); rpc_service_.ManageHMICommand(get_all_languages); - utils::SharedPtr get_capabilities( + std::shared_ptr get_capabilities( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::VR_GetCapabilities, application_manager_)); rpc_service_.ManageHMICommand(get_capabilities); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc index 1da9fc497f..fc836aae5f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/add_command_request.cc @@ -592,7 +592,7 @@ const std::string AddCommandRequest::GenerateMobileResponseInfo() { void AddCommandRequest::RemoveCommand() { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "No application associated with session key"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc index 0dda8b3277..40debbcd4d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc @@ -149,7 +149,7 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) { } smart_objects::SmartObjectSPtr on_btn_event = - new smart_objects::SmartObject(); + std::make_shared(); if (!on_btn_event) { LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer"); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc index 06ff29134c..faf6ffe38b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc @@ -138,7 +138,7 @@ void OnButtonPressNotification::Run() { } // if "appID" is present, send it to named app only if its FULL or // LIMITED - if (app.valid()) { + if (app.use_count() != 0) { if (app->app_id() == subscribed_app->app_id()) { SendButtonPress(subscribed_app); } @@ -156,7 +156,7 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) { } smart_objects::SmartObjectSPtr on_btn_press = - new smart_objects::SmartObject(); + std::make_shared(); if (!on_btn_press) { LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer"); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc index 9422bec478..6b5838e40a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification.cc @@ -61,7 +61,7 @@ void OnHMIStatusNotification::Run() { (*message_)[strings::params][strings::message_type] = static_cast(application_manager::MessageType::kNotification); ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc index 45caedfc2e..c4ee22afed 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_hmi_status_notification_from_mobile.cc @@ -60,7 +60,7 @@ void OnHMIStatusNotificationFromMobile::Run() { static_cast(application_manager::MessageType::kNotification); ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR( logger_, "OnHMIStatusNotificationFromMobile application doesn't exist"); return; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc index 2065c0b52d..04b52f29e1 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_keyboard_input_notification.cc @@ -82,7 +82,7 @@ void OnKeyBoardInputNotification::Run() { } } - if (app_to_notify.valid()) { + if (app_to_notify.use_count() != 0) { (*message_)[strings::params][strings::connection_key] = app_to_notify->app_id(); SendNotification(); 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 419024f9b0..b78e541f17 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 @@ -68,7 +68,7 @@ void OnSystemRequestNotification::Run() { ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Application with connection key " << connection_key() << " is not registered."); 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 18fe00b54a..92d44d4fe8 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 @@ -301,7 +301,7 @@ void PutFileRequest::Run() { void PutFileRequest::SendOnPutFileNotification() { LOG4CXX_INFO(logger_, "SendOnPutFileNotification"); smart_objects::SmartObjectSPtr notification = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = 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 4706f9742f..78a92d360a 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 @@ -38,7 +38,6 @@ #include #include -#include #include "application_manager/application_manager.h" #include "application_manager/policies/policy_handler_interface.h" #include "application_manager/application_impl.h" @@ -419,7 +418,7 @@ RegisterAppInterfaceRequest::GetLockScreenIconUrlNotification( const uint32_t connection_key, ApplicationSharedPtr app) { DCHECK_OR_RETURN(app.get(), smart_objects::SmartObjectSPtr()); smart_objects::SmartObjectSPtr message = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = mobile_apis::FunctionID::OnSystemRequestID; @@ -838,7 +837,7 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( bool resumption, bool need_restore_vr) { using namespace smart_objects; - SmartObjectSPtr notification = utils::MakeShared(SmartType_Map); + SmartObjectSPtr notification = std::make_shared(SmartType_Map); if (!notification) { LOG4CXX_ERROR(logger_, "Failed to create smart object"); return; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc index 3cb57c90e8..e6332d85c8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_app_icon_request.cc @@ -259,7 +259,7 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { ApplicationSharedPtr app = application_manager_.application(connection_key()); - if (!message_.valid() || !app.valid()) { + if ((message_.use_count() == 0) || (app.use_count() == 0)) { LOG4CXX_ERROR(logger_, "NULL pointer."); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc index 92c72d7f66..b4b4e84f49 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/set_global_properties_request.cc @@ -284,7 +284,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { ui_result_ = static_cast( message[strings::params][hmi_response::code].asInt()); GetInfo(message, ui_response_info_); - if (application.valid()) { + if (application.use_count() != 0) { auto& help_prompt_manager = application->help_prompt_manager(); help_prompt_manager.OnSetGlobalPropertiesReceived(message, true); } @@ -297,7 +297,7 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { tts_result_ = static_cast( message[strings::params][hmi_response::code].asInt()); GetInfo(message, tts_response_info_); - if (application.valid()) { + if (application.use_count() != 0) { auto& help_prompt_manager = application->help_prompt_manager(); help_prompt_manager.OnSetGlobalPropertiesReceived(message, true); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc index 80a28b288c..0fdf6d83cf 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/show_request.cc @@ -276,7 +276,7 @@ void ShowRequest::Run() { SendHMIRequest(hmi_apis::FunctionID::UI_Show, &msg_params, true); app_mngr::commands::MessageSharedPtr persistentData = - new smart_objects::SmartObject(msg_params); + std::make_shared(msg_params); app->set_show_command(*persistentData); } 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 62eb2d59c5..78de02b527 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 @@ -452,7 +452,7 @@ void SystemRequest::Run() { ApplicationSharedPtr application = application_manager_.application(connection_key()); - if (!(application.valid())) { + if (application.use_count() == 0) { LOG4CXX_ERROR(logger_, "NULL pointer"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; @@ -655,7 +655,7 @@ void SystemRequest::on_event(const event_engine::Event& event) { ApplicationSharedPtr application = application_manager_.application(connection_key()); - if (!(application.valid())) { + if (application.use_count() == 0) { LOG4CXX_ERROR(logger_, "NULL pointer"); return; } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc index d27161ff77..32113228f5 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc @@ -125,7 +125,7 @@ #include "sdl_rpc_plugin/commands/mobile/send_haptic_data_request.h" #include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h" #include "interfaces/MOBILE_API.h" -#include "utils/make_shared.h" + CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") namespace sdl_rpc_plugin { 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 8cb5e97891..20298c7d33 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 @@ -32,7 +32,7 @@ #include "gtest/gtest.h" #include "hmi/activate_app_request.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/command_impl.h" #include "application_manager/commands/commands_test.h" @@ -45,7 +45,7 @@ namespace hmi_commands_test { namespace activate_app_request { using ::testing::_; -using ::utils::SharedPtr; + namespace am = ::application_manager; namespace strings = ::application_manager::strings; using am::commands::MessageSharedPtr; @@ -54,8 +54,8 @@ using am::commands::CommandImpl; using ::test::components::application_manager_test::MockApplication; -typedef SharedPtr MockAppPtr; -typedef ::utils::SharedPtr ActivateAppRequestPtr; +typedef std::shared_ptr MockAppPtr; +typedef std::shared_ptr ActivateAppRequestPtr; MATCHER_P(CheckMessage, level, "") { return level == 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 d43d70b5ca..a5707488dd 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 @@ -32,7 +32,7 @@ #include "gtest/gtest.h" #include "hmi/add_statistics_info_notification.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" @@ -58,7 +58,7 @@ using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -typedef ::utils::SharedPtr NotificationPtr; +typedef std::shared_ptr NotificationPtr; namespace { const uint32_t kStatisticType = 1u; 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 4b7fb0fc09..a2fcf8f605 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 @@ -32,7 +32,7 @@ #include "gtest/gtest.h" #include "hmi/allow_all_apps_response.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/command_impl.h" #include "application_manager/commands/commands_test.h" @@ -49,7 +49,7 @@ using sdl_rpc_plugin::commands::AllowAllAppsResponse; namespace strings = ::application_manager::strings; namespace hmi_response = ::application_manager::hmi_response; -typedef ::utils::SharedPtr ResponsePtr; +typedef std::shared_ptr ResponsePtr; namespace { const bool kResponseIsAllowed = true; 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 3681bf01b6..2ce400542a 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 @@ -32,7 +32,7 @@ #include "gtest/gtest.h" #include "hmi/allow_app_response.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" @@ -55,7 +55,7 @@ const uint32_t kConnectionKey = 1u; const bool kIsResponseAllowed = true; } -typedef ::utils::SharedPtr ResponsePtr; +typedef std::shared_ptr ResponsePtr; class AllowAppResponseTest : public CommandsTest {}; 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 78fec997e9..a3f0ab6933 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 @@ -33,7 +33,7 @@ #include "hmi/basic_communication_get_system_time_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/command_request_test.h" #include "protocol_handler/mock_protocol_handler.h" 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 930e024b4b..6ed15bebeb 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 @@ -32,7 +32,7 @@ #include "gtest/gtest.h" #include "hmi/button_get_capabilities_response.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" @@ -51,7 +51,7 @@ using ::testing::NiceMock; namespace strings = ::application_manager::strings; namespace hmi_response = ::application_manager::hmi_response; -typedef ::utils::SharedPtr ResponsePtr; +typedef std::shared_ptr ResponsePtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> 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 1bae77bb30..775f3b653f 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" @@ -49,13 +49,13 @@ namespace commands_test { namespace hmi_commands_test { namespace close_popup_response { -using ::utils::SharedPtr; + namespace am = ::application_manager; using application_manager::commands::ResponseFromHMI; using sdl_rpc_plugin::commands::ClosePopupResponse; using am::commands::CommandImpl; -typedef SharedPtr ResponseFromHMIPtr; +typedef std::shared_ptr ResponseFromHMIPtr; class ClosePopupResponseTest : public CommandsTest { }; 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 b8b84f13c9..0f02deded0 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 @@ -506,30 +506,30 @@ TYPED_TEST_CASE(HMICommandsTestFourth, HMICommandsListFourth); TYPED_TEST_CASE(HMICommandsTestFifth, HMICommandsListFifth); TYPED_TEST(HMICommandsTestFirst, CtorAndDtorCall) { - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(); UNUSED(command); } TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) { - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(); UNUSED(command); } TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) { - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(); UNUSED(command); } TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) { - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(); UNUSED(command); } TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) { - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(); UNUSED(command); } 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 6262e1dd8a..ee576aedb6 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -49,14 +49,14 @@ namespace commands_test { namespace hmi_commands_test { namespace get_system_info_request { -using ::utils::SharedPtr; + namespace am = ::application_manager; namespace strings = ::application_manager::strings; using am::commands::RequestToHMI; using sdl_rpc_plugin::commands::GetSystemInfoRequest; using am::commands::CommandImpl; -typedef SharedPtr RequestToHMIPtr; +typedef std::shared_ptr RequestToHMIPtr; namespace { const uint32_t kConnectionKey = 2u; 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 3a68264e2a..0333102370 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/application.h" @@ -52,7 +52,7 @@ namespace hmi_commands_test { namespace get_system_info_response { using ::testing::Return; -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; @@ -62,7 +62,7 @@ using sdl_rpc_plugin::commands::GetSystemInfoResponse; using sdl_rpc_plugin::commands::SystemInfo; using am::commands::CommandImpl; -typedef SharedPtr ResponseFromHMIPtr; +typedef std::shared_ptr ResponseFromHMIPtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc index 05169e5067..bef49826ce 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" @@ -52,14 +52,14 @@ namespace get_urls_response { using ::testing::_; using ::testing::Return; -using ::utils::SharedPtr; + namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::GetUrlsResponse; using am::commands::ResponseToHMI; using am::commands::CommandImpl; -typedef SharedPtr ResponseToHMIPtr; +typedef std::shared_ptr ResponseToHMIPtr; namespace { const uint32_t kConnectionKey = 2u; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc index 7788cb2ebe..8d785c8a69 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "application_manager/message.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" @@ -58,7 +58,7 @@ namespace get_urls { using namespace hmi_apis; using namespace policy; -using ::utils::SharedPtr; + using ::testing::NiceMock; using ::testing::_; using ::testing::SetArgReferee; @@ -71,7 +71,7 @@ using am::commands::CommandImpl; using policy::PolicyHandler; using policy_test::MockPolicyHandlerInterface; -typedef SharedPtr RequestFromHMIPtr; +typedef std::shared_ptr RequestFromHMIPtr; namespace { const uint32_t kInvalidAppId_ = 0u; 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 245bb72860..bdbf2db216 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 @@ -90,8 +90,8 @@ #include "utils/lock.h" #include "utils/data_accessor.h" #include "utils/signals.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "utils/file_system.h" #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" @@ -126,7 +126,7 @@ using ::testing::Return; using ::testing::ReturnRef; using ::testing::NiceMock; using ::testing::InSequence; -using ::utils::SharedPtr; + using ::smart_objects::SmartObject; using ::application_manager::commands::MessageSharedPtr; using ::test::components::application_manager_test::MockApplicationManager; @@ -139,7 +139,7 @@ using ::application_manager::MockMessageHelper; using namespace sdl_rpc_plugin::commands; using namespace am::commands; -typedef SharedPtr MockAppPtr; +typedef std::shared_ptr MockAppPtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; @@ -348,7 +348,7 @@ TYPED_TEST_CASE(HMIOnNotificationsEventDispatcher, TYPED_TEST(HMIOnNotificationsListToHMI, CommandsSendNotificationToHmi) { MessageSharedPtr message = commands_test::CommandsTest::CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(message); EXPECT_CALL(commands_test::CommandsTest::mock_rpc_service_, SendMessageToHMI(_)); @@ -366,7 +366,7 @@ TYPED_TEST(HMIOnNotificationsEventDispatcher, int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM; MessageSharedPtr message = commands_test::CommandsTest::CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand< typename TestFixture::CommandType::CommandType>(message); EXPECT_CALL(commands_test::CommandsTest::app_mngr_, @@ -381,7 +381,7 @@ TYPED_TEST(HMIOnNotificationsEventDispatcher, // notifications(SendNotificationToMobile) TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL)); @@ -394,7 +394,7 @@ TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) { TEST_F(HMICommandsNotificationsTest, OnNaviTBTClientSendNotificationToMobile) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL)); @@ -408,7 +408,7 @@ TEST_F(HMICommandsNotificationsTest, OnNaviTBTClientSendNotificationToMobile) { TEST_F(HMICommandsNotificationsTest, OnNaviWayPointChangeSendNotificationToMobile) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL)); @@ -421,7 +421,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnUICommandSendNotificationToMobile) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL)); @@ -438,7 +438,7 @@ TEST_F(HMICommandsNotificationsTest, OnUICommandSendNotificationToMobile) { TEST_F(HMICommandsNotificationsTest, OnUIKeyBoardInputSendNotificationToMobile) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL)); @@ -451,7 +451,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnUITouchEventSendNotificationToMobile) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL)); @@ -466,7 +466,7 @@ TEST_F(HMICommandsNotificationsTest, OnAppRegisteredNotificationSendNotificationToHmi) { int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM; MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)); EXPECT_CALL(app_mngr_, event_dispatcher()); @@ -488,7 +488,7 @@ TEST_F(HMICommandsNotificationsTest, OnAppUnregisteredNotificationEventDispatcher) { int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM; MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)); EXPECT_CALL(app_mngr_, event_dispatcher()); @@ -509,7 +509,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) { int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM; MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL)); @@ -526,7 +526,7 @@ TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) { TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) { int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM; MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, OnHMIStartedCooperation()); @@ -541,7 +541,7 @@ TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) { TEST_F(HMICommandsNotificationsTest, OnIgnitionCycleOverNotificationPolicyHandler) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_policy_handler_, OnIgnitionCycleOver()); @@ -550,7 +550,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnPolicyUpdateNotificationPolicyHandler) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = CreateCommand(message); + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_policy_handler_, OnPTExchangeNeeded()); command->Run(); @@ -567,7 +567,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String); (*message)[am::strings::msg_params][am::hmi_notification::policyfile] = kFile; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_policy_handler_, ReceiveMessageFromSDK(kFile, data)); @@ -579,7 +579,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnReceivePolicyUpdateNotification_UNSUCCESS) { MessageSharedPtr message = CreateMessage(smart_objects::SmartType_String); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_policy_handler_, ReceiveMessageFromSDK(_, _)).Times(0); @@ -597,7 +597,7 @@ TEST_F(HMICommandsNotificationsTest, smart_objects::SmartObject hmi_application_temp(smart_objects::SmartType_Map); applications[0] = hmi_application_temp; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); int32_t connection_id = -1; @@ -619,11 +619,11 @@ TEST_F(HMICommandsNotificationsTest, smart_objects::SmartObject(smart_objects::SmartType_Array); smart_objects::SmartObjectSPtr consented_function = - utils::MakeShared(); + std::make_shared(); (*message)[am::strings::msg_params]["consentedFunctions"][0] = *consented_function; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); int32_t connection_id = -1; @@ -653,14 +653,14 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params]["source"] = "test_content_source"; smart_objects::SmartObjectSPtr consented_function = - utils::MakeShared(); + std::make_shared(); (*consented_function)["allowed"] = true; (*consented_function)[am::strings::id] = 999; (*consented_function)[am::strings::name] = "test_group_alias"; (*message)[am::strings::msg_params]["consentedFunctions"][0] = *consented_function; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); int32_t connection_id = -1; @@ -694,14 +694,14 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params]["source"] = "test_content_source"; smart_objects::SmartObjectSPtr consented_function = - utils::MakeShared(); + std::make_shared(); (*consented_function)["allowed"] = false; (*consented_function)[am::strings::id] = 999; (*consented_function)[am::strings::name] = "test_group_alias"; (*message)[am::strings::msg_params]["consentedFunctions"][0] = *consented_function; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); int32_t connection_id = -1; @@ -732,7 +732,7 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params][am::hmi_notification::error] = hmi_apis::Common_SystemError::SYNC_REBOOTED; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); int32_t code = hmi_apis::Common_SystemError::INVALID_ENUM; @@ -748,7 +748,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = kLangCode; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_)); @@ -761,7 +761,7 @@ TEST_F(HMICommandsNotificationsTest, const std::string kDeviceId = ""; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::hmi_response::allowed] = true; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); bool value = false; @@ -779,7 +779,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::hmi_response::allowed] = true; (*message)[am::strings::msg_params]["device"]["id"] = kDeviceId; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); bool value; @@ -796,7 +796,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params]["deviceState"] = hmi_apis::Common_DeviceState::INVALID_ENUM; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_policy_handler_, RemoveDevice(_)).Times(0); @@ -812,7 +812,7 @@ TEST_F(HMICommandsNotificationsTest, hmi_apis::Common_DeviceState::UNPAIRED; (*message)[am::strings::msg_params]["deviceInternalId"] = device_id; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_policy_handler_, RemoveDevice(_)); @@ -827,7 +827,7 @@ TEST_F(HMICommandsNotificationsTest, hmi_apis::Common_DeviceState::UNPAIRED; (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); std::string device_id = "default_id"; @@ -847,7 +847,7 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params]["deviceInternalId"] = empty_device_id; (*message)[am::strings::msg_params]["deviceId"]["id"] = id; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); std::string device_id = "default_id"; @@ -864,7 +864,7 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params][am::hmi_request::reason] = hmi_apis::Common_ApplicationsCloseReason::IGNITION_OFF; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); #if defined(OS_POSIX) am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason; @@ -906,7 +906,7 @@ TEST_F(HMICommandsNotificationsTest, for (; it_reason != reason_list.end(); ++it_reason, ++it_mob_reason) { (*message)[am::strings::msg_params][am::hmi_request::reason] = *it_reason; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); #if defined(OS_POSIX) am::mobile_api::AppInterfaceUnregisteredReason::eType mob_reason = @@ -928,7 +928,7 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params][am::hmi_request::reason] = hmi_apis::Common_ApplicationsCloseReason::SUSPEND; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); MessageSharedPtr ethalon_message = @@ -970,7 +970,7 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params][am::hmi_request::reason] = hmi_apis::Common_ApplicationsCloseReason::INVALID_ENUM; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, SetUnregisterAllApplicationsReason(_)).Times(0); @@ -985,7 +985,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_; smart_objects::SmartObjectSPtr notification = - utils::MakeShared(); + std::make_shared(); (*notification)[am::strings::params][am::strings::function_id] = static_cast( mobile_apis::FunctionID::OnAppInterfaceUnregisteredID); @@ -1013,7 +1013,7 @@ TEST_F(HMICommandsNotificationsTest, for (; it_reason != reason_list.end(); ++it_reason, ++it_mobile_reason) { (*message)[am::strings::msg_params][am::strings::reason] = *it_reason; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); (*notification)[am::strings::msg_params][am::strings::reason] = @@ -1044,7 +1044,7 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params][am::strings::reason] = hmi_apis::Common_ApplicationExitReason::INVALID_ENUM; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_; @@ -1064,7 +1064,7 @@ TEST_F(HMICommandsNotificationsTest, OnExitApplicationNotificationInvalidApp) { MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); am::ApplicationSharedPtr invalid_app; @@ -1082,7 +1082,7 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_; (*message)[am::strings::msg_params][am::strings::reason] = hmi_apis::Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, application(kAppId_)).WillRepeatedly(Return(app_)); @@ -1104,7 +1104,7 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_; (*message)[am::strings::msg_params][am::strings::reason] = hmi_apis::Common_ApplicationExitReason::USER_EXIT; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); am::plugin_manager::MockRPCPluginManager mock_rpc_plugin_manager_; EXPECT_CALL(app_mngr_, GetPluginManager()) @@ -1131,7 +1131,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::cmd_id] = cmd_id; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, application(_)).WillRepeatedly(Return(app_)); @@ -1153,7 +1153,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); am::ApplicationSharedPtr invalid_app; @@ -1172,7 +1172,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, application(_)).Times(0); @@ -1189,7 +1189,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); am::ApplicationSharedPtr invalid_app; @@ -1210,7 +1210,7 @@ TEST_F(HMICommandsNotificationsTest, int32_t event_id = hmi_apis::FunctionID::INVALID_ENUM; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); @@ -1236,7 +1236,7 @@ TEST_F(HMICommandsNotificationsTest, (*message)[am::strings::msg_params][am::strings::cmd_id] = kCmdId; (*message)[am::strings::msg_params][am::strings::function_id] = mobile_apis::FunctionID::eType::OnCommandID; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); @@ -1263,7 +1263,7 @@ TEST_F(HMICommandsNotificationsTest, OnVRLanguageChangeNotificationEmptyData) { const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = kLang; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_hmi_capabilities_, active_ui_language()) @@ -1281,7 +1281,7 @@ TEST_F(HMICommandsNotificationsTest, const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = kLang; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); application_set_.insert(app_); @@ -1314,12 +1314,12 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = mobile_apis::Language::EN_US; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); application_set_.insert(app_); smart_objects::SmartObjectSPtr notification = - utils::MakeShared(); + std::make_shared(); (*notification)[am::strings::params][am::strings::function_id] = static_cast(mobile_apis::FunctionID::OnLanguageChangeID); (*notification)[am::strings::params][am::strings::message_type] = @@ -1367,7 +1367,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnStartDeviceDiscoveryRun) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, StartDevicesDiscovery()); command->Run(); @@ -1378,7 +1378,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::device_info] [am::strings::id] = "2014"; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, ConnectToDevice( @@ -1390,7 +1390,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnDeviceChosenNotificationDeviceInfoNotExists) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, ConnectToDevice(_)).Times(0); command->Run(); @@ -1411,7 +1411,7 @@ TEST_F(HMICommandsNotificationsTest, for (; it != system_context_list.end(); ++it) { (*message)[am::strings::msg_params][am::hmi_notification::system_context] = *it; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(app_)); EXPECT_CALL(app_mngr_, state_controller()) @@ -1426,7 +1426,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::hmi_notification::system_context] = am::mobile_api::SystemContext::SYSCTXT_VRSESSION; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); ApplicationSharedPtr invalid_app; EXPECT_CALL(app_mngr_, active_application()).WillOnce(Return(invalid_app)); @@ -1439,7 +1439,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::hmi_notification::system_context] = am::mobile_api::SystemContext::INVALID_ENUM; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, active_application()).Times(0); EXPECT_CALL(app_mngr_, application(_)).Times(0); @@ -1460,7 +1460,7 @@ TEST_F(HMICommandsNotificationsTest, for (; it != system_context_list.end(); ++it) { (*message)[am::strings::msg_params][am::hmi_notification::system_context] = *it; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); EXPECT_CALL(app_mngr_, state_controller()) @@ -1475,7 +1475,7 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::hmi_notification::system_context] = am::mobile_api::SystemContext::SYSCTXT_ALERT; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, application(_)).Times(0); EXPECT_CALL(app_mngr_, state_controller()).Times(0); @@ -1486,7 +1486,7 @@ TEST_F(HMICommandsNotificationsTest, OnSystemRequestNotificationAppIdExistsAndValidApp) { MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(app_)); @@ -1520,7 +1520,7 @@ TEST_F(HMICommandsNotificationsTest, OnSystemRequestNotificationAppIdExistsAndInvalidApp) { MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::app_id] = kAppId_; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); ApplicationSharedPtr invalid_app; EXPECT_CALL(app_mngr_, application(kAppId_)).WillOnce(Return(invalid_app)); @@ -1535,7 +1535,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnSystemRequestNotificationAppIdDoesntExistsAndValidApp) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_policy_handler_, GetAppIdForSending()) @@ -1571,7 +1571,7 @@ TEST_F(HMICommandsNotificationsTest, OnSystemRequestNotificationAppIdDoesntExistsAndNullAppId) { const uint32_t kNullApppId = 0u; MessageSharedPtr message = CreateMessage(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_policy_handler_, GetAppIdForSending()) @@ -1585,7 +1585,7 @@ TEST_F(HMICommandsNotificationsTest, OnTTSLanguageChangeNotificationEmptyData) { const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = kLang; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(_)); @@ -1604,7 +1604,7 @@ TEST_F(HMICommandsNotificationsTest, const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = kLang; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); application_set_.insert(app_); @@ -1638,12 +1638,12 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = mobile_apis::Language::EN_US; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); application_set_.insert(app_); smart_objects::SmartObjectSPtr notification = - utils::MakeShared(); + std::make_shared(); (*notification)[am::strings::params][am::strings::function_id] = static_cast(mobile_apis::FunctionID::OnLanguageChangeID); (*notification)[am::strings::params][am::strings::message_type] = @@ -1690,7 +1690,7 @@ TEST_F(HMICommandsNotificationsTest, OnUILanguageChangeNotificationEmptyData) { const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = kLang; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(_)); @@ -1708,7 +1708,7 @@ TEST_F(HMICommandsNotificationsTest, const mobile_apis::Language::eType& kLang = mobile_apis::Language::EN_GB; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = kLang; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); application_set_.insert(app_); @@ -1741,12 +1741,12 @@ TEST_F(HMICommandsNotificationsTest, MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::strings::language] = mobile_apis::Language::EN_US; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); application_set_.insert(app_); smart_objects::SmartObjectSPtr notification = - utils::MakeShared(); + std::make_shared(); (*notification)[am::strings::params][am::strings::function_id] = static_cast(mobile_apis::FunctionID::OnLanguageChangeID); (*notification)[am::strings::params][am::strings::message_type] = @@ -1793,7 +1793,7 @@ TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationEmptyData) { hmi_apis::Common_DriverDistractionState::DD_ON; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::hmi_notification::state] = state; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); EXPECT_CALL(app_mngr_, set_driver_distraction_state(state)); @@ -1809,7 +1809,7 @@ TEST_F(HMICommandsNotificationsTest, hmi_apis::Common_DriverDistractionState::DD_ON; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::hmi_notification::state] = state; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); ApplicationSharedPtr invalid_app; @@ -1825,7 +1825,7 @@ TEST_F(HMICommandsNotificationsTest, OnDriverDistractionNotificationValidApp) { hmi_apis::Common_DriverDistractionState::DD_ON; MessageSharedPtr message = CreateMessage(); (*message)[am::strings::msg_params][am::mobile_notification::state] = state; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); application_set_.insert(app_); 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 7759dace96..8892fa3809 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -50,14 +50,14 @@ namespace mixing_audio_supported_request { using ::testing::_; using ::testing::Return; -using ::utils::SharedPtr; + namespace am = ::application_manager; namespace strings = ::application_manager::strings; using am::commands::RequestToHMI; using sdl_rpc_plugin::commands::MixingAudioSupportedRequest; using am::commands::CommandImpl; -typedef SharedPtr RequestToHMIPtr; +typedef std::shared_ptr RequestToHMIPtr; namespace { const uint32_t kConnectionKey = 2u; 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 9c8c30f493..60b86cf2bd 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" @@ -56,7 +56,7 @@ namespace mixing_audio_supported_response { using ::testing::Return; using ::testing::ReturnRef; using ::testing::NiceMock; -using ::utils::SharedPtr; + namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::MixingAudioSupportedResponse; @@ -65,7 +65,7 @@ using am::commands::CommandImpl; using am::HMICapabilities; namespace hmi_response = ::application_manager::hmi_response; -typedef SharedPtr ResponseFromHMIPtr; +typedef std::shared_ptr ResponseFromHMIPtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; 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 69cb04f073..d8454bb98e 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 @@ -35,7 +35,7 @@ #include "hmi/navi_audio_start_stream_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -76,7 +76,7 @@ class AudioStartStreamRequestTest std::pair start_stream_retry_amount_; MessageSharedPtr msg_; - SharedPtr command_; + std::shared_ptr command_; }; TEST_F(AudioStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) { 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 49145d1644..1a03ecf523 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 @@ -33,7 +33,7 @@ #include "hmi/navi_is_ready_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -62,7 +62,7 @@ const hmi_apis::FunctionID::eType kEventID = hmi_apis::FunctionID::Navigation_IsReady; } // namespace -typedef SharedPtr NaviIsReadyRequestPtr; +typedef std::shared_ptr NaviIsReadyRequestPtr; class NaviIsReadyRequestTest : public CommandRequestTest { 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 3bcea20be7..715d788100 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 @@ -51,11 +51,11 @@ namespace am = ::application_manager; namespace commands = sdl_rpc_plugin::commands; using ::testing::ReturnRef; -using ::utils::SharedPtr; + using application_manager::commands::ResponseFromHMI; using test::components::event_engine_test::MockEventDispatcher; -typedef SharedPtr ResponseFromHMIPtr; +typedef std::shared_ptr ResponseFromHMIPtr; class NaviIsReadyResponseTest : public CommandRequestTest {}; 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 c7287c024a..3110a11fd8 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 @@ -35,7 +35,7 @@ #include "hmi/navi_set_video_config_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -65,7 +65,7 @@ const hmi_apis::FunctionID::eType kEventID = hmi_apis::FunctionID::Navigation_SetVideoConfig; } // namespace -typedef SharedPtr NaviSetVideoConfigRequestPtr; +typedef std::shared_ptr NaviSetVideoConfigRequestPtr; class NaviSetVideoConfigRequestTest : public CommandRequestTest { 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 6469966ca2..4140d18110 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 @@ -44,7 +44,7 @@ namespace commands_test { namespace hmi_commands_test { namespace navi_set_video_config_response { -using utils::SharedPtr; + using sdl_rpc_plugin::commands::NaviSetVideoConfigResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::_; @@ -61,7 +61,7 @@ class NaviSetVideoConfigResponseTest TEST_F(NaviSetVideoConfigResponseTest, RUN_SUCCESS) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); MockEventDispatcher mock_event_dispatcher; 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 6700aa68ab..a7f50504fb 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 @@ -35,7 +35,7 @@ #include "hmi/navi_start_stream_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -75,7 +75,7 @@ class NaviStartStreamRequestTest std::pair start_stream_retry_amount_; MessageSharedPtr msg_; - SharedPtr command_; + std::shared_ptr command_; }; TEST_F(NaviStartStreamRequestTest, Run_HmiInterfaceNotAvailable_NoRequest) { 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 0ef903224b..e4a79997fd 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 @@ -34,7 +34,7 @@ #include "hmi/navi_audio_stop_stream_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -72,7 +72,7 @@ class NaviStopStreamRequestsTest } MessageSharedPtr msg_; - SharedPtr command_; + std::shared_ptr command_; }; typedef testing::Types NotificationPtr; +typedef std::shared_ptr NotificationPtr; class HMIOnDriverDistractionNotificationTest : public CommandsTest { 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 bbd5920f9f..d62a2897f8 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 @@ -33,7 +33,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "interfaces/MOBILE_API.h" #include "application_manager/mock_hmi_capabilities.h" @@ -48,7 +48,7 @@ namespace commands_test { namespace hmi_commands_test { namespace rc_get_capabilities_response { -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = am::strings; @@ -56,7 +56,7 @@ namespace hmi_response = am::hmi_response; using sdl_rpc_plugin::commands::RCGetCapabilitiesResponse; using am::commands::CommandImpl; -typedef SharedPtr RCGetCapabilitiesResponsePtr; +typedef std::shared_ptr RCGetCapabilitiesResponsePtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; 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 41acf67116..030db2f424 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 @@ -33,7 +33,7 @@ #include "hmi/rc_is_ready_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -57,7 +57,7 @@ using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::RCIsReadyRequest; using am::event_engine::Event; -typedef SharedPtr RCIsReadyRequestPtr; +typedef std::shared_ptr RCIsReadyRequestPtr; class RCIsReadyRequestTest : public CommandRequestTest { 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 e07a0c1538..a1a8c1c87e 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_hmi_capabilities.h" @@ -48,7 +48,7 @@ namespace hmi_commands_test { namespace rc_is_ready_response { using ::testing::Return; -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; @@ -56,7 +56,7 @@ namespace hmi_response = am::hmi_response; using sdl_rpc_plugin::commands::RCIsReadyResponse; using test::components::event_engine_test::MockEventDispatcher; -typedef SharedPtr RCIsReadyResponsePtr; +typedef std::shared_ptr RCIsReadyResponsePtr; class RCIsReadyResponseTest : public CommandsTest { }; 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 c5b0c2ba24..3e084bd6cc 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 @@ -33,7 +33,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/test/include/application_manager/commands/commands_test.h" @@ -51,13 +51,13 @@ using ::testing::Return; using ::testing::SaveArg; using ::testing::DoAll; -using ::utils::SharedPtr; + using ::test::components::event_engine_test::MockEventDispatcher; namespace am = ::application_manager; using application_manager::commands::ResponseFromHMI; -typedef SharedPtr ResponseFromHMIPtr; +typedef std::shared_ptr ResponseFromHMIPtr; class ResponseFromHMITest : public CommandsTest {}; @@ -97,7 +97,7 @@ TEST_F(ResponseFromHMITest, CreateHMIRequest_SUCCESS) { MessageSharedPtr dummy_msg_params = CreateMessage(); command->CreateHMIRequest(posted_function_id, *dummy_msg_params); - ASSERT_TRUE(result_msg); + ASSERT_TRUE((bool)result_msg); const application_manager::MessageType received_message_tipe = static_cast( 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 c21791e913..38cbc7b069 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 @@ -134,7 +134,7 @@ TEST_F(SDLActivateAppRequestTest, Run_ActivateApp_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(app_mngr_, state_controller()) @@ -154,7 +154,7 @@ TEST_F(SDLActivateAppRequestTest, DISABLED_Run_DactivateApp_REJECTED) { (*msg)[strings::msg_params][strings::function_id] = hmi_apis::FunctionID::SDL_ActivateApp; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(app_mngr_, state_controller()) @@ -176,7 +176,7 @@ TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -222,7 +222,7 @@ TEST_F(SDLActivateAppRequestTest, AppIdNotFound_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kAppID)) @@ -237,7 +237,7 @@ TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -263,7 +263,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppActive_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -301,7 +301,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotActive_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -322,7 +322,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -362,7 +362,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegisteredAndEmpty_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -395,7 +395,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -431,7 +431,7 @@ TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ON_CALL(mock_event_dispatcher_, remove_observer(_, _)); EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).WillOnce(Return(true)); @@ -443,7 +443,7 @@ TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidEventId_UNSUCCESS) { MessageSharedPtr event_msg = CreateMessage(); (*event_msg)[strings::params][strings::correlation_id] = kCorrelationID; - SharedPtr command( + std::shared_ptr command( CreateCommand()); Event event(hmi_apis::FunctionID::INVALID_ENUM); @@ -458,7 +458,7 @@ TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidAppId_UNSUCCESS) { (*event_msg)[strings::msg_params][strings::application][strings::app_id] = kAppID; - SharedPtr command( + std::shared_ptr command( CreateCommand()); Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered); @@ -474,7 +474,7 @@ TEST_F(SDLActivateAppRequestTest, OnEvent_InvalidAppId_UNSUCCESS) { TEST_F(SDLActivateAppRequestTest, OnEvent_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::params][strings::correlation_id] = kCorrelationID; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); MessageSharedPtr event_msg = CreateMessage(); 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 716c818269..1dc41e1486 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -47,13 +47,13 @@ namespace commands_test { namespace hmi_commands_test { namespace sdl_activate_app_response { -using ::utils::SharedPtr; + namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::SDLActivateAppResponse; using am::commands::CommandImpl; -typedef SharedPtr SDLActivateAppResponsePtr; +typedef std::shared_ptr SDLActivateAppResponsePtr; namespace { const uint32_t kConnectionKey = 2u; 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 e5f9845b74..262ac5fc7d 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 @@ -82,7 +82,7 @@ TEST_F(SDLGetListOfPermissionsRequestTest, Run_SUCCESS) { EXPECT_CALL(app_mngr_, application_by_hmi_app(kAppID)) .WillOnce(Return(mock_app_)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_policy_handler_, @@ -95,7 +95,7 @@ TEST_F(SDLGetListOfPermissionsRequestTest, Run_KeyDoesntExist_SUCCESS) { MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Binary); (*msg)[strings::params][strings::correlation_id] = kCorrelationID; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_policy_handler_, 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 7cfd7e49e2..fca8ed840f 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 @@ -64,7 +64,7 @@ TEST_F(SDLGetStatusUpdateRequestTest, Run_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::params][strings::correlation_id] = kCorrelationID; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_policy_handler_, OnGetStatusUpdate(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 0ec40f896a..b040f8ea40 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 @@ -99,7 +99,7 @@ TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageSet_SUCCESS) { (*msg)[strings::msg_params][strings::language] = kLanguage; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_message_helper_, CommonLanguageToString(kLanguage)) @@ -123,7 +123,7 @@ TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_LanguageNotSet_SUCCESS) { (*msg)[strings::msg_params][kMessageCodes][0] = SmartObject(kLanguageDe); (*msg)[strings::msg_params][kMessageCodes][1] = SmartObject(kLanguageEn); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_hmi_capabilities_, active_ui_language()) @@ -144,7 +144,7 @@ TEST_F(SDLGetUserFriendlyMessageRequestTest, Run_NoMsgCodes_Canceled) { (*msg)[strings::params][strings::correlation_id] = kCorrelationID; (*msg)[strings::msg_params][strings::app_id] = kAppID; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_message_helper_, CommonLanguageToString(_)).Times(0); 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 d25c9b41e8..e610628416 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 @@ -62,7 +62,7 @@ TYPED_TEST_CASE(SimpleNotificationsTest, CommandsList); TYPED_TEST(SimpleNotificationsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - SharedPtr command = this->template CreateCommand(); + std::shared_ptr command = this->template CreateCommand(); // Current implementation always return `true` EXPECT_TRUE(command->Init()); 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 e47009583f..028054c626 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 @@ -31,7 +31,7 @@ */ #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -51,7 +51,7 @@ using ::testing::Types; using ::testing::NotNull; using ::testing::NiceMock; -using ::utils::SharedPtr; + namespace commands = ::application_manager::commands; using commands::MessageSharedPtr; using ::application_manager::event_engine::EventObserver; @@ -67,7 +67,7 @@ class RequestFromHMITest : public CommandsTest { }; TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) { - SharedPtr command( + std::shared_ptr command( CreateCommand()); application_manager::event_engine::Event event( hmi_apis::FunctionID::BasicCommunication_ActivateApp); @@ -79,7 +79,7 @@ TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) { } TEST_F(RequestFromHMITest, SendResponse_SUCCESS) { - SharedPtr command( + std::shared_ptr command( CreateCommand()); const bool success = false; 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 c24cfc48db..42b1b9a182 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 @@ -31,7 +31,7 @@ */ #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -120,7 +120,7 @@ using ::testing::_; using ::testing::Types; using ::testing::NotNull; -using ::utils::SharedPtr; + namespace am_commands = application_manager::commands; using am_commands::MessageSharedPtr; @@ -129,7 +129,7 @@ using event_engine_test::MockEventDispatcher; class RequestToHMITest : public CommandsTest {}; TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) { - SharedPtr command( + std::shared_ptr command( CreateCommand()); // Current implementation always return `true` @@ -139,7 +139,7 @@ TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) { } TEST_F(RequestToHMITest, SendRequest_SUCCESS) { - SharedPtr command( + std::shared_ptr command( CreateCommand()); EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(NotNull())); @@ -235,7 +235,7 @@ TYPED_TEST_CASE(RequestToHMICommandsTest3, RequestCommandsList3); TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - SharedPtr command = this->template CreateCommand(); + std::shared_ptr command = this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull())); @@ -245,7 +245,7 @@ TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - SharedPtr command = this->template CreateCommand(); + std::shared_ptr command = this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull())); command->Run(); @@ -254,7 +254,7 @@ TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) { TYPED_TEST(RequestToHMICommandsTest3, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - SharedPtr command = this->template CreateCommand(); + std::shared_ptr command = this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull())); command->Run(); 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 229f48b5e1..c3b9809814 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 @@ -33,7 +33,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -109,7 +109,7 @@ using ::testing::ReturnRef; using ::testing::Types; using ::testing::Eq; -using ::utils::SharedPtr; + using ::test::components::event_engine_test::MockEventDispatcher; namespace am = ::application_manager; @@ -244,7 +244,7 @@ TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandData CommandData; typedef typename CommandData::CommandType CommandType; - SharedPtr command = this->template CreateCommand(); + std::shared_ptr command = this->template CreateCommand(); EXPECT_CALL(this->event_dispatcher_, raise_event(EventIdIsEqualTo(CommandData::kEventId))); @@ -255,7 +255,7 @@ TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { TYPED_TEST(EmptyResponseFromHMICommandsTest, Run_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - SharedPtr command = this->template CreateCommand(); + std::shared_ptr command = this->template CreateCommand(); command->Run(); } @@ -277,7 +277,7 @@ class NotificationFromHMITest : public CommandsTest {}; TEST_F(NotificationFromHMITest, BasicMethodsOverloads_SUCCESS) { - SharedPtr command( + std::shared_ptr command( CreateCommand()); // Current implementation always return `true` EXPECT_TRUE(command->Init()); @@ -290,7 +290,7 @@ TEST_F(NotificationFromHMITest, SendNotificationToMobile_SUCCESS) { (*command_msg)[am::strings::params][am::strings::message_type] = static_cast(am::MessageType::kNotification); - SharedPtr command( + std::shared_ptr command( CreateCommand()); EXPECT_CALL( mock_rpc_service_, @@ -303,7 +303,7 @@ TEST_F(NotificationFromHMITest, SendNotificationToMobile_SUCCESS) { TEST_F(NotificationFromHMITest, CreateHMIRequest_UNSUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); (*command_msg)[am::strings::msg_params] = 0; - SharedPtr command( + std::shared_ptr command( CreateCommand( command_msg)); 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 ef8978c34c..2a52601a44 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 @@ -31,7 +31,7 @@ */ #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" @@ -51,7 +51,7 @@ namespace simple_response_to_hmi_test { using ::testing::_; using ::testing::Types; using ::testing::NotNull; -using ::utils::SharedPtr; + namespace commands = sdl_rpc_plugin::commands; using application_manager::commands::MessageSharedPtr; @@ -73,7 +73,7 @@ TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList); TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - SharedPtr command = this->template CreateCommand(); + std::shared_ptr command = this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull())); command->Run(); @@ -82,7 +82,7 @@ TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { class ResponseToHMITest : public CommandsTest {}; TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) { - SharedPtr command( + std::shared_ptr command( CreateCommand()); // Current implementation always return `true` @@ -91,7 +91,7 @@ TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) { } TEST_F(ResponseToHMITest, Run_SUCCESS) { - SharedPtr command( + std::shared_ptr command( CreateCommand()); EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(NotNull())); 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 afc18114de..bc9d262e6d 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 @@ -47,7 +47,7 @@ namespace tts_get_capabilities_response { using application_manager::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::TTSGetCapabilitiesResponse; using test::components::application_manager_test::MockHMICapabilities; -using utils::SharedPtr; + using testing::_; namespace strings = ::application_manager::strings; @@ -71,7 +71,7 @@ TEST_F(TTSGetCapabilitiesResponseTest, Run_BothExist_SUCCESS) { EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(SmartObject(kText))); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -85,7 +85,7 @@ TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlySpeech_SUCCESS) { set_speech_capabilities(SmartObject(kText))); EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -100,7 +100,7 @@ TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlyPrerecorded_SUCCESS) { EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(SmartObject(kText))); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -112,7 +112,7 @@ TEST_F(TTSGetCapabilitiesResponseTest, Run_Nothing_SUCCESS) { EXPECT_CALL(mock_hmi_capabilities_, set_speech_capabilities(_)).Times(0); EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(_)).Times(0); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); 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 5f2fe1beda..b67976cc07 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 @@ -44,7 +44,7 @@ namespace commands_test { namespace hmi_commands_test { namespace tts_get_language_response { -using utils::SharedPtr; + using sdl_rpc_plugin::commands::TTSGetLanguageResponse; using test::components::application_manager_test::MockHMICapabilities; using test::components::event_engine_test::MockEventDispatcher; @@ -66,7 +66,7 @@ TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::msg_params][hmi_response::language] = kLanguage; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_hmi_capabilities_, set_active_tts_language(kLanguage)); @@ -82,7 +82,7 @@ TEST_F(TTSGetLanguageResponseTest, Run_LanguageSet_SUCCESS) { TEST_F(TTSGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_hmi_capabilities_, 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 2672062aab..6495229a2e 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -54,7 +54,7 @@ namespace tts_get_supported_languages_response { using ::testing::_; using ::testing::Return; -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; @@ -63,7 +63,7 @@ using application_manager::commands::ResponseFromHMI; using sdl_rpc_plugin::commands::TTSGetSupportedLanguagesResponse; using am::commands::CommandImpl; -typedef SharedPtr ResponseFromHMIPtr; +typedef std::shared_ptr ResponseFromHMIPtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; 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 d6d74d18bd..24a5c57a23 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -55,7 +55,7 @@ namespace tts_is_ready_response { using ::testing::_; using ::testing::Return; -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; @@ -65,7 +65,7 @@ using sdl_rpc_plugin::commands::TTSIsReadyResponse; using am::commands::CommandImpl; using test::components::event_engine_test::MockEventDispatcher; -typedef SharedPtr ResponseFromHMIPtr; +typedef std::shared_ptr ResponseFromHMIPtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; 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 8dbc09fc4f..36581ba665 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 @@ -33,8 +33,8 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "smart_objects/smart_object.h" #include "interfaces/MOBILE_API.h" #include "application_manager/mock_hmi_capabilities.h" @@ -49,7 +49,7 @@ namespace commands_test { namespace hmi_commands_test { namespace ui_get_capabilities_response { -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = am::strings; @@ -58,7 +58,7 @@ using application_manager::commands::ResponseFromHMI; using sdl_rpc_plugin::commands::UIGetCapabilitiesResponse; using am::commands::CommandImpl; -typedef SharedPtr ResponseFromHMIPtr; +typedef std::shared_ptr ResponseFromHMIPtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; 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 285024ed40..01a7ae41f4 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 @@ -44,7 +44,7 @@ namespace commands_test { namespace hmi_commands_test { namespace ui_get_language_response { -using utils::SharedPtr; + using sdl_rpc_plugin::commands::UIGetLanguageResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::_; @@ -70,7 +70,7 @@ TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::msg_params][hmi_response::language] = kLanguage; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_hmi_capabilities_, set_active_ui_language(kLanguage)); @@ -86,7 +86,7 @@ TEST_F(UIGetLanguageResponseTest, Run_LanguageSet_SUCCESS) { TEST_F(UIGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_hmi_capabilities_, 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 021ef4fdb6..d7fa03cdc0 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/application.h" @@ -51,14 +51,14 @@ namespace hmi_commands_test { namespace ui_get_supported_languages_response { using ::testing::Return; -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; using sdl_rpc_plugin::commands::UIGetSupportedLanguagesResponse; -typedef SharedPtr +typedef std::shared_ptr UIGetSupportedLanguagesResponsePtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> 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 b8fc839f12..fe0d8a8470 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 @@ -33,7 +33,7 @@ #include "hmi/ui_is_ready_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -60,7 +60,7 @@ using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::UIIsReadyRequest; using am::event_engine::Event; -typedef SharedPtr UIIsReadyRequestPtr; +typedef std::shared_ptr UIIsReadyRequestPtr; class UIIsReadyRequestTest : public CommandRequestTest { 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 6817c5ef0e..f7e13f06ed 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_hmi_capabilities.h" @@ -48,7 +48,7 @@ namespace hmi_commands_test { namespace ui_is_ready_response { using ::testing::Return; -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; @@ -56,7 +56,7 @@ namespace hmi_response = am::hmi_response; using sdl_rpc_plugin::commands::UIIsReadyResponse; using test::components::event_engine_test::MockEventDispatcher; -typedef SharedPtr UIIsReadyResponsePtr; +typedef std::shared_ptr UIIsReadyResponsePtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; 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 2ce7d9e8f0..b29a0fde57 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 @@ -33,7 +33,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "interfaces/HMI_API.h" #include "application_manager/smart_object_keys.h" @@ -54,7 +54,7 @@ namespace commands_test { namespace hmi_commands_test { namespace update_device_list_request { -using ::utils::SharedPtr; + using testing::_; using testing::ReturnRef; using testing::Return; @@ -68,7 +68,7 @@ using am::event_engine::Event; using sdl_rpc_plugin::commands::UpdateDeviceListRequest; using am::commands::CommandImpl; -typedef SharedPtr UpdateDeviceListRequestPtr; +typedef std::shared_ptr UpdateDeviceListRequestPtr; namespace { const uint32_t kConnectionKey = 2u; 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 2b079a21e0..b22dba73e5 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -48,14 +48,14 @@ namespace commands_test { namespace hmi_commands_test { namespace update_sdl_request { -using ::utils::SharedPtr; + using ::testing::ReturnRef; using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::UpdateSDLRequest; -typedef SharedPtr UpdateSDLRequestPtr; +typedef std::shared_ptr UpdateSDLRequestPtr; namespace { const uint32_t kConnectionKey = 2u; 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 0035637605..3e09ce29fd 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -47,13 +47,13 @@ namespace commands_test { namespace hmi_commands_test { namespace update_sdl_response { -using ::utils::SharedPtr; + namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::UpdateSDLResponse; using am::commands::CommandImpl; -typedef SharedPtr UpdateSDLResponsePtr; +typedef std::shared_ptr UpdateSDLResponsePtr; namespace { const uint32_t kConnectionKey = 2u; 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 0163fdd1d1..954925731c 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 @@ -33,7 +33,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "interfaces/MOBILE_API.h" #include "application_manager/mock_hmi_capabilities.h" @@ -48,7 +48,7 @@ namespace commands_test { namespace hmi_commands_test { namespace vr_get_capabilities_response { -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = am::strings; @@ -56,7 +56,7 @@ namespace hmi_response = am::hmi_response; using sdl_rpc_plugin::commands::VRGetCapabilitiesResponse; using am::commands::CommandImpl; -typedef SharedPtr VRGetCapabilitiesResponsePtr; +typedef std::shared_ptr VRGetCapabilitiesResponsePtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; 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 845324925f..287ea3b7f3 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 @@ -44,7 +44,7 @@ namespace commands_test { namespace hmi_commands_test { namespace vr_get_language_response { -using utils::SharedPtr; + using sdl_rpc_plugin::commands::VRGetLanguageResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::_; @@ -70,7 +70,7 @@ TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::msg_params][hmi_response::language] = kLanguage; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_hmi_capabilities_, set_active_vr_language(kLanguage)); @@ -86,7 +86,7 @@ TEST_F(VRGetLanguageResponseTest, Run_LanguageSet_SUCCESS) { TEST_F(VRGetLanguageResponseTest, Run_LanguageNotSet_SUCCESS) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_hmi_capabilities_, 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 0ac0d8e118..1baf777e69 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/application.h" @@ -51,14 +51,14 @@ namespace hmi_commands_test { namespace vr_get_supported_languages_response { using ::testing::Return; -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; namespace hmi_response = am::hmi_response; using sdl_rpc_plugin::commands::VRGetSupportedLanguagesResponse; -typedef SharedPtr +typedef std::shared_ptr VRGetSupportedLanguagesResponsePtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> 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 1ec0adb5e0..5aa00e0264 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 @@ -33,7 +33,7 @@ #include "hmi/vr_is_ready_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -57,7 +57,7 @@ using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::VRIsReadyRequest; using am::event_engine::Event; -typedef SharedPtr VRIsReadyRequestPtr; +typedef std::shared_ptr VRIsReadyRequestPtr; class VRIsReadyRequestTest : public CommandRequestTest { 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 452679e189..2f70995d83 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_hmi_capabilities.h" @@ -48,7 +48,7 @@ namespace hmi_commands_test { namespace vr_is_ready_response { using ::testing::Return; -using ::utils::SharedPtr; + using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; @@ -56,7 +56,7 @@ namespace hmi_response = am::hmi_response; using sdl_rpc_plugin::commands::VRIsReadyResponse; using test::components::event_engine_test::MockEventDispatcher; -typedef SharedPtr VRIsReadyResponsePtr; +typedef std::shared_ptr VRIsReadyResponsePtr; class VRIsReadyResponseTest : public CommandsTest { }; 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 9f60053eb3..ea1a0fafed 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 @@ -37,9 +37,9 @@ #include "mobile/add_command_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "utils/helpers.h" -#include "utils/make_shared.h" + #include "smart_objects/smart_object.h" #include "utils/custom_string.h" #include "application_manager/commands/command_request_test.h" @@ -64,7 +64,7 @@ using am::ApplicationManager; using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using ::testing::_; -using ::utils::SharedPtr; + using ::testing::Return; using ::testing::InSequence; using sdl_rpc_plugin::commands::AddCommandRequest; @@ -182,7 +182,7 @@ class AddCommandRequestTest EXPECT_CALL(*mock_app_, commands_map()) .WillRepeatedly(Return(DataAccessor( commands_map, lock_ptr_))); - so_ptr_ = utils::MakeShared(SmartType_Map); + so_ptr_ = std::make_shared(SmartType_Map); EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId)) .WillOnce(Return(so_ptr_.get())); { @@ -198,7 +198,7 @@ class AddCommandRequestTest .WillOnce(Return(true)); } EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); Event event(incoming_cmd); @@ -210,7 +210,7 @@ class AddCommandRequestTest ManageHMICommand(HMIResultCodeIs(cmd_to_delete))) .WillOnce(Return(true)); - SmartObjectSPtr response = utils::MakeShared(SmartType_Map); + SmartObjectSPtr response = std::make_shared(SmartType_Map); (*response)[strings::msg_params][strings::info] = "info"; EXPECT_CALL( mock_message_helper_, @@ -221,8 +221,8 @@ class AddCommandRequestTest mock_rpc_service_, ManageMobileCommand(response, am::commands::Command::CommandSource::SOURCE_SDL)); - utils::SharedPtr base_class_request = - static_cast >(request_ptr); + std::shared_ptr base_class_request = + static_cast >(request_ptr); base_class_request->onTimeOut(); } @@ -243,7 +243,7 @@ TEST_F(AddCommandRequestTest, Run_AppNotExisted_EXPECT_AppNotRegistered) { mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_result::APPLICATION_NOT_REGISTERED), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -258,7 +258,7 @@ TEST_F(AddCommandRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -284,7 +284,7 @@ TEST_F(AddCommandRequestTest, Run_MenuNameHasSyntaxError_EXPECT_INVALID_DATA) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -303,7 +303,7 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -329,7 +329,7 @@ TEST_F(AddCommandRequestTest, Run_CMDIconHasError_EXPECT_INVALID_DATA) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg); request_ptr->Run(); } @@ -340,13 +340,13 @@ TEST_F(AddCommandRequestTest, Run_CommandIDAlreadyExists_EXPECT_INVALID_ID) { SmartObject& image = msg_params[cmd_icon]; EXPECT_CALL(mock_message_helper_, VerifyImage(image, _, _)) .WillOnce(Return(mobile_apis::Result::SUCCESS)); - so_ptr_ = utils::MakeShared(SmartType_Map); + so_ptr_ = std::make_shared(SmartType_Map); EXPECT_CALL(*mock_app_, FindCommand(kCmdId)).WillOnce(Return(so_ptr_.get())); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -371,7 +371,7 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -398,7 +398,7 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::INVALID_ID), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -421,14 +421,14 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(*mock_app_, commands_map()) .WillRepeatedly(Return(DataAccessor( commands_map, lock_ptr_))); - so_ptr_ = utils::MakeShared(SmartType_Map); + so_ptr_ = std::make_shared(SmartType_Map); EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId)) .WillOnce(Return(so_ptr_.get())); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::DUPLICATE_NAME), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -444,7 +444,7 @@ TEST_F(AddCommandRequestTest, Run_MsgDataEmpty_EXPECT_INVALID_DATA) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg); request_ptr->Run(); } @@ -466,7 +466,7 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(*mock_app_, commands_map()) .WillRepeatedly(Return(DataAccessor( commands_map, lock_ptr_))); - so_ptr_ = utils::MakeShared(SmartType_Map); + so_ptr_ = std::make_shared(SmartType_Map); EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId)) .WillOnce(Return(so_ptr_.get())); { @@ -482,7 +482,7 @@ TEST_F(AddCommandRequestTest, .WillOnce(Return(true)); } EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -504,7 +504,7 @@ TEST_F(AddCommandRequestTest, GetRunMethods_SUCCESS) { mock_rpc_service_, ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) .WillOnce(Return(true)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); } @@ -535,7 +535,7 @@ TEST_F(AddCommandRequestTest, OnEvent_UI_SUCCESS) { EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandAdded(kCmdId, (*msg_)[msg_params], false)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); request_ptr->on_event(event); @@ -566,7 +566,7 @@ TEST_F(AddCommandRequestTest, OnEvent_VR_SUCCESS) { EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandAdded(kCmdId, (*msg_)[msg_params], false)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); request_ptr->on_event(event); @@ -597,7 +597,7 @@ TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) { EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(command_msg); request_ptr->Run(); request_ptr->on_event(event_ui); @@ -606,7 +606,7 @@ TEST_F(AddCommandRequestTest, OnEvent_BothSend_SUCCESS) { TEST_F(AddCommandRequestTest, OnEvent_UnknownEvent_UNSUCCESS) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); Event event(hmi_apis::FunctionID::INVALID_ENUM); request_ptr->on_event(event); @@ -619,7 +619,7 @@ TEST_F(AddCommandRequestTest, OnEvent_AppNotExisted_UNSUCCESS) { Event event(hmi_apis::FunctionID::UI_AddCommand); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->on_event(event); } @@ -641,7 +641,7 @@ TEST_F(AddCommandRequestTest, mock_rpc_service_, ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) .WillOnce(Return(true)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); @@ -687,7 +687,7 @@ TEST_F(AddCommandRequestTest, .WillOnce(ReturnRef(*mock_help_prompt_manager_)); EXPECT_CALL(*mock_help_prompt_manager_, OnVrCommandAdded(kCmdId, _, false)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); Event event_ui(hmi_apis::FunctionID::UI_AddCommand); @@ -725,7 +725,7 @@ TEST_F( } EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); @@ -770,7 +770,7 @@ TEST_F( } EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); @@ -813,7 +813,7 @@ TEST_F( ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) .WillOnce(Return(true)); } - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); @@ -862,7 +862,7 @@ TEST_F( ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) .WillOnce(Return(true)); } - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); @@ -903,7 +903,7 @@ TEST_F( mock_rpc_service_, ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::UI_AddCommand))) .WillOnce(Return(true)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); EXPECT_CALL(mock_hmi_interfaces_, @@ -940,7 +940,7 @@ TEST_F( mock_rpc_service_, ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) .WillOnce(Return(true)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); EXPECT_CALL(mock_hmi_interfaces_, @@ -988,7 +988,7 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); @@ -1036,7 +1036,7 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); @@ -1063,7 +1063,7 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(ApplicationSharedPtr())); EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)).Times(0); - SmartObjectSPtr response = utils::MakeShared(SmartType_Map); + SmartObjectSPtr response = std::make_shared(SmartType_Map); (*response)[strings::msg_params][strings::info] = "info"; EXPECT_CALL( mock_message_helper_, @@ -1072,8 +1072,8 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( response, am::commands::Command::CommandSource::SOURCE_SDL)); - utils::SharedPtr base_class_request = - static_cast >( + std::shared_ptr base_class_request = + static_cast >( CreateCommand(msg_)); base_class_request->onTimeOut(); } @@ -1094,7 +1094,7 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) { EXPECT_CALL(*mock_app_, commands_map()) .WillRepeatedly(Return(DataAccessor( commands_map, lock_ptr_))); - so_ptr_ = utils::MakeShared(SmartType_Map); + so_ptr_ = std::make_shared(SmartType_Map); EXPECT_CALL(*mock_app_, FindSubMenu(kSecondParentId)) .WillOnce(Return(so_ptr_.get())); { @@ -1109,11 +1109,11 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) { .WillOnce(Return(true)); } EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg_); request_ptr->Run(); EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); - SmartObjectSPtr response = utils::MakeShared(SmartType_Map); + SmartObjectSPtr response = std::make_shared(SmartType_Map); (*response)[strings::msg_params][strings::info] = "info"; EXPECT_CALL( mock_message_helper_, @@ -1122,8 +1122,8 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( response, am::commands::Command::CommandSource::SOURCE_SDL)); - utils::SharedPtr base_class_request = - static_cast >(request_ptr); + std::shared_ptr base_class_request = + static_cast >(request_ptr); base_class_request->onTimeOut(); } 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 9fad021c3e..ecaa436529 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 @@ -57,7 +57,7 @@ using am::event_engine::Event; using ::testing::_; using ::testing::Return; -typedef SharedPtr AddSubMenuPtr; +typedef std::shared_ptr AddSubMenuPtr; namespace { const uint32_t kConnectionKey = 2u; @@ -98,7 +98,7 @@ TEST_F(AddSubMenuRequestTest, Run_ImageVerificationFailed_EXPECT_INVALID_DATA) { EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::INVALID_DATA), _)); - utils::SharedPtr request_ptr = + std::shared_ptr request_ptr = CreateCommand(msg); request_ptr->Run(); @@ -110,7 +110,7 @@ TEST_F(AddSubMenuRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; (*msg)[am::strings::msg_params][am::strings::menu_id] = menu_id; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg); ON_CALL(app_mngr_, application(kConnectionKey)) 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 ac870e7001..7d2dd0b2c2 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -64,7 +64,7 @@ using sdl_rpc_plugin::commands::AlertManeuverRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; -typedef SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; class AlertManeuverRequestTest : public CommandRequestTest { @@ -80,7 +80,7 @@ class AlertManeuverRequestTest am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak); event.set_smart_object(*response); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(response); MockAppPtr mock_app(CreateMockApp()); 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 5835cbff81..895aafa0c8 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 @@ -56,14 +56,14 @@ using sdl_rpc_plugin::commands::AlertRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using ::utils::SharedPtr; + using am::event_engine::Event; using policy_test::MockPolicyHandlerInterface; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -typedef SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; namespace { const int32_t kCommandId = 1; @@ -192,7 +192,7 @@ TEST_F(AlertRequestTest, OnTimeout_GENERIC_ERROR) { (*command_msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr command = CreateCommand(); + std::shared_ptr command = CreateCommand(); EXPECT_CALL( mock_message_helper_, @@ -223,7 +223,7 @@ TEST_F(AlertRequestTest, OnEvent_UI_HmiSendSuccess_UNSUPPORTED_RESOURCE) { (*command_msg)[am::strings::msg_params][am::strings::menu_params] [am::strings::menu_name] = "menu_name"; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(command_msg); MessageSharedPtr 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 3d6a345ced..56f06890c4 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 @@ -37,9 +37,9 @@ #include "mobile/change_registration_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "utils/helpers.h" -#include "utils/make_shared.h" + #include "utils/custom_string.h" #include "smart_objects/smart_object.h" #include "application_manager/commands/command_request_test.h" @@ -66,7 +66,7 @@ using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; using ::testing::_; -using ::utils::SharedPtr; + using ::testing::Return; using ::testing::ReturnRef; using ::testing::SetArgPointee; @@ -149,7 +149,7 @@ class ChangeRegistrationRequestTest hmi_apis::Common_Result::UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_from_mobile = CreateMsgFromMobile(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_from_mobile); MockAppPtr mock_app = CreateMockApp(); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); @@ -279,7 +279,7 @@ typedef ChangeRegistrationRequestTest::MockHMICapabilities MockHMICapabilities; TEST_F(ChangeRegistrationRequestTest, OnEvent_VRHmiSendSuccess_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_from_mobile = CreateMsgFromMobile(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_from_mobile); am::ApplicationSet application_set; @@ -367,7 +367,7 @@ TEST_F(ChangeRegistrationRequestTest, TEST_F(ChangeRegistrationRequestTest, OnEvent_TTS_UNSUPPORTED_RESOURCE_STATE_NOT_AVAILABLE_Expect_false) { MessageSharedPtr msg_from_mobile = CreateMsgFromMobile(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_from_mobile); MockAppPtr mock_app = CreateMockApp(); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app)); @@ -472,7 +472,7 @@ TEST_F(ChangeRegistrationRequestTest, OnEvent_UIHmiSendSuccess_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_from_mobile = CreateMsgFromMobile(); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_from_mobile); am::ApplicationSet application_set; 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 10ffbded09..099dc216c8 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 @@ -38,9 +38,9 @@ #include "mobile/create_interaction_choice_set_response.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "utils/helpers.h" -#include "utils/make_shared.h" + #include "smart_objects/smart_object.h" #include "utils/custom_string.h" #include "application_manager/commands/command_request_test.h" @@ -65,7 +65,7 @@ using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; using ::testing::_; -using ::utils::SharedPtr; + using ::testing::Return; using ::testing::ReturnRef; using ::testing::AtLeast; @@ -77,9 +77,9 @@ namespace custom_str = utils::custom_string; namespace strings = ::application_manager::strings; namespace hmi_response = ::application_manager::hmi_response; -typedef SharedPtr +typedef std::shared_ptr CreateInteractionChoiceSetRequestPtr; -typedef SharedPtr +typedef std::shared_ptr CreateInteractionChoiceSetResponsePtr; typedef NiceMock< @@ -171,7 +171,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeout_GENERIC_ERROR) { am::mobile_api::Result::GENERIC_ERROR; (*msg_vr)[strings::msg_params][strings::success] = false; - utils::SharedPtr req_vr = + std::shared_ptr req_vr = CreateCommand(); MockAppPtr mock_app = CreateMockApp(); @@ -203,7 +203,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_VR_UNSUPPORTED_RESOURCE) { (*msg_vr)[strings::msg_params][strings::choice_set][0][strings::menu_name] = "menu_name"; (*msg_vr)[strings::msg_params][strings::interaction_choice_set_id] = 11; - utils::SharedPtr req_vr = + std::shared_ptr req_vr = CreateCommand(msg_vr); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(mock_app_)); 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 e3a4e0f381..a87d172923 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 @@ -36,7 +36,7 @@ #include "mobile/delete_command_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -64,7 +64,7 @@ using am::event_engine::Event; using am::MockMessageHelper; using am::MockHmiInterfaces; -typedef SharedPtr DeleteCommandPtr; +typedef std::shared_ptr DeleteCommandPtr; namespace { const int32_t kCommandId = 1; @@ -260,7 +260,7 @@ TEST_F(DeleteCommandRequestTest, MessageSharedPtr result_msg( CatchMobileCommandResult(CallOnEvent(*command, event_ui))); - ASSERT_TRUE(result_msg); + ASSERT_TRUE((bool)result_msg); ResultCommandExpectations(result_msg, "UI is not supported by system"); } 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 5cc9dcf543..0ed7a92fa4 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 @@ -39,7 +39,7 @@ #include "mobile/delete_file_response.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "utils/file_system.h" #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" @@ -77,8 +77,8 @@ using am::commands::MessageSharedPtr; using am::event_engine::Event; using am::MockMessageHelper; -typedef SharedPtr DeleteFileRequestPtr; -typedef SharedPtr DeleteFileResponsePtr; +typedef std::shared_ptr DeleteFileRequestPtr; +typedef std::shared_ptr DeleteFileResponsePtr; typedef NiceMock< ::test::components::application_manager_test::MockHMICapabilities> MockHMICapabilities; 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 b2daef9cd2..43c30809e5 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 @@ -37,7 +37,7 @@ #include "mobile/delete_interaction_choice_set_response.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -63,9 +63,9 @@ using sdl_rpc_plugin::commands::DeleteInteractionChoiceSetResponse; using am::commands::MessageSharedPtr; using am::event_engine::Event; -typedef SharedPtr +typedef std::shared_ptr DeleteInteractionChoiceSetRequestPtr; -typedef SharedPtr +typedef std::shared_ptr DeleteInteractionChoiceSetResponsePtr; MATCHER_P(CheckMessageSuccess, success, "") { 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 5dad433d6d..f1c44f86ac 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 @@ -65,8 +65,8 @@ using am::MockMessageHelper; using sdl_rpc_plugin::commands::DeleteSubMenuRequest; using sdl_rpc_plugin::commands::DeleteSubMenuResponse; -typedef SharedPtr DeleteSubMenuRequestPtr; -typedef SharedPtr DeleteSubMenuResponsePtr; +typedef std::shared_ptr DeleteSubMenuRequestPtr; +typedef std::shared_ptr DeleteSubMenuResponsePtr; MATCHER_P(CheckMessageResultCode, result_code, "") { return (*arg)[am::strings::msg_params][am::strings::result_code].asInt() == @@ -123,7 +123,7 @@ TEST_F(DeleteSubMenuRequestTest, DISABLED_OnEvent_UI_UNSUPPORTED_RESOURCE) { (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; (*msg)[am::strings::msg_params][am::strings::menu_id] = 10u; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); 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 bf689629b4..7052830d49 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 @@ -35,7 +35,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -61,7 +61,7 @@ using sdl_rpc_plugin::commands::DialNumberRequest; using am::event_engine::Event; namespace mobile_result = mobile_apis::Result; -typedef SharedPtr DialNumberRequestPtr; +typedef std::shared_ptr DialNumberRequestPtr; namespace { const uint32_t kConnectionKey = 2u; 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 a8afe4007f..c6601d6352 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 @@ -292,18 +292,18 @@ TYPED_TEST_CASE(MobileCommandsTestSecond, MobileCommandsListSecond); TYPED_TEST_CASE(MobileCommandsTestThird, MobileCommandsListThird); TYPED_TEST(MobileCommandsTestFirst, CtorAndDtorCall) { - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(); UNUSED(command); } TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) { - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(); UNUSED(command); } TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) { - utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(); UNUSED(command); } 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 567f46e4ea..304cf13ffd 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 @@ -60,7 +60,7 @@ using sdl_rpc_plugin::commands::EndAudioPassThruRequest; using am::event_engine::Event; using am::MockMessageHelper; -typedef SharedPtr EndAudioPassThruRequestPtr; +typedef std::shared_ptr EndAudioPassThruRequestPtr; class EndAudioPassThruRequestTest : public CommandRequestTest {}; 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 0239f3c7d7..09a3336a10 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 @@ -31,7 +31,7 @@ */ #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" #include "application_manager/application.h" @@ -58,7 +58,7 @@ using sdl_rpc_plugin::commands::GetWayPointsRequest; using application_manager::MockMessageHelper; using application_manager::MockHmiInterfaces; -typedef SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; typedef mobile_apis::Result::eType MobileResult; typedef hmi_apis::Common_Result::eType HmiResult; @@ -75,7 +75,7 @@ class GetWayPointsRequestTest GetWayPointsRequestTest() : mock_app_(CreateMockApp()) {} void SetUp() OVERRIDE { - message_ = utils::MakeShared(::smart_objects::SmartType_Map); + message_ = std::make_shared(::smart_objects::SmartType_Map); (*message_)[am::strings::msg_params] = ::smart_objects::SmartObject(::smart_objects::SmartType_Map); @@ -85,7 +85,7 @@ class GetWayPointsRequestTest MockAppPtr mock_app_; MessageSharedPtr message_; - utils::SharedPtr command_sptr_; + std::shared_ptr command_sptr_; }; class GetWayPointsRequestOnEventTest @@ -133,7 +133,7 @@ TEST_F(GetWayPointsRequestTest, (*message_)[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr null_application_sptr; + std::shared_ptr null_application_sptr; EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(null_application_sptr)); 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 f9fd31f99a..3fcc4225f3 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" @@ -69,10 +69,10 @@ class ListFilesRequestTest }; TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) { - SharedPtr command(CreateCommand()); + std::shared_ptr command(CreateCommand()); ON_CALL(app_mngr_, application(_)) - .WillByDefault(Return(SharedPtr())); + .WillByDefault(Return(std::shared_ptr())); MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command))); EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED, @@ -83,7 +83,7 @@ TEST_F(ListFilesRequestTest, Run_AppNotRegistered_UNSUCCESS) { TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) { MockAppPtr app(CreateMockApp()); - SharedPtr command(CreateCommand()); + std::shared_ptr command(CreateCommand()); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app)); ON_CALL(*app, hmi_level()) @@ -108,7 +108,7 @@ TEST_F(ListFilesRequestTest, Run_TooManyHmiNone_UNSUCCESS) { TEST_F(ListFilesRequestTest, Run_SUCCESS) { MockAppPtr app(CreateMockApp()); - SharedPtr command(CreateCommand()); + std::shared_ptr command(CreateCommand()); EXPECT_CALL(app_mngr_, get_settings()) .WillRepeatedly(ReturnRef(app_mngr_settings_)); 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 d2e86f0103..2ea0091332 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" @@ -61,7 +61,7 @@ using ::testing::_; using ::testing::Types; using ::testing::Return; -using ::utils::SharedPtr; + using am::commands::MessageSharedPtr; namespace { @@ -131,7 +131,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] = mobile_apis::ButtonName::CUSTOM_BUTTON; - SharedPtr command( + std::shared_ptr command( this->template CreateCommand(notification_msg)); command->Run(); @@ -148,7 +148,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, mobile_apis::ButtonName::CUSTOM_BUTTON; (*notification_msg)[am::strings::msg_params][am::strings::app_id] = kAppId; - SharedPtr command( + std::shared_ptr command( this->template CreateCommand(notification_msg)); typename TestFixture::MockAppPtr mock_app = this->CreateMockApp(); @@ -170,7 +170,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, (*notification_msg)[am::strings::msg_params] [am::hmi_response::custom_button_id] = kCustomButtonId; - SharedPtr command( + std::shared_ptr command( this->template CreateCommand(notification_msg)); EXPECT_CALL(this->app_mngr_, application(kAppId)) @@ -192,7 +192,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, (*notification_msg)[am::strings::msg_params] [am::hmi_response::custom_button_id] = kCustomButtonId; - SharedPtr command( + std::shared_ptr command( this->template CreateCommand(notification_msg)); typename TestFixture::MockAppPtr mock_app = this->CreateMockApp(); @@ -216,7 +216,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_CustomButton_SUCCESS) { (*notification_msg)[am::strings::msg_params] [am::hmi_response::custom_button_id] = kCustomButtonId; - SharedPtr command( + std::shared_ptr command( this->template CreateCommand(notification_msg)); typename TestFixture::MockAppPtr mock_app = this->CreateMockApp(); @@ -241,7 +241,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_NoSubscribedApps_UNSUCCESS) { (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] = kButtonName; - SharedPtr command( + std::shared_ptr command( this->template CreateCommand(notification_msg)); const std::vector empty_subscribed_apps_list; @@ -260,7 +260,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_InvalidHmiLevel_UNSUCCESS) { (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] = kButtonName; - SharedPtr command( + std::shared_ptr command( this->template CreateCommand(notification_msg)); typename TestFixture::MockAppPtr mock_app = this->CreateMockApp(); @@ -286,7 +286,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] = kButtonName; - SharedPtr command( + std::shared_ptr command( this->template CreateCommand(notification_msg)); typename TestFixture::MockAppPtr mock_app = this->CreateMockApp(); @@ -312,7 +312,7 @@ TYPED_TEST(OnButtonNotificationCommandsTest, Run_SUCCESS) { (*notification_msg)[am::strings::msg_params][am::hmi_response::button_name] = kButtonName; - SharedPtr command( + std::shared_ptr command( this->template CreateCommand(notification_msg)); typename TestFixture::MockAppPtr mock_app = this->CreateMockApp(); 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 9e12303f23..2fd6f6137d 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -55,7 +55,7 @@ using ::testing::Return; using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::OnCommandNotification; -typedef ::utils::SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; namespace { const uint32_t kAppId = 1u; 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 86df3cdab6..1d6711e36f 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 @@ -63,7 +63,7 @@ TEST_F(OnHashChangeNotificationTest, Run_ValidApp_SUCCESS) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::params][strings::connection_key] = kConnectionKey; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); std::string return_string = "1234"; @@ -93,7 +93,7 @@ TEST_F(OnHashChangeNotificationTest, Run_InvalidApp_NoNotification) { MessageSharedPtr msg = CreateMessage(); (*msg)[strings::params][strings::connection_key] = kConnectionKey; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); std::string return_string; 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 43e01c5a3d..333c204d57 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 @@ -78,7 +78,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_CurrentStateForeground_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); @@ -106,7 +106,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, TEST_F(OnHMIStatusNotificationFromMobileTest, Run_InvalidApp_NoNotification) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); @@ -132,7 +132,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_CurrentStateNotForeground_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); @@ -161,7 +161,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_ProtocolVersionKV3_NoNotification) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); @@ -190,7 +190,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_AppNotRequestedBeforeAndKV3_NoNotification) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); @@ -218,7 +218,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_AppNotRequestedBefore_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); @@ -249,7 +249,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_AnotherForegroundSDLApp_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); 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 afb1574cbf..ba3b1e8f1d 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 @@ -85,7 +85,7 @@ class OnHMIStatusNotificationTest TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); @@ -104,7 +104,7 @@ TEST_F(OnHMIStatusNotificationTest, Run_InvalidApp_NoNotification) { TEST_F(OnHMIStatusNotificationTest, Run_InvalidEnum_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::INVALID_ENUM); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); @@ -121,7 +121,7 @@ TEST_F(OnHMIStatusNotificationTest, Run_InvalidEnum_SUCCESS) { TEST_F(OnHMIStatusNotificationTest, Run_FullAndFalseProperties_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); @@ -143,7 +143,7 @@ TEST_F(OnHMIStatusNotificationTest, Run_FullAndFalseProperties_SUCCESS) { TEST_F(OnHMIStatusNotificationTest, Run_FullAndTrueProperties_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app = CreateMockApp(); 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 ebfc2256ac..04f88e2b13 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 @@ -79,8 +79,8 @@ class OnKeyBoardInputNotificationTest (*msg)[strings::params][strings::protocol_version].asInt()); } - MockAppPtr InitAppSetDataAccessor(SharedPtr& app_set) { - app_set = (!app_set ? ::utils::MakeShared() : app_set); + MockAppPtr InitAppSetDataAccessor(std::shared_ptr& app_set) { + app_set = (!app_set ? std::make_shared() : app_set); MockAppPtr app(CreateMockApp()); app_set->insert(app); EXPECT_CALL(app_mngr_, applications()) @@ -88,14 +88,14 @@ class OnKeyBoardInputNotificationTest return app; } - SharedPtr app_set_; + std::shared_ptr app_set_; std::shared_ptr lock_; }; TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app(InitAppSetDataAccessor(app_set_)); @@ -119,7 +119,7 @@ TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) { TEST_F(OnKeyBoardInputNotificationTest, Run_ActionNotActive_SUCCESS) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app(InitAppSetDataAccessor(app_set_)); @@ -144,7 +144,7 @@ TEST_F(OnKeyBoardInputNotificationTest, Run_ActionNotActive_SUCCESS) { TEST_F(OnKeyBoardInputNotificationTest, Run_InvalidApp_NoNotification) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MockAppPtr mock_app(InitAppSetDataAccessor(app_set_)); 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 d6e1b2fe52..4981301e07 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 @@ -88,7 +88,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_ProprietaryType_SUCCESS) { (*msg)[strings::params][strings::connection_key] = kConnectionKey; (*msg)[strings::msg_params][strings::request_type] = request_type; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); EXPECT_CALL(app_mngr_, application(kConnectionKey)) @@ -128,7 +128,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_HTTPType_SUCCESS) { (*msg)[strings::params][strings::connection_key] = kConnectionKey; (*msg)[strings::msg_params][strings::request_type] = request_type; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); EXPECT_CALL(app_mngr_, application(kConnectionKey)) @@ -162,7 +162,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_InvalidApp_NoNotification) { (*msg)[strings::params][strings::connection_key] = kConnectionKey; (*msg)[strings::msg_params][strings::request_type] = request_type; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); EXPECT_CALL(app_mngr_, application(kConnectionKey)) @@ -185,7 +185,7 @@ TEST_F(OnSystemRequestNotificationTest, Run_RequestNotAllowed_NoNotification) { (*msg)[strings::params][strings::connection_key] = kConnectionKey; (*msg)[strings::msg_params][strings::request_type] = request_type; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); EXPECT_CALL(app_mngr_, application(kConnectionKey)) 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 14939a433d..3d989db478 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 @@ -35,7 +35,7 @@ #include "gtest/gtest.h" #include "mobile/on_tbt_client_state_notification.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -56,7 +56,7 @@ using ::testing::Return; using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::OnTBTClientStateNotification; -typedef ::utils::SharedPtr NotificationPtr; +typedef std::shared_ptr NotificationPtr; namespace { const uint32_t kAppId = 1u; 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 4576637d8d..f69dd5da2e 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 @@ -35,7 +35,7 @@ #include "gtest/gtest.h" #include "mobile/on_touch_event_notification.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -56,7 +56,7 @@ using ::testing::Return; using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::mobile::OnTouchEventNotification; -typedef ::utils::SharedPtr NotificationPtr; +typedef std::shared_ptr NotificationPtr; namespace { const uint32_t kAppId = 1u; 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 e0b7ab3b38..97a290e792 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 @@ -35,7 +35,7 @@ #include "gtest/gtest.h" #include "mobile/on_way_point_change_notification.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -56,7 +56,7 @@ using ::testing::Return; using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::OnWayPointChangeNotification; -typedef ::utils::SharedPtr NotificationPtr; +typedef std::shared_ptr NotificationPtr; namespace { const uint32_t kAppId = 1u; 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 f06a642e3b..7d01dcb722 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 @@ -55,7 +55,7 @@ using sdl_rpc_plugin::commands::PerformAudioPassThruRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using ::utils::SharedPtr; + using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; @@ -80,7 +80,7 @@ class PerformAudioPassThruRequestTest public: PerformAudioPassThruRequestTest() : mock_app_(CreateMockApp()) - , message_(utils::MakeShared(::smart_objects::SmartType_Map)) + , message_(std::make_shared(::smart_objects::SmartType_Map)) , msg_params_((*message_)[am::strings::msg_params]) {} MessageSharedPtr CreateFullParamsUISO() { @@ -151,7 +151,7 @@ class PerformAudioPassThruRequestTest MockAppPtr mock_app_; MessageSharedPtr message_; ::smart_objects::SmartObject& msg_params_; - utils::SharedPtr command_sptr_; + std::shared_ptr command_sptr_; MockAppPtr application_sptr_; }; @@ -162,10 +162,10 @@ TEST_F(PerformAudioPassThruRequestTest, OnTimeout_GENERIC_ERROR) { (*msg_ui)[am::strings::msg_params][am::strings::success] = false; MessageSharedPtr message = - utils::MakeShared(::smart_objects::SmartType_Map); + std::make_shared(::smart_objects::SmartType_Map); (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(message); uint32_t app_id = kConnectionKey; @@ -209,7 +209,7 @@ TEST_F(PerformAudioPassThruRequestTest, EXPECT_CALL(*application_sptr_, hmi_level()) .WillOnce(Return(am::mobile_api::HMILevel::HMI_FULL)); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(mobile_request); ON_CALL(mock_hmi_interfaces_, @@ -271,7 +271,7 @@ TEST_F(PerformAudioPassThruRequestTest, TEST_F(PerformAudioPassThruRequestTest, Run_InvalidApp_ApplicationNotRegisteredResponce) { - utils::SharedPtr null_application_sptr; + std::shared_ptr null_application_sptr; EXPECT_CALL(app_mngr_, application(_)) .WillOnce(Return(null_application_sptr)); 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 2ffe9195b6..e4ed330681 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 @@ -37,9 +37,9 @@ #include "mobile/perform_interaction_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "utils/helpers.h" -#include "utils/make_shared.h" + #include "smart_objects/smart_object.h" #include "utils/custom_string.h" #include "application_manager/commands/command_request_test.h" @@ -63,7 +63,7 @@ using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; using ::testing::_; -using ::utils::SharedPtr; + using ::testing::Return; using ::testing::ReturnRef; using sdl_rpc_plugin::commands::PerformInteractionRequest; @@ -113,7 +113,7 @@ TEST_F(PerformInteractionRequestTest, OnTimeout_VR_GENERIC_ERROR) { MessageSharedPtr request_msg = CreateMessage(smart_objects::SmartType_Map); (*request_msg)[strings::msg_params][strings::interaction_mode] = mobile_apis::InteractionMode::BOTH; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(request_msg); MockAppPtr mock_app; @@ -156,7 +156,7 @@ TEST_F(PerformInteractionRequestTest, (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey; (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] = mobile_apis::InteractionMode::VR_ONLY; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_from_mobile); command->Init(); @@ -210,7 +210,7 @@ TEST_F(PerformInteractionRequestTest, (*msg_from_mobile)[strings::params][strings::connection_key] = kConnectionKey; (*msg_from_mobile)[strings::msg_params][strings::interaction_mode] = mobile_apis::InteractionMode::VR_ONLY; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_from_mobile); ON_CALL(mock_hmi_interfaces_, 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 c5feeeba25..6f151d4080 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 @@ -42,7 +42,7 @@ #include "mobile/put_file_response.h" #include "mobile/put_file_request.h" -#include "utils/make_shared.h" + #include "utils/file_system.h" #include "smart_objects/smart_object.h" #include "interfaces/MOBILE_API.h" @@ -68,8 +68,8 @@ using sdl_rpc_plugin::commands::PutFileResponse; using am::commands::MessageSharedPtr; using policy_test::MockPolicyHandlerInterface; -typedef SharedPtr PutFileRequestPtr; -typedef SharedPtr PutFileResponsePtr; +typedef std::shared_ptr PutFileRequestPtr; +typedef std::shared_ptr PutFileResponsePtr; namespace { const uint32_t kConnectionKey = 1u; @@ -131,7 +131,7 @@ class PutFileResponceTest : public CommandsTest { } MessageSharedPtr message_; - SharedPtr command_sptr_; + std::shared_ptr command_sptr_; }; TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) { @@ -140,7 +140,7 @@ TEST_F(PutFileResponceTest, Run_InvalidApp_ApplicationNotRegisteredResponce) { message_ref[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr null_application_sptr; + std::shared_ptr null_application_sptr; EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(null_application_sptr)); EXPECT_CALL( @@ -158,8 +158,8 @@ TEST_F(PutFileResponceTest, Run_ApplicationRegistered_Success) { kConnectionKey; message_ref[am::strings::msg_params][am::strings::success] = true; - utils::SharedPtr application_sptr = - utils::MakeShared(); + std::shared_ptr application_sptr = + std::make_shared(); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(application_sptr)); 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 a44a4a452a..807d59fac2 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 @@ -36,7 +36,7 @@ #include "gtest/gtest.h" #include "mobile/register_app_interface_request.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" @@ -70,7 +70,7 @@ using ::testing::DoAll; namespace am = ::application_manager; -using ::utils::SharedPtr; + using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::RegisterAppInterfaceRequest; @@ -220,12 +220,12 @@ class RegisterAppInterfaceRequestTest EXPECT_CALL( app_mngr_, OnApplicationSwitched( - MockAppPtr::static_pointer_cast( + std::static_pointer_cast( mock_app))); } MessageSharedPtr msg_; - SharedPtr command_; + std::shared_ptr command_; const utils::custom_string::CustomString app_name_; std::shared_ptr lock_ptr_; @@ -279,7 +279,7 @@ TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) { ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _)) .WillByDefault(Return(true)); policy::StatusNotifier notify_upd_manager = - utils::MakeShared(); + std::make_shared(); ON_CALL(mock_policy_handler_, AddApplication(_, _)) .WillByDefault(Return(notify_upd_manager)); @@ -377,7 +377,7 @@ TEST_F(RegisterAppInterfaceRequestTest, ON_CALL(mock_policy_handler_, GetInitialAppData(kAppId, _, _)) .WillByDefault(Return(true)); policy::StatusNotifier notify_upd_manager = - utils::MakeShared(); + std::make_shared(); ON_CALL(mock_policy_handler_, AddApplication(_, _)) .WillByDefault(Return(notify_upd_manager)); @@ -434,7 +434,7 @@ TEST_F(RegisterAppInterfaceRequestTest, EXPECT_CALL( mock_resume_crt_, CheckApplicationHash( - MockAppPtr::static_pointer_cast( + std::static_pointer_cast( mock_app), request_hash_id)).WillOnce(Return(true)); @@ -469,14 +469,14 @@ TEST_F(RegisterAppInterfaceRequestTest, EXPECT_CALL( mock_resume_crt_, CheckApplicationHash( - MockAppPtr::static_pointer_cast( + std::static_pointer_cast( mock_app), request_hash_id)).WillOnce(Return(false)); EXPECT_CALL( mock_application_helper_, RecallApplicationData( - MockAppPtr::static_pointer_cast( + std::static_pointer_cast( mock_app), _)); @@ -506,7 +506,7 @@ TEST_F(RegisterAppInterfaceRequestTest, EXPECT_CALL( mock_application_helper_, RecallApplicationData( - MockAppPtr::static_pointer_cast( + std::static_pointer_cast( mock_app), _)); 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 4cdf4f8858..6eafae16c2 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 @@ -38,8 +38,8 @@ #include "mobile/reset_global_properties_response.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "smart_objects/smart_object.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" @@ -69,8 +69,8 @@ using am::commands::MessageSharedPtr; using am::event_engine::Event; using am::MockMessageHelper; -typedef SharedPtr ResetGlobalPropertiesRequestPtr; -typedef SharedPtr +typedef std::shared_ptr ResetGlobalPropertiesRequestPtr; +typedef std::shared_ptr ResetGlobalPropertiesResponsePtr; namespace { @@ -219,7 +219,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) { EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true)); smart_objects::SmartObjectSPtr vr_help = - ::utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_)) .WillOnce(Return(vr_help)); @@ -232,7 +232,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, Run_SUCCESS) { set_menu_title(msg_params[am::hmi_request::menu_title])); const smart_objects::SmartObjectSPtr so_help_prompt = - ::utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); EXPECT_CALL(*mock_app_, help_prompt()).WillOnce(Return(so_help_prompt.get())); EXPECT_CALL(*mock_app_, timeout_prompt()) @@ -271,7 +271,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, set_reset_global_properties_active(true)); smart_objects::SmartObjectSPtr vr_help = - ::utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_)) .WillOnce(Return(vr_help)); @@ -310,7 +310,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, set_timeout_prompt(_)); smart_objects::SmartObjectSPtr prompt = - utils::MakeShared(); + std::make_shared(); *prompt = "prompt"; EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get())); @@ -368,7 +368,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, OnEvent_InvalidApp_NoHashUpdate) { hmi_apis::FunctionID::UI_SetGlobalProperties))) .WillOnce(Return(true)); smart_objects::SmartObjectSPtr vr_help = - ::utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); EXPECT_CALL(mock_message_helper_, CreateAppVrHelp(_)) .WillOnce(Return(vr_help)); @@ -406,7 +406,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, set_timeout_prompt(_)); smart_objects::SmartObjectSPtr prompt = - utils::MakeShared(); + std::make_shared(); *prompt = "prompt"; EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get())); @@ -439,7 +439,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, // TTS doesn't respond, so timeout should send generic error smart_objects::SmartObjectSPtr response = - utils::MakeShared(); + std::make_shared(); (*response)[am::strings::msg_params][am::strings::result_code] = mobile_apis::Result::GENERIC_ERROR; EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _)) @@ -471,7 +471,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, set_timeout_prompt(_)); smart_objects::SmartObjectSPtr prompt = - utils::MakeShared(); + std::make_shared(); *prompt = "prompt"; EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get())); @@ -501,7 +501,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, // UI doesn't respond, so timeout should send generic error smart_objects::SmartObjectSPtr response = - utils::MakeShared(); + std::make_shared(); (*response)[am::strings::msg_params][am::strings::result_code] = mobile_apis::Result::GENERIC_ERROR; EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _)) @@ -535,7 +535,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, EXPECT_CALL(*mock_app_, set_timeout_prompt(_)); smart_objects::SmartObjectSPtr prompt = - utils::MakeShared(); + std::make_shared(); *prompt = "prompt"; EXPECT_CALL(*mock_app_, timeout_prompt()).WillOnce(Return(prompt.get())); @@ -555,7 +555,7 @@ TEST_F(ResetGlobalPropertiesRequestTest, // TTS and UI don't respond, so timeout should send generic error std::string info = "TTS, UI component does not respond"; smart_objects::SmartObjectSPtr response = - utils::MakeShared(); + std::make_shared(); (*response)[am::strings::msg_params][am::strings::result_code] = mobile_apis::Result::GENERIC_ERROR; EXPECT_CALL(mock_message_helper_, CreateNegativeResponse(_, _, _, _)) 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 f550043414..382ccf4b0e 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 @@ -61,7 +61,7 @@ using sdl_rpc_plugin::commands::ScrollableMessageRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using ::utils::SharedPtr; + using ::testing::_; using ::testing::Eq; using ::testing::Ref; @@ -116,7 +116,7 @@ class ScrollableMessageRequestTest MockAppPtr mock_app_; MessageSharedPtr msg_; - SharedPtr command_; + std::shared_ptr command_; }; typedef ScrollableMessageRequestTest::MockHMICapabilities MockHMICapabilities; @@ -125,7 +125,7 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_ui = CreateFullParamsUISO(); (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_ui); MockAppPtr mock_app = CreateMockApp(); 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 c0c44922e3..6c7127e48c 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 @@ -57,8 +57,8 @@ using sdl_rpc_plugin::commands::SendHapticDataRequest; using sdl_rpc_plugin::commands::SendHapticDataResponse; using am::commands::MessageSharedPtr; -typedef SharedPtr SendHapticDataRequestPtr; -typedef SharedPtr SendHapticDataResponsePtr; +typedef std::shared_ptr SendHapticDataRequestPtr; +typedef std::shared_ptr SendHapticDataResponsePtr; namespace { const uint32_t kConnectionKey = 1u; @@ -91,7 +91,7 @@ class SendHapticDataResponseTest } MessageSharedPtr message_; - SharedPtr command_sptr_; + std::shared_ptr command_sptr_; }; TEST_F(SendHapticDataRequestTest, Run_SUCCESS) { 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 d0072f6288..bf75e651c6 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 @@ -36,7 +36,7 @@ #include "mobile/send_location_request.h" #include "application_manager/mock_hmi_capabilities.h" #include "application_manager/mock_message_helper.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/command_request_test.h" namespace test { @@ -50,7 +50,7 @@ using sdl_rpc_plugin::commands::SendLocationRequest; using application_manager::MockMessageHelper; using test::components::application_manager_test::MockHMICapabilities; using smart_objects::SmartObject; -using utils::SharedPtr; + using testing::_; using testing::Return; using testing::ReturnRef; @@ -95,11 +95,11 @@ class SendLocationRequestTest } }; - typedef SharedPtr CommandSPrt; + typedef std::shared_ptr CommandSPrt; SendLocationRequestTest() { mock_app_ = CreateMockApp(); - disp_cap_ = utils::MakeShared(smart_objects::SmartType_Map); + disp_cap_ = std::make_shared(smart_objects::SmartType_Map); message_ = CreateMessage(); command_ = CreateCommand(message_); } @@ -158,7 +158,7 @@ class SendLocationRequestTest } MockAppPtr mock_app_; - SharedPtr disp_cap_; + std::shared_ptr disp_cap_; MessageSharedPtr message_; CommandSPrt command_; }; 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 e1612dbacb..75d3992c43 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 @@ -60,7 +60,7 @@ using am::MockMessageHelper; using am::MockHmiInterfaces; using test::components::protocol_handler_test::MockProtocolHandler; using test::components::protocol_handler_test::MockProtocolHandlerSettings; -using ::utils::SharedPtr; + using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; @@ -110,7 +110,7 @@ TEST_F(SetAppIconRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { ON_CALL(app_mngr_settings_, app_icons_folder()) .WillByDefault(ReturnRef(dir_path)); - utils::SharedPtr req_vr = + std::shared_ptr req_vr = CreateCommand(msg_vr); MockAppPtr mock_app = CreateMockApp(); 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 0758fb32f4..1ff65196bf 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 @@ -57,12 +57,12 @@ using sdl_rpc_plugin::commands::SetDisplayLayoutRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; -using ::utils::SharedPtr; + using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -typedef ::utils::SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; namespace { const uint32_t kAppId = 1u; @@ -132,7 +132,7 @@ TEST_F(SetDisplayLayoutRequestTest, MessageSharedPtr msg_ui = CreateFullParamsUISO(); (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_ui); MockAppPtr mock_app = CreateMockApp(); 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 f39ccf7be3..e849866c1a 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 @@ -58,7 +58,7 @@ using am::commands::MessageSharedPtr; using am::MockMessageHelper; using am::CommandsMap; using utils::custom_string::CustomString; -using ::utils::SharedPtr; + using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; @@ -127,7 +127,7 @@ class SetGlobalPropertiesRequestTest } void OnEventUISetupHelper(MessageSharedPtr msg, - SharedPtr command) { + std::shared_ptr command) { SmartObject vr_help_title("yes"); SmartObject vr_help_array(smart_objects::SmartType_Array); VRArraySetupHelper(msg, vr_help_title, vr_help_array); @@ -154,7 +154,7 @@ class SetGlobalPropertiesRequestTest } void OnEventTTSSetupHelper(MessageSharedPtr msg, - SharedPtr command) { + std::shared_ptr command) { SmartObject help_prompt(smart_objects::SmartType_Array); help_prompt[0][am::strings::text] = "Help_Prompt_One"; (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt; @@ -275,7 +275,7 @@ TEST_F(SetGlobalPropertiesRequestTest, (*msg_vr)[am::strings::msg_params][am::strings::vr_commands][0] = "vr_command"; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_vr); EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey)); @@ -360,7 +360,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_SUCCESS_Expect_MessageNotSend) { am::event_engine::Event event(hmi_apis::FunctionID::TTS_SetGlobalProperties); event.set_smart_object(*response); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(response); MockAppPtr mock_app(CreateMockApp()); @@ -393,7 +393,7 @@ TEST_F(SetGlobalPropertiesRequestTest, am::event_engine::Event event_ui( hmi_apis::FunctionID::UI_SetGlobalProperties); event_tts.set_smart_object(*response); - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(response); EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) @@ -427,7 +427,7 @@ TEST_F(SetGlobalPropertiesRequestTest, TEST_F(SetGlobalPropertiesRequestTest, Run_VRNoMenuAndKeyboard_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL( mock_hmi_interfaces_, @@ -484,7 +484,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRWithMenuAndKeyboard_SUCCESS) { EXPECT_CALL(*mock_help_prompt_manager_, OnSetGlobalPropertiesReceived(_, false)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -506,7 +506,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenMenuIcon_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -528,7 +528,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenVRHelp_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -552,7 +552,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRIncorrectSyntax_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -573,7 +573,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingTitle_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey)); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -590,7 +590,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingArray_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey)); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -611,7 +611,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRWrongOrder_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey)); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -642,7 +642,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVR_SUCCESS) { GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -671,7 +671,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataNoDefault_Canceled) { GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -699,7 +699,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoVRNoDataDefaultCreated_SUCCESS) { GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -741,7 +741,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) { EXPECT_CALL(*mock_help_prompt_manager_, OnSetGlobalPropertiesReceived(_, false)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -775,7 +775,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyHelp_SUCCESS) { .WillOnce(ReturnRef(*mock_help_prompt_manager_.get())); EXPECT_CALL(*mock_help_prompt_manager_, OnSetGlobalPropertiesReceived(_, false)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -809,7 +809,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSOnlyTimeout_SUCCESS) { .WillOnce(ReturnRef(*mock_help_prompt_manager_.get())); EXPECT_CALL(*mock_help_prompt_manager_, OnSetGlobalPropertiesReceived(_, false)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -826,7 +826,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSIncorrectSyntax_Canceled) { EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -842,7 +842,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidHelpPromptText_INVALID_DATA) { ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectInvalidData(); @@ -860,7 +860,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidVrHelpText_INVALID_DATA) { ExpectVerifyImageVrHelpSuccess(vr_help); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectInvalidData(); @@ -879,7 +879,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidImageValue_INVALID_DATA) { ExpectVerifyImageVrHelpSuccess(vr_help); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectInvalidData(); @@ -897,7 +897,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuIcon_INVALID_DATA) { ExpectVerifyImageSuccess(menu_icon); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectInvalidData(); @@ -914,7 +914,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuTitle_INVALID_DATA) { ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectInvalidData(); @@ -934,7 +934,7 @@ TEST_F(SetGlobalPropertiesRequestTest, ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectInvalidData(); @@ -954,7 +954,7 @@ TEST_F(SetGlobalPropertiesRequestTest, ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectInvalidData(); @@ -968,7 +968,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoData_Canceled) { ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -982,7 +982,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidApp_Canceled) { EmptyExpectationsSetupHelper(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -994,7 +994,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_PendingRequest_UNSUCCESS) { hmi_apis::Common_Result::SUCCESS; (*msg)[am::strings::params][am::hmi_response::code] = response_code; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); Event event(hmi_apis::FunctionID::UI_SetGlobalProperties); @@ -1022,7 +1022,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndSuccessResultCode_SUCCESS) { GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); OnEventUISetupHelper(msg, command); @@ -1050,7 +1050,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_UIAndWarningResultCode_SUCCESS) { hmi_apis::Common_Result::WARNINGS; (*msg)[am::strings::params][am::hmi_response::code] = response_code; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ON_CALL( mock_hmi_interfaces_, @@ -1090,7 +1090,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) { ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_UI)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); OnEventUISetupHelper(msg, command); @@ -1111,7 +1111,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) { TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidEventID_Canceled) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(mock_app_)); @@ -1136,7 +1136,7 @@ TEST_F(SetGlobalPropertiesRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); OnEventTTSSetupHelper(msg, command); @@ -1170,7 +1170,7 @@ TEST_F(SetGlobalPropertiesRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(am::HmiInterfaces::HMI_INTERFACE_TTS)) .WillByDefault(Return(am::HmiInterfaces::STATE_NOT_AVAILABLE)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); OnEventTTSSetupHelper(msg, command); 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 9d2dd996bc..e6557bdad2 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 @@ -60,7 +60,7 @@ using ::testing::ReturnRef; namespace UpdateMode = mobile_apis::UpdateMode; -typedef SharedPtr SetMediaClockRequestPtr; +typedef std::shared_ptr SetMediaClockRequestPtr; namespace { const uint32_t kConnectionKey = 2u; @@ -116,7 +116,7 @@ TEST_F(SetMediaClockRequestTest, MessageSharedPtr msg = CreateMessage(smart_objects::SmartType_Map); (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg); MessageSharedPtr ev_msg = CreateMessage(smart_objects::SmartType_Map); @@ -160,7 +160,7 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountUp_SUCCESS) { (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] = kSeconds; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) @@ -196,7 +196,7 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountDown_SUCCESS) { (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] = kMinutes; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) @@ -232,7 +232,7 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountUpWrongTime_Canceled) { (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::minutes] = kMinutes; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectationsSetupHelper(true); @@ -255,7 +255,7 @@ TEST_F(SetMediaClockRequestTest, Run_UpdateCountDownWrongTime_Canceled) { (*msg)[am::strings::msg_params][am::strings::end_time][am::strings::seconds] = kSeconds; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) @@ -273,7 +273,7 @@ TEST_F(SetMediaClockRequestTest, Run_NoStartTime_Canceled) { (*msg)[am::strings::msg_params][am::strings::update_mode] = UpdateMode::COUNTDOWN; - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectationsSetupHelper(true); @@ -284,7 +284,7 @@ TEST_F(SetMediaClockRequestTest, Run_NoStartTime_Canceled) { TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectationsSetupHelper(true); @@ -295,7 +295,7 @@ TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) { TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); ExpectationsSetupHelper(false); @@ -306,7 +306,7 @@ TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) { TEST_F(SetMediaClockRequestTest, Run_InvalidApp_Canceled) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) @@ -332,7 +332,7 @@ TEST_F(SetMediaClockRequestTest, OnEvent_Success) { Event event(hmi_apis::FunctionID::UI_SetMediaClockTimer); event.set_smart_object(*msg); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->on_event(event); } @@ -340,7 +340,7 @@ TEST_F(SetMediaClockRequestTest, OnEvent_Success) { TEST_F(SetMediaClockRequestTest, OnEvent_Canceled) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); Event event(hmi_apis::FunctionID::UI_Slider); 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 9d5497d4a7..53e803b415 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 @@ -57,7 +57,7 @@ using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; using test::components::policy_test::MockPolicyHandlerInterface; -using ::utils::SharedPtr; + using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; @@ -211,7 +211,7 @@ TEST_F(ShowRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { (*msg_vr)[am::strings::msg_params][am::strings::menu_params] [am::strings::menu_name] = "menu_name"; - utils::SharedPtr command = CreateCommand(msg_vr); + std::shared_ptr command = CreateCommand(msg_vr); MockAppPtr mock_app = CreateMockApp(); ON_CALL(app_mngr_, application(kConnectionKey)) @@ -257,7 +257,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_SUCCESS) { msg_params[am::strings::soft_buttons] = "Soft_Buttons"; (*msg)[am::strings::msg_params] = msg_params; SmartObject creation_msg_params(msg_params); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -284,7 +284,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonNotExists_SUCCESS) { SmartObject msg_params(smart_objects::SmartType_Map); msg_params[am::strings::soft_buttons] = ""; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -309,7 +309,7 @@ TEST_F(ShowRequestTest, Run_SoftButtonExists_Canceled) { msg_params[am::strings::soft_buttons] = "Soft_Buttons"; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -336,7 +336,7 @@ TEST_F(ShowRequestTest, Run_Graphic_SUCCESS) { msg_params[am::strings::graphic] = graphic; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -363,7 +363,7 @@ TEST_F(ShowRequestTest, Run_Graphic_Canceled) { msg_params[am::strings::graphic] = graphic; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -386,7 +386,7 @@ TEST_F(ShowRequestTest, Run_Graphic_WrongSyntax) { msg_params[am::strings::graphic] = graphic; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -409,7 +409,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_SUCCESS) { msg_params[am::strings::secondary_graphic] = graphic; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -435,7 +435,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_Canceled) { msg_params[am::strings::secondary_graphic] = graphic; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -459,7 +459,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) { msg_params[am::strings::secondary_graphic] = graphic; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -476,7 +476,7 @@ TEST_F(ShowRequestTest, Run_SecondaryGraphic_WrongSyntax) { TEST_F(ShowRequestTest, Run_MainField1_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_1"; TestSetupHelper(msg, @@ -489,7 +489,7 @@ TEST_F(ShowRequestTest, Run_MainField1_SUCCESS) { TEST_F(ShowRequestTest, Run_MainField1_WrongSyntax) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_1\\n"; TestSetupHelperWrongSyntax(msg, @@ -502,7 +502,7 @@ TEST_F(ShowRequestTest, Run_MainField1_WrongSyntax) { TEST_F(ShowRequestTest, Run_MainField2_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_2"; TestSetupHelper(msg, @@ -514,7 +514,7 @@ TEST_F(ShowRequestTest, Run_MainField2_SUCCESS) { TEST_F(ShowRequestTest, Run_MainField2_WrongSyntax) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_2\\n"; TestSetupHelperWrongSyntax(msg, @@ -526,7 +526,7 @@ TEST_F(ShowRequestTest, Run_MainField2_WrongSyntax) { TEST_F(ShowRequestTest, Run_MainField3_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_3"; TestSetupHelper(msg, @@ -538,7 +538,7 @@ TEST_F(ShowRequestTest, Run_MainField3_SUCCESS) { TEST_F(ShowRequestTest, Run_MainField3_WrongSyntax) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_3\\n"; TestSetupHelperWrongSyntax(msg, @@ -550,7 +550,7 @@ TEST_F(ShowRequestTest, Run_MainField3_WrongSyntax) { TEST_F(ShowRequestTest, Run_MainField4_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_4"; TestSetupHelper(msg, @@ -562,7 +562,7 @@ TEST_F(ShowRequestTest, Run_MainField4_SUCCESS) { TEST_F(ShowRequestTest, Run_MainField4_WrongSyntax) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_4\\n"; TestSetupHelperWrongSyntax(msg, @@ -574,7 +574,7 @@ TEST_F(ShowRequestTest, Run_MainField4_WrongSyntax) { TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_1"; const size_t num_tags = 1; @@ -590,7 +590,7 @@ TEST_F(ShowRequestTest, Run_MainField1_MetadataTag) { TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_1"; const size_t num_tags = 5; @@ -610,7 +610,7 @@ TEST_F(ShowRequestTest, Run_MainField1_MultipleMetadataTags) { TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_2"; const size_t num_tags = 1; @@ -626,7 +626,7 @@ TEST_F(ShowRequestTest, Run_MainField2_MetadataTag) { TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_3"; const size_t num_tags = 1; @@ -642,7 +642,7 @@ TEST_F(ShowRequestTest, Run_MainField3_MetadataTag) { TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_4"; const size_t num_tags = 1; @@ -658,7 +658,7 @@ TEST_F(ShowRequestTest, Run_MainField4_MetadataTag) { TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Main_Field_1"; const size_t num_tags = 1; @@ -700,7 +700,7 @@ TEST_F(ShowRequestTest, Run_MainField1_MetadataTagWithNoFieldData) { TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Media_Clock"; TestSetupHelper(msg, @@ -712,7 +712,7 @@ TEST_F(ShowRequestTest, Run_MediaClock_SUCCESS) { TEST_F(ShowRequestTest, Run_MediaClock_WrongSyntax) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Media_Clock\\n"; TestSetupHelperWrongSyntax(msg, @@ -724,7 +724,7 @@ TEST_F(ShowRequestTest, Run_MediaClock_WrongSyntax) { TEST_F(ShowRequestTest, Run_MediaTrack_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Media_Track"; TestSetupHelper(msg, @@ -736,7 +736,7 @@ TEST_F(ShowRequestTest, Run_MediaTrack_SUCCESS) { TEST_F(ShowRequestTest, Run_MediaTrack_WrongSyntax) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Media_Track\\n"; TestSetupHelperWrongSyntax(msg, @@ -748,7 +748,7 @@ TEST_F(ShowRequestTest, Run_MediaTrack_WrongSyntax) { TEST_F(ShowRequestTest, Run_StatusBar_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Status_Bar"; TestSetupHelper( @@ -759,7 +759,7 @@ TEST_F(ShowRequestTest, Run_StatusBar_SUCCESS) { TEST_F(ShowRequestTest, Run_StatusBar_WrongSyntax) { MessageSharedPtr msg = CreateMessage(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); text_field_ = "Status_Bar\\n"; TestSetupHelperWrongSyntax( @@ -773,7 +773,7 @@ TEST_F(ShowRequestTest, Run_Alignment_SUCCESS) { msg_params[am::strings::alignment] = "Alignment"; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -797,7 +797,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_SUCCESS) { msg_params[am::strings::custom_presets] = custom_presets; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -820,7 +820,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) { msg_params[am::strings::custom_presets] = custom_presets; (*msg)[am::strings::msg_params] = msg_params; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -836,7 +836,7 @@ TEST_F(ShowRequestTest, Run_CustomPresets_WrongSyntax) { TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(MockAppPtr())); @@ -851,7 +851,7 @@ TEST_F(ShowRequestTest, Run_InvalidApp_Canceled) { TEST_F(ShowRequestTest, Run_EmptyParams_Canceled) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(app_mngr_, application(kConnectionKey)) .WillOnce(Return(mock_app_)); @@ -869,7 +869,7 @@ TEST_F(ShowRequestTest, OnEvent_SuccessResultCode_SUCCESS) { hmi_apis::Common_Result::eType::SUCCESS; (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::eType::SUCCESS), _)); @@ -889,7 +889,7 @@ TEST_F(ShowRequestTest, OnEvent_WarningsResultCode_SUCCESS) { (*msg)[am::strings::params][am::hmi_response::message] = "Response Info"; (*msg)[am::strings::msg_params] = SmartObject(smart_objects::SmartType_Map); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)); Event event(hmi_apis::FunctionID::UI_Show); @@ -905,7 +905,7 @@ TEST_F(ShowRequestTest, OnEvent_WrongFunctionID_Canceled) { (*msg)[am::strings::params][am::hmi_response::code] = mobile_apis::Result::SUCCESS; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); Event event(hmi_apis::FunctionID::UI_Alert); 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 dcdda55b1c..d96a9d7643 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/mock_message_helper.h" @@ -85,7 +85,7 @@ MATCHER(CheckNotificationMessage, "") { TYPED_TEST_CASE(MobileNotificationCommandsTest, NotificationCommandsList); TYPED_TEST(MobileNotificationCommandsTest, Run_SendMessageToMobile_SUCCESS) { - ::utils::SharedPtr command = + std::shared_ptr command = this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToMobile(CheckNotificationMessage(), _)); 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 cf1f7c6711..bbd39874e0 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 @@ -35,7 +35,7 @@ #include "gtest/gtest.h" #include "utils/helpers.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application_manager.h" #include "mobile/delete_command_response.h" @@ -125,7 +125,7 @@ typedef Types command = + std::shared_ptr command = this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToMobile(NotNull(), _)); command->Run(); @@ -154,7 +154,7 @@ MATCHER_P2(CheckMessageParams, success, result, "") { TEST_F(GenericResponseFromHMICommandsTest, Run_SUCCESS) { MessageSharedPtr command_msg(CreateMessage(smart_objects::SmartType_Map)); - SharedPtr command( + std::shared_ptr command( CreateCommand(command_msg)); EXPECT_CALL( @@ -175,7 +175,7 @@ TEST_F(ScrollableMessageResponseTest, Run_SUCCESS) { MockAppPtr app(CreateMockApp()); - SharedPtr command( + std::shared_ptr command( CreateCommand(message)); EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app)); EXPECT_CALL(*app, UnsubscribeFromSoftButtons(_)); 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 a039581284..9e7d826f2a 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 @@ -57,12 +57,12 @@ using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; using policy_test::MockPolicyHandlerInterface; -using ::utils::SharedPtr; + using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -typedef SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; namespace { const int32_t kCommandId = 1; @@ -140,7 +140,7 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_ui = CreateFullParamsUISO(); (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(msg_ui); MockAppPtr mock_app = CreateMockApp(); 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 ab086de0e6..dfb8452003 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 @@ -34,14 +34,14 @@ #include #include "gtest/gtest.h" #include "mobile/speak_request.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" -#include "utils/shared_ptr.h" + #include "utils/helpers.h" -#include "utils/make_shared.h" + #include "smart_objects/smart_object.h" #include "utils/custom_string.h" #include "application_manager/application.h" @@ -68,13 +68,13 @@ using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; using ::testing::_; -using ::utils::SharedPtr; + using ::testing::Return; using ::testing::ReturnRef; using sdl_rpc_plugin::commands::SpeakRequest; using ::test::components::application_manager_test::MockApplication; -typedef SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; namespace { const uint32_t kAppId = 10u; @@ -92,7 +92,7 @@ class SpeakRequestTest : public CommandRequestTest { const mobile_apis::Result::eType mobile_response, const am::HmiInterfaces::InterfaceState state, const bool success) { - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(request_); (*response_)[strings::params][hmi_response::code] = hmi_response; @@ -129,7 +129,7 @@ class SpeakRequestTest : public CommandRequestTest { }; TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) { - utils::SharedPtr command = + std::shared_ptr command = CreateCommand(request_); (*response_)[strings::params][hmi_response::code] = 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 17c4db36bc..bbc18504a6 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" @@ -61,7 +61,7 @@ namespace am = ::application_manager; using sdl_rpc_plugin::commands::SubscribeButtonRequest; using am::commands::MessageSharedPtr; -typedef SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; class SubscribeButtonRequestTest : public CommandRequestTest { @@ -78,7 +78,7 @@ TEST_F(SubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) { CommandPtr command(CreateCommand()); ON_CALL(app_mngr_, application(_)) - .WillByDefault(Return(SharedPtr())); + .WillByDefault(Return(std::shared_ptr())); MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command))); EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED, 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 e944c3eb39..d08c13b3f3 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 @@ -31,7 +31,7 @@ */ #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" @@ -61,7 +61,7 @@ namespace am = ::application_manager; using sdl_rpc_plugin::commands::SubscribeWayPointsRequest; using am::commands::MessageSharedPtr; -typedef SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; class SubscribeWayPointsRequestTest : public CommandRequestTest {}; 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 7214e0eea4..9e6bc8f505 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 @@ -58,7 +58,7 @@ using am::MockHmiInterfaces; using am::event_engine::Event; using am::MessageType; using policy_test::MockPolicyHandlerInterface; -using ::utils::SharedPtr; + using ::testing::_; using ::testing::DoAll; using ::testing::Return; @@ -126,7 +126,7 @@ TEST_F(SystemRequestTest, Run_HTTP_FileName_no_binary_data_REJECTED) { ExpectManageMobileCommandWithResultCode(mobile_apis::Result::REJECTED); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); command->Run(); } @@ -163,7 +163,7 @@ TEST_F(SystemRequestTest, EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); ASSERT_TRUE(command->Init()); command->Run(); @@ -203,7 +203,7 @@ TEST_F( ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED); EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); ASSERT_TRUE(command->Init()); command->Run(); } @@ -224,7 +224,7 @@ TEST_F(SystemRequestTest, Run_RequestTypeDisallowed_SendDisallowedResponse) { ExpectManageMobileCommandWithResultCode(mobile_apis::Result::DISALLOWED); EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)).Times(0); - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); ASSERT_TRUE(command->Init()); command->Run(); } 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 1c4df3a463..771374348b 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" @@ -54,7 +54,7 @@ using ::testing::_; using sdl_rpc_plugin::commands::UnregisterAppInterfaceRequest; using am::commands::MessageSharedPtr; -typedef ::utils::SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; class UnregisterAppInterfaceRequestTest : public CommandRequestTest {}; 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 439e94b94f..e363567c64 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 @@ -2,7 +2,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" @@ -23,7 +23,7 @@ using ::testing::_; using sdl_rpc_plugin::commands::UnsubscribeButtonRequest; using am::commands::MessageSharedPtr; -typedef ::utils::SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; namespace { const uint32_t kConnectionKey = 1u; 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 a6e1eb0518..042604b672 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 @@ -36,7 +36,7 @@ #include "gtest/gtest.h" #include "mobile/unsubscribe_way_points_request.h" #include "interfaces/MOBILE_API.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" @@ -78,7 +78,7 @@ class UnSubscribeWayPointsRequestTest } MessageSharedPtr command_msg_; - ::utils::SharedPtr command_; + std::shared_ptr command_; }; TEST_F(UnSubscribeWayPointsRequestTest, 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 d1f59bb3a4..acb421af6b 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 @@ -36,7 +36,7 @@ #include "gtest/gtest.h" #include "mobile/update_turn_list_request.h" #include "interfaces/MOBILE_API.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" @@ -88,7 +88,7 @@ class UpdateTurnListRequestTest } MessageSharedPtr command_msg_; - ::utils::SharedPtr command_; + std::shared_ptr command_; }; TEST_F(UpdateTurnListRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { @@ -214,7 +214,7 @@ TEST_F(UpdateTurnListRequestTest, Run_ValidTurnList_SUCCESS) { SubscribeApplicationToSoftButton(_, _, kFunctionId)); MessageSharedPtr result_msg(CatchHMICommandResult(CallRun(*command_))); - ASSERT_TRUE(result_msg); + ASSERT_TRUE((bool)result_msg); EXPECT_EQ( hmi_apis::FunctionID::Navigation_UpdateTurnList, (*result_msg)[am::strings::params][am::strings::function_id].asInt()); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc index 3401849861..04bcc435ba 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/commands/hmi/vi_is_ready_request.cc @@ -100,7 +100,7 @@ void VIIsReadyRequest::onTimeOut() { } void VIIsReadyRequest::SendMessageToHMI() { - utils::SharedPtr get_type( + std::shared_ptr get_type( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::VehicleInfo_GetVehicleType, application_manager_)); diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc index ed4755a818..a19fdbee97 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc @@ -118,7 +118,7 @@ VehicleInfoAppExtension& VehicleInfoAppExtension::ExtractVIExtension( DCHECK(ext_ptr); DCHECK(dynamic_cast(ext_ptr.get())); auto vi_app_extension = - application_manager::AppExtensionPtr::static_pointer_cast< + std::static_pointer_cast< VehicleInfoAppExtension>(ext_ptr); DCHECK(vi_app_extension); return *vi_app_extension; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc index 7b94d22312..b16993b002 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc @@ -74,7 +74,7 @@ void VehicleInfoPlugin::OnApplicationEvent( plugins::ApplicationEvent event, app_mngr::ApplicationSharedPtr application) { if (plugins::ApplicationEvent::kApplicationRegistered == event) { - application->AddExtension(new VehicleInfoAppExtension(*this, *application)); + application->AddExtension(std::make_shared(*this, *application)); } } 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 ddfc8e8a55..0508f0cdd6 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 @@ -35,7 +35,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -65,7 +65,7 @@ using vehicle_info_plugin::commands::VIGetVehicleDataResponse; using am::event_engine::Event; using test::components::event_engine_test::MockEventDispatcher; -typedef SharedPtr VIGetVehicleDataResponsePtr; +typedef std::shared_ptr VIGetVehicleDataResponsePtr; namespace { const uint32_t kConnectionKey = 2u; 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 d0093f45cf..d4477d5d5f 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 @@ -33,7 +33,7 @@ #include "hmi/vi_is_ready_request.h" #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command_request_test.h" @@ -59,7 +59,7 @@ using am::commands::MessageSharedPtr; using vehicle_info_plugin::commands::VIIsReadyRequest; using am::event_engine::Event; -typedef SharedPtr VIIsReadyRequestPtr; +typedef std::shared_ptr VIIsReadyRequestPtr; class VIIsReadyRequestTest : public CommandRequestTest { 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 3f684cae3f..9cdf60b1ea 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 @@ -35,7 +35,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -63,7 +63,7 @@ using vehicle_info_plugin::commands::DiagnosticMessageRequest; using am::event_engine::Event; namespace mobile_result = mobile_apis::Result; -typedef SharedPtr DiagnosticMessageRequestPtr; +typedef std::shared_ptr DiagnosticMessageRequestPtr; namespace { const uint32_t kConnectionKey = 2u; 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 9719d3ceed..4473a36c63 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 @@ -35,7 +35,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -64,7 +64,7 @@ using am::MockMessageHelper; using testing::Mock; namespace mobile_result = mobile_apis::Result; -typedef SharedPtr GetDTCsRequestPtr; +typedef std::shared_ptr GetDTCsRequestPtr; class GetDTCsRequestTest : public CommandRequestTest { 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 4ad8a84189..a88d362968 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 @@ -35,7 +35,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -63,7 +63,7 @@ using vehicle_info_plugin::commands::GetVehicleDataRequest; using am::event_engine::Event; namespace mobile_result = mobile_apis::Result; -typedef SharedPtr GetVehicleDataRequestPtr; +typedef std::shared_ptr GetVehicleDataRequestPtr; namespace { const uint32_t kConnectionKey = 2u; @@ -160,7 +160,7 @@ TEST_F(GetVehicleDataRequestTest, (*command_msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; - SharedPtr command( + std::shared_ptr command( CreateCommand(command_msg)); const am::VehicleData kEmptyVehicleData; @@ -212,7 +212,7 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_UnknownEvent_UNSUCCESS) { (*command_msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; - SharedPtr command( + std::shared_ptr command( CreateCommand(command_msg)); Event event(hmi_apis::FunctionID::INVALID_ENUM); @@ -232,7 +232,7 @@ TEST_F(GetVehicleDataRequestTest, OnEvent_DataNotAvailable_SUCCESS) { (*command_msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; - SharedPtr command( + std::shared_ptr command( CreateCommand(command_msg)); MessageSharedPtr event_msg(CreateMessage(smart_objects::SmartType_Map)); 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 3cc5af575e..1e8a289637 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 @@ -36,7 +36,7 @@ #include "gtest/gtest.h" #include "mobile/on_vehicle_data_notification.h" -#include "utils/shared_ptr.h" + #include "utils/custom_string.h" #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" @@ -61,7 +61,7 @@ using ::testing::ReturnRef; using am::commands::MessageSharedPtr; using vehicle_info_plugin::commands::OnVehicleDataNotification; -typedef ::utils::SharedPtr NotificationPtr; +typedef std::shared_ptr NotificationPtr; namespace { const uint32_t kAppId = 1u; 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 7cdeb2541c..c468a82bad 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" @@ -62,14 +62,14 @@ namespace am = ::application_manager; using vehicle_info_plugin::commands::ReadDIDRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; -using ::utils::SharedPtr; + class ReadDIDRequestTest : public CommandRequestTest {}; TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) { Event event(Event::EventID::INVALID_ENUM); - SharedPtr command(CreateCommand()); + std::shared_ptr command(CreateCommand()); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); command->on_event(event); } @@ -77,7 +77,7 @@ TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) { TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) { Event event(Event::EventID::VehicleInfo_ReadDID); - SharedPtr command(CreateCommand()); + std::shared_ptr command(CreateCommand()); const hmi_apis::Common_Result::eType hmi_response_code = hmi_apis::Common_Result::SUCCESS; @@ -99,10 +99,10 @@ TEST_F(ReadDIDRequestTest, OnEvent_SUCCESS) { } TEST_F(ReadDIDRequestTest, Run_AppNotRegistered_UNSUCCESS) { - SharedPtr command(CreateCommand()); + std::shared_ptr command(CreateCommand()); ON_CALL(app_mngr_, application(_)) - .WillByDefault(Return(SharedPtr())); + .WillByDefault(Return(std::shared_ptr())); MessageSharedPtr result_msg(CatchMobileCommandResult(CallRun(*command))); EXPECT_EQ(mobile_apis::Result::APPLICATION_NOT_REGISTERED, @@ -112,7 +112,7 @@ TEST_F(ReadDIDRequestTest, Run_AppNotRegistered_UNSUCCESS) { } TEST_F(ReadDIDRequestTest, Run_CommandLimitsExceeded_UNSUCCESS) { - SharedPtr command(CreateCommand()); + std::shared_ptr command(CreateCommand()); MockAppPtr app(CreateMockApp()); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app)); @@ -128,7 +128,7 @@ TEST_F(ReadDIDRequestTest, Run_CommandLimitsExceeded_UNSUCCESS) { TEST_F(ReadDIDRequestTest, Run_EmptyDidLocation_UNSUCCESS) { MockAppPtr app(CreateMockApp()); - SharedPtr command(CreateCommand()); + std::shared_ptr command(CreateCommand()); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app)); @@ -145,7 +145,7 @@ TEST_F(ReadDIDRequestTest, Run_SUCCESS) { MockAppPtr app(CreateMockApp()); MessageSharedPtr msg(CreateMessage(smart_objects::SmartType_Map)); (*msg)[am::strings::msg_params][am::strings::did_location]["SomeData"] = 0; - SharedPtr command(CreateCommand(msg)); + std::shared_ptr command(CreateCommand(msg)); ON_CALL(app_mngr_, application(_)).WillByDefault(Return(app)); 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 369a37e388..323334de2d 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/command_request_test.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_message_helper.h" @@ -56,7 +56,7 @@ using ::testing::_; using vehicle_info_plugin::commands::UnsubscribeVehicleDataRequest; using am::commands::MessageSharedPtr; -typedef ::utils::SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; namespace { const uint32_t kConnectionKey = 1u; @@ -71,7 +71,7 @@ class UnsubscribeVehicleRequestTest UnsubscribeVehicleRequestTest() : mock_app_(CreateMockApp()) , vi_app_extension_ptr_( - utils::MakeShared( + std::make_shared( vi_plugin_, *mock_app_)) , app_set_lock_ptr_(std::make_shared()) {} 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 bed9cffeb2..a0d4699de8 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 @@ -34,7 +34,7 @@ #include #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application_manager.h" @@ -66,10 +66,10 @@ MATCHER_P(ResultCodeIs, result_code, "") { TEST_F(UnsubscribeVehicleResponseTest, Run_SendFalseResponseToMobile_SendInvalidEnum) { MessageSharedPtr command_msg = - ::utils::MakeShared(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); (*command_msg)[am::strings::msg_params][am::strings::success] = false; - ::utils::SharedPtr command = + std::shared_ptr command = CreateCommand(command_msg); EXPECT_CALL( @@ -81,9 +81,9 @@ TEST_F(UnsubscribeVehicleResponseTest, TEST_F(UnsubscribeVehicleResponseTest, Run_SendSuccessfulResponseToMobile_SUCCESS) { MessageSharedPtr command_msg = - ::utils::MakeShared(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); (*command_msg)[am::strings::msg_params][am::strings::success] = true; - ::utils::SharedPtr command = + std::shared_ptr command = CreateCommand(command_msg); EXPECT_CALL( @@ -95,13 +95,13 @@ TEST_F(UnsubscribeVehicleResponseTest, TEST_F(UnsubscribeVehicleResponseTest, Run_SendResponseToMobile_SendCodeToMobile) { MessageSharedPtr command_msg = - ::utils::MakeShared(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); (*command_msg)[am::strings::msg_params][am::strings::success] = true; mobile_apis::Result::eType result_type = mobile_apis::Result::WARNINGS; (*command_msg)[am::strings::msg_params][am::strings::result_code] = result_type; - ::utils::SharedPtr command = + std::shared_ptr command = CreateCommand(command_msg); command->Run(); diff --git a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc index 481635d8e6..25cb5a7e1e 100644 --- a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc +++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc @@ -38,7 +38,7 @@ #include "connection_handler/connection_handler.h" #include "application_manager/application.h" #include "utils/timer_task_impl.h" -#include "utils/make_shared.h" + namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") @@ -60,7 +60,7 @@ void AppLaunchCtrlImpl::OnAppRegistered( const application_manager::Application& app) { LOG4CXX_AUTO_TRACE(logger_); // TODO (AKutsan) : get device mac - ApplicationDataPtr app_data = utils::MakeShared( + ApplicationDataPtr app_data = std::make_shared( app.policy_app_id(), app.bundle_id(), app.mac_address()); apps_launcher_.OnLaunched(app_data); app_launch_data_.AddApplicationData(*app_data); 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 64f9102d90..9a7ae0dee8 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 @@ -37,7 +37,7 @@ #include "application_manager/app_launch/app_launch_sql_queries.h" #include "application_manager/smart_object_keys.h" #include "application_manager/message_helper.h" -#include "utils/make_shared.h" + namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") @@ -276,7 +276,7 @@ std::vector AppLaunchDataDB::GetAppDataByDevMac( const std::string device_mac = query.GetString(device_mac_index); const std::string mobile_app_id = query.GetString(application_id_index); const std::string bundle_id = query.GetString(bundle_id_index); - dev_apps.push_back(utils::MakeShared( + dev_apps.push_back(std::make_shared( mobile_app_id, bundle_id, device_mac)); } while (query.Next()); LOG4CXX_DEBUG(logger_, "All application data has been successfully loaded"); diff --git a/src/components/application_manager/src/app_launch/app_launch_data_json.cc b/src/components/application_manager/src/app_launch/app_launch_data_json.cc index 7599dcccb3..f59053d97b 100644 --- a/src/components/application_manager/src/app_launch/app_launch_data_json.cc +++ b/src/components/application_manager/src/app_launch/app_launch_data_json.cc @@ -33,7 +33,7 @@ #include "application_manager/app_launch/app_launch_data_json.h" #include "application_manager/smart_object_keys.h" #include "smart_objects/smart_object.h" -#include "utils/make_shared.h" + #include "utils/date_time.h" #include "json/json.h" @@ -185,7 +185,7 @@ std::vector AppLaunchDataJson::GetAppDataByDevMac( if (deviceMac == dev_mac) { dev_apps.push_back( - utils::MakeShared(appID, bundleID, deviceMac)); + std::make_shared(appID, bundleID, deviceMac)); } } } 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 bf3ce1e0a9..f3851482c1 100644 --- a/src/components/application_manager/src/app_launch/apps_launcher.cc +++ b/src/components/application_manager/src/app_launch/apps_launcher.cc @@ -1,6 +1,6 @@ #include #include "application_manager/app_launch/apps_launcher.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" #include @@ -15,7 +15,7 @@ struct LauncherGenerator { , app_launch_max_retry_attempt_(app_launch_max_retry_attempt) , app_launch_retry_wait_time_(app_launch_retry_wait_time) {} AppsLauncher::LauncherPtr operator()() { - return utils::MakeShared( + return std::make_shared( apps_laucnher_, connection_handler_, app_launch_max_retry_attempt_, 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 9c67c70e2c..3532cb819a 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 @@ -6,8 +6,8 @@ #include "application_manager/app_launch/app_launch_data.h" #include "application_manager/app_launch/apps_launcher.h" #include "application_manager/resumption/resume_ctrl.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "utils/timer.h" #include "utils/timer_task_impl.h" #include @@ -16,7 +16,7 @@ namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") typedef std::pair > AppsOnDevice; -typedef utils::SharedPtr AppsOnDevicePtr; +typedef std::shared_ptr AppsOnDevicePtr; class Launcher { public: @@ -95,7 +95,7 @@ class Launcher { AppsOnDevicePtr apps_on_device_; }; -typedef utils::SharedPtr LauncherPtr; +typedef std::shared_ptr LauncherPtr; typedef std::vector Launchers; struct LauncherGenerator { @@ -107,7 +107,7 @@ struct LauncherGenerator { , apps_launcher_(apps_launcher) {} LauncherPtr operator()() const { - return utils::MakeShared( + return std::make_shared( resume_ctrl_, interface_, apps_launcher_); } @@ -130,7 +130,7 @@ DeviceAppsLauncherImpl::DeviceAppsLauncherImpl(DeviceAppsLauncher& interface, } bool DeviceAppsLauncherImpl::LauncherFinder::operator()( - const utils::SharedPtr& launcher) const { + const std::shared_ptr& launcher) const { return device_mac_ == launcher->apps_on_device_->first; } @@ -142,7 +142,7 @@ bool DeviceAppsLauncherImpl::LaunchAppsOnDevice( "On Device " << device_mac << " will be launched " << applications_to_launch.size() << " apps"); AppsOnDevicePtr apps_on_device = - utils::MakeShared(device_mac, applications_to_launch); + std::make_shared(device_mac, applications_to_launch); sync_primitives::AutoLock lock(launchers_lock_); DCHECK_OR_RETURN(!free_launchers_.empty(), false) const Launchers::iterator it = free_launchers_.begin(); diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 717fbeba1b..aca4b9ba05 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -41,8 +41,8 @@ #include "utils/file_system.h" #include "utils/logger.h" #include "utils/gen_hash.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "utils/timer_task_impl.h" #include "application_manager/policies/policy_handler_interface.h" #include "application_manager/resumption/resume_ctrl.h" @@ -83,8 +83,8 @@ void SwitchApplicationParameters(ApplicationSharedPtr app, const size_t device_id, const std::string& mac_address) { LOG4CXX_AUTO_TRACE(logger_); - utils::SharedPtr application = - ApplicationSharedPtr::dynamic_pointer_cast(app); + std::shared_ptr application = + std::dynamic_pointer_cast(app); DCHECK_OR_RETURN_VOID(application); application->app_id_ = app_id; application->device_id_ = device_id; @@ -97,7 +97,7 @@ ApplicationImpl::ApplicationImpl( const std::string& mac_address, const connection_handler::DeviceHandle device_id, const custom_str::CustomString& app_name, - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, ApplicationManager& application_manager) : grammar_id_(0) , hmi_app_id_(0) diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 571359007c..41dcdf3885 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -65,7 +65,7 @@ #include "utils/threads/thread.h" #include "utils/file_system.h" #include "utils/helpers.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" #include "smart_objects/enum_schema_item.h" #include "interfaces/HMI_API_schema.h" @@ -186,7 +186,7 @@ ApplicationManagerImpl::ApplicationManagerImpl( {TYPE_ICONS, "Icons"}}; sync_primitives::AutoLock lock(timer_pool_lock_); - TimerSPtr clearing_timer(utils::MakeShared( + TimerSPtr clearing_timer(std::make_shared( "ClearTimerPoolTimer", new TimerTaskImpl( this, &ApplicationManagerImpl::ClearTimerPool))); @@ -411,7 +411,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( bool mobile_projection_state = app->mobile_projection_enabled(); ApplicationSharedPtr active_app = active_application(); // Check app in FULL level - if (active_app.valid()) { + if (active_app.use_count() != 0) { // If checking app hmi level FULL, we return false // because we couldn't have two applications with same HMIType in FULL and // LIMITED HMI level @@ -438,28 +438,28 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( // Check LIMITED apps if (voice_state) { - if (get_limited_voice_application().valid() && + if ((get_limited_voice_application().use_count() != 0) && (get_limited_voice_application()->app_id() != app->app_id())) { return true; } } if (media_state) { - if (get_limited_media_application().valid() && + if ((get_limited_media_application().use_count() != 0) && (get_limited_media_application()->app_id() != app->app_id())) { return true; } } if (navi_state) { - if (get_limited_navi_application().valid() && + if ((get_limited_navi_application().use_count() != 0) && (get_limited_navi_application()->app_id() != app->app_id())) { return true; } } if (mobile_projection_state) { - if (get_limited_mobile_projection_application().valid() && + if ((get_limited_mobile_projection_application().use_count() != 0) && (get_limited_mobile_projection_application()->app_id() != app->app_id())) { return true; @@ -470,7 +470,7 @@ bool ApplicationManagerImpl::IsAppTypeExistsInFullOrLimited( } ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( - const utils::SharedPtr& + const std::shared_ptr& request_for_registration) { LOG4CXX_AUTO_TRACE(logger_); @@ -488,7 +488,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( if (connection_handler().get_session_observer().GetDataOnSessionKey( connection_key, &app_id, &sessions_list, &device_id) == -1) { LOG4CXX_ERROR(logger_, "Failed to create application: no connection info."); - utils::SharedPtr response( + std::shared_ptr response( MessageHelper::CreateNegativeResponse( connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID, @@ -520,7 +520,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( if (!is_all_apps_allowed_) { LOG4CXX_WARN(logger_, "RegisterApplication: access to app's disabled by user"); - utils::SharedPtr response( + std::shared_ptr response( MessageHelper::CreateNegativeResponse( connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID, @@ -539,7 +539,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( GetPolicyHandler().GetStatisticManager(), *this)); if (!application) { - utils::SharedPtr response( + std::shared_ptr response( MessageHelper::CreateNegativeResponse( connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID, @@ -550,7 +550,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( } HmiStatePtr initial_state = - CreateRegularState(utils::SharedPtr(application), + CreateRegularState(std::shared_ptr(application), mobile_apis::HMILevel::INVALID_ENUM, mobile_apis::AudioStreamingState::INVALID_ENUM, mobile_apis::VideoStreamingState::INVALID_ENUM, @@ -705,7 +705,7 @@ mobile_api::HMILevel::eType ApplicationManagerImpl::IsHmiLevelFullAllowed( const bool is_audio_app = app->IsAudioApplication(); const bool does_audio_app_with_same_type_exist = IsAppTypeExistsInFullOrLimited(app); - const bool is_active_app_exist = active_application().valid(); + const bool is_active_app_exist = (active_application().use_count() != 0); mobile_api::HMILevel::eType result = mobile_api::HMILevel::HMI_FULL; if (is_audio_app && does_audio_app_with_same_type_exist) { @@ -747,42 +747,42 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() { hmi_cooperating_ = true; MessageHelper::SendGetSystemInfoRequest(*this); - utils::SharedPtr is_vr_ready( + std::shared_ptr is_vr_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_IsReady, *this)); rpc_service_->ManageHMICommand(is_vr_ready); - utils::SharedPtr is_tts_ready( + std::shared_ptr is_tts_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_IsReady, *this)); rpc_service_->ManageHMICommand(is_tts_ready); - utils::SharedPtr is_ui_ready( + std::shared_ptr is_ui_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_IsReady, *this)); rpc_service_->ManageHMICommand(is_ui_ready); - utils::SharedPtr is_navi_ready( + std::shared_ptr is_navi_ready( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::Navigation_IsReady, *this)); rpc_service_->ManageHMICommand(is_navi_ready); - utils::SharedPtr is_ivi_ready( + std::shared_ptr is_ivi_ready( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::VehicleInfo_IsReady, *this)); rpc_service_->ManageHMICommand(is_ivi_ready); - utils::SharedPtr is_rc_ready( + std::shared_ptr is_rc_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady, *this)); rpc_service_->ManageHMICommand(is_rc_ready); - utils::SharedPtr button_capabilities( + std::shared_ptr button_capabilities( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::Buttons_GetCapabilities, *this)); rpc_service_->ManageHMICommand(button_capabilities); - utils::SharedPtr mixing_audio_supported_request( + std::shared_ptr mixing_audio_supported_request( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported, *this)); @@ -862,7 +862,7 @@ void ApplicationManagerImpl::SetAllAppsAllowed(const bool allowed) { } HmiStatePtr ApplicationManagerImpl::CreateRegularState( - utils::SharedPtr app, + std::shared_ptr app, mobile_apis::HMILevel::eType hmi_level, mobile_apis::AudioStreamingState::eType audio_state, mobile_apis::VideoStreamingState::eType video_state, @@ -1021,7 +1021,7 @@ void ApplicationManagerImpl::OnDeviceListUpdated( return; } - smart_objects::SmartObjectSPtr update_list = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr update_list = std::make_shared(); smart_objects::SmartObject& so_to_send = *update_list; so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList; @@ -1108,7 +1108,7 @@ void ApplicationManagerImpl::OnDeviceSwitchingStart( return; } - auto update_list = utils::MakeShared(); + auto update_list = std::make_shared(); smart_objects::SmartObject& so_to_send = *update_list; so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList; @@ -1295,7 +1295,7 @@ void ApplicationManagerImpl::ReplaceMobileByHMIAppId( if (message.keyExists(strings::app_id)) { ApplicationSharedPtr application_ptr = application(message[strings::app_id].asUInt()); - if (application_ptr.valid()) { + if (application_ptr.use_count() != 0) { LOG4CXX_DEBUG(logger_, "ReplaceMobileByHMIAppId from " << message[strings::app_id].asInt() << " to " @@ -1332,7 +1332,7 @@ void ApplicationManagerImpl::ReplaceHMIByMobileAppId( ApplicationSharedPtr application = application_by_hmi_app(message[strings::app_id].asUInt()); - if (application.valid()) { + if (application.use_count() != 0) { LOG4CXX_DEBUG(logger_, "ReplaceHMIByMobileAppId from " << message[strings::app_id].asInt() << " to " @@ -2421,7 +2421,7 @@ void ApplicationManagerImpl::SendOnSDLClose() { // must be sent to PASA HMI on shutdown synchronously smart_objects::SmartObjectSPtr msg = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); (*msg)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_OnSDLClose; @@ -2438,7 +2438,7 @@ void ApplicationManagerImpl::SendOnSDLClose() { } // SmartObject |message| has no way to declare priority for now - utils::SharedPtr message_to_send( + std::shared_ptr message_to_send( new Message(protocol_handler::MessagePriority::kDefault)); hmi_so_factory().attachSchema(*msg, false); @@ -2880,7 +2880,7 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) { navi_app_to_stop_.push_back(app_id); - TimerSPtr close_timer(utils::MakeShared( + TimerSPtr close_timer(std::make_shared( "CloseNaviAppTimer", new TimerTaskImpl( this, &ApplicationManagerImpl::CloseNaviApp))); @@ -2955,7 +2955,7 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id, if (from == HMI_FULL || from == HMI_LIMITED) { LOG4CXX_TRACE(logger_, "HMILevel from FULL or LIMITED"); navi_app_to_end_stream_.push_back(app_id); - TimerSPtr end_stream_timer(utils::MakeShared( + TimerSPtr end_stream_timer(std::make_shared( "AppShouldFinishStreaming", new TimerTaskImpl( this, &ApplicationManagerImpl::EndNaviStreaming))); @@ -2973,11 +2973,11 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id, } void ApplicationManagerImpl::SendHMIStatusNotification( - const utils::SharedPtr app) { + const std::shared_ptr app) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); smart_objects::SmartObjectSPtr notification = - utils::MakeShared(); + std::make_shared(); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = @@ -3517,7 +3517,7 @@ void ApplicationManagerImpl::SendDriverDistractionState( return; } smart_objects::SmartObjectSPtr on_driver_distraction = - utils::MakeShared(); + std::make_shared(); (*on_driver_distraction)[strings::params][strings::message_type] = static_cast(application_manager::MessageType::kNotification); @@ -3640,7 +3640,7 @@ bool ApplicationManagerImpl::IsAppSubscribedForWayPoints( LOG4CXX_DEBUG(logger_, "There are applications subscribed: " << subscribed_way_points_apps_list_.size()); - if (subscribed_way_points_apps_list_.find(app) == + if (subscribed_way_points_apps_list_.find(app->app_id()) == subscribed_way_points_apps_list_.end()) { return false; } @@ -3651,7 +3651,7 @@ void ApplicationManagerImpl::SubscribeAppForWayPoints( ApplicationSharedPtr app) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_); - subscribed_way_points_apps_list_.insert(app); + subscribed_way_points_apps_list_.insert(app->app_id()); LOG4CXX_DEBUG(logger_, "There are applications subscribed: " << subscribed_way_points_apps_list_.size()); @@ -3661,7 +3661,7 @@ void ApplicationManagerImpl::UnsubscribeAppFromWayPoints( ApplicationSharedPtr app) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_); - subscribed_way_points_apps_list_.erase(app); + subscribed_way_points_apps_list_.erase(app->app_id()); LOG4CXX_DEBUG(logger_, "There are applications subscribed: " << subscribed_way_points_apps_list_.size()); diff --git a/src/components/application_manager/src/command_holder_impl.cc b/src/components/application_manager/src/command_holder_impl.cc index 9799b170dc..ea74e78f4e 100644 --- a/src/components/application_manager/src/command_holder_impl.cc +++ b/src/components/application_manager/src/command_holder_impl.cc @@ -43,7 +43,7 @@ CommandHolderImpl::CommandHolderImpl(ApplicationManager& app_manager) void CommandHolderImpl::Suspend( ApplicationSharedPtr application, CommandType type, - utils::SharedPtr command) { + std::shared_ptr command) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(application); LOG4CXX_DEBUG(logger_, diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc index dbe89b8881..db78ad15f0 100644 --- a/src/components/application_manager/src/commands/command_impl.cc +++ b/src/components/application_manager/src/commands/command_impl.cc @@ -40,7 +40,7 @@ namespace { struct AppExtensionPredicate { AppExtensionUID uid; bool operator()(const ApplicationSharedPtr app) { - return app ? app->QueryInterface(uid).valid() : false; + return app ? (app->QueryInterface(uid).use_count() != 0) : false; } }; } diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index 491fc72de4..18b3d2a94e 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -34,7 +34,7 @@ #include #include #include "utils/macro.h" -#include "utils/make_shared.h" + #include "application_manager/commands/command_request_impl.h" #include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" @@ -145,7 +145,7 @@ struct DisallowedParamsInserter { VehicleData::const_iterator it = vehicle_data.find(param); if (vehicle_data.end() != it) { smart_objects::SmartObjectSPtr disallowed_param = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); (*disallowed_param)[strings::data_type] = (*it).second; (*disallowed_param)[strings::result_code] = code_; response_[strings::msg_params][param.c_str()] = *disallowed_param; @@ -273,7 +273,7 @@ void CommandRequestImpl::SendResponse( } smart_objects::SmartObjectSPtr result = - utils::MakeShared(); + std::make_shared(); smart_objects::SmartObject& response = *result; @@ -417,7 +417,7 @@ uint32_t CommandRequestImpl::SendHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject* msg_params, bool use_events) { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr result = std::make_shared(); const uint32_t hmi_correlation_id = application_manager_.GetNextHMICorrelationID(); @@ -455,7 +455,7 @@ uint32_t CommandRequestImpl::SendHMIRequest( void CommandRequestImpl::CreateHMINotification( const hmi_apis::FunctionID::eType& function_id, const NsSmart::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr result = std::make_shared(); if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); return; diff --git a/src/components/application_manager/src/commands/notification_from_hmi.cc b/src/components/application_manager/src/commands/notification_from_hmi.cc index 1fef383213..649b52fde9 100644 --- a/src/components/application_manager/src/commands/notification_from_hmi.cc +++ b/src/components/application_manager/src/commands/notification_from_hmi.cc @@ -76,7 +76,7 @@ void NotificationFromHMI::SendNotificationToMobile( void NotificationFromHMI::CreateHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr result = std::make_shared(); if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); return; diff --git a/src/components/application_manager/src/commands/request_from_hmi.cc b/src/components/application_manager/src/commands/request_from_hmi.cc index f77495ac31..b993ab033e 100644 --- a/src/components/application_manager/src/commands/request_from_hmi.cc +++ b/src/components/application_manager/src/commands/request_from_hmi.cc @@ -33,7 +33,7 @@ #include "application_manager/commands/request_from_hmi.h" #include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" -#include "utils/make_shared.h" + namespace application_manager { @@ -74,7 +74,7 @@ void RequestFromHMI::SendResponse( const hmi_apis::FunctionID::eType function_id, const hmi_apis::Common_Result::eType result_code) { smart_objects::SmartObjectSPtr message = - ::utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); FillCommonParametersOfSO(*message, correlation_id, function_id); (*message)[strings::params][strings::message_type] = MessageType::kResponse; @@ -91,7 +91,7 @@ void RequestFromHMI::SendErrorResponse( const hmi_apis::Common_Result::eType result_code, const std::string error_message) { smart_objects::SmartObjectSPtr message = - ::utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); FillCommonParametersOfSO(*message, correlation_id, function_id); (*message)[strings::params][strings::message_type] = diff --git a/src/components/application_manager/src/commands/response_from_hmi.cc b/src/components/application_manager/src/commands/response_from_hmi.cc index 123dbad828..bf732830f2 100644 --- a/src/components/application_manager/src/commands/response_from_hmi.cc +++ b/src/components/application_manager/src/commands/response_from_hmi.cc @@ -80,7 +80,7 @@ void ResponseFromHMI::SendResponseToMobile( void ResponseFromHMI::CreateHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr result = std::make_shared(); if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); diff --git a/src/components/application_manager/src/help_prompt_manager_impl.cc b/src/components/application_manager/src/help_prompt_manager_impl.cc index 0587327791..6fb88ddd3b 100644 --- a/src/components/application_manager/src/help_prompt_manager_impl.cc +++ b/src/components/application_manager/src/help_prompt_manager_impl.cc @@ -38,7 +38,7 @@ #include "application_manager/smart_object_keys.h" #include "smart_objects/smart_object.h" #include "utils/logger.h" -#include "utils/make_shared.h" + CREATE_LOGGERPTR_GLOBAL(logger_, "HelpPromptManagerImpl") @@ -86,7 +86,7 @@ bool HelpPromptManagerImpl::AddCommand( LOG4CXX_DEBUG(logger_, "Will be added " << count_new_commands << " commands"); smart_objects::SmartObjectSPtr vr_item = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Array); smart_objects::SmartArray& ar_vr_cmd = *(vr_item->asArray()); smart_objects::SmartArray& ar_cmd = *(commands.asArray()); @@ -207,7 +207,7 @@ void HelpPromptManagerImpl::SendTTSRequest() { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "TTS request for appID:" << app_.app_id()); smart_objects::SmartObjectSPtr tts_global_properties = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); if (tts_global_properties) { smart_objects::SmartObject& ref = *tts_global_properties; @@ -241,7 +241,7 @@ void HelpPromptManagerImpl::SendUIRequest() { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "UI request for appID:" << app_.app_id()); smart_objects::SmartObjectSPtr ui_global_properties = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); if (ui_global_properties) { smart_objects::SmartObject& ref = *ui_global_properties; diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc index ce8514010f..b1872dfaab 100644 --- a/src/components/application_manager/src/hmi_language_handler.cc +++ b/src/components/application_manager/src/hmi_language_handler.cc @@ -223,7 +223,7 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile( const uint32_t connection_key) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr notification =std::make_shared(); DCHECK_OR_RETURN_VOID(notification); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc index e1bc2b5125..0033fe4fb6 100644 --- a/src/components/application_manager/src/hmi_state.cc +++ b/src/components/application_manager/src/hmi_state.cc @@ -42,7 +42,7 @@ namespace application_manager { CREATE_LOGGERPTR_GLOBAL(logger_, "HmiState") -HmiState::HmiState(utils::SharedPtr app, +HmiState::HmiState(std::shared_ptr app, const ApplicationManager& app_mngr, StateID state_id) : app_(app) @@ -55,7 +55,7 @@ HmiState::HmiState(utils::SharedPtr app, LOG4CXX_DEBUG(logger_, *this); } -HmiState::HmiState(utils::SharedPtr app, +HmiState::HmiState(std::shared_ptr app, const ApplicationManager& app_mngr) : app_(app) , state_id_(STATE_ID_REGULAR) @@ -115,7 +115,7 @@ mobile_apis::AudioStreamingState::eType VRHmiState::audio_streaming_state() return AudioStreamingState::NOT_AUDIBLE; } -VRHmiState::VRHmiState(utils::SharedPtr app, +VRHmiState::VRHmiState(std::shared_ptr app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_VR_SESSION) {} @@ -123,7 +123,7 @@ DEPRECATED VRHmiState::VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr) : HmiState(app_id, app_mngr, STATE_ID_VR_SESSION) {} -TTSHmiState::TTSHmiState(utils::SharedPtr app, +TTSHmiState::TTSHmiState(std::shared_ptr app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_TTS_SESSION) {} @@ -147,7 +147,7 @@ mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state() } VideoStreamingHmiState::VideoStreamingHmiState( - utils::SharedPtr app, const ApplicationManager& app_mngr) + std::shared_ptr app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_VIDEO_STREAMING) {} mobile_apis::VideoStreamingState::eType @@ -159,7 +159,7 @@ VideoStreamingHmiState::video_streaming_state() const { return mobile_apis::VideoStreamingState::NOT_STREAMABLE; } -NaviStreamingHmiState::NaviStreamingHmiState(utils::SharedPtr app, +NaviStreamingHmiState::NaviStreamingHmiState(std::shared_ptr app, const ApplicationManager& app_mngr) : VideoStreamingHmiState(app, app_mngr) { set_state_id(STATE_ID_NAVI_STREAMING); @@ -185,7 +185,7 @@ NaviStreamingHmiState::audio_streaming_state() const { return expected_state; } -PhoneCallHmiState::PhoneCallHmiState(utils::SharedPtr app, +PhoneCallHmiState::PhoneCallHmiState(std::shared_ptr app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_PHONE_CALL) {} @@ -210,7 +210,7 @@ mobile_apis::HMILevel::eType PhoneCallHmiState::hmi_level() const { return HMILevel::HMI_BACKGROUND; } -SafetyModeHmiState::SafetyModeHmiState(utils::SharedPtr app, +SafetyModeHmiState::SafetyModeHmiState(std::shared_ptr app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_SAFETY_MODE) {} @@ -218,7 +218,7 @@ DEPRECATED SafetyModeHmiState::SafetyModeHmiState( uint32_t app_id, const ApplicationManager& app_mngr) : HmiState(app_id, app_mngr, STATE_ID_SAFETY_MODE) {} -DeactivateHMI::DeactivateHMI(utils::SharedPtr app, +DeactivateHMI::DeactivateHMI(std::shared_ptr app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_DEACTIVATE_HMI) {} @@ -238,7 +238,7 @@ mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const { return HMILevel::HMI_BACKGROUND; } -AudioSource::AudioSource(utils::SharedPtr app, +AudioSource::AudioSource(std::shared_ptr app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_AUDIO_SOURCE) {} @@ -256,7 +256,7 @@ mobile_apis::HMILevel::eType AudioSource::hmi_level() const { return mobile_apis::HMILevel::HMI_BACKGROUND; } -EmbeddedNavi::EmbeddedNavi(utils::SharedPtr app, +EmbeddedNavi::EmbeddedNavi(std::shared_ptr app, const ApplicationManager& app_mngr) : HmiState(app, app_mngr, STATE_ID_EMBEDDED_NAVI) {} 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 81491b7bf9..aa3f2449ee 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -61,7 +61,7 @@ #include "utils/file_system.h" #include "utils/macro.h" #include "utils/logger.h" -#include "utils/make_shared.h" + #include "formatters/formatter_json_rpc.h" #include "formatters/CFormatterJsonSDLRPCv2.h" @@ -258,7 +258,7 @@ MessageHelper::CreateHMINotification(hmi_apis::FunctionID::eType function_id) { using smart_objects::SmartType_Map; LOG4CXX_AUTO_TRACE(logger_); SmartObjectSPtr notification_ptr = - utils::MakeShared(SmartType_Map); + std::make_shared(SmartType_Map); SmartObject& notification = *notification_ptr; notification[strings::params][strings::message_type] = static_cast(kNotification); @@ -315,7 +315,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateMessageForHMI( hmi_apis::messageType::eType message_type, const uint32_t correlation_id) { using namespace smart_objects; - SmartObjectSPtr message = utils::MakeShared(SmartType_Map); + SmartObjectSPtr message = std::make_shared(SmartType_Map); SmartObject& ref = *message; ref[strings::params][strings::message_type] = static_cast(message_type); @@ -331,7 +331,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification( const uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr message = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = mobile_apis::FunctionID::OnHashChangeID; @@ -399,7 +399,7 @@ MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr notification = - utils::MakeShared(); + std::make_shared(); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = static_cast( @@ -698,7 +698,7 @@ void MessageHelper::SendHMIStatusNotification( const Application& application_impl, ApplicationManager& application_manager) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject; + smart_objects::SmartObjectSPtr notification = std::make_shared(); if (!notification) { LOG4CXX_ERROR(logger_, "Failed to create smart object"); return; @@ -739,8 +739,8 @@ void MessageHelper::SendActivateAppToHMI( return; } - utils::SharedPtr message = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::shared_ptr message = + std::make_shared(smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_ActivateApp; @@ -825,7 +825,7 @@ void MessageHelper::CreateGetVehicleDataRequest( ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr request = - utils::MakeShared(); + std::make_shared(); (*request)[strings::params][strings::message_type] = static_cast(kRequest); @@ -853,7 +853,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse( uint32_t connection_key) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr response = - utils::MakeShared(); + std::make_shared(); (*response)[strings::params][strings::function_id] = static_cast(function_id); @@ -877,7 +877,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO( ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr device_list_so = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); (*device_list_so)[strings::device_list] = @@ -911,7 +911,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO( uint32_t function_id, ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr module_info = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); smart_objects::SmartObject& object = *module_info; object[strings::params][strings::message_type] = static_cast(kRequest); @@ -927,7 +927,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon( const std::string& path_to_icon, uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr set_icon = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); if (!set_icon) { @@ -954,7 +954,7 @@ void MessageHelper::SendOnButtonSubscriptionNotification( LOG4CXX_AUTO_TRACE(logger_); SmartObjectSPtr notification_ptr = - utils::MakeShared(SmartType_Map); + std::make_shared(SmartType_Map); if (!notification_ptr) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); return; @@ -988,7 +988,7 @@ void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp( using namespace mobile_apis; LOG4CXX_AUTO_TRACE(logger_); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Invalid application pointer "); return; } @@ -1044,7 +1044,7 @@ void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app, void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Invalid application"); return; } @@ -1064,7 +1064,7 @@ MessageHelper::CreateGlobalPropertiesRequestsToHMI( LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectList requests; - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Invalid application"); return requests; } @@ -1197,7 +1197,7 @@ void MessageHelper::SendTTSGlobalProperties(ApplicationSharedPtr app, smart_objects::SmartObjectSPtr MessageHelper::CreateAppVrHelp( ApplicationConstSharedPtr app) { smart_objects::SmartObjectSPtr result = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); if (!result) { return NULL; @@ -1420,7 +1420,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateChangeRegistration( void MessageHelper::SendUIChangeRegistrationRequestToHMI( ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Application is not valid"); return; } @@ -1595,7 +1595,7 @@ bool MessageHelper::CreateHMIApplicationStruct( void MessageHelper::SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_ERROR(logger_, "Invalid application"); return; } @@ -1651,7 +1651,7 @@ void MessageHelper::SendOnAppUnregNotificationToHMI( bool is_unexpected_disconnect, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr notification = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); smart_objects::SmartObject& message = *notification; @@ -1681,7 +1681,7 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI( const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID(); smart_objects::SmartObjectSPtr message = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_ActivateApp; @@ -1724,8 +1724,8 @@ void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id, return; } - utils::SharedPtr message = - utils::MakeShared( + std::shared_ptr message = + std::make_shared( smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = @@ -1744,7 +1744,7 @@ void MessageHelper::SendSDLActivateAppResponse( const uint32_t correlation_id, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr message = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = @@ -1793,7 +1793,7 @@ void MessageHelper::SendSDLActivateAppResponse( void MessageHelper::SendOnSDLConsentNeeded( const policy::DeviceParams& device_info, ApplicationManager& app_man) { smart_objects::SmartObjectSPtr message = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = @@ -1833,7 +1833,7 @@ void MessageHelper::SendGetUserFriendlyMessageResponse( ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr message = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); if (!message) { return; } @@ -1903,7 +1903,7 @@ void MessageHelper::SendGetListOfPermissionsResponse( using namespace smart_objects; using namespace hmi_apis; - SmartObjectSPtr message = utils::MakeShared(SmartType_Map); + SmartObjectSPtr message = std::make_shared(SmartType_Map); DCHECK_OR_RETURN_VOID(message); SmartObject& params = (*message)[strings::params]; @@ -1945,7 +1945,7 @@ void MessageHelper::SendGetListOfPermissionsResponse( using namespace smart_objects; using namespace hmi_apis; - SmartObjectSPtr message = utils::MakeShared(SmartType_Map); + SmartObjectSPtr message = std::make_shared(SmartType_Map); DCHECK_OR_RETURN_VOID(message); SmartObject& params = (*message)[strings::params]; @@ -1986,7 +1986,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateNegativeResponse( response_data[strings::msg_params][strings::success] = false; response_data[strings::params][strings::connection_key] = connection_key; - return utils::MakeShared(response_data); + return std::make_shared(response_data); } void MessageHelper::SendNaviSetVideoConfig( @@ -2136,7 +2136,7 @@ void MessageHelper::SendOnDataStreaming( } smart_objects::SmartObjectSPtr notification = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); (*notification)[strings::params][strings::function_id] = @@ -2226,7 +2226,7 @@ void MessageHelper::SendSystemRequestNotification( #endif DCHECK(app_mngr.GetRPCService().ManageMobileCommand( - utils::MakeShared(content), + std::make_shared(content), commands::Command::SOURCE_SDL)); } @@ -2394,7 +2394,7 @@ void MessageHelper::SendOnPermissionsChangeNotification( } app_mngr.GetRPCService().ManageMobileCommand( - utils::MakeShared(content), + std::make_shared(content), commands::Command::SOURCE_SDL); } @@ -2479,14 +2479,14 @@ void MessageHelper::SendOnAppPermissionsChangedNotification( } app_mngr.GetRPCService().ManageHMICommand( - utils::MakeShared(message)); + std::make_shared(message)); } void MessageHelper::SendGetStatusUpdateResponse(const std::string& status, const uint32_t correlation_id, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr message = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); if (!message) { return; @@ -2507,7 +2507,7 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result, const uint32_t correlation_id, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr message = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); DCHECK(message); @@ -2525,7 +2525,7 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result, void MessageHelper::SendOnStatusUpdate(const std::string& status, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr message = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Map); if (!message) { return; diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 88c01c7af7..ce0bac9c0e 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -54,7 +54,7 @@ #include "interfaces/MOBILE_API.h" #include "utils/file_system.h" #include "utils/scope_guard.h" -#include "utils/make_shared.h" + #include "utils/helpers.h" #include "policy/policy_manager.h" @@ -224,7 +224,7 @@ struct LinksCollector { } void operator()(const ApplicationSharedPtr& app) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Invalid pointer to application was passed." "Skip current application."); @@ -258,7 +258,7 @@ struct LinkAppToDevice { } void operator()(const ApplicationSharedPtr& app) { - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Invalid pointer to application was passed." "Skip current application."); @@ -328,7 +328,7 @@ PolicyHandler::PolicyHandler(const PolicySettings& settings, , dl_handle_(0) , last_activated_app_id_(0) , app_to_device_link_lock_(true) - , statistic_manager_impl_(utils::MakeShared(this)) + , statistic_manager_impl_(std::make_shared(this)) , settings_(settings) , application_manager_(application_manager) {} @@ -355,14 +355,14 @@ bool PolicyHandler::LoadPolicyLibrary() { if (CreateManager()) { policy_manager_->set_listener(this); event_observer_ = - utils::SharedPtr(new PolicyEventObserver( + std::shared_ptr(new PolicyEventObserver( this, application_manager_.event_dispatcher())); } } else { LOG4CXX_ERROR(logger_, error); } - return policy_manager_.valid(); + return (policy_manager_.use_count() != 0); } bool PolicyHandler::CreateManager() { @@ -375,11 +375,11 @@ bool PolicyHandler::CreateManager() { char* error_string = dlerror(); if (NULL == error_string) { policy_manager_ = - utils::SharedPtr(create_manager(), delete_manager); + std::shared_ptr(create_manager(), delete_manager); } else { LOG4CXX_WARN(logger_, error_string); } - return policy_manager_.valid(); + return (policy_manager_.use_count() != 0); } const PolicySettings& PolicyHandler::get_settings() const { @@ -520,7 +520,7 @@ void PolicyHandler::SendOnAppPermissionsChanged( << policy_app_id); ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "No app found for policy app id = " << policy_app_id); return; } @@ -555,7 +555,7 @@ struct SmartObjectToInt { StatusNotifier PolicyHandler::AddApplication( const std::string& application_id, const rpc::policy_table_interface_base::AppHmiTypes& hmi_types) { - POLICY_LIB_CHECK(utils::MakeShared()); + POLICY_LIB_CHECK(std::make_shared()); return policy_manager_->AddApplication(application_id, hmi_types); } @@ -591,7 +591,7 @@ void PolicyHandler::OnAppPermissionConsentInternal( if (connection_key) { ApplicationSharedPtr app = application_manager_.application(connection_key); - if (app.valid()) { + if (app.use_count() != 0) { out_permissions.policy_app_id = app->policy_app_id(); DeviceParams device_params = GetDeviceParams( app->device(), @@ -618,7 +618,7 @@ void PolicyHandler::OnAppPermissionConsentInternal( // If list of apps sent to HMI for user consents is not the same as // current, // permissions should be set only for coincident to registered apps - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Invalid pointer to application was passed." "Permissions setting skipped."); @@ -733,7 +733,7 @@ std::vector PolicyHandler::CollectAppPermissions( ApplicationSharedPtr app = application_manager_.application(connection_key); std::vector group_permissions; - if (NULL == app.get() || !app.valid()) { + if (NULL == app.get() || app.use_count() == 0) { LOG4CXX_WARN(logger_, "Connection key '" << connection_key @@ -883,7 +883,7 @@ std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired( ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Application with id '" << policy_app_id @@ -958,7 +958,7 @@ void PolicyHandler::OnPendingPermissionChange( POLICY_LIB_CHECK_VOID(); ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "No app found for " << policy_app_id << " policy app id."); return; @@ -1269,7 +1269,7 @@ void PolicyHandler::OnActivateApp(uint32_t connection_key, LOG4CXX_AUTO_TRACE(logger_); POLICY_LIB_CHECK_VOID(); ApplicationSharedPtr app = application_manager_.application(connection_key); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN(logger_, "Activated App failed: no app found."); return; } @@ -1363,7 +1363,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN( logger_, "Connection_key not found for application_id:" << policy_app_id); @@ -1416,7 +1416,7 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN( logger_, "Connection_key not found for application_id:" << policy_app_id); @@ -1627,7 +1627,7 @@ void PolicyHandler::remove_listener(PolicyHandlerObserver* listener) { listeners_.remove(listener); } -utils::SharedPtr +std::shared_ptr PolicyHandler::GetStatisticManager() const { return statistic_manager_impl_; } @@ -1669,7 +1669,7 @@ custom_str::CustomString PolicyHandler::GetAppName( ApplicationSharedPtr app = application_manager_.application_by_policy_id(policy_app_id); - if (!app.valid()) { + if (app.use_count() == 0) { LOG4CXX_WARN( logger_, "Connection_key not found for application_id:" << policy_app_id); diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc index e052e347f0..1c103b13af 100644 --- a/src/components/application_manager/src/request_controller.cc +++ b/src/components/application_manager/src/request_controller.cc @@ -35,7 +35,7 @@ #include "application_manager/request_controller.h" #include "application_manager/commands/command_request_impl.h" #include "application_manager/commands/request_to_hmi.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" namespace application_manager { @@ -176,7 +176,7 @@ RequestController::TResult RequestController::addHMIRequest( const RequestPtr request) { LOG4CXX_AUTO_TRACE(logger_); - if (!request.valid()) { + if (request.use_count() == 0) { LOG4CXX_ERROR(logger_, "HMI request pointer is invalid"); return RequestController::INVALID_DATA; } @@ -185,7 +185,7 @@ RequestController::TResult RequestController::addHMIRequest( const uint64_t timeout_in_mseconds = static_cast(request->default_timeout()); RequestInfoPtr request_info_ptr = - utils::MakeShared(request, timeout_in_mseconds); + std::make_shared(request, timeout_in_mseconds); if (0 == timeout_in_mseconds) { LOG4CXX_DEBUG(logger_, @@ -287,7 +287,7 @@ void RequestController::terminateWaitingForExecutionAppRequests( std::list::iterator request_it = mobile_request_list_.begin(); while (mobile_request_list_.end() != request_it) { RequestPtr request = (*request_it); - if ((request.valid()) && (request->connection_key() == app_id)) { + if ((request.use_count() != 0) && (request->connection_key() == app_id)) { mobile_request_list_.erase(request_it++); } else { ++request_it; @@ -488,7 +488,7 @@ void RequestController::Worker::threadMain() { const uint32_t timeout_in_mseconds = request_ptr->default_timeout(); RequestInfoPtr request_info_ptr = - utils::MakeShared(request_ptr, timeout_in_mseconds); + std::make_shared(request_ptr, timeout_in_mseconds); if (!request_controller_->waiting_for_response_.Add(request_info_ptr)) { commands::CommandRequestImpl* cmd_request = diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc index 9a5828d939..04210a7572 100644 --- a/src/components/application_manager/src/request_info.cc +++ b/src/components/application_manager/src/request_info.cc @@ -151,7 +151,7 @@ RequestInfoPtr RequestInfoSet::Find(const uint32_t connection_key, RequestInfoPtr result; // Request info for searching in request info set by log_n time - utils::SharedPtr request_info_for_search( + std::shared_ptr request_info_for_search( new FakeRequestInfo(connection_key, correlation_id)); sync_primitives::AutoLock lock(this_lock_); 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 be2bff5534..74054eab29 100644 --- a/src/components/application_manager/src/resumption/resume_ctrl_impl.cc +++ b/src/components/application_manager/src/resumption/resume_ctrl_impl.cc @@ -48,7 +48,7 @@ #include "utils/helpers.h" #include "application_manager/resumption/resumption_data_db.h" #include "application_manager/resumption/resumption_data_json.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" namespace resumption { @@ -79,7 +79,7 @@ ResumeCtrlImpl::ResumeCtrlImpl(ApplicationManager& application_manager) , application_manager_(application_manager) {} #ifdef BUILD_TESTS void ResumeCtrlImpl::set_resumption_storage( - utils::SharedPtr mock_storage) { + std::shared_ptr mock_storage) { resumption_storage_ = mock_storage; } diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc index 42894a36a8..3152d1f749 100644 --- a/src/components/application_manager/src/rpc_handler_impl.cc +++ b/src/components/application_manager/src/rpc_handler_impl.cc @@ -54,7 +54,7 @@ RPCHandlerImpl::RPCHandlerImpl(ApplicationManager& app_manager) RPCHandlerImpl::~RPCHandlerImpl() {} void RPCHandlerImpl::ProcessMessageFromMobile( - const utils::SharedPtr message) { + const std::shared_ptr message) { LOG4CXX_AUTO_TRACE(logger_); #ifdef TELEMETRY_MONITOR AMTelemetryObserver::MessageMetricSharedPtr metric( @@ -62,7 +62,7 @@ void RPCHandlerImpl::ProcessMessageFromMobile( metric->begin = date_time::DateTime::getCurrentTime(); #endif // TELEMETRY_MONITOR smart_objects::SmartObjectSPtr so_from_mobile = - utils::MakeShared(); + std::make_shared(); DCHECK_OR_RETURN_VOID(so_from_mobile); if (!so_from_mobile) { @@ -91,9 +91,9 @@ void RPCHandlerImpl::ProcessMessageFromMobile( } void RPCHandlerImpl::ProcessMessageFromHMI( - const utils::SharedPtr message) { + const std::shared_ptr message) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr smart_object(new smart_objects::SmartObject); + smart_objects::SmartObjectSPtr smart_object = std::make_shared(); if (!smart_object) { LOG4CXX_ERROR(logger_, "Null pointer"); @@ -154,7 +154,7 @@ void RPCHandlerImpl::OnMessageReceived( return; } - utils::SharedPtr outgoing_message = ConvertRawMsgToMessage(message); + std::shared_ptr outgoing_message = ConvertRawMsgToMessage(message); if (outgoing_message) { LOG4CXX_DEBUG(logger_, "Posting new Message"); @@ -220,7 +220,7 @@ bool RPCHandlerImpl::ConvertMessageToSO( LOG4CXX_WARN(logger_, "Failed to parse string to smart object :" << message.json_message()); - utils::SharedPtr response( + std::shared_ptr response( MessageHelper::CreateNegativeResponse( message.connection_key(), message.function_id(), @@ -245,7 +245,7 @@ bool RPCHandlerImpl::ConvertMessageToSO( << " binary size should be " << message.data_size() << " payload data size is " << message.payload_size()); - utils::SharedPtr response( + std::shared_ptr response( MessageHelper::CreateNegativeResponse( message.connection_key(), message.function_id(), @@ -310,7 +310,7 @@ bool RPCHandlerImpl::ConvertMessageToSO( NsSmartDeviceLinkRPC::V1::Result::UNSUPPORTED_VERSION; smart_objects::SmartObjectSPtr msg_to_send = - new smart_objects::SmartObject(output); + std::make_shared(output); v1_shema.attachSchema(*msg_to_send, false); app_manager_.GetRPCService().SendMessageToMobile(msg_to_send); return false; @@ -329,11 +329,11 @@ bool RPCHandlerImpl::ConvertMessageToSO( return true; } -utils::SharedPtr RPCHandlerImpl::ConvertRawMsgToMessage( +std::shared_ptr RPCHandlerImpl::ConvertRawMsgToMessage( const protocol_handler::RawMessagePtr message) { LOG4CXX_AUTO_TRACE(logger_); DCHECK(message); - utils::SharedPtr outgoing_message; + std::shared_ptr outgoing_message; LOG4CXX_DEBUG(logger_, "Service type." << message->service_type()); if (message->service_type() != protocol_handler::kRpc && @@ -347,7 +347,7 @@ utils::SharedPtr RPCHandlerImpl::ConvertRawMsgToMessage( MobileMessageHandler::HandleIncomingMessageProtocol(message); if (convertion_result) { - outgoing_message = convertion_result; + outgoing_message = std::shared_ptr(convertion_result); } else { LOG4CXX_ERROR(logger_, "Received invalid message"); } diff --git a/src/components/application_manager/src/rpc_service_impl.cc b/src/components/application_manager/src/rpc_service_impl.cc index 11a98fc970..bdd6c8e0c2 100644 --- a/src/components/application_manager/src/rpc_service_impl.cc +++ b/src/components/application_manager/src/rpc_service_impl.cc @@ -327,8 +327,8 @@ void RPCServiceImpl::Handle(const impl::MessageToMobile message) { return; } - utils::SharedPtr rawMessage = - MobileMessageHandler::HandleOutgoingMessageProtocol(message); + std::shared_ptr rawMessage( + MobileMessageHandler::HandleOutgoingMessageProtocol(message)); if (!rawMessage) { LOG4CXX_ERROR(logger_, "Failed to create raw message."); @@ -404,7 +404,7 @@ void RPCServiceImpl::SendMessageToMobile( "Attached schema to message, result if valid: " << message->isValid()); // Messages to mobile are not yet prioritized so use default priority value - utils::SharedPtr message_to_send( + std::shared_ptr message_to_send( new Message(protocol_handler::MessagePriority::kDefault)); if (!ConvertSOtoMessage((*message), (*message_to_send))) { LOG4CXX_WARN(logger_, "Can't send msg to Mobile: failed to create string"); @@ -486,7 +486,7 @@ void RPCServiceImpl::SendMessageToHMI( } // SmartObject |message| has no way to declare priority for now - utils::SharedPtr message_to_send( + std::shared_ptr message_to_send( new Message(protocol_handler::MessagePriority::kDefault)); if (!message_to_send) { LOG4CXX_ERROR(logger_, "Null pointer"); diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index 1a1e5543df..f7a147d6df 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -35,7 +35,7 @@ #include "application_manager/usage_statistics.h" #include "application_manager/rpc_service.h" #include "utils/helpers.h" -#include "utils/make_shared.h" + #include "connection_handler/connection_handler.h" namespace application_manager { @@ -472,7 +472,7 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel( return result; } - const bool is_active_app_exist = app_mngr_.active_application(); + const bool is_active_app_exist = (bool)app_mngr_.active_application(); if (is_audio_app) { if (does_audio_app_with_same_type_exist) { result = app_mngr_.GetDefaultHmiLevel(app); @@ -853,7 +853,7 @@ void StateControllerImpl::DeactivateApp(ApplicationSharedPtr app) { DCHECK_OR_RETURN_VOID(app); const HmiStatePtr regular = app->RegularHmiState(); DCHECK_OR_RETURN_VOID(regular); - HmiStatePtr new_regular = utils::MakeShared(*regular); + HmiStatePtr new_regular = std::make_shared(*regular); LOG4CXX_DEBUG(logger_, "Current HMI level: '" << app->hmi_level() << "'"); const bool is_audio_app = app->IsAudioApplication(); @@ -968,53 +968,53 @@ bool StateControllerImpl::IsStateActive(HmiState::StateID state_id) const { } HmiStatePtr StateControllerImpl::CreateHmiState( - utils::SharedPtr app, HmiState::StateID state_id) const { + std::shared_ptr app, HmiState::StateID state_id) const { using namespace utils; LOG4CXX_AUTO_TRACE(logger_); HmiStatePtr new_state; switch (state_id) { case HmiState::STATE_ID_PHONE_CALL: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } case HmiState::STATE_ID_SAFETY_MODE: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } case HmiState::STATE_ID_VR_SESSION: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } case HmiState::STATE_ID_TTS_SESSION: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } case HmiState::STATE_ID_VIDEO_STREAMING: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } case HmiState::STATE_ID_NAVI_STREAMING: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } case HmiState::STATE_ID_REGULAR: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } case HmiState::STATE_ID_POSTPONED: { - new_state = MakeShared(app, app_mngr_, state_id); + new_state = std::make_shared(app, app_mngr_, state_id); break; } case HmiState::STATE_ID_DEACTIVATE_HMI: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } case HmiState::STATE_ID_AUDIO_SOURCE: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } case HmiState::STATE_ID_EMBEDDED_NAVI: { - new_state = MakeShared(app, app_mngr_); + new_state = std::make_shared(app, app_mngr_); break; } default: diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc index 80755b6509..8081dee139 100644 --- a/src/components/application_manager/src/usage_statistics.cc +++ b/src/components/application_manager/src/usage_statistics.cc @@ -35,7 +35,7 @@ #include "smart_objects/enum_schema_item.h" #include "policy/usage_statistics/statistics_manager.h" #include "utils/macro.h" -#include "utils/make_shared.h" + using namespace mobile_apis; using namespace NsSmartDeviceLink::NsSmartObjects; @@ -56,7 +56,7 @@ std::string LanguageIdToString(Language::eType lang_id) { UsageStatistics::UsageStatistics( const std::string& app_id, - utils::SharedPtr statistics_manager) + std::shared_ptr statistics_manager) : time_in_hmi_state_sptr_( new usage_statistics::AppStopwatchImpl(statistics_manager, app_id)) , app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI) @@ -78,7 +78,7 @@ UsageStatistics::UsageStatistics( UsageStatistics::UsageStatistics( const std::string& app_id, - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, AppStopwatch* time_in_hmi_state_ptr) : time_in_hmi_state_sptr_(time_in_hmi_state_ptr) , app_registration_language_gui_(statistics_manager, app_id, LANGUAGE_GUI) 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 2fda4a7031..3293a8908d 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 @@ -40,7 +40,7 @@ #include "application_manager/mock_application.h" #include "application_manager/mock_application_manager.h" #include "connection_handler/mock_connection_handler.h" -#include "utils/make_shared.h" + #include "utils/test_async_waiter.h" namespace test { @@ -60,12 +60,12 @@ namespace ch_test = test::components::connection_handler_test; namespace am_test = test::components::application_manager_test; const uint32_t MAX_TEST_DURATION = 1000; // 1 second -typedef utils::SharedPtr MockAppPtr; +typedef std::shared_ptr MockAppPtr; class AppLaunchCtrlTest : public ::testing::Test { public: MockAppPtr AppFromAppData(const app_launch::ApplicationData& app_data) { - utils::SharedPtr > app = - utils::MakeShared >(); + std::shared_ptr > app = + std::make_shared >(); ON_CALL(*app, mac_address()).WillByDefault(ReturnRef(app_data.device_mac_)); ON_CALL(*app, bundle_id()).WillByDefault(ReturnRef(app_data.bundle_id_)); @@ -77,7 +77,7 @@ class AppLaunchCtrlTest : public ::testing::Test { app_launch::ApplicationDataPtr AppDataFromApp( const am_test::MockApplication& app) { app_launch::ApplicationDataPtr app_data = - utils::MakeShared >( + std::make_shared >( app.policy_app_id(), app.bundle_id(), app.mac_address()); return app_data; } @@ -137,7 +137,7 @@ class AppLaunchCtrlTest : public ::testing::Test { using app_launch::ApplicationData; AppAndAppData app; app.second = - utils::MakeShared(app_id, bundle_id, device_mac); + std::make_shared(app_id, bundle_id, device_mac); app.first = AppFromAppData(*app.second); return app; } 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 bfae920dbf..dc96fcf176 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 @@ -38,7 +38,7 @@ #include "utils/macro.h" #include "sql_database.h" #include "sql_query.h" -#include "utils/make_shared.h" + #include "utils/file_system.h" #include "application_manager/mock_app_launch_settings.h" #include "application_manager/app_launch/app_launch_data_db.h" @@ -284,7 +284,7 @@ TEST_F(AppLaunchDataDBTest, SelectMultipleData) { const std::string mobile_app_id = AddCounter("d1_mobile_app_id", i); const std::string bundle_id = AddCounter("d1_bundle_id", i); - ApplicationDataPtr app_data = utils::MakeShared( + ApplicationDataPtr app_data = std::make_shared( mobile_app_id, bundle_id, device_mac_1); AddApplicationDataWithIncreaseTable(*app_data); input_data1.push_back(app_data); @@ -294,7 +294,7 @@ TEST_F(AppLaunchDataDBTest, SelectMultipleData) { const std::string mobile_app_id = AddCounter("d2_mobile_app_id", i); const std::string bundle_id = AddCounter("d2_bundle_id", i); - ApplicationDataPtr app_data = utils::MakeShared( + ApplicationDataPtr app_data = std::make_shared( mobile_app_id, bundle_id, device_mac_2); AddApplicationDataWithIncreaseTable(*app_data); input_data2.push_back(app_data); 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 04006954b5..f68ad32bbb 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 @@ -36,7 +36,7 @@ #include "json/json.h" #include "gtest/gtest.h" #include "utils/macro.h" -#include "utils/make_shared.h" + #include "utils/file_system.h" #include "utils/date_time.h" #include "resumption/last_state_impl.h" @@ -301,7 +301,7 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) { const std::string mobile_app_id = AddCounter("d1_mobile_app_id_", i); const std::string bundle_id = AddCounter("d1_bundle_id_", i); - ApplicationDataPtr app_data = utils::MakeShared( + ApplicationDataPtr app_data = std::make_shared( mobile_app_id, bundle_id, device_mac_1); AddApplicationDataWithIncreaseTable(*app_data); input_data1.push_back(app_data); @@ -311,7 +311,7 @@ TEST_F(AppLaunchDataJsonTest, SelectMultipleData) { const std::string mobile_app_id = AddCounter("d2_mobile_app_id_", i); const std::string bundle_id = AddCounter("d2_bundle_id_", i); - ApplicationDataPtr app_data = utils::MakeShared( + ApplicationDataPtr app_data = std::make_shared( mobile_app_id, bundle_id, device_mac_2); AddApplicationDataWithIncreaseTable(*app_data); input_data2.push_back(app_data); diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc index c9a8fd2da4..e84dc5f7be 100644 --- a/src/components/application_manager/test/application_helper_test.cc +++ b/src/components/application_manager/test/application_helper_test.cc @@ -50,8 +50,8 @@ #include "smart_objects/smart_object.h" #include "utils/custom_string.h" #include "utils/macro.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "test/resumption/mock_last_state.h" #include "media_manager/mock_media_manager.h" @@ -121,13 +121,13 @@ class ApplicationHelperTest : public testing::Test { .WillOnce(ReturnRef(path_to_plagin)); app_manager_impl_.Init(mock_last_state_, &mock_media_manager_); - app_impl_ = new ApplicationImpl( + app_impl_ = std::make_shared( application_id, policy_app_id, mac_address, device_id, app_name, - utils::MakeShared(), + std::make_shared(), app_manager_impl_); } diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index 3fe646d710..ce1d4ed326 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -39,7 +39,7 @@ #include "application_manager/hmi_state.h" #include "utils/file_system.h" -#include "utils/make_shared.h" + #include "application_manager/mock_message_helper.h" #include "utils/custom_string.h" #include "application_manager/mock_application_manager.h" @@ -101,7 +101,7 @@ class ApplicationImplTest : public ::testing::Test { mac_address, device_handle, app_name, - utils::MakeShared(), + std::make_shared(), mock_application_manager_)); HmiStatePtr initial_state = CreateTestHmiState(); @@ -121,7 +121,7 @@ class ApplicationImplTest : public ::testing::Test { void CheckCurrentHMIState(); MockApplicationManagerSettings mock_application_manager_settings_; MockApplicationManager mock_application_manager_; - utils::SharedPtr app_impl; + std::shared_ptr app_impl; uint32_t app_id; std::string policy_app_id; std::string mac_address; @@ -136,8 +136,8 @@ class ApplicationImplTest : public ::testing::Test { }; HmiStatePtr ApplicationImplTest::CreateTestHmiState() { - HmiStatePtr testState = utils::MakeShared( - static_cast >(app_impl), + HmiStatePtr testState = std::make_shared( + static_cast >(app_impl), mock_application_manager_, state_id); testState->set_hmi_level(test_lvl); @@ -271,7 +271,7 @@ TEST_F(ApplicationImplTest, AddStates_RemoveFirstState) { // Last state does not have a parent EXPECT_EQ(HMILevel::HMI_LIMITED, current_state->hmi_level()); EXPECT_EQ(HmiState::STATE_ID_TTS_SESSION, current_state->state_id()); - EXPECT_EQ(NULL, current_state->parent()); + EXPECT_EQ(nullptr, current_state->parent()); } TEST_F(ApplicationImplTest, SetRegularState_RemoveFirstState) { @@ -310,7 +310,7 @@ TEST_F(ApplicationImplTest, SetPostponedState_RemovePostponedState) { // Check that state was correctly removed app_impl->RemovePostponedState(); state2 = app_impl->PostponedHmiState(); - EXPECT_EQ(NULL, state2); + EXPECT_EQ(nullptr, state2); } TEST_F(ApplicationImplTest, AddStateAddRegularState_GetHmiLvlAudioSystemState) { @@ -406,7 +406,7 @@ TEST_F(ApplicationImplTest, GetFile) { test_file.file_type = FileType::GRAPHIC_JPEG; test_file.file_name = "test_file 1"; - EXPECT_EQ(NULL, app_impl->GetFile(test_file.file_name)); + EXPECT_EQ(nullptr, app_impl->GetFile(test_file.file_name)); EXPECT_TRUE(app_impl->AddFile(test_file)); const AppFile* app_file = app_impl->GetFile(test_file.file_name); EXPECT_EQ(test_file.is_persistent, app_file->is_persistent); @@ -812,7 +812,7 @@ TEST_F(ApplicationImplTest, StopStreaming_StreamingApproved) { TEST_F(ApplicationImplTest, PushPopMobileMessage) { smart_objects::SmartObjectSPtr on_driver_distraction = - utils::MakeShared(); + std::make_shared(); const hmi_apis::Common_DriverDistractionState::eType state = hmi_apis::Common_DriverDistractionState::DD_ON; (*on_driver_distraction)[strings::params][strings::function_id] = 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 9ae388c809..b168f7a480 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 @@ -38,7 +38,7 @@ #include "application_manager/application_impl.h" #include "application_manager/application_manager_impl.h" #include "utils/custom_string.h" -#include "utils/make_shared.h" + #include "encryption/hashing.h" #include "application_manager/mock_application_manager_settings.h" @@ -87,7 +87,7 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test { public: ApplicationManagerImplMockHmiTest() : mock_storage_( - ::utils::MakeShared >( + std::make_shared >( mock_app_mngr_)) {} protected: @@ -146,7 +146,7 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test { Return(0))); } - utils::SharedPtr > + std::shared_ptr > mock_storage_; application_manager_test::MockApplicationManager mock_app_mngr_; NiceMock mock_policy_settings_; @@ -168,13 +168,13 @@ TEST_F(ApplicationManagerImplMockHmiTest, plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager = new plugin_manager::MockRPCPluginManager; - utils::SharedPtr app_impl = new ApplicationImpl( + std::shared_ptr app_impl = std::make_shared( application_id, policy_app_id, encryption::MakeHash(mac_address), device_id, app_name, - utils::SharedPtr( + std::shared_ptr( new usage_statistics_test::MockStatisticsManager()), *app_manager_impl_); std::unique_ptr mock_rpc_plugin_manager_ptr( @@ -195,7 +195,7 @@ TEST_F(ApplicationManagerImplMockHmiTest, // // Skip sending notification on device switching as it is not the goal // here EXPECT_CALL(mock_command_factory, CreateCommand(_, _)) - .WillOnce(Return(utils::SharedPtr())); + .WillOnce(Return(std::shared_ptr())); plugin_manager::MockRPCPlugin mock_rpc_plugin; utils::Optional mock_rpc_plugin_opt = @@ -212,14 +212,14 @@ TEST_F(ApplicationManagerImplMockHmiTest, const uint32_t correlation_id_1 = 1u; const uint32_t correlation_id_2 = 2u; const uint32_t correlation_id_3 = 3u; - utils::SharedPtr > cmd_1 = - utils::MakeShared >(connection_key, + std::shared_ptr > cmd_1 = + std::make_shared >(connection_key, correlation_id_1); - utils::SharedPtr > cmd_2 = - utils::MakeShared >(connection_key, + std::shared_ptr > cmd_2 = + std::make_shared >(connection_key, correlation_id_2); - utils::SharedPtr > cmd_3 = - utils::MakeShared >(connection_key, + std::shared_ptr > cmd_3 = + std::make_shared >(connection_key, correlation_id_3); EXPECT_CALL(mock_command_factory, CreateCommand(_, _)) @@ -228,11 +228,11 @@ TEST_F(ApplicationManagerImplMockHmiTest, .WillOnce(Return(cmd_3)); commands::MessageSharedPtr hmi_msg_1 = - utils::MakeShared(); + std::make_shared(); commands::MessageSharedPtr hmi_msg_2 = - utils::MakeShared(); + std::make_shared(); commands::MessageSharedPtr hmi_msg_3 = - utils::MakeShared(); + std::make_shared(); (*hmi_msg_1)[strings::msg_params][strings::app_id] = (*hmi_msg_2)[strings::msg_params][strings::app_id] = 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 d2bba895c8..5b3a148357 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -58,7 +58,7 @@ #include "utils/custom_string.h" #include "utils/file_system.h" #include "utils/lock.h" -#include "utils/make_shared.h" + #include "utils/push_log.h" #include "encryption/hashing.h" @@ -103,7 +103,7 @@ class ApplicationManagerImplTest : public ::testing::Test { ApplicationManagerImplTest() : app_id_(0u) , mock_storage_( - ::utils::MakeShared >( + std::make_shared >( mock_app_mngr_)) , mock_rpc_service_(new MockRPCService) , mock_message_helper_( @@ -151,7 +151,7 @@ class ApplicationManagerImplTest : public ::testing::Test { app_manager_impl_.reset(new am::ApplicationManagerImpl( mock_application_manager_settings_, mock_policy_settings_)); - mock_app_ptr_ = utils::SharedPtr(new MockApplication()); + mock_app_ptr_ = std::shared_ptr(new MockApplication()); app_manager_impl_->set_protocol_handler(&mock_protocol_handler_); ASSERT_TRUE(app_manager_impl_.get()); ASSERT_TRUE(mock_app_ptr_.get()); @@ -196,7 +196,7 @@ class ApplicationManagerImplTest : public ::testing::Test { uint32_t app_id_; NiceMock mock_policy_settings_; - utils::SharedPtr > + std::shared_ptr > mock_storage_; std::unique_ptr mock_rpc_service_; @@ -207,7 +207,7 @@ class ApplicationManagerImplTest : public ::testing::Test { std::unique_ptr app_manager_impl_; application_manager::MockMessageHelper* mock_message_helper_; - utils::SharedPtr mock_app_ptr_; + std::shared_ptr mock_app_ptr_; NiceMock mock_protocol_handler_; }; @@ -221,7 +221,7 @@ TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) { app_data[am::json::android][am::json::packageName] = "com.android.test"; smart_objects::SmartObject sm_object(SmartType_Map); sm_object[am::json::response][0] = app_data; - SmartObjectSPtr sptr = MakeShared(sm_object); + SmartObjectSPtr sptr = std::make_shared(sm_object); ON_CALL(*mock_message_helper_, CreateModuleInfoSO(_, _)) .WillByDefault(Return(sptr)); @@ -233,7 +233,7 @@ TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) { TEST_F(ApplicationManagerImplTest, SubscribeAppForWayPoints_ExpectSubscriptionApp) { auto app_ptr = - ApplicationSharedPtr::static_pointer_cast(mock_app_ptr_); + std::static_pointer_cast(mock_app_ptr_); app_manager_impl_->SubscribeAppForWayPoints(app_ptr); EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr)); } @@ -241,7 +241,7 @@ TEST_F(ApplicationManagerImplTest, TEST_F(ApplicationManagerImplTest, UnsubscribeAppForWayPoints_ExpectUnsubscriptionApp) { auto app_ptr = - ApplicationSharedPtr::static_pointer_cast(mock_app_ptr_); + std::static_pointer_cast(mock_app_ptr_); app_manager_impl_->SubscribeAppForWayPoints(app_ptr); EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr)); app_manager_impl_->UnsubscribeAppFromWayPoints(app_ptr); @@ -263,11 +263,11 @@ TEST_F( ApplicationManagerImplTest, GetAppsSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) { auto app_ptr = - ApplicationSharedPtr::static_pointer_cast(mock_app_ptr_); + std::static_pointer_cast(mock_app_ptr_); app_manager_impl_->SubscribeAppForWayPoints(app_ptr); std::set result = app_manager_impl_->GetAppsSubscribedForWayPoints(); EXPECT_EQ(1u, result.size()); - EXPECT_TRUE(result.find(app_ptr) != result.end()); + EXPECT_TRUE(result.find(app_ptr->app_id()) != result.end()); } TEST_F(ApplicationManagerImplTest, OnServiceStartedCallback_RpcService) { @@ -727,7 +727,7 @@ TEST_F(ApplicationManagerImplTest, .WillOnce(Return(mobile_api::HMILevel::eType::INVALID_ENUM)); smart_objects::SmartObject dummy_object(SmartType_Map); - SmartObjectSPtr sptr = MakeShared(dummy_object); + SmartObjectSPtr sptr = std::make_shared(dummy_object); EXPECT_CALL(*mock_message_helper_, CreateModuleInfoSO( @@ -753,7 +753,7 @@ TEST_F(ApplicationManagerImplTest, EXPECT_CALL(*mock_app_ptr_, set_secondary_device(0)).Times(1); smart_objects::SmartObject dummy_object(SmartType_Map); - SmartObjectSPtr sptr = MakeShared(dummy_object); + SmartObjectSPtr sptr = std::make_shared(dummy_object); EXPECT_CALL(*mock_message_helper_, CreateModuleInfoSO( @@ -778,8 +778,8 @@ TEST_F(ApplicationManagerImplTest, TEST_F(ApplicationManagerImplTest, OnDeviceSwitchingStart_ExpectPutAppsInWaitList) { - utils::SharedPtr switching_app_ptr = - utils::MakeShared(); + std::shared_ptr switching_app_ptr = + std::make_shared(); const std::string switching_device_id = "switching"; const std::string switching_device_id_hash = @@ -796,8 +796,8 @@ TEST_F(ApplicationManagerImplTest, EXPECT_CALL(*switching_app_ptr, hmi_level()) .WillRepeatedly(Return(hmi_level_switching_app)); - utils::SharedPtr nonswitching_app_ptr = - utils::MakeShared(); + std::shared_ptr nonswitching_app_ptr = + std::make_shared(); const std::string nonswitching_device_id = "nonswitching"; const std::string nonswitching_device_id_hash = @@ -836,8 +836,8 @@ TEST_F(ApplicationManagerImplTest, TEST_F(ApplicationManagerImplTest, OnDeviceSwitchingFinish_ExpectUnregisterAppsInWaitList) { - utils::SharedPtr switching_app_ptr = - utils::MakeShared(); + std::shared_ptr switching_app_ptr = + std::make_shared(); plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager = new plugin_manager::MockRPCPluginManager; @@ -860,8 +860,8 @@ TEST_F(ApplicationManagerImplTest, EXPECT_CALL(*switching_app_ptr, hmi_level()) .WillRepeatedly(Return(hmi_level_switching_app)); - utils::SharedPtr nonswitching_app_ptr = - utils::MakeShared(); + std::shared_ptr nonswitching_app_ptr = + std::make_shared(); const std::string nonswitching_device_id = "nonswitching"; const std::string nonswitching_device_id_hash = @@ -909,13 +909,13 @@ TEST_F(ApplicationManagerImplTest, const connection_handler::DeviceHandle device_id = 1; const custom_str::CustomString app_name(""); - utils::SharedPtr app_impl = new ApplicationImpl( + std::shared_ptr app_impl = std::make_shared( application_id, policy_app_id, mac_address, device_id, app_name, - utils::SharedPtr( + std::shared_ptr( new usage_statistics_test::MockStatisticsManager()), *app_manager_impl_); @@ -986,8 +986,8 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) { const uint32_t app_id_2 = 65538; std::string dummy_mac_address; - utils::SharedPtr mock_app_1 = - utils::SharedPtr(new MockApplication()); + std::shared_ptr mock_app_1 = + std::shared_ptr(new MockApplication()); EXPECT_CALL(*mock_app_1, app_id()).WillRepeatedly(Return(app_id_1)); EXPECT_CALL(*mock_app_1, device()).WillRepeatedly(Return(0)); EXPECT_CALL(*mock_app_1, mac_address()) @@ -997,8 +997,8 @@ TEST_F(ApplicationManagerImplTest, UnregisterAnotherAppDuringAudioPassThru) { .WillRepeatedly( Return(protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_4)); - utils::SharedPtr mock_app_2 = - utils::SharedPtr(new MockApplication()); + std::shared_ptr mock_app_2 = + std::shared_ptr(new MockApplication()); EXPECT_CALL(*mock_app_2, app_id()).WillRepeatedly(Return(app_id_2)); EXPECT_CALL(*mock_app_2, device()).WillRepeatedly(Return(0)); EXPECT_CALL(*mock_app_2, mac_address()) @@ -1397,7 +1397,7 @@ TEST_F(ApplicationManagerImplTest, protocol_handler::MajorProtocolVersion::PROTOCOL_VERSION_2; smart_objects::SmartObjectSPtr request_for_registration_ptr = - MakeShared(request_for_registration); + std::make_shared(request_for_registration); ApplicationSharedPtr application = app_manager_impl_->RegisterApplication(request_for_registration_ptr); diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc index 6f732b6adc..c19fd00930 100644 --- a/src/components/application_manager/test/application_state_test.cc +++ b/src/components/application_manager/test/application_state_test.cc @@ -41,7 +41,7 @@ #include "application_manager/state_controller.h" #include "application_manager/resumption/resume_ctrl.h" -#include "utils/make_shared.h" + namespace test { namespace components { @@ -75,7 +75,7 @@ class ApplicationStateTest : public ::testing::Test { ApplicationState app_state; const StateID current_id = StateID::STATE_ID_CURRENT; const StateID postponed_id = StateID::STATE_ID_POSTPONED; - utils::SharedPtr mock_app_; + std::shared_ptr mock_app_; MockApplicationManager app_mngr_; }; @@ -85,8 +85,8 @@ std::vector ApplicationStateTest::added_states_ = TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) { std::vector::iterator new_state = added_states_.begin(); for (; new_state != added_states_.end(); ++new_state) { - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, *new_state); app_state.AddState(state); @@ -97,8 +97,8 @@ TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) { TEST_F(ApplicationStateTest, AddStates_RemoveStates_GetCurrentState) { std::vector::iterator new_state = added_states_.begin(); for (; new_state != added_states_.end(); ++new_state) { - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, *new_state); app_state.AddState(state); @@ -120,18 +120,18 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) { // Added some states std::vector::iterator new_state = added_states_.begin(); for (; new_state != added_states_.end(); ++new_state) { - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, *new_state); app_state.AddState(state); } // Postponed state wasn't added HmiStatePtr get_postponed_id = app_state.GetState(postponed_id); - EXPECT_EQ(NULL, get_postponed_id); + EXPECT_EQ(nullptr, get_postponed_id); // Add posponed state - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, postponed_id); app_state.AddState(state); @@ -143,8 +143,8 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) { TEST_F(ApplicationStateTest, AddStates_GetRegularState) { // Add state std::vector::iterator new_state = added_states_.begin(); - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, *new_state); state->set_hmi_level(HMILevel::HMI_FULL); @@ -152,8 +152,8 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) { ++new_state; // Add some other for (; new_state != added_states_.end(); ++new_state) { - state = utils::MakeShared( - static_cast >(mock_app_), + state = std::make_shared( + static_cast >(mock_app_), app_mngr_, *new_state); app_state.AddState(state); @@ -169,16 +169,16 @@ TEST_F(ApplicationStateTest, AddStates_GetRegularState) { TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) { std::vector::iterator new_state = added_states_.begin(); - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, *new_state); app_state.AddState(state); ++new_state; // Add postponed state - state = utils::MakeShared( - static_cast >(mock_app_), + state = std::make_shared( + static_cast >(mock_app_), app_mngr_, postponed_id); app_state.AddState(state); @@ -188,8 +188,8 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) { ASSERT_EQ(state, post_state); for (; new_state != added_states_.end(); ++new_state) { - state = utils::MakeShared( - static_cast >(mock_app_), + state = std::make_shared( + static_cast >(mock_app_), app_mngr_, *new_state); app_state.AddState(state); @@ -211,30 +211,30 @@ TEST_F(ApplicationStateTest, AddRegularState_RemoveFirstState_GetRegularState) { TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) { // Add some state StateID first_state = StateID::STATE_ID_PHONE_CALL; - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, first_state); app_state.AddState(state); // Add postponed state - state = utils::MakeShared( - static_cast >(mock_app_), + state = std::make_shared( + static_cast >(mock_app_), app_mngr_, postponed_id); app_state.AddState(state); // Add new postponed state - utils::SharedPtr mock_app_2(new MockApplication); - state = utils::MakeShared( - static_cast >(mock_app_), + std::shared_ptr mock_app_2(new MockApplication); + state = std::make_shared( + static_cast >(mock_app_), app_mngr_, postponed_id); app_state.AddState(state); // Add regular state - state = utils::MakeShared( - static_cast >(mock_app_), + state = std::make_shared( + static_cast >(mock_app_), app_mngr_, StateID::STATE_ID_REGULAR); app_state.AddState(state); @@ -250,8 +250,8 @@ TEST_F(ApplicationStateTest, AddRegularState_PreviousStatePostponed) { TEST_F(ApplicationStateTest, InitState_GetRegularState) { StateID init_state = StateID::STATE_ID_REGULAR; - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, init_state); @@ -267,8 +267,8 @@ TEST_F(ApplicationStateTest, InitState_GetRegularState) { TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) { // Precondition StateID init_state = StateID::STATE_ID_REGULAR; - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, init_state); state->set_hmi_level(mobile_apis::HMILevel::HMI_FULL); @@ -276,8 +276,8 @@ TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) { app_state.InitState(state); // Add postponed state - state = utils::MakeShared( - static_cast >(mock_app_), + state = std::make_shared( + static_cast >(mock_app_), app_mngr_, postponed_id); app_state.AddState(state); @@ -290,14 +290,14 @@ TEST_F(ApplicationStateTest, AddPosponedState_DeletePosponedState) { app_state.RemoveState(postponed_id); get_postponed_state = app_state.GetState(postponed_id); - EXPECT_EQ(NULL, get_postponed_state); + EXPECT_EQ(nullptr, get_postponed_state); } TEST_F(ApplicationStateTest, AddRegularState_RemoveRegularState_RegularStateNotDeleted) { StateID reg_state = StateID::STATE_ID_REGULAR; - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, reg_state); app_state.InitState(state); diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc index 9227fd8fcb..588dc8e6ab 100644 --- a/src/components/application_manager/test/command_holder_test.cc +++ b/src/components/application_manager/test/command_holder_test.cc @@ -35,8 +35,8 @@ #include "application_manager/command_holder_impl.h" #include "application_manager/commands/command.h" #include "smart_objects/smart_object.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "application_manager/mock_application_manager.h" #include "application_manager/mock_application.h" @@ -75,8 +75,8 @@ class CommandHolderImplTest : public testing::Test { const std::string kPolicyAppId_; const uint32_t kHmiApplicationId_; const uint32_t kConnectionKey_; - utils::SharedPtr cmd_ptr_; - utils::SharedPtr mock_app_ptr_; + std::shared_ptr cmd_ptr_; + std::shared_ptr mock_app_ptr_; application_manager_test::MockRPCService mock_rpc_service_; }; @@ -126,8 +126,8 @@ TEST_F(CommandHolderImplTest, Hold_ReleaseAnotherId_ExpectNoReleased) { mock_app_ptr_, am::CommandHolder::CommandType::kHmiCommand, cmd_ptr_); // Act - utils::SharedPtr another_app = - utils::MakeShared(); + std::shared_ptr another_app = + std::make_shared(); EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(0); cmd_holder.Resume(another_app, am::CommandHolder::CommandType::kHmiCommand); @@ -144,8 +144,8 @@ TEST_F(CommandHolderImplTest, Hold_DropAnotherId_ExpectReleased) { } while (iterations < 3); // Act - utils::SharedPtr another_app = - utils::MakeShared(); + std::shared_ptr another_app = + std::make_shared(); cmd_holder.Clear(another_app); EXPECT_CALL(mock_rpc_service_, ManageHMICommand(cmd_ptr_)).Times(iterations); 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 b50d94f824..2b15397769 100644 --- a/src/components/application_manager/test/commands/command_impl_test.cc +++ b/src/components/application_manager/test/commands/command_impl_test.cc @@ -37,7 +37,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -55,7 +55,7 @@ using ::testing::Return; using ::testing::AtLeast; using ::testing::_; -using ::utils::SharedPtr; + namespace strings = ::application_manager::strings; using ::application_manager::commands::CommandImpl; using ::application_manager::ApplicationManager; @@ -63,7 +63,7 @@ using ::application_manager::commands::MessageSharedPtr; using ::application_manager::ApplicationSharedPtr; using ::test::components::application_manager_test::MockApplication; -typedef SharedPtr MockAppPtr; +typedef std::shared_ptr MockAppPtr; namespace { const uint32_t kDefaultMsgCount = 5u; @@ -125,11 +125,11 @@ class CommandImplTest : public CommandsTest { }; typedef CommandImplTest::UnwrappedCommandImpl UCommandImpl; -typedef SharedPtr UCommandImplPtr; +typedef std::shared_ptr UCommandImplPtr; TEST_F(CommandImplTest, GetMethods_SUCCESS) { MessageSharedPtr msg; - SharedPtr command = + std::shared_ptr command = CreateCommand(kDefaultTimeout_, msg); // Current implementation always return `true` 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 c5a3459673..968c606855 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 @@ -40,7 +40,7 @@ #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" #include "utils/lock.h" -#include "utils/shared_ptr.h" + #include "utils/data_accessor.h" #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" @@ -65,7 +65,7 @@ using ::testing::Return; using ::testing::SaveArg; using ::testing::DoAll; -using ::utils::SharedPtr; + using am::commands::MessageSharedPtr; using am::CommandParametersPermissions; using am::event_engine::EventObserver; @@ -134,8 +134,8 @@ class CommandRequestImplTest } }; - MockAppPtr InitAppSetDataAccessor(SharedPtr& app_set) { - app_set = (!app_set ? ::utils::MakeShared() : app_set); + MockAppPtr InitAppSetDataAccessor(std::shared_ptr& app_set) { + app_set = (!app_set ? std::make_shared() : app_set); MockAppPtr app(CreateMockApp()); app_set->insert(app); EXPECT_CALL(app_mngr_, applications()) @@ -148,7 +148,7 @@ class CommandRequestImplTest }; typedef CommandRequestImplTest::UnwrappedCommandRequestImpl UCommandRequestImpl; -typedef SharedPtr CommandPtr; +typedef std::shared_ptr CommandPtr; TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) { CommandPtr command = CreateCommand(); 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 bd7499ce8f..eb1cb473e0 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 @@ -34,7 +34,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -49,7 +49,7 @@ namespace command_response_impl { namespace strings = ::application_manager::strings; namespace hmi_response = ::application_manager::hmi_response; -using ::utils::SharedPtr; + using ::application_manager::commands::MessageSharedPtr; using ::application_manager::commands::CommandResponseImpl; @@ -57,7 +57,7 @@ class CommandResponseImplTest : public CommandsTest {}; TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) { - SharedPtr command = CreateCommand(); + std::shared_ptr command = CreateCommand(); // Current implementation always return `true` EXPECT_TRUE(command->Init()); EXPECT_TRUE(command->CleanUp()); @@ -66,7 +66,7 @@ TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) { TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) { MessageSharedPtr msg; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); // Do not have a weight in this case const bool kSuccess = true; @@ -86,7 +86,7 @@ TEST_F(CommandResponseImplTest, SendResponse_MessageWithResultCode_SUCCESS) { TEST_F(CommandResponseImplTest, SendResponse_EmptyMessageValidResultCode_SUCCESS) { MessageSharedPtr msg; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); const bool kSuccess = true; @@ -108,7 +108,7 @@ TEST_F(CommandResponseImplTest, TEST_F(CommandResponseImplTest, SendResponse_EmptyMessageInvalidResultCode_SUCCESS) { MessageSharedPtr msg; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); const bool kSuccess = true; @@ -133,7 +133,7 @@ TEST_F(CommandResponseImplTest, TEST_F(CommandResponseImplTest, SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_SUCCESS) { MessageSharedPtr msg; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); const mobile_apis::Result::eType kResultCode = @@ -158,7 +158,7 @@ TEST_F(CommandResponseImplTest, TEST_F(CommandResponseImplTest, SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_INVALID_ENUM) { MessageSharedPtr msg; - SharedPtr command = + std::shared_ptr command = CreateCommand(msg); const mobile_apis::Result::eType kResultCode = diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc index 440763d4c3..de0b5afb3c 100644 --- a/src/components/application_manager/test/event_engine_test.cc +++ b/src/components/application_manager/test/event_engine_test.cc @@ -38,7 +38,7 @@ #include "application_manager/mock_event_observer.h" #include "application_manager/mock_event_dispatcher.h" #include "smart_objects/smart_object.h" -#include "utils/make_shared.h" + #include "interfaces/HMI_API.h" namespace test { 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 335e8e4f64..3be730c2c9 100644 --- a/src/components/application_manager/test/help_prompt_manager_test.cc +++ b/src/components/application_manager/test/help_prompt_manager_test.cc @@ -89,7 +89,7 @@ class ApplicationImplTest : public ApplicationImpl { const std::string& mac_address, const connection_handler::DeviceHandle device_id, const custom_str::CustomString& app_name, - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, ApplicationManager& application_manager, MockHelpPromptManager& mock_help_prompt_manager) : ApplicationImpl(application_id, @@ -124,8 +124,8 @@ class HelpPromptManagerTest : public ::testing::Test { HmiStatePtr CreateTestHmiState(); template - SharedPtr CreateCommand(MessageSharedPtr& msg) { - return ::utils::MakeShared(msg, + std::shared_ptr CreateCommand(MessageSharedPtr& msg) { + return std::make_shared(msg, app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -136,17 +136,17 @@ class HelpPromptManagerTest : public ::testing::Test { typedef CommandsTest::MockAppManager MockAppManager; MockAppManager app_mngr_; - utils::SharedPtr app_impl_; + std::shared_ptr app_impl_; MockHmiInterfaces mock_hmi_interfaces_; NiceMock mock_event_dispatcher_; NiceMock app_mngr_settings_; - utils::SharedPtr mock_app_; + std::shared_ptr mock_app_; sync_primitives::Lock app_lock_; MockRPCService mock_rpc_service_; application_manager_test::MockHMICapabilities mock_hmi_capabilities_; policy_test::MockPolicyHandlerInterface mock_policy_handler_; MockMessageHelper& mock_message_helper_; - utils::SharedPtr mock_help_prompt_manager_; + std::shared_ptr mock_help_prompt_manager_; }; void HelpPromptManagerTest::SetUp() { @@ -173,17 +173,17 @@ void HelpPromptManagerTest::SetUp() { .WillByDefault(Return(0)); mock_help_prompt_manager_ = - utils::SharedPtr(new MockHelpPromptManager()); + std::shared_ptr(new MockHelpPromptManager()); - HmiStatePtr state = utils::MakeShared( - static_cast >(mock_app_), + HmiStatePtr state = std::make_shared( + static_cast >(mock_app_), app_mngr_, HmiState::STATE_ID_REGULAR); std::string path = file_system::CreateDirectory("storage"); file_system::CreateFile(path + "/" + "certificate"); - mock_app_ = utils::MakeShared(); + mock_app_ = std::make_shared(); } void HelpPromptManagerTest::TearDown() { @@ -192,7 +192,7 @@ void HelpPromptManagerTest::TearDown() { MessageSharedPtr HelpPromptManagerTest::CreateMsgParams() { MessageSharedPtr msg = - ::utils::MakeShared(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); (*msg)[am::strings::params][am::strings::connection_key] = kConnectionKey; (*msg)[am::strings::msg_params][am::strings::app_id] = kAppId; return msg; @@ -220,8 +220,8 @@ void HelpPromptManagerTest::CreateBasicParamsVRRequest(MessageSharedPtr msg) { } HmiStatePtr HelpPromptManagerTest::CreateTestHmiState() { - HmiStatePtr testState = utils::MakeShared( - static_cast >(app_impl_), + HmiStatePtr testState = std::make_shared( + static_cast >(app_impl_), app_mngr_, HmiState::STATE_ID_REGULAR); testState->set_hmi_level(HMILevel::INVALID_ENUM); @@ -243,7 +243,7 @@ void HelpPromptManagerTest::CreateApplication( mac_address, device_id, app_name, - utils::MakeShared(), + std::make_shared(), app_mngr_, mock_help_prompt_manager)); HmiStatePtr initial_state = CreateTestHmiState(); @@ -253,7 +253,7 @@ void HelpPromptManagerTest::CreateApplication( TEST_F(HelpPromptManagerTest, AddCommand_OnVrCommandAdded) { CreateApplication(*mock_help_prompt_manager_.get()); MessageSharedPtr msg = - ::utils::MakeShared(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); CreateBasicParamsVRRequest(msg); (*msg)[strings::params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS; @@ -265,7 +265,7 @@ TEST_F(HelpPromptManagerTest, AddCommand_OnVrCommandAdded) { TEST_F(HelpPromptManagerTest, RemoveCommand_OnVrCommandDeleted) { CreateApplication(*mock_help_prompt_manager_.get()); MessageSharedPtr msg = - ::utils::MakeShared(smart_objects::SmartType_Map); + std::make_shared(smart_objects::SmartType_Map); CreateBasicParamsVRRequest(msg); (*msg)[strings::params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS; @@ -310,7 +310,7 @@ TEST_F(HelpPromptManagerTest, EXPECT_CALL(*mock_help_prompt_manager_, OnSetGlobalPropertiesReceived(_, false)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); @@ -358,7 +358,7 @@ TEST_F(HelpPromptManagerTest, EXPECT_CALL(*mock_help_prompt_manager_, OnSetGlobalPropertiesReceived(_, false)); - SharedPtr command( + std::shared_ptr command( CreateCommand(msg)); command->Run(); diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index e1d2eeb402..8d11a0cc93 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -41,7 +41,7 @@ #include "application_manager/mock_message_helper.h" #include "smart_objects/enum_schema_item.h" #include "interfaces/HMI_API.h" -#include "utils/make_shared.h" + #include "application_manager/hmi_capabilities_for_testing.h" #include "utils/file_system.h" #include "application_manager/mock_application_manager.h" @@ -82,7 +82,7 @@ class HMICapabilitiesTest : public ::testing::Test { EXPECT_CALL(mock_application_manager_settings_, launch_hmi()) .WillOnce(Return(false)); hmi_capabilities_test = - utils::MakeShared(app_mngr_); + std::make_shared(app_mngr_); hmi_capabilities_test->Init(&last_state_); } @@ -100,7 +100,7 @@ class HMICapabilitiesTest : public ::testing::Test { event_engine_test::MockEventDispatcher mock_event_dispatcher; resumption::LastStateImpl last_state_; MockApplicationManagerSettings mock_application_manager_settings_; - utils::SharedPtr hmi_capabilities_test; + std::shared_ptr hmi_capabilities_test; const std::string file_name_; application_manager_test::MockRPCService mock_rpc_service_; }; @@ -506,8 +506,8 @@ TEST_F(HMICapabilitiesTest, EXPECT_TRUE(::file_system::DeleteFile("./app_info_data")); } - utils::SharedPtr hmi_capabilities = - utils::MakeShared(mock_app_mngr); + std::shared_ptr hmi_capabilities = + std::make_shared(mock_app_mngr); hmi_capabilities->Init(&last_state_); // Check system capabilities; only phone capability is available @@ -546,8 +546,8 @@ TEST_F(HMICapabilitiesTest, EXPECT_TRUE(::file_system::DeleteFile("./app_info_data")); } - utils::SharedPtr hmi_capabilities = - utils::MakeShared(mock_app_mngr); + std::shared_ptr hmi_capabilities = + std::make_shared(mock_app_mngr); hmi_capabilities->Init(&last_state_); // Check system capabilities; only navigation capability is valid, the other 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 9b8bddc6bc..9777183b8b 100644 --- a/src/components/application_manager/test/hmi_language_handler_test.cc +++ b/src/components/application_manager/test/hmi_language_handler_test.cc @@ -45,8 +45,8 @@ #include "application_manager/mock_rpc_service.h" #include "application_manager/smart_object_keys.h" #include "test/resumption/mock_last_state.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "utils/lock.h" namespace test { @@ -57,7 +57,7 @@ namespace am = ::application_manager; using am::event_engine::Event; using am::ApplicationSet; -using ::utils::SharedPtr; + using ::testing::Return; using ::testing::ReturnRef; @@ -75,7 +75,7 @@ typedef NiceMock< ::test::components::event_engine_test::MockEventDispatcher> typedef NiceMock MockApp; typedef NiceMock MockRPCService; -typedef SharedPtr ApplicationSharedPtr; +typedef std::shared_ptr ApplicationSharedPtr; typedef am::HMILanguageHandler::Apps Apps; namespace { @@ -89,7 +89,7 @@ class HmiLanguageHandlerTest : public ::testing::Test { EXPECT_CALL(app_manager_, event_dispatcher()) .WillOnce(ReturnRef(event_dispatcher_)); hmi_language_handler_ = - ::utils::MakeShared(app_manager_); + std::make_shared(app_manager_); } void InitHMIActiveLanguages(hmi_apis::Common_Language::eType ui_language, @@ -114,7 +114,7 @@ class HmiLanguageHandlerTest : public ::testing::Test { ApplicationSharedPtr CreateMockApp(const uint32_t app_id, bool expect_call = false) const { - ApplicationSharedPtr app = ::utils::MakeShared(); + ApplicationSharedPtr app = std::make_shared(); if (expect_call) { EXPECT_CALL(*app, app_id()).WillRepeatedly(Return(app_id)); } else { @@ -135,7 +135,7 @@ class HmiLanguageHandlerTest : public ::testing::Test { MockApplicationManager app_manager_; MockHMICapabilities hmi_capabilities_; MockEventDispatcher event_dispatcher_; - SharedPtr hmi_language_handler_; + std::shared_ptr hmi_language_handler_; std::shared_ptr app_set_lock_; resumption_test::MockLastState last_state_; MockRPCService mock_rpc_service_; @@ -317,7 +317,7 @@ TEST_F(HmiLanguageHandlerTest, // Needed to call of `ManageMobileCommand` method ON_CALL(*am::MockMessageHelper::message_helper_mock(), GetOnAppInterfaceUnregisteredNotificationToMobile(_, _)) - .WillByDefault(Return(::utils::MakeShared())); + .WillByDefault(Return(std::make_shared())); // Wait for `ManageMobileCommand` call twice. // First time in `SendOnLanguageChangeToMobile` diff --git a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h index 05cb80c989..1980ffa100 100644 --- a/src/components/application_manager/test/include/application_manager/commands/command_request_test.h +++ b/src/components/application_manager/test/include/application_manager/commands/command_request_test.h @@ -36,7 +36,7 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/test/include/application_manager/commands/commands_test.h" diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h index ddd0db2cbe..a93e33b373 100644 --- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h +++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h @@ -36,10 +36,10 @@ #include #include "gtest/gtest.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/command.h" -#include "utils/make_shared.h" + #include "application_manager/mock_application_manager.h" #include "test/application_manager/mock_application_manager_settings.h" #include "application_manager/test/include/application_manager/mock_hmi_interface.h" @@ -60,7 +60,7 @@ using ::testing::NiceMock; using ::testing::Mock; using ::testing::_; -using ::utils::SharedPtr; + using ::smart_objects::SmartObject; using am::commands::MessageSharedPtr; using ::test::components::application_manager_test::MockApplicationManager; @@ -104,7 +104,7 @@ class CommandsTest : public ::testing::Test { typedef typename TypeIf, MockApplication>::Result MockApp; - typedef SharedPtr MockAppPtr; + typedef std::shared_ptr MockAppPtr; virtual ~CommandsTest() { Mock::VerifyAndClearExpectations(&mock_message_helper_); @@ -112,18 +112,18 @@ class CommandsTest : public ::testing::Test { static MessageSharedPtr CreateMessage( const smart_objects::SmartType type = smart_objects::SmartType_Null) { - return ::utils::MakeShared(type); + return std::make_shared(type); } static MockAppPtr CreateMockApp() { - return ::utils::MakeShared(); + return std::make_shared(); } template - SharedPtr CreateCommand(const uint32_t timeout, + std::shared_ptr CreateCommand(const uint32_t timeout, MessageSharedPtr& msg) { InitCommand(timeout); - return ::utils::MakeShared((msg ? msg : msg = CreateMessage()), + return std::make_shared((msg ? msg : msg = CreateMessage()), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -131,15 +131,15 @@ class CommandsTest : public ::testing::Test { } template - SharedPtr CreateCommand(MessageSharedPtr& msg) { + std::shared_ptr CreateCommand(MessageSharedPtr& msg) { return CreateCommand(kDefaultTimeout_, msg); } template - SharedPtr CreateCommand(const uint32_t timeout = kDefaultTimeout_) { + std::shared_ptr CreateCommand(const uint32_t timeout = kDefaultTimeout_) { InitCommand(timeout); MessageSharedPtr msg = CreateMessage(); - return ::utils::MakeShared(msg, + return std::make_shared(msg, app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, diff --git a/src/components/application_manager/test/include/application_manager/mock_command_factory.h b/src/components/application_manager/test/include/application_manager/mock_command_factory.h index a55183e341..cb48f2220e 100644 --- a/src/components/application_manager/test/include/application_manager/mock_command_factory.h +++ b/src/components/application_manager/test/include/application_manager/mock_command_factory.h @@ -37,7 +37,7 @@ #include "application_manager/command_factory.h" #include "application_manager/commands/command.h" #include "smart_objects/smart_object.h" -#include "utils/shared_ptr.h" + namespace test { namespace components { diff --git a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h index 907d0c26f2..3c4a3806d6 100644 --- a/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h +++ b/src/components/application_manager/test/include/application_manager/mock_resume_ctrl.h @@ -96,7 +96,7 @@ class MockResumeCtrl : public resumption::ResumeCtrl { #ifdef BUILD_TESTS MOCK_METHOD1(set_resumption_storage, - void(utils::SharedPtr mock_storage)); + void(std::shared_ptr mock_storage)); MOCK_CONST_METHOD0(get_resumption_active, bool()); #endif // BUILD_TESTS }; diff --git a/src/components/application_manager/test/include/application_manager/resumption_data_test.h b/src/components/application_manager/test/include/application_manager/resumption_data_test.h index 0d34c113b2..4f8c9fd25e 100644 --- a/src/components/application_manager/test/include/application_manager/resumption_data_test.h +++ b/src/components/application_manager/test/include/application_manager/resumption_data_test.h @@ -79,7 +79,7 @@ class ResumptionDataTest : public ::testing::Test { void CheckSavedApp(sm::SmartObject& saved_data); // Set data for resumption virtual void PrepareData(); - utils::SharedPtr > + std::shared_ptr > app_mock; profile::Profile profile_; @@ -152,7 +152,7 @@ class ResumptionDataTest : public ::testing::Test { application_manager_test::MockApplicationManagerSettings mock_application_manager_settings_; application_manager_test::MockApplicationManager mock_application_manager_; - utils::SharedPtr > + std::shared_ptr > mock_app_extension_; std::list extensions_; }; 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 0e48d39e24..39bd5f4d4d 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 @@ -35,7 +35,7 @@ #include "gmock/gmock.h" #include "utils/macro.h" -#include "utils/make_shared.h" + #include "application_manager/policies/policy_handler.h" #include "application_manager/mock_application.h" #include "application_manager/mock_help_prompt_manager.h" @@ -63,9 +63,9 @@ namespace MobileResults = mobile_apis::Result; using namespace application_manager; -typedef utils::SharedPtr MockApplicationSharedPtr; +typedef std::shared_ptr MockApplicationSharedPtr; typedef std::vector StringArray; -typedef utils::SharedPtr ApplicationSharedPtr; +typedef std::shared_ptr ApplicationSharedPtr; using testing::AtLeast; using testing::ReturnRefOfCopy; @@ -87,7 +87,7 @@ TEST(MessageHelperTestCreate, application_manager::MessageHelper::CreateBlockedByPoliciesResponse( function_id, result, correlation_id, connection_key); - EXPECT_TRUE(ptr); + EXPECT_TRUE((bool)ptr); smart_objects::SmartObject& obj = *ptr; @@ -109,7 +109,7 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendNullPathImagetype_Equal) { smart_objects::SmartObjectSPtr ptr = MessageHelper::CreateSetAppIcon(path_to_icon, app_id); - EXPECT_TRUE(ptr); + EXPECT_TRUE((bool)ptr); smart_objects::SmartObject& obj = *ptr; @@ -128,7 +128,7 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) { smart_objects::SmartObjectSPtr ptr = MessageHelper::CreateSetAppIcon(path_to_icon, app_id); - EXPECT_TRUE(ptr); + EXPECT_TRUE((bool)ptr); smart_objects::SmartObject& obj = *ptr; @@ -143,7 +143,7 @@ TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) { TEST(MessageHelperTestCreate, CreateGlobalPropertiesRequestsToHMI_SmartObject_EmptyList) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + MockApplicationSharedPtr appSharedMock = std::make_shared(); EXPECT_CALL(*appSharedMock, vr_help_title()).Times(AtLeast(1)); EXPECT_CALL(*appSharedMock, vr_help()).Times(AtLeast(1)); EXPECT_CALL(*appSharedMock, help_prompt()).Times(AtLeast(1)); @@ -164,9 +164,9 @@ TEST(MessageHelperTestCreate, TEST(MessageHelperTestCreate, CreateGlobalPropertiesRequestsToHMI_SmartObject_NotEmpty) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + MockApplicationSharedPtr appSharedMock = std::make_shared(); smart_objects::SmartObjectSPtr objPtr = - MakeShared(); + std::make_shared(); (*objPtr)[0][strings::vr_help_title] = "111"; (*objPtr)[1][strings::vr_help] = "222"; @@ -225,10 +225,10 @@ TEST(MessageHelperTestCreate, } TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + MockApplicationSharedPtr appSharedMock = std::make_shared(); smart_objects::SmartObjectSPtr smartObjectPtr = - utils::MakeShared(); + std::make_shared(); const smart_objects::SmartObject& object = *smartObjectPtr; @@ -251,7 +251,7 @@ TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) { TEST(MessageHelperTestCreate, CreateAddCommandRequestToHMI_SendSmartObject_Empty) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + MockApplicationSharedPtr appSharedMock = std::make_shared(); ::application_manager::CommandsMap vis; DataAccessor data_accessor( vis, std::make_shared(true)); @@ -267,12 +267,12 @@ TEST(MessageHelperTestCreate, TEST(MessageHelperTestCreate, CreateAddCommandRequestToHMI_SendSmartObject_Equal) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + MockApplicationSharedPtr appSharedMock = std::make_shared(); CommandsMap vis; DataAccessor data_accessor( vis, std::make_shared(true)); smart_objects::SmartObjectSPtr smartObjectPtr = - utils::MakeShared(); + std::make_shared(); smart_objects::SmartObject& object = *smartObjectPtr; @@ -309,7 +309,7 @@ TEST(MessageHelperTestCreate, TEST(MessageHelperTestCreate, CreateAddVRCommandRequestFromChoiceToHMI_SendEmptyData_EmptyList) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + MockApplicationSharedPtr appSharedMock = std::make_shared(); application_manager::ChoiceSetMap vis; DataAccessor< ::application_manager::ChoiceSetMap> data_accessor( vis, std::make_shared(true)); @@ -325,12 +325,12 @@ TEST(MessageHelperTestCreate, TEST(MessageHelperTestCreate, CreateAddVRCommandRequestFromChoiceToHMI_SendObject_EqualList) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + MockApplicationSharedPtr appSharedMock = std::make_shared(); application_manager::ChoiceSetMap vis; DataAccessor< ::application_manager::ChoiceSetMap> data_accessor( vis, std::make_shared(true)); smart_objects::SmartObjectSPtr smartObjectPtr = - utils::MakeShared(); + std::make_shared(); smart_objects::SmartObject& object = *smartObjectPtr; @@ -372,12 +372,12 @@ TEST(MessageHelperTestCreate, } TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + MockApplicationSharedPtr appSharedMock = std::make_shared(); application_manager::SubMenuMap vis; DataAccessor< ::application_manager::SubMenuMap> data_accessor( vis, std::make_shared(true)); smart_objects::SmartObjectSPtr smartObjectPtr = - utils::MakeShared(); + std::make_shared(); smart_objects::SmartObject& object = *smartObjectPtr; @@ -412,7 +412,7 @@ TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) { TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendEmptyMap_EmptySmartObjectList) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + MockApplicationSharedPtr appSharedMock = std::make_shared(); application_manager::SubMenuMap vis; DataAccessor< ::application_manager::SubMenuMap> data_accessor( vis, std::make_shared(true)); @@ -435,7 +435,7 @@ TEST(MessageHelperTestCreate, CreateNegativeResponse_SendSmartObject_Equal) { smart_objects::SmartObjectSPtr ptr = MessageHelper::CreateNegativeResponse( connection_key, function_id, correlation_id, result_code); - EXPECT_TRUE(ptr); + EXPECT_TRUE((bool)ptr); smart_objects::SmartObject& obj = *ptr; @@ -732,8 +732,8 @@ TEST_F(MessageHelperTest, VerifySoftButtonString_CorrectStrings_True) { TEST_F(MessageHelperTest, ProcessSoftButtons_SmartObjectWithoutButtonsKey_Success) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject object; policy_handler_test::MockPolicySettings policy_settings_; @@ -748,8 +748,8 @@ TEST_F(MessageHelperTest, TEST_F(MessageHelperTest, ProcessSoftButtons_IncorectSoftButonValue_InvalidData) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject object; smart_objects::SmartObject& buttons = object[strings::soft_buttons]; @@ -766,8 +766,8 @@ TEST_F(MessageHelperTest, } TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject image; image[strings::image_type] = mobile_apis::ImageType::STATIC; @@ -779,8 +779,8 @@ TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) { } TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject image; image[strings::image_type] = mobile_apis::ImageType::DYNAMIC; @@ -794,8 +794,8 @@ TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) { } TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageTypeIsStatic_Success) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject image; image[strings::image_type] = mobile_apis::ImageType::STATIC; @@ -809,8 +809,8 @@ TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageTypeIsStatic_Success) { } TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageValueNotValid_InvalidData) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject image; image[strings::image_type] = mobile_apis::ImageType::DYNAMIC; @@ -824,8 +824,8 @@ TEST_F(MessageHelperTest, VerifyImageApplyPath_ImageValueNotValid_InvalidData) { } TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject images; images[0][strings::image_type] = mobile_apis::ImageType::STATIC; @@ -839,8 +839,8 @@ TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) { TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithInvalidData_NotSuccsess) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject images; images[0][strings::image_type] = mobile_apis::ImageType::DYNAMIC; @@ -857,8 +857,8 @@ TEST_F(MessageHelperTest, TEST_F(MessageHelperTest, VerifyImageVrHelpItems_SmartObjectWithSeveralValidImages_Succsess) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject message; message[0][strings::image][strings::image_type] = @@ -874,8 +874,8 @@ TEST_F(MessageHelperTest, TEST_F(MessageHelperTest, VerifyImageVrHelpItems_SmartObjWithSeveralInvalidImages_NotSuccsess) { - // Creating sharedPtr to MockApplication - MockApplicationSharedPtr appSharedMock = utils::MakeShared(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared(); // Creating input data for method smart_objects::SmartObject message; message[0][strings::image][strings::image_type] = @@ -936,7 +936,7 @@ TEST_F(MessageHelperTest, StringToHmiLevel_LevelString_EqEType) { TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) { // Create application mock - MockApplicationSharedPtr appSharedPtr = utils::MakeShared(); + MockApplicationSharedPtr appSharedPtr = std::make_shared(); // Prepare data for method smart_objects::SmartObject message_params; size_t function_id = 1; 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 2fe28d8249..2122dc463e 100644 --- a/src/components/application_manager/test/mobile_message_handler_test.cc +++ b/src/components/application_manager/test/mobile_message_handler_test.cc @@ -41,7 +41,7 @@ #include "gmock/gmock.h" #include "application_manager/message.h" #include "protocol/raw_message.h" -#include "utils/make_shared.h" + namespace test { namespace components { @@ -106,7 +106,7 @@ class MobileMessageHandlerTest : public testing::Test { size_t full_size = sizeof(uint8_t) * full_data.size(); - message_ptr_ = utils::MakeShared(connection_key_, + message_ptr_ = std::make_shared(connection_key_, protocol_version, &full_data[0], full_size, @@ -170,7 +170,7 @@ class MobileMessageHandlerTest : public testing::Test { uint32_t connection_key, const std::string& json_msg, const application_manager::BinaryData* data = NULL) { - MobileMessage message = utils::MakeShared( + MobileMessage message = std::make_shared( MessagePriority::FromServiceType(ServiceType::kRpc)); message->set_function_id(function_id); message->set_correlation_id(correlation_id); @@ -254,7 +254,7 @@ class MobileMessageHandlerTest : public testing::Test { TEST(mobile_message_test, basic_test) { // Example message MobileMessage message = - utils::MakeShared(protocol_handler::MessagePriority::kDefault); + std::make_shared(protocol_handler::MessagePriority::kDefault); EXPECT_FALSE(message->has_binary_data()); application_manager::BinaryData binary_data; binary_data.push_back('X'); 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 a19ea991b9..72edf741f9 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 @@ -40,7 +40,7 @@ #include "gmock/gmock.h" #include "application_manager/message.h" #include "protocol/raw_message.h" -#include "utils/make_shared.h" + using protocol_handler::RawMessage; using protocol_handler::RawMessagePtr; @@ -70,7 +70,7 @@ const unsigned char* data_v1 = TEST(MobileMessageHandlerTestV1Test, HandleIncomingMessageProtocolV1_SendJSONData_ExpectEqual) { - RawMessagePtr message = utils::MakeShared( + RawMessagePtr message = std::make_shared( connection_key_p1, protocol_version_1, data_v1, data_json.length()); application_manager::Message* ptr = @@ -90,7 +90,7 @@ TEST(MobileMessageHandlerTestV1Test, const unsigned char* data_v1 = reinterpret_cast(full_data.c_str()); - RawMessagePtr message = utils::MakeShared( + RawMessagePtr message = std::make_shared( connection_key_p1, protocol_version_1, data_v1, full_data.length()); application_manager::Message* ptr = @@ -108,7 +108,7 @@ TEST(MobileMessageHandlerTestV1Test, uint32_t connection_key = 1; application_manager::MobileMessage message = - utils::MakeShared( + std::make_shared( protocol_handler::MessagePriority::kDefault); message->set_protocol_version( diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc index 57fa67bf0a..c7baac7923 100644 --- a/src/components/application_manager/test/policy_handler_test.cc +++ b/src/components/application_manager/test/policy_handler_test.cc @@ -53,13 +53,13 @@ #include "json/value.h" #include "smart_objects/smart_object.h" #include "utils/file_system.h" -#include "utils/make_shared.h" + #include "utils/custom_string.h" #include "policy/usage_statistics/counter.h" #include "policy/usage_statistics/statistics_manager.h" #include "interfaces/MOBILE_API.h" #include "policy/mock_policy_settings.h" -#include "utils/make_shared.h" + #include "application_manager/mock_application.h" #include "policy/usage_statistics/mock_statistics_manager.h" #include "protocol_handler/mock_session_observer.h" @@ -134,14 +134,14 @@ class PolicyHandlerTest : public ::testing::Test { protected: NiceMock policy_settings_; NiceMock mock_event_dispatcher_; - utils::SharedPtr mock_app_; + std::shared_ptr mock_app_; connection_handler_test::MockConnectionHandler conn_handler; protocol_handler_test::MockSessionObserver mock_session_observer; application_manager_test::MockStateController mock_state_controller; components::usage_statistics_test::MockStatisticsManager mock_statistics_manager_; PolicyHandler policy_handler_; - utils::SharedPtr mock_policy_manager_; + std::shared_ptr mock_policy_manager_; application_manager_test::MockApplicationManager app_manager_; const std::string kPolicyAppId_; const std::string kMacAddr_; @@ -179,15 +179,15 @@ class PolicyHandlerTest : public ::testing::Test { std::string path = file_system::CreateDirectory("storage"); file_system::CreateFile(path + "/" + "certificate"); mock_policy_manager_ = - utils::MakeShared(); - ASSERT_TRUE(mock_policy_manager_.valid()); + std::make_shared(); + ASSERT_TRUE(mock_policy_manager_.use_count() != 0); ON_CALL(app_manager_, connection_handler()) .WillByDefault(ReturnRef(conn_handler)); ON_CALL(conn_handler, get_session_observer()) .WillByDefault(ReturnRef(mock_session_observer)); - mock_app_ = utils::MakeShared(); + mock_app_ = std::make_shared(); } virtual void TearDown() OVERRIDE { @@ -444,7 +444,7 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_method_With2Parameters) { } TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) { - utils::SharedPtr invalid_app; + std::shared_ptr invalid_app; EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_)) .WillOnce(Return(invalid_app)); EXPECT_CALL(mock_message_helper_, @@ -455,7 +455,7 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) { } TEST_F(PolicyHandlerTest, OnPermissionsUpdated_InvalidApp_UNSUCCESS) { - utils::SharedPtr invalid_app; + std::shared_ptr invalid_app; EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_)) .WillOnce(Return(mock_app_)) .WillOnce(Return(invalid_app)); @@ -774,8 +774,8 @@ TEST_F(PolicyHandlerTest, KmsChanged) { void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key, const uint32_t correlation_id) { - utils::SharedPtr application1 = - utils::MakeShared(); + std::shared_ptr application1 = + std::make_shared(); EXPECT_CALL(app_manager_, ActivateApplication(_)) .WillRepeatedly(Return(true)); EXPECT_CALL(app_manager_, application(connection_key)) @@ -791,12 +791,12 @@ void PolicyHandlerTest::TestActivateApp(const uint32_t connection_key, .WillRepeatedly(ReturnRef(conn_handler)); EXPECT_CALL(conn_handler, get_session_observer()) .WillOnce(ReturnRef(mock_session_observer)); - utils::SharedPtr + std::shared_ptr mock_statistics_manager = - utils::MakeShared(); + std::make_shared(); UsageStatistics usage_stats( "0", - utils::SharedPtr( + std::shared_ptr( mock_statistics_manager)); EXPECT_CALL(*application1, usage_report()).WillOnce(ReturnRef(usage_stats)); EXPECT_CALL(*mock_policy_manager_, GetUserConsentForDevice(_)) @@ -839,7 +839,7 @@ TEST_F(PolicyHandlerTest, OnActivateApp) { TEST_F(PolicyHandlerTest, OnActivateApp_InvalidApp_UNSUCCESS) { // Arrange EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr invalid_app; + std::shared_ptr invalid_app; EXPECT_CALL(app_manager_, application(kConnectionKey_)) .WillOnce(Return(invalid_app)); @@ -859,12 +859,12 @@ TEST_F(PolicyHandlerTest, OnActivateApp_AppIsRevoked_AppNotActivated) { permissions.appRevoked = true; #ifdef EXTERNAL_PROPRIETARY_MODE - utils::SharedPtr + std::shared_ptr mock_statistics_manager = - utils::MakeShared(); + std::make_shared(); UsageStatistics usage_stats( "0", - utils::SharedPtr( + std::shared_ptr( mock_statistics_manager)); EXPECT_CALL(*mock_app_, usage_report()).WillOnce(ReturnRef(usage_stats)); const std::string default_mac = "00:00:00:00:00:00"; @@ -898,8 +898,8 @@ void PolicyHandlerTest::OnPendingPermissionChangePrecondition( // Arrange EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr application = - utils::MakeShared(); + std::shared_ptr application = + std::make_shared(); EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_)) .WillOnce(Return(application)); @@ -998,7 +998,7 @@ TEST_F(PolicyHandlerTest, permissions.appUnauthorized = true; NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message = - utils::MakeShared(); + std::make_shared(); // Check expectations EXPECT_CALL(mock_message_helper_, SendOnAppPermissionsChangedNotification(kAppId1_, _, _)); @@ -1051,7 +1051,7 @@ TEST_F(PolicyHandlerTest, permissions.appUnauthorized = true; NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr message = - utils::MakeShared(); + std::make_shared(); // Check expectations // Notification won't be sent EXPECT_CALL(mock_message_helper_, @@ -1168,8 +1168,8 @@ TEST_F(PolicyHandlerTest, OnCurrentDeviceIdUpdateRequired) { // Arrange EnablePolicyAndPolicyManagerMock(); // Check expectations - utils::SharedPtr application = - utils::MakeShared(); + std::shared_ptr application = + std::make_shared(); EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_)) .WillOnce(Return(application)); EXPECT_CALL(app_manager_, connection_handler()) @@ -1271,8 +1271,8 @@ TEST_F(PolicyHandlerTest, GetAppName) { // Check expectations const CustomString app_name("my_mobile_app"); - utils::SharedPtr application = - utils::MakeShared(); + std::shared_ptr application = + std::make_shared(); EXPECT_CALL(*application, name()).WillOnce(ReturnRef(app_name)); EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_)) @@ -1309,8 +1309,8 @@ TEST_F(PolicyHandlerTest, SendOnAppPermissionsChanged) { // Arrange EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr application = - utils::MakeShared(); + std::shared_ptr application = + std::make_shared(); // Check expectations EXPECT_CALL(app_manager_, application_by_policy_id(kPolicyAppId_)) .WillOnce(Return(application)); @@ -1337,7 +1337,7 @@ TEST_F(PolicyHandlerTest, AddApplication) { EXPECT_CALL( *mock_policy_manager_, AddApplication(kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT))) - .WillOnce(Return(utils::MakeShared())); + .WillOnce(Return(std::make_shared())); // Act policy_handler_.AddApplication(kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT)); @@ -1953,8 +1953,8 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) { // Arrange EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr mock_app_in_full = - utils::MakeShared(); + std::shared_ptr mock_app_in_full = + std::make_shared(); const uint32_t app_in_full_id = 1; EXPECT_CALL(*mock_app_in_full, app_id()) .WillRepeatedly(Return(app_in_full_id)); @@ -1964,9 +1964,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) { test_app.insert(mock_app_in_full); - utils::SharedPtr + std::shared_ptr mock_app_in_limited = - utils::MakeShared(); + std::make_shared(); const uint32_t app_in_limited_id = 2; EXPECT_CALL(*mock_app_in_limited, app_id()) .WillRepeatedly(Return(app_in_limited_id)); @@ -1976,9 +1976,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) { test_app.insert(mock_app_in_limited); - utils::SharedPtr + std::shared_ptr mock_app_in_background = - utils::MakeShared(); + std::make_shared(); const uint32_t app_in_background_id = 3; EXPECT_CALL(*mock_app_in_background, app_id()) .WillRepeatedly(Return(app_in_background_id)); @@ -1988,8 +1988,8 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) { test_app.insert(mock_app_in_background); - utils::SharedPtr mock_app_in_none = - utils::MakeShared(); + std::shared_ptr mock_app_in_none = + std::make_shared(); const uint32_t app_in_none_id = 4; EXPECT_CALL(*mock_app_in_none, app_id()) .WillRepeatedly(Return(app_in_none_id)); @@ -2017,9 +2017,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) { // Arrange EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr + std::shared_ptr mock_app_in_none_1 = - utils::MakeShared(); + std::make_shared(); const uint32_t app_in_none_id_1 = 1; EXPECT_CALL(*mock_app_in_none_1, app_id()) .WillRepeatedly(Return(app_in_none_id_1)); @@ -2029,9 +2029,9 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyAppInNone) { test_app.insert(mock_app_in_none_1); - utils::SharedPtr + std::shared_ptr mock_app_in_none_2 = - utils::MakeShared(); + std::make_shared(); const uint32_t app_in_none_id_2 = 2; EXPECT_CALL(*mock_app_in_none_2, app_id()) .WillRepeatedly(Return(app_in_none_id_2)); @@ -2110,7 +2110,7 @@ TEST_F(PolicyHandlerTest, // with such id EXPECT_CALL(app_manager_, application(0)) .WillOnce(Return( - utils::SharedPtr())); + std::shared_ptr())); EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, url)); } @@ -2122,8 +2122,8 @@ TEST_F(PolicyHandlerTest, CanUpdate) { TEST_F(PolicyHandlerTest, CanUpdate_TwoApplicationForSending_SUCCESS) { EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr second_mock_app = - utils::MakeShared(); + std::shared_ptr second_mock_app = + std::make_shared(); EXPECT_CALL(*mock_app_, hmi_level()) .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL)); 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 0d9cbfe6aa..b7caf635c9 100644 --- a/src/components/application_manager/test/rc_policy_handler_test.cc +++ b/src/components/application_manager/test/rc_policy_handler_test.cc @@ -46,7 +46,7 @@ #include "json/writer.h" #include "json/value.h" #include "smart_objects/smart_object.h" -#include "utils/make_shared.h" + #include "utils/custom_string.h" #include "interfaces/MOBILE_API.h" #include "policy/mock_policy_settings.h" @@ -94,13 +94,13 @@ class RCPolicyHandlerTest : public ::testing::Test { protected: NiceMock policy_settings_; - utils::SharedPtr mock_app_; + std::shared_ptr mock_app_; connection_handler_test::MockConnectionHandler conn_handler; protocol_handler_test::MockSessionObserver mock_session_observer; components::usage_statistics_test::MockStatisticsManager mock_statistics_manager_; PolicyHandler policy_handler_; - utils::SharedPtr mock_policy_manager_; + std::shared_ptr mock_policy_manager_; application_manager_test::MockApplicationManager app_manager_; const std::string kPolicyAppId_; const std::string kMacAddr_; @@ -122,15 +122,15 @@ class RCPolicyHandlerTest : public ::testing::Test { ON_CALL(app_manager_, applications()).WillByDefault(Return(app_set)); ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true)); mock_policy_manager_ = - utils::MakeShared(); - ASSERT_TRUE(mock_policy_manager_.valid()); + std::make_shared(); + ASSERT_TRUE(mock_policy_manager_.use_count() != 0); ON_CALL(app_manager_, connection_handler()) .WillByDefault(ReturnRef(conn_handler)); ON_CALL(conn_handler, get_session_observer()) .WillByDefault(ReturnRef(mock_session_observer)); - mock_app_ = utils::MakeShared(); + mock_app_ = std::make_shared(); } virtual void TearDown() OVERRIDE { @@ -206,7 +206,7 @@ TEST_F(RCPolicyHandlerTest, SendMessageToSDK_RemoteControl_SUCCESS) { TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidApp_UNSUCCESS) { EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr invalid_app; + std::shared_ptr invalid_app; EXPECT_CALL(app_manager_, application(kDeviceId_, kPolicyAppId_)) .WillOnce(Return(invalid_app)); EXPECT_CALL(mock_message_helper_, StringToHMILevel(_)).Times(0); @@ -293,7 +293,7 @@ TEST_F(RCPolicyHandlerTest, TEST_F(RCPolicyHandlerTest, OnUpdateHMIStatus_InvalidApp_UNSUCCESS) { EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr invalid_app; + std::shared_ptr invalid_app; EXPECT_CALL(app_manager_, application(_, _)).WillOnce(Return(invalid_app)); EXPECT_CALL(app_manager_, ChangeAppsHMILevel(_, _)).Times(0); @@ -379,7 +379,7 @@ TEST_F(RCPolicyHandlerTest, CheckHMIType_ValidTypes_SUCCESS) { mobile_apis::AppHMIType::eType hmi = mobile_apis::AppHMIType::MEDIA; const smart_objects::SmartObjectSPtr app_types = - utils::MakeShared( + std::make_shared( smart_objects::SmartType_Array); (*app_types)[strings::app_hmi_type][0] = mobile_apis::AppHMIType::MEDIA; (*app_types)[strings::app_hmi_type][1] = 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 c2912fdc0b..112e3c1c39 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 @@ -36,12 +36,12 @@ #include "application_manager/request_controller.h" #include "application_manager/request_info.h" #include "application_manager/mock_request.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "application_manager/commands/command_request_impl.h" #include "application_manager/message_helper.h" #include "application_manager/application_impl.h" -#include "utils/make_shared.h" + #include "application_manager/mock_application_manager.h" #include "application_manager/event_engine/event_dispatcher.h" #include "resumption/last_state.h" @@ -65,8 +65,8 @@ using ::testing::NiceMock; using ::testing::_; typedef NiceMock MRequest; -typedef utils::SharedPtr RequestPtr; -typedef utils::SharedPtr RequestControllerSPtr; +typedef std::shared_ptr RequestPtr; +typedef std::shared_ptr RequestControllerSPtr; namespace { const size_t kNumberOfRequests = 10u; @@ -105,7 +105,7 @@ class RequestControllerTestClass : public ::testing::Test { ON_CALL(mock_request_controller_settings_, thread_pool_size()) .WillByDefault(Return(kThreadPoolSize)); request_ctrl_ = - utils::MakeShared(mock_request_controller_settings_); + std::make_shared(mock_request_controller_settings_); } RequestPtr GetMockRequest( @@ -113,7 +113,7 @@ class RequestControllerTestClass : public ::testing::Test { const uint32_t connection_key = kDefaultConnectionKey, const uint32_t default_timeout = kDefaultTimeout) { RequestPtr output = - utils::MakeShared(connection_key, correlation_id); + std::make_shared(connection_key, correlation_id); ON_CALL(*output, default_timeout()).WillByDefault(Return(default_timeout)); ON_CALL(*output, CheckPermissions()).WillByDefault(Return(true)); return output; diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc index 11b2d2f259..85cb4f3a37 100644 --- a/src/components/application_manager/test/request_info_test.cc +++ b/src/components/application_manager/test/request_info_test.cc @@ -36,8 +36,8 @@ #include #include #include "gmock/gmock.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + namespace request_info = application_manager::request_controller; @@ -76,26 +76,26 @@ class RequestInfoTest : public ::testing::Test { uint32_t default_timeout_; uint32_t mobile_correlation_id; - utils::SharedPtr CreateTestInfo( + std::shared_ptr CreateTestInfo( uint32_t connection_key, uint32_t correlation_id, request_info::RequestInfo::RequestType requst_type, const TimevalStruct& start_time, uint64_t timeout_msec) { - utils::SharedPtr mock_request = - utils::MakeShared(connection_key, correlation_id); - utils::SharedPtr request = - utils::MakeShared( + std::shared_ptr mock_request = + std::make_shared(connection_key, correlation_id); + std::shared_ptr request = + std::make_shared( mock_request, requst_type, start_time, timeout_msec); return request; } }; TEST_F(RequestInfoTest, RequestInfoEqualEndTime) { - std::vector > requests; + std::vector > requests; const TimevalStruct& time = date_time::DateTime::getCurrentTime(); for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) { - utils::SharedPtr request = CreateTestInfo( + std::shared_ptr request = CreateTestInfo( i, i, request_info::RequestInfo::MobileRequest, time, default_timeout_); request->SetEndTime(time); EXPECT_TRUE(request_info_set_.Add(request)); @@ -105,7 +105,7 @@ TEST_F(RequestInfoTest, RequestInfoEqualEndTime) { TEST_F(RequestInfoTest, AddRemoveHMIRequests) { for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) { - utils::SharedPtr request = + std::shared_ptr request = CreateTestInfo(hmi_connection_key_, i, request_info::RequestInfo::HMIRequest, @@ -119,11 +119,11 @@ TEST_F(RequestInfoTest, AddRemoveHMIRequests) { } TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) { - std::vector > requests; + std::vector > requests; // Add hmi requests for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) { - utils::SharedPtr request = + std::shared_ptr request = CreateTestInfo(hmi_connection_key_, i, request_info::RequestInfo::HMIRequest, @@ -135,7 +135,7 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) { EXPECT_EQ(count_of_requests_for_test_, request_info_set_.Size()); // Delete every request - std::vector >::iterator req_it = + std::vector >::iterator req_it = requests.begin(); for (; req_it != requests.end(); ++req_it) { @@ -155,14 +155,14 @@ TEST_F(RequestInfoTest, AddHMIRequests_RemoveAllRequests) { } TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) { - utils::SharedPtr mobile_request1 = + std::shared_ptr mobile_request1 = CreateTestInfo(mobile_connection_key1_, 12345, request_info::RequestInfo::MobileRequest, date_time::DateTime::getCurrentTime(), default_timeout_); EXPECT_TRUE(request_info_set_.Add(mobile_request1)); - utils::SharedPtr mobile_request2 = + std::shared_ptr mobile_request2 = CreateTestInfo(mobile_connection_key2_, 54321, request_info::RequestInfo::MobileRequest, @@ -175,11 +175,11 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequests) { } TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) { - std::vector > requests; + std::vector > requests; const uint32_t count_of_mobile_request1 = 200; const uint32_t count_of_mobile_request2 = 100; for (uint32_t i = 0; i < count_of_mobile_request1; ++i) { - utils::SharedPtr mobile_request1 = + std::shared_ptr mobile_request1 = CreateTestInfo(mobile_connection_key1_, i, request_info::RequestInfo::MobileRequest, @@ -192,7 +192,7 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) { EXPECT_EQ(count_of_mobile_request1, request_info_set_.Size()); for (uint32_t i = 0; i < count_of_mobile_request2; ++i) { - utils::SharedPtr mobile_request2 = + std::shared_ptr mobile_request2 = CreateTestInfo(mobile_connection_key2_, i, request_info::RequestInfo::MobileRequest, @@ -214,7 +214,7 @@ TEST_F(RequestInfoTest, AddMobileRequests_RemoveMobileRequestsByConnectionKey) { TEST_F(RequestInfoTest, RequestInfoSetFront) { for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) { - utils::SharedPtr request = + std::shared_ptr request = CreateTestInfo(mobile_connection_key1_, i, request_info::RequestInfo::HMIRequest, @@ -225,9 +225,9 @@ TEST_F(RequestInfoTest, RequestInfoSetFront) { for (uint32_t i = 1; i < count_of_requests_for_test_; ++i) { request_info::RequestInfoPtr request_info = request_info_set_.Front(); - EXPECT_TRUE(request_info.valid()); + EXPECT_TRUE(request_info.use_count() != 0); request_info = request_info_set_.FrontWithNotNullTimeout(); - EXPECT_TRUE(request_info.valid()); + EXPECT_TRUE(request_info.use_count() != 0); EXPECT_TRUE(request_info_set_.RemoveRequest(request_info)); } EXPECT_EQ(1u, request_info_set_.Size()); @@ -248,7 +248,7 @@ TEST_F(RequestInfoTest, RequestInfoSetFind) { appid_connection_id.end(); for (; req_it != end; ++req_it) { - utils::SharedPtr request = + std::shared_ptr request = CreateTestInfo(req_it->first, req_it->second, request_info::RequestInfo::HMIRequest, @@ -259,16 +259,16 @@ TEST_F(RequestInfoTest, RequestInfoSetFind) { request_info::RequestInfoPtr request = request_info_set_.Find( count_of_requests_for_test_, count_of_requests_for_test_); - EXPECT_FALSE(request.valid()); + EXPECT_FALSE(request.use_count() != 0); req_it = appid_connection_id.begin(); for (; req_it != end; ++req_it) { request_info::RequestInfoPtr request = request_info_set_.Find(req_it->first, req_it->second); - EXPECT_TRUE(request.valid()); + EXPECT_TRUE(request.use_count() != 0); EXPECT_TRUE(request_info_set_.RemoveRequest(request)); request = request_info_set_.Find(req_it->first, req_it->second); - EXPECT_FALSE(request.valid()); + EXPECT_FALSE(request.use_count() != 0); } EXPECT_EQ(0u, request_info_set_.Size()); } @@ -277,7 +277,7 @@ TEST_F(RequestInfoTest, RequestInfoSetEqualHash) { request_info::RequestInfoSet request_info_set; const uint32_t connection_key = 65483; const uint32_t corr_id = 65483; - utils::SharedPtr request = + std::shared_ptr request = CreateTestInfo(connection_key, corr_id, request_info::RequestInfo::HMIRequest, @@ -289,18 +289,18 @@ TEST_F(RequestInfoTest, RequestInfoSetEqualHash) { EXPECT_EQ(1u, request_info_set.Size()); request_info::RequestInfoPtr found = request_info_set.Find(connection_key, corr_id); - EXPECT_TRUE(found.valid()); + EXPECT_TRUE(found.use_count() != 0); EXPECT_TRUE(request_info_set.RemoveRequest(found)); EXPECT_EQ(0u, request_info_set.Size()); EXPECT_TRUE(request_info_set.Add(request)); EXPECT_FALSE(request_info_set.Add(request)); found = request_info_set.FrontWithNotNullTimeout(); - EXPECT_TRUE(found.valid()); + EXPECT_TRUE(found.use_count() != 0); EXPECT_TRUE(request_info_set.RemoveRequest(found)); found = request_info_set.FrontWithNotNullTimeout(); - EXPECT_FALSE(found.valid()); + EXPECT_FALSE(found.use_count() != 0); found = request_info_set.Front(); - EXPECT_FALSE(found.valid()); + EXPECT_FALSE(found.use_count() != 0); EXPECT_EQ(0u, request_info_set.Size()); } @@ -313,7 +313,7 @@ TEST_F(RequestInfoTest, EndTimeisExpired) { TimevalStruct expired = date_time::DateTime::getCurrentTime(); expired.tv_usec = std::numeric_limits::max(); - utils::SharedPtr request = + std::shared_ptr request = CreateTestInfo(mobile_connection_key1_, mobile_correlation_id, request_info::RequestInfo::MobileRequest, @@ -329,7 +329,7 @@ TEST_F(RequestInfoTest, EndTimeisExpired) { TEST_F(RequestInfoTest, UpdateEndTime) { TimevalStruct time = date_time::DateTime::getCurrentTime(); - utils::SharedPtr request = + std::shared_ptr request = CreateTestInfo(mobile_connection_key1_, mobile_correlation_id, request_info::RequestInfo::MobileRequest, @@ -343,7 +343,7 @@ TEST_F(RequestInfoTest, UpdateEndTime) { TEST_F(RequestInfoTest, UpdateTimeOut) { TimevalStruct time = date_time::DateTime::getCurrentTime(); - utils::SharedPtr request = + std::shared_ptr request = CreateTestInfo(mobile_connection_key1_, mobile_correlation_id, request_info::RequestInfo::MobileRequest, 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 f126e95e33..2a430ae655 100644 --- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc +++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc @@ -44,7 +44,7 @@ #include "application_manager/application_manager_impl.h" #include "application_manager/application.h" #include "utils/data_accessor.h" -#include "utils/make_shared.h" + #include "application_manager/mock_message_helper.h" #include "application_manager/mock_application_manager.h" #include "application_manager/mock_application_manager_settings.h" @@ -96,16 +96,16 @@ class ResumeCtrlTest : public ::testing::Test { ON_CALL(mock_app_mngr_, event_dispatcher()) .WillByDefault(ReturnRef(mock_event_dispatcher_)); mock_storage_ = - ::utils::MakeShared >( + std::make_shared >( mock_app_mngr_); - mock_app_ = utils::MakeShared >(); + mock_app_ = std::make_shared >(); mock_help_prompt_manager_ = std::shared_ptr(new MockHelpPromptManager()); - mock_app_extension_ = utils::MakeShared< + mock_app_extension_ = std::make_shared< NiceMock >(); const_app_ = static_cast(mock_app_); - res_ctrl_ = utils::MakeShared(mock_app_mngr_); + res_ctrl_ = std::make_shared(mock_app_mngr_); res_ctrl_->set_resumption_storage(mock_storage_); ON_CALL(mock_app_mngr_, state_controller()) @@ -154,13 +154,13 @@ class ResumeCtrlTest : public ::testing::Test { application_manager_test::MockApplicationManagerSettings mock_application_manager_settings_; application_manager_test::MockApplicationManager mock_app_mngr_; - utils::SharedPtr > + std::shared_ptr > mock_app_extension_; MockStateController mock_state_controller_; - utils::SharedPtr res_ctrl_; - utils::SharedPtr > + std::shared_ptr res_ctrl_; + std::shared_ptr > mock_storage_; - utils::SharedPtr > mock_app_; + std::shared_ptr > mock_app_; std::shared_ptr mock_help_prompt_manager_; application_manager::ApplicationConstSharedPtr const_app_; const uint32_t kTestAppId_; @@ -971,8 +971,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevDisallowed) { } TEST_F(ResumeCtrlTest, SaveAllApplications) { - utils::SharedPtr test_app = - ::utils::MakeShared(); + std::shared_ptr test_app = + std::make_shared(); EXPECT_CALL(*test_app, app_id()).WillRepeatedly(Return(kTestAppId_)); application_manager::ApplicationSet app_set; @@ -987,8 +987,8 @@ TEST_F(ResumeCtrlTest, SaveAllApplications) { } TEST_F(ResumeCtrlTest, SaveAllApplications_EmptyApplicationlist) { - utils::SharedPtr mock_app = - ::utils::MakeShared(); + std::shared_ptr mock_app = + std::make_shared(); application_manager::ApplicationSet app_set; @@ -1001,8 +1001,8 @@ TEST_F(ResumeCtrlTest, SaveAllApplications_EmptyApplicationlist) { } TEST_F(ResumeCtrlTest, SaveApplication) { - utils::SharedPtr app_sh_mock = - ::utils::MakeShared(); + std::shared_ptr app_sh_mock = + std::make_shared(); EXPECT_CALL(*mock_storage_, SaveApplication(app_sh_mock)); res_ctrl_->SaveApplication(app_sh_mock); @@ -1022,16 +1022,16 @@ TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionHasStarted) { const bool res = res_ctrl_->StartResumptionOnlyHMILevel(mock_app_); EXPECT_TRUE(res); - utils::SharedPtr app_sh_mock = - ::utils::MakeShared(); + std::shared_ptr app_sh_mock = + std::make_shared(); EXPECT_CALL(*app_sh_mock, app_id()).WillOnce(Return(kTestAppId_)); res_ctrl_->OnAppActivated(app_sh_mock); } TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionNotActive) { - utils::SharedPtr app_sh_mock = - ::utils::MakeShared(); + std::shared_ptr app_sh_mock = + std::make_shared(); EXPECT_CALL(*app_sh_mock, app_id()).Times(0); res_ctrl_->OnAppActivated(app_sh_mock); } @@ -1137,8 +1137,8 @@ TEST_F(ResumeCtrlTest, DISABLED_OnSuspend) { } TEST_F(ResumeCtrlTest, OnSuspend_EmptyApplicationlist) { - utils::SharedPtr mock_app = - ::utils::MakeShared(); + std::shared_ptr mock_app = + std::make_shared(); application_manager::ApplicationSet app_set; 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 a75ba23bfb..953f43e056 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 @@ -38,7 +38,7 @@ #include "interfaces/MOBILE_API.h" #include "utils/sqlite_wrapper/sql_database.h" #include "utils/sqlite_wrapper/sql_query.h" -#include "utils/make_shared.h" + #include "utils/file_system.h" #include "application_manager/resumption_data_test.h" #include "application_manager/test_resumption_data_db.h" @@ -68,7 +68,7 @@ const std::string kPath = class ResumptionDataDBTest : public ResumptionDataTest { protected: void SetUp() OVERRIDE { - app_mock = utils::MakeShared >(); + app_mock = std::make_shared >(); policy_app_id_ = "test_policy_app_id"; app_id_ = 10; is_audio_ = true; 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 ea257b902c..442aacb609 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 @@ -69,7 +69,7 @@ class ResumptionDataJsonTest : public ResumptionDataTest { : last_state_("app_storage_folder", "app_info_storage") , res_json(last_state_, mock_application_manager_) {} virtual void SetUp() { - app_mock = new NiceMock(); + app_mock = std::make_shared>(); policy_app_id_ = "test_policy_app_id"; app_id_ = 10; 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 e80349dd47..ced9ca84af 100644 --- a/src/components/application_manager/test/resumption/resumption_data_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_test.cc @@ -40,7 +40,7 @@ #include "application_manager/application.h" #include "utils/data_accessor.h" #include "application_manager/message_helper.h" -#include "utils/make_shared.h" + #include "application_manager/resumption_data_test.h" @@ -322,7 +322,7 @@ void ResumptionDataTest::CheckVRTitle( } void ResumptionDataTest::PrepareData() { - mock_app_extension_ = utils::MakeShared< + mock_app_extension_ = std::make_shared< NiceMock >(); extensions_.insert(extensions_.begin(), mock_app_extension_); ON_CALL(*app_mock, Extensions()).WillByDefault(ReturnRef(extensions_)); 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 bbd7220bc9..001a4da3af 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 @@ -41,7 +41,7 @@ #include "transport_manager/mock_transport_manager.h" #include "utils/lock.h" #include "utils/data_accessor.h" -#include "utils/make_shared.h" + #include "application_manager/message_helper.h" #include "application_manager/event_engine/event.h" #include "application_manager/smart_object_keys.h" @@ -138,7 +138,7 @@ class StateControllerImplTest : public ::testing::Test { StateControllerImplTest() : ::testing::Test() , usage_stat("0", - utils::SharedPtr( + std::shared_ptr( new usage_statistics_test::MockStatisticsManager)) , applications_lock_ptr_(std::make_shared()) , applications_(application_set_, applications_lock_ptr_) @@ -164,7 +164,7 @@ class StateControllerImplTest : public ::testing::Test { am::ApplicationSet application_set_; mutable std::shared_ptr applications_lock_ptr_; DataAccessor applications_; - utils::SharedPtr state_ctrl_; + std::shared_ptr state_ctrl_; am::ApplicationSharedPtr simple_app_; NiceMock* simple_app_ptr_; @@ -222,7 +222,7 @@ class StateControllerImplTest : public ::testing::Test { namespace SystemContext = mobile_apis::SystemContext; am::HmiStatePtr state = - utils::MakeShared(simple_app_, app_manager_mock_); + std::make_shared(simple_app_, app_manager_mock_); state->set_hmi_level(hmi_level); state->set_audio_streaming_state(audio_ss); state->set_video_streaming_state(video_ss); @@ -242,7 +242,7 @@ class StateControllerImplTest : public ::testing::Test { const mobile_apis::SystemContext::eType system_context, const am::ApplicationSharedPtr app) { am::HmiStatePtr new_state = - utils::MakeShared(app, app_manager_mock_); + std::make_shared(app, app_manager_mock_); new_state->set_hmi_level(hmi_level); new_state->set_audio_streaming_state(audio_ss); @@ -647,9 +647,9 @@ class StateControllerImplTest : public ::testing::Test { app_type = AppType(app_id); app = (*it_begin); am::HmiStatePtr state_first = - utils::MakeShared(app, app_manager_mock_); + std::make_shared(app, app_manager_mock_); am::HmiStatePtr state_second = - utils::MakeShared(app, app_manager_mock_); + std::make_shared(app, app_manager_mock_); TestSetSeveralState( app, state_first, state_second, app_type, call_back_result); TestSetSeveralState( @@ -954,7 +954,7 @@ class StateControllerImplTest : public ::testing::Test { virtual void SetUp() OVERRIDE { ON_CALL(app_manager_mock_, event_dispatcher()) .WillByDefault(ReturnRef(mock_event_dispatcher_)); - state_ctrl_ = utils::MakeShared(app_manager_mock_); + state_ctrl_ = std::make_shared(app_manager_mock_); ON_CALL(app_manager_mock_, applications()) .WillByDefault(Return(applications_)); @@ -984,7 +984,7 @@ class StateControllerImplTest : public ::testing::Test { ON_CALL(app_manager_mock_, GetPolicyHandler()) .WillByDefault(ReturnRef(policy_interface_)); smart_objects::SmartObjectSPtr bc_activate_app_request = - new smart_objects::SmartObject(); + std::make_shared(); (*bc_activate_app_request)[am::strings::params] [am::strings::correlation_id] = corr_id; ON_CALL(message_helper_mock_, @@ -1929,7 +1929,7 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) { std::vector::iterator it = hmi_states.begin(); std::vector::iterator it2 = initial_hmi_states.begin(); smart_objects::SmartObjectSPtr bc_activate_app_request = - new smart_objects::SmartObject(); + std::make_shared(); (*bc_activate_app_request)[am::strings::params][am::strings::correlation_id] = corr_id; @@ -2096,7 +2096,7 @@ TEST_F(StateControllerImplTest, ApplyTempStatesForMediaNaviVCApp) { TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) { am::HmiStatePtr state_phone_call = - utils::MakeShared(simple_app_, app_manager_mock_); + std::make_shared(simple_app_, app_manager_mock_); TestSetState(simple_app_, state_phone_call, APP_TYPE_NON_MEDIA, @@ -2105,7 +2105,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForNonMediaApplication) { TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) { am::HmiStatePtr state_phone_call = - utils::MakeShared(media_app_, app_manager_mock_); + std::make_shared(media_app_, app_manager_mock_); TestSetState(media_app_, state_phone_call, APP_TYPE_MEDIA, @@ -2113,7 +2113,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaApplication) { } TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) { - am::HmiStatePtr state_phone_call = utils::MakeShared( + am::HmiStatePtr state_phone_call = std::make_shared( media_navi_app_, app_manager_mock_); TestSetState(media_navi_app_, state_phone_call, @@ -2123,7 +2123,7 @@ TEST_F(StateControllerImplTest, SetStatePhoneCallForMediaNaviApplication) { TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) { am::HmiStatePtr state_vr = - utils::MakeShared(simple_app_, app_manager_mock_); + std::make_shared(simple_app_, app_manager_mock_); TestSetState(simple_app_, state_vr, APP_TYPE_NON_MEDIA, @@ -2132,7 +2132,7 @@ TEST_F(StateControllerImplTest, SetVRStateForNonMediaApplication) { TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) { am::HmiStatePtr state_vr = - utils::MakeShared(media_app_, app_manager_mock_); + std::make_shared(media_app_, app_manager_mock_); TestSetState(media_app_, state_vr, APP_TYPE_MEDIA, @@ -2141,7 +2141,7 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaApplication) { TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) { am::HmiStatePtr state_vr = - utils::MakeShared(media_navi_vc_app_, app_manager_mock_); + std::make_shared(media_navi_vc_app_, app_manager_mock_); TestSetState(media_navi_vc_app_, state_vr, APP_TYPE_MEDIA, @@ -2151,7 +2151,7 @@ TEST_F(StateControllerImplTest, SetVRStateForMediaNaviVoiceApplication) { TEST_F(StateControllerImplTest, SetTTSStateForNonMediaApplicationAttenuatedNotSupported) { am::HmiStatePtr state_tts = - utils::MakeShared(simple_app_, app_manager_mock_); + std::make_shared(simple_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(false)); TestSetState(simple_app_, @@ -2163,7 +2163,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, SetTTSStateForNonMediaApplicationAttenuatedSupported) { am::HmiStatePtr state_tts = - utils::MakeShared(simple_app_, app_manager_mock_); + std::make_shared(simple_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(true)); TestSetState(simple_app_, @@ -2175,7 +2175,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, SetTTSStateForMediaApplicationAttenuatedNotSupported) { am::HmiStatePtr state_tts = - utils::MakeShared(media_app_, app_manager_mock_); + std::make_shared(media_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(false)); TestSetState(media_app_, @@ -2187,7 +2187,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, SetTTSStateForMediaApplicationAttenuatedSupported) { am::HmiStatePtr state_tts = - utils::MakeShared(media_app_, app_manager_mock_); + std::make_shared(media_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(true)); TestSetState(media_app_, @@ -2199,7 +2199,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, SetTTSStateForMediaNaviVCApplicationAttenuatedNotSupported) { am::HmiStatePtr state_tts = - utils::MakeShared(media_navi_vc_app_, app_manager_mock_); + std::make_shared(media_navi_vc_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(false)); TestSetState(media_navi_vc_app_, @@ -2211,7 +2211,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, SetTTSStateForMediaNaviVCApplicationAttenuatedSupported) { am::HmiStatePtr state_tts = - utils::MakeShared(media_navi_vc_app_, app_manager_mock_); + std::make_shared(media_navi_vc_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(true)); TestSetState(media_navi_vc_app_, @@ -2222,7 +2222,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) { am::HmiStatePtr state_navi_streming = - utils::MakeShared(simple_app_, + std::make_shared(simple_app_, app_manager_mock_); TestSetState(simple_app_, state_navi_streming, @@ -2233,7 +2233,7 @@ TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) { TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedNotSupported) { am::HmiStatePtr state_navi_streming = - utils::MakeShared(media_app_, + std::make_shared(media_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(false)); @@ -2246,7 +2246,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedSupported) { am::HmiStatePtr state_navi_streming = - utils::MakeShared(media_app_, + std::make_shared(media_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(true)); @@ -2259,7 +2259,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateVCApplicationAttenuatedNotSupported) { am::HmiStatePtr state_navi_streming = - utils::MakeShared(vc_app_, app_manager_mock_); + std::make_shared(vc_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(false)); TestSetState(vc_app_, @@ -2271,7 +2271,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateVCApplicationAttenuatedSupported) { am::HmiStatePtr state_navi_streming = - utils::MakeShared(vc_app_, app_manager_mock_); + std::make_shared(vc_app_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(true)); TestSetState(vc_app_, @@ -2282,7 +2282,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateNaviApplication) { am::HmiStatePtr state_navi_streming = - utils::MakeShared(navi_app_, + std::make_shared(navi_app_, app_manager_mock_); TestSetState(navi_app_, state_navi_streming, @@ -2293,7 +2293,7 @@ TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateNaviApplication) { TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateMediaNaviApplication) { am::HmiStatePtr state_navi_streming = - utils::MakeShared(media_navi_app_, + std::make_shared(media_navi_app_, app_manager_mock_); TestSetState(media_navi_app_, state_navi_streming, @@ -2303,7 +2303,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) { am::HmiStatePtr state_safety_mode = - utils::MakeShared(simple_app_, app_manager_mock_); + std::make_shared(simple_app_, app_manager_mock_); TestSetState(simple_app_, state_safety_mode, APP_TYPE_NON_MEDIA, @@ -2312,7 +2312,7 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForNonMediaApplication) { TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) { am::HmiStatePtr state_safety_mode = - utils::MakeShared(media_app_, app_manager_mock_); + std::make_shared(media_app_, app_manager_mock_); TestSetState(media_app_, state_safety_mode, APP_TYPE_MEDIA, @@ -2322,7 +2322,7 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) { TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaNaviVoiceApplication) { am::HmiStatePtr state_safety_mode = - utils::MakeShared(media_navi_vc_app_, app_manager_mock_); + std::make_shared(media_navi_vc_app_, app_manager_mock_); TestSetState(media_navi_vc_app_, state_safety_mode, APP_TYPE_MEDIA, @@ -2956,7 +2956,7 @@ TEST_F(StateControllerImplTest, OnEventOnAppActivated) { .WillRepeatedly(Return(true)); smart_objects::SmartObjectSPtr activate_app = - utils::MakeShared(); + std::make_shared(); (*activate_app)[am::strings::params][am::strings::correlation_id] = kCorrID; SetBCActivateAppRequestToHMI(hmi_apis::Common_HMILevel::FULL, kCorrID); state_ctrl_->on_event(event); diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc index b07ce310e9..28e71f6f60 100644 --- a/src/components/application_manager/test/usage_statistics_test.cc +++ b/src/components/application_manager/test/usage_statistics_test.cc @@ -36,8 +36,8 @@ #include "smart_objects/enum_schema_item.h" #include "policy/usage_statistics/mock_statistics_manager.h" #include "policy/usage_statistics/mock_app_stopwatch.h" -#include "utils/make_shared.h" -#include "utils/shared_ptr.h" + + namespace test { namespace components { @@ -70,14 +70,14 @@ class UsageStatisticsTest : public testing::Test { public: UsageStatisticsTest() : mock_statistics_manager_sptr_( - utils::MakeShared()) + std::make_shared()) , usage_statistics_test_object1_sptr_( new application_manager::UsageStatistics( kAppId, mock_statistics_manager_sptr_)) , language_(LanguageIdToString(kTestLanguageId)) {} protected: - utils::SharedPtr mock_statistics_manager_sptr_; + std::shared_ptr mock_statistics_manager_sptr_; std::unique_ptr usage_statistics_test_object1_sptr_; const std::string language_; diff --git a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h index 8f5ee96ce5..934e4d5b08 100644 --- a/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h +++ b/src/components/formatters/test/include/formatters/SmartFactoryTestHelper.h @@ -107,9 +107,9 @@ class CSmartFactoryTest : public CSmartFactory > TStructsSchemaItems; + std::shared_ptr > TStructsSchemaItems; - static utils::SharedPtr ProvideObjectSchemaItemForStruct( + static std::shared_ptr ProvideObjectSchemaItemForStruct( TStructsSchemaItems& struct_schema_items, const StructIdentifiersTest::eType struct_id); @@ -147,10 +147,10 @@ class CSmartFactoryTest : public CSmartFactory& function_id_items, const std::set& message_type_items); - static utils::SharedPtr InitStructSchemaItem_Common_1( + static std::shared_ptr InitStructSchemaItem_Common_1( TStructsSchemaItems& struct_schema_items); - static utils::SharedPtr InitStructSchemaItem_Common_2(); + static std::shared_ptr InitStructSchemaItem_Common_2(); }; } // namespace formatters diff --git a/src/components/formatters/test/src/SmartFactoryTestHelper.cc b/src/components/formatters/test/src/SmartFactoryTestHelper.cc index 2dd76f85f8..8c7716e9b4 100644 --- a/src/components/formatters/test/src/SmartFactoryTestHelper.cc +++ b/src/components/formatters/test/src/SmartFactoryTestHelper.cc @@ -148,7 +148,7 @@ CSmartFactoryTest::CSmartFactoryTest() void CSmartFactoryTest::InitStructSchemes( TStructsSchemaItems& struct_schema_items) { - utils::SharedPtr struct_schema_item_Common_1 = + std::shared_ptr struct_schema_item_Common_1 = InitStructSchemaItem_Common_1(struct_schema_items); struct_schema_items.insert(std::make_pair(StructIdentifiersTest::Common_1, struct_schema_item_Common_1)); @@ -156,7 +156,7 @@ void CSmartFactoryTest::InitStructSchemes( std::make_pair(StructIdentifiersTest::Common_1, CSmartSchema(struct_schema_item_Common_1))); - utils::SharedPtr struct_schema_item_Common_2 = + std::shared_ptr struct_schema_item_Common_2 = InitStructSchemaItem_Common_2(); struct_schema_items.insert(std::make_pair(StructIdentifiersTest::Common_2, struct_schema_item_Common_2)); @@ -269,7 +269,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function1_response( const std::set& function_id_items, const std::set& message_type_items) { // Function parameter available. - utils::SharedPtr available_SchemaItem = + std::shared_ptr available_SchemaItem = CBoolSchemaItem::create(TSchemaItemParameter()); CObjectSchemaItem::Members schema_members; @@ -333,7 +333,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function2_response( const std::set& function_id_items, const std::set& message_type_items) { // Function parameter available. - utils::SharedPtr available_SchemaItem = + std::shared_ptr available_SchemaItem = CBoolSchemaItem::create(TSchemaItemParameter()); CObjectSchemaItem::Members schema_members; @@ -399,7 +399,7 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function3_response( // Function parameter available. // // Must be true if VR is present and ready to communicate with SDL. - utils::SharedPtr available_SchemaItem = + std::shared_ptr available_SchemaItem = CBoolSchemaItem::create(TSchemaItemParameter()); CObjectSchemaItem::Members schema_members; @@ -431,12 +431,12 @@ CSmartSchema CSmartFactoryTest::InitFunction_Function3_response( return CSmartSchema(CObjectSchemaItem::create(root_members_map)); } -utils::SharedPtr CSmartFactoryTest::InitStructSchemaItem_Common_1( +std::shared_ptr CSmartFactoryTest::InitStructSchemaItem_Common_1( TStructsSchemaItems& struct_schema_items) { // Struct member text. // // Text to display - utils::SharedPtr text_SchemaItem = + std::shared_ptr text_SchemaItem = CStringSchemaItem::create(TSchemaItemParameter(1), TSchemaItemParameter(500), TSchemaItemParameter()); @@ -444,14 +444,14 @@ utils::SharedPtr CSmartFactoryTest::InitStructSchemaItem_Common_1( // Struct member image. // // Image struct - utils::SharedPtr image_SchemaItem = + std::shared_ptr image_SchemaItem = ProvideObjectSchemaItemForStruct(struct_schema_items, StructIdentifiersTest::Common_2); // Struct member position. // // Position to display item - utils::SharedPtr position_SchemaItem = + std::shared_ptr position_SchemaItem = TNumberSchemaItem::create(TSchemaItemParameter(1), TSchemaItemParameter(500), TSchemaItemParameter()); @@ -472,19 +472,19 @@ utils::SharedPtr CSmartFactoryTest::InitStructSchemaItem_Common_1( return CObjectSchemaItem::create(schema_members); } -utils::SharedPtr +std::shared_ptr CSmartFactoryTest::InitStructSchemaItem_Common_2() { // Struct member text. // // Text to display - utils::SharedPtr text_SchemaItem = + std::shared_ptr text_SchemaItem = CStringSchemaItem::create(TSchemaItemParameter(1), TSchemaItemParameter(500), TSchemaItemParameter()); // Struct member position. // // Position to display item - utils::SharedPtr position_SchemaItem = + std::shared_ptr position_SchemaItem = TNumberSchemaItem::create(TSchemaItemParameter(1), TSchemaItemParameter(500), TSchemaItemParameter()); @@ -497,7 +497,7 @@ CSmartFactoryTest::InitStructSchemaItem_Common_2() { return CObjectSchemaItem::create(schema_members); } -utils::SharedPtr +std::shared_ptr CSmartFactoryTest::ProvideObjectSchemaItemForStruct( TStructsSchemaItems& struct_schema_items, const StructIdentifiersTest::eType struct_id) { diff --git a/src/components/hmi_message_handler/mock_hmi_message_handler.h b/src/components/hmi_message_handler/mock_hmi_message_handler.h index d9060088ff..f4ed601bed 100644 --- a/src/components/hmi_message_handler/mock_hmi_message_handler.h +++ b/src/components/hmi_message_handler/mock_hmi_message_handler.h @@ -50,9 +50,9 @@ class MockHMIMessageHandler : public ::hmi_message_handler::HMIMessageHandler { MOCK_METHOD1(RemoveHMIMessageAdapter, void(HMIMessageAdapter* adapter)); MOCK_CONST_METHOD0(get_settings, const HMIMessageHandlerSettings&()); MOCK_METHOD1(OnMessageReceived, - void(utils::SharedPtr message)); + void(std::shared_ptr message)); MOCK_METHOD1(OnErrorSending, - void(utils::SharedPtr message)); + void(std::shared_ptr message)); MOCK_METHOD1(SendMessageToHMI, void(MessageSharedPointer message)); }; } // namespace hmi_message_handler_test diff --git a/src/components/hmi_message_handler/src/messagebroker_adapter.cc b/src/components/hmi_message_handler/src/messagebroker_adapter.cc index 53a0d84362..d400cca335 100644 --- a/src/components/hmi_message_handler/src/messagebroker_adapter.cc +++ b/src/components/hmi_message_handler/src/messagebroker_adapter.cc @@ -55,7 +55,7 @@ void MessageBrokerAdapter::SendMessageToHMI( hmi_message_handler::MessageSharedPointer message) { LOG4CXX_AUTO_TRACE(logger_); - if (!message.valid()) { + if (message.use_count() == 0) { LOG4CXX_ERROR(logger_, "Can`t send not valid message"); return; } diff --git a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc index eead7106c6..2ac91ba16d 100644 --- a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc +++ b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc @@ -31,8 +31,8 @@ */ #include "gtest/gtest.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "hmi_message_handler/hmi_message_handler_impl.h" #include "hmi_message_handler/mock_hmi_message_adapter_impl.h" @@ -45,7 +45,7 @@ namespace hmi_message_handler_test { using ::testing::Return; using hmi_message_handler::HMIMessageHandlerImpl; -typedef utils::SharedPtr +typedef std::shared_ptr MockHMIMessageAdapterImplSPtr; TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) { @@ -60,7 +60,7 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) { ; MockHMIMessageAdapterImplSPtr message_adapter_impl = - utils::MakeShared(message_handler); + std::make_shared(message_handler); EXPECT_EQ(message_handler, message_adapter_impl->get_handler()); @@ -71,7 +71,7 @@ TEST(HMIMessageAdapterImplTest, Handler_CorrectPointer_CorrectReturnedPointer) { TEST(HMIMessageAdapterImplTest, Handler_NULLPointer_CorrectReturnedPointer) { HMIMessageHandler* message_handler = NULL; MockHMIMessageAdapterImplSPtr message_adapter_impl = - utils::MakeShared(message_handler); + std::make_shared(message_handler); EXPECT_EQ(NULL, message_adapter_impl->get_handler()); } diff --git a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc index fd459ea094..e66f900299 100644 --- a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc +++ b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc @@ -86,7 +86,7 @@ class HMIMessageHandlerImplTest : public ::testing::Test { hmi_message_handler::MessageSharedPointer CreateMessage() { // The ServiceType doesn't really matter - return new application_manager::Message( + return std::make_shared( protocol_handler::MessagePriority::FromServiceType( protocol_handler::ServiceType::kInvalidServiceType)); } @@ -104,7 +104,7 @@ TEST_F(HMIMessageHandlerImplTest, TEST_F(HMIMessageHandlerImplTest, OnErrorSending_NotEmptyMessage_ExpectOnErrorSendingProceeded) { // Arrange - utils::SharedPtr message = CreateMessage(); + std::shared_ptr message = CreateMessage(); EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(message)); // Act @@ -113,7 +113,7 @@ TEST_F(HMIMessageHandlerImplTest, TEST_F(HMIMessageHandlerImplTest, OnErrorSending_InvalidObserver_Cancelled) { // Arrange - utils::SharedPtr message = CreateMessage(); + std::shared_ptr message = CreateMessage(); hmi_handler_->set_message_observer(NULL); EXPECT_CALL(*mock_hmi_message_observer_, OnErrorSending(_)).Times(0); diff --git a/src/components/include/application_manager/application_manager.h b/src/components/include/application_manager/application_manager.h index f514168c53..61095e388a 100644 --- a/src/components/include/application_manager/application_manager.h +++ b/src/components/include/application_manager/application_manager.h @@ -42,7 +42,7 @@ #include "application_manager/command_factory.h" #include "connection_handler/connection_handler.h" #include "utils/data_accessor.h" -#include "utils/shared_ptr.h" + #include "telemetry_monitor/telemetry_observable.h" #include "application_manager/policies/policy_handler_interface.h" #include "application_manager/application_manager_settings.h" @@ -260,7 +260,7 @@ class ApplicationManager { * **/ virtual void SendHMIStatusNotification( - const utils::SharedPtr app) = 0; + const std::shared_ptr app) = 0; /** * @brief Checks if driver distraction state is valid, creates message @@ -457,7 +457,7 @@ class ApplicationManager { virtual void IviInfoUpdated(mobile_apis::VehicleDataType::eType vehicle_info, int value) = 0; - virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr< + virtual ApplicationSharedPtr RegisterApplication(const std::shared_ptr< smart_objects::SmartObject>& request_for_registration) = 0; virtual void SendUpdateAppList() = 0; @@ -697,7 +697,7 @@ class ApplicationManager { * @return new regular HMI state */ virtual HmiStatePtr CreateRegularState( - utils::SharedPtr app, + std::shared_ptr app, mobile_apis::HMILevel::eType hmi_level, mobile_apis::AudioStreamingState::eType audio_state, mobile_apis::VideoStreamingState::eType video_state, diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index b8946a63f4..ee9274ead7 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -52,7 +52,7 @@ using namespace ::rpc::policy_table_interface_base; namespace policy { -typedef utils::SharedPtr StatusNotifier; +typedef std::shared_ptr StatusNotifier; class PolicyHandlerInterface { public: @@ -124,7 +124,7 @@ class PolicyHandlerInterface { virtual void add_listener(PolicyHandlerObserver* listener) = 0; virtual void remove_listener(PolicyHandlerObserver* listener) = 0; - virtual utils::SharedPtr + virtual std::shared_ptr GetStatisticManager() const = 0; virtual void SendOnAppPermissionsChanged( diff --git a/src/components/include/hmi_message_handler/hmi_message_observer.h b/src/components/include/hmi_message_handler/hmi_message_observer.h index 0676615b53..d9ae422b8f 100644 --- a/src/components/include/hmi_message_handler/hmi_message_observer.h +++ b/src/components/include/hmi_message_handler/hmi_message_observer.h @@ -33,7 +33,7 @@ #ifndef SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_ #define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_ -#include "utils/shared_ptr.h" + namespace application_manager { class Message; @@ -45,9 +45,9 @@ class HMIMessageObserver { public: virtual ~HMIMessageObserver() {} virtual void OnMessageReceived( - utils::SharedPtr message) = 0; + std::shared_ptr message) = 0; virtual void OnErrorSending( - utils::SharedPtr message) = 0; + std::shared_ptr message) = 0; }; } diff --git a/src/components/include/hmi_message_handler/hmi_message_sender.h b/src/components/include/hmi_message_handler/hmi_message_sender.h index 91c20a1986..3f70f78a97 100644 --- a/src/components/include/hmi_message_handler/hmi_message_sender.h +++ b/src/components/include/hmi_message_handler/hmi_message_sender.h @@ -36,7 +36,7 @@ #include "application_manager/message.h" namespace hmi_message_handler { -typedef utils::SharedPtr MessageSharedPointer; +typedef std::shared_ptr MessageSharedPointer; class HMIMessageSender { public: diff --git a/src/components/include/policy/policy_external/policy/policy_manager.h b/src/components/include/policy/policy_external/policy/policy_manager.h index 83038472cd..57f6d2f802 100644 --- a/src/components/include/policy/policy_external/policy/policy_manager.h +++ b/src/components/include/policy/policy_external/policy/policy_manager.h @@ -46,7 +46,7 @@ namespace policy { class PolicySettings; -typedef utils::SharedPtr StatusNotifier; +typedef std::shared_ptr StatusNotifier; class PolicyManager : public usage_statistics::StatisticsManager { public: @@ -609,7 +609,7 @@ class PolicyManager : public usage_statistics::StatisticsManager { * @param access_remote pointer to new access_remote instance */ virtual void set_access_remote( - utils::SharedPtr access_remote) = 0; + std::shared_ptr access_remote) = 0; /** * @brief Checks if there is existing URL in the EndpointUrls vector with diff --git a/src/components/include/policy/policy_regular/policy/policy_manager.h b/src/components/include/policy/policy_regular/policy/policy_manager.h index bd29b2942e..ee0bae7118 100644 --- a/src/components/include/policy/policy_regular/policy/policy_manager.h +++ b/src/components/include/policy/policy_regular/policy/policy_manager.h @@ -46,7 +46,7 @@ namespace policy { class PolicySettings; -typedef utils::SharedPtr StatusNotifier; +typedef std::shared_ptr StatusNotifier; class PolicyManager : public usage_statistics::StatisticsManager { public: @@ -589,7 +589,7 @@ class PolicyManager : public usage_statistics::StatisticsManager { * @param access_remote pointer to new access_remote instance */ virtual void set_access_remote( - utils::SharedPtr access_remote) = 0; + std::shared_ptr access_remote) = 0; /** * @brief Checks if there is existing URL in the EndpointUrls vector with diff --git a/src/components/include/protocol/raw_message.h b/src/components/include/protocol/raw_message.h index 99cb73ce67..5171d42593 100644 --- a/src/components/include/protocol/raw_message.h +++ b/src/components/include/protocol/raw_message.h @@ -33,7 +33,7 @@ #define SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_ #include "utils/macro.h" -#include "utils/shared_ptr.h" +#include #include "protocol/service_type.h" #include "protocol/message_priority.h" @@ -114,6 +114,6 @@ class RawMessage { bool waiting_; DISALLOW_COPY_AND_ASSIGN(RawMessage); }; -typedef utils::SharedPtr RawMessagePtr; +typedef std::shared_ptr RawMessagePtr; } // namespace protocol_handler #endif // SRC_COMPONENTS_INCLUDE_PROTOCOL_RAW_MESSAGE_H_ diff --git a/src/components/include/protocol_handler/telemetry_observer.h b/src/components/include/protocol_handler/telemetry_observer.h index a76fbce717..a908ebcaa1 100644 --- a/src/components/include/protocol_handler/telemetry_observer.h +++ b/src/components/include/protocol_handler/telemetry_observer.h @@ -50,7 +50,7 @@ class PHTelemetryObserver { }; virtual void StartMessageProcess(uint32_t message_id, const TimevalStruct& start_time) = 0; - virtual void EndMessageProcess(utils::SharedPtr m) = 0; + virtual void EndMessageProcess(std::shared_ptr m) = 0; virtual ~PHTelemetryObserver() {} }; } // protocol_handler diff --git a/src/components/include/security_manager/security_query.h b/src/components/include/security_manager/security_query.h index cdad1c746c..8aa5b60853 100644 --- a/src/components/include/security_manager/security_query.h +++ b/src/components/include/security_manager/security_query.h @@ -37,7 +37,7 @@ #include #include #include -#include "utils/shared_ptr.h" +#include namespace security_manager { /** @@ -189,6 +189,6 @@ class SecurityQuery { /** *\brief SmartPointer wrapper */ -typedef utils::SharedPtr SecurityQueryPtr; +typedef std::shared_ptr SecurityQueryPtr; } // namespace security_manager #endif // SRC_COMPONENTS_INCLUDE_SECURITY_MANAGER_SECURITY_QUERY_H_ diff --git a/src/components/include/test/application_manager/mock_application_manager.h b/src/components/include/test/application_manager/mock_application_manager.h index 79f601d75d..4a86c17f39 100644 --- a/src/components/include/test/application_manager/mock_application_manager.h +++ b/src/components/include/test/application_manager/mock_application_manager.h @@ -121,7 +121,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { mobile_apis::HMILevel::eType to)); MOCK_METHOD1( SendHMIStatusNotification, - void(const utils::SharedPtr app)); + void(const std::shared_ptr app)); MOCK_METHOD1(SendDriverDistractionState, void(application_manager::ApplicationSharedPtr app)); MOCK_METHOD1(RemoveHMIFakeParameters, @@ -171,7 +171,7 @@ class MockApplicationManager : public application_manager::ApplicationManager { void(mobile_apis::VehicleDataType::eType vehicle_info, int value)); MOCK_METHOD1(RegisterApplication, - application_manager::ApplicationSharedPtr(const utils::SharedPtr< + application_manager::ApplicationSharedPtr(const std::shared_ptr< smart_objects::SmartObject>& request_for_registration)); MOCK_METHOD0(SendUpdateAppList, void()); MOCK_METHOD2(MarkAppsGreyOut, diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h index ffa9222c8e..cb47147074 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_interface.h @@ -112,7 +112,7 @@ class MockPolicyHandlerInterface : public policy::PolicyHandlerInterface { MOCK_METHOD1(add_listener, void(policy::PolicyHandlerObserver* listener)); MOCK_METHOD1(remove_listener, void(policy::PolicyHandlerObserver* listener)); MOCK_CONST_METHOD0(GetStatisticManager, - utils::SharedPtr()); + std::shared_ptr()); MOCK_CONST_METHOD2(CheckSystemAction, bool(mobile_apis::SystemAction::eType system_action, const std::string& policy_app_id)); diff --git a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h index 859d164231..17ec69ccf8 100644 --- a/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h +++ b/src/components/include/test/hmi_message_handler/mock_hmi_message_observer.h @@ -45,9 +45,9 @@ class MockHMIMessageObserver : public hmi_message_handler::HMIMessageObserver, public utils::Singleton { public: MOCK_METHOD1(OnMessageReceived, - void(utils::SharedPtr message)); + void(std::shared_ptr message)); MOCK_METHOD1(OnErrorSending, - void(utils::SharedPtr message)); + void(std::shared_ptr message)); virtual ~MockHMIMessageObserver() {} }; diff --git a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h index 02931114f0..a4d50d7cc2 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_cache_manager.h @@ -106,7 +106,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface { MOCK_METHOD2(Init, bool(const std::string& file_name, const PolicySettings* settings)); - MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr()); + MOCK_METHOD0(GenerateSnapshot, std::shared_ptr()); MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt)); MOCK_METHOD1(Save, bool(const policy_table::Table& table)); MOCK_CONST_METHOD0(UpdateRequired, bool()); @@ -231,7 +231,7 @@ class MockCacheManagerInterface : public ::policy::CacheManagerInterface { bool(const std::string& device_id, const std::string& policy_app_id, policy::Permissions& permission)); - MOCK_CONST_METHOD0(GetPT, utils::SharedPtr()); + MOCK_CONST_METHOD0(GetPT, std::shared_ptr()); MOCK_CONST_METHOD0(GetMetaInfo, const MetaInfo()); MOCK_CONST_METHOD0(GetCertificate, std::string()); MOCK_METHOD1(SetDecryptedCertificate, void(const std::string&)); diff --git a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h index ea259fc916..aeabf8fdcb 100644 --- a/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_external/policy/mock_policy_manager.h @@ -163,7 +163,7 @@ class MockPolicyManager : public PolicyManager { bool(const std::string& policy_app_id, std::vector* modules)); MOCK_METHOD1(set_access_remote, - void(utils::SharedPtr access_remote)); + void(std::shared_ptr access_remote)); MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h index d216957eb0..440000dbff 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_cache_manager.h @@ -84,7 +84,7 @@ class MockCacheManagerInterface : public CacheManagerInterface { MOCK_METHOD2(Init, bool(const std::string& file_name, const PolicySettings* settings)); - MOCK_METHOD0(GenerateSnapshot, utils::SharedPtr()); + MOCK_METHOD0(GenerateSnapshot, std::shared_ptr()); MOCK_METHOD1(ApplyUpdate, bool(const policy_table::Table& update_pt)); MOCK_METHOD1(Save, bool(const policy_table::Table& table)); MOCK_CONST_METHOD0(UpdateRequired, bool()); @@ -202,7 +202,7 @@ class MockCacheManagerInterface : public CacheManagerInterface { bool(const std::string& device_id, const std::string& policy_app_id, policy::Permissions& permission)); - MOCK_CONST_METHOD0(pt, utils::SharedPtr()); + MOCK_CONST_METHOD0(pt, std::shared_ptr()); MOCK_METHOD1(GetHMITypes, const policy_table::AppHMITypes*(const std::string& app_id)); MOCK_CONST_METHOD0(GetCertificate, std::string()); diff --git a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h index 952b264caf..0e06e9c1a3 100644 --- a/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h +++ b/src/components/include/test/policy/policy_regular/policy/mock_policy_manager.h @@ -162,7 +162,7 @@ class MockPolicyManager : public PolicyManager { bool(const std::string& policy_app_id, std::vector* modules)); MOCK_METHOD1(set_access_remote, - void(utils::SharedPtr access_remote)); + void(std::shared_ptr access_remote)); MOCK_METHOD0(CleanupUnpairedDevices, bool()); MOCK_CONST_METHOD1(CanAppKeepContext, bool(const std::string& app_id)); MOCK_CONST_METHOD1(CanAppStealFocus, bool(const std::string& app_id)); diff --git a/src/components/include/test/protocol_handler/mock_telemetry_observer.h b/src/components/include/test/protocol_handler/mock_telemetry_observer.h index 1c87de4d5a..fb1141baa4 100644 --- a/src/components/include/test/protocol_handler/mock_telemetry_observer.h +++ b/src/components/include/test/protocol_handler/mock_telemetry_observer.h @@ -45,7 +45,7 @@ class MockPHTelemetryObserver : public PHTelemetryObserver { public: MOCK_METHOD2(StartMessageProcess, void(uint32_t message_id, const TimevalStruct& start_time)); - MOCK_METHOD1(EndMessageProcess, void(utils::SharedPtr m)); + MOCK_METHOD1(EndMessageProcess, void(std::shared_ptr m)); }; } // namespace protocol_handler_test diff --git a/src/components/include/transport_manager/error.h b/src/components/include/transport_manager/error.h index 022ddf0e38..ba357dd54b 100644 --- a/src/components/include/transport_manager/error.h +++ b/src/components/include/transport_manager/error.h @@ -34,7 +34,7 @@ #define SRC_COMPONENTS_INCLUDE_TRANSPORT_MANAGER_ERROR_H_ #include -#include +#include namespace transport_manager { @@ -79,7 +79,7 @@ class BaseError { private: std::string description_; }; -typedef utils::SharedPtr BaseErrorPtr; +typedef std::shared_ptr BaseErrorPtr; /** * @brief Error that originates during device search. diff --git a/src/components/include/transport_manager/transport_adapter/device.h b/src/components/include/transport_manager/transport_adapter/device.h index 148e715050..1ac1424477 100644 --- a/src/components/include/transport_manager/transport_adapter/device.h +++ b/src/components/include/transport_manager/transport_adapter/device.h @@ -35,9 +35,10 @@ #include #include +#include #include "transport_manager/common.h" -#include "utils/shared_ptr.h" + #include "utils/macro.h" namespace transport_manager { @@ -160,7 +161,7 @@ class Device { **/ bool keep_on_disconnect_; }; -typedef utils::SharedPtr DeviceSptr; +typedef std::shared_ptr DeviceSptr; typedef std::vector DeviceVector; } // namespace transport_adapter } // namespace transport_manager diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter.h b/src/components/include/transport_manager/transport_adapter/transport_adapter.h index c00adb33b8..630ec4e85f 100644 --- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h +++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h @@ -44,7 +44,7 @@ #include #include -#include "utils/shared_ptr.h" + #include "transport_manager/transport_adapter/device.h" #include "transport_manager/common.h" diff --git a/src/components/include/utils/data_accessor.h b/src/components/include/utils/data_accessor.h index 6d0fb0ed68..0c1eb6ebbd 100644 --- a/src/components/include/utils/data_accessor.h +++ b/src/components/include/utils/data_accessor.h @@ -34,7 +34,7 @@ #include #include "utils/lock.h" -#include "utils/shared_ptr.h" + // This class is for thread-safe const access to data template @@ -67,7 +67,7 @@ class DataAccessor { const T& data_; // Require that the lock lives at least as long as the DataAccessor const std::shared_ptr lock_; - utils::SharedPtr counter_; + std::shared_ptr counter_; }; #endif // SRC_COMPONENTS_INCLUDE_UTILS_DATA_ACCESSOR_H_ diff --git a/src/components/include/utils/make_shared.h b/src/components/include/utils/make_shared.h deleted file mode 100644 index 9d40d646a6..0000000000 --- a/src/components/include/utils/make_shared.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2015, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_ -#define SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_ - -#include -/** - * @brief The functions set below allows to create shared pointer in a safe way. - * There are up to 5 parameters could be passed as the constructor parameters. - * - * @example - * struct A { - * A(int){} - * A(int, double) {} - * A(int, double, std::string) {} - * } - * SharedPtr shared1(MakeShared(5); - * SharedPtr shared2(MakeShared(5, 5.5); - * SharedPtr shared3(MakeShared(5, 5.5, std::string("MyStr")); - * - * The profit in using MakeShared instead of simple allocation with operator new - *is evident. - * Firstly it allows us to centralize allocation place, secondly it allows us to - *use - * safe operator new overloading (no throwable one). - */ -namespace utils { -template -class SharedPtr; - -namespace { -template -SharedPtr Initialize(T* object) { - return object == NULL ? SharedPtr() : SharedPtr(object); -} -} - -template -SharedPtr MakeShared() { - T* t = new (std::nothrow) T; - return Initialize(t); -} - -template -SharedPtr MakeShared(Arg1& arg1) { - T* t = new (std::nothrow) T(arg1); - return Initialize(t); -} - -template -SharedPtr MakeShared(Arg1& arg1, Arg2& arg2) { - T* t = new (std::nothrow) T(arg1, arg2); - return Initialize(t); -} - -template -SharedPtr MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3) { - T* t = new (std::nothrow) T(arg1, arg2, arg3); - return Initialize(t); -} - -template -SharedPtr MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4); - return Initialize(t); -} - -template -SharedPtr MakeShared( - Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5); - return Initialize(t); -} - -template -SharedPtr MakeShared( - Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5, Arg6& arg6) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6); - return Initialize(t); -} - -template -SharedPtr MakeShared(const Arg1& arg1) { - T* t = new (std::nothrow) T(arg1); - return Initialize(t); -} - -template -SharedPtr MakeShared(const Arg1& arg1, const Arg2& arg2) { - T* t = new (std::nothrow) T(arg1, arg2); - return Initialize(t); -} - -template -SharedPtr MakeShared(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3) { - T* t = new (std::nothrow) T(arg1, arg2, arg3); - return Initialize(t); -} - -template -SharedPtr MakeShared(const Arg1& arg1, - const Arg2& arg2, - const Arg3& arg3, - const Arg4& arg4) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4); - return Initialize(t); -} - -template -SharedPtr MakeShared(const Arg1& arg1, - const Arg2& arg2, - const Arg3& arg3, - const Arg4& arg4, - const Arg5& arg5) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5); - return Initialize(t); -} - -template -SharedPtr MakeShared(const Arg1& arg1, - const Arg2& arg2, - const Arg3& arg3, - const Arg4& arg4, - const Arg5& arg5, - const Arg6& arg6) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6); - return Initialize(t); -} - -} // namespace utils; -#endif // SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_ diff --git a/src/components/include/utils/shared_ptr.h b/src/components/include/utils/shared_ptr.h deleted file mode 100644 index 064bb36b4a..0000000000 --- a/src/components/include/utils/shared_ptr.h +++ /dev/null @@ -1,390 +0,0 @@ -/* - * Copyright (c) 2013, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_ -#define SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_ - -#include -#include -#include - -#include "utils/macro.h" -#include "utils/atomic.h" - -namespace utils { - -/** - * @brief Shared pointer. - * - * Pointer to an object with reference counting. - * Object will be automatically deallocated when last shared - * pointer is destroyed. - * - * @tparam ObjectType Type of wrapped object. - **/ -template -class SharedPtr { - static void DummyDeleter(ObjectType* object_to_delete) { - delete object_to_delete; - } - - public: - // std smart pointer compatibility - typedef ObjectType element_type; - typedef void (*Deleter)(ObjectType*); - /** - * @brief Constructor. - * - * Initialize shared pointer with wrapped object. - * Reference counter will be initialized to 1. - * - * @param Object Wrapped object. - **/ - SharedPtr(ObjectType* Object); - - SharedPtr(ObjectType* Object, Deleter deleter) - : mObject(Object) - , mReferenceCounter(new uint32_t(1)) - , deleter_(deleter) {} - - SharedPtr(); - - /** - * @brief Copy constructor. - * - * Initialize shared pointer with another shared pointer. - * Reference counter will be incremented. - * - * @param Other Other shared pointer. - **/ - SharedPtr(const SharedPtr& Other); - - /** - * @brief Copy constructor. - * - * Initialize shared pointer with another shared pointer. - * Reference counter will be incremented. - * - * @tparam OtherObjectType Type of other object pointer. This - * allows creating a shared pointer to an - * intstance of a base class from a shared - * pointer to an instance of a class - * inherited from this base class. - * If OtherObjectType is not implicitly - * convertible to ObjectType it will - * cause a compile error. - * - * @param Other Other shared pointer. - **/ - template - SharedPtr(const SharedPtr& Other); - - /** - * @brief Destructor. - * - * Decrement reference counter and destroy wrapped object - * if reference counter reaches zero. - **/ - ~SharedPtr(); - - /** - * @brief Assignment operator. - * - * Drop reference to currently referenced object and add - * reference to assigned object. - * - * @param Other Shared pointer to an object - * that must be referenced. - * - * @return Reference to this shared pointer. - **/ - SharedPtr& operator=(const SharedPtr& Other); - - bool operator==(const SharedPtr& Other) const; - - bool operator<(const SharedPtr& other) const; - - /** - * @brief Assignment operator. - * - * Drop reference to currently referenced object and add - * reference to assigned object. - * - * @tparam OtherObjectType Type of other object pointer. This - * allows creating a shared pointer to an - * intstance of a base class from a shared - * pointer to an instance of a class - * inherited from this base class. - * If OtherObjectType is not implicitly - * convertible to ObjectType it will - * cause a compile error. - * - * @param Other Shared pointer to an object - * that must be referenced. - * - * @return Reference to this shared pointer. - **/ - template - SharedPtr& operator=(const SharedPtr& Other); - - template - static SharedPtr static_pointer_cast( - const SharedPtr& pointer); - - template - static SharedPtr dynamic_pointer_cast( - const SharedPtr& pointer); - - /** - * @brief Member access operator. - * - * @return Wrapped object. - **/ - ObjectType* operator->() const; - - ObjectType& operator*() const; - operator bool() const; - void reset(); - void reset(ObjectType* other); - ObjectType* get() const; - -#ifdef BUILD_TESTS - inline const uint32_t* get_ReferenceCounter() const { - return mReferenceCounter; - } -#endif // BUILD_TESTS - - /** - * @return true if mObject not NULL - */ - bool valid() const; - - private: - void reset_impl(ObjectType* other); - - // TSharedPtr needs access to other TSharedPtr private members - // for shared pointers type casts. - template - friend class SharedPtr; - - /** - * @brief Drop reference to wrapped object. - * - * If reference counter reaches zero object and its reference - * counter will be deallocated. - **/ - void dropReference(); - - /** - * @brief Wrapped object. - **/ - ObjectType* mObject; - - /** - * @brief Pointer to reference counter. - **/ - uint32_t* mReferenceCounter; - - Deleter deleter_; - void release(); -}; - -template -inline utils::SharedPtr::SharedPtr(ObjectType* Object) - : mObject(NULL) - , mReferenceCounter(new uint32_t(1)) - , deleter_(DummyDeleter) { - DCHECK(Object != NULL); - mObject = Object; -} - -template -inline utils::SharedPtr::SharedPtr() - : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {} - -template -inline utils::SharedPtr::SharedPtr( - const SharedPtr& Other) - : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) { - *this = Other; -} - -template -template -inline utils::SharedPtr::SharedPtr( - const SharedPtr& Other) - : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) { - *this = Other; -} - -template -inline utils::SharedPtr::~SharedPtr() { - dropReference(); -} - -template -inline utils::SharedPtr& utils::SharedPtr::operator=( - const SharedPtr& Other) { - return operator=(Other); -} - -template -inline bool utils::SharedPtr::operator==( - const SharedPtr& Other) const { - return (mObject == Other.mObject); -} - -template -inline bool utils::SharedPtr::operator<( - const SharedPtr& other) const { - return (mObject < other.mObject); -} - -template -template -inline utils::SharedPtr& utils::SharedPtr::operator=( - const SharedPtr& Other) { - dropReference(); - - mObject = Other.mObject; - mReferenceCounter = Other.mReferenceCounter; - - if (0 != mReferenceCounter) { - atomic_post_inc(mReferenceCounter); - } - - return *this; -} - -template -template -utils::SharedPtr utils::SharedPtr< - ObjectType>::static_pointer_cast(const SharedPtr& pointer) { - SharedPtr casted_pointer; - casted_pointer.mObject = static_cast(pointer.mObject); - casted_pointer.mReferenceCounter = pointer.mReferenceCounter; - - if (0 != casted_pointer.mReferenceCounter) { - atomic_post_inc(casted_pointer.mReferenceCounter); - } - - return casted_pointer; -} - -template -template -utils::SharedPtr utils::SharedPtr< - ObjectType>::dynamic_pointer_cast(const SharedPtr& pointer) { - SharedPtr casted_pointer; - casted_pointer.mObject = dynamic_cast(pointer.mObject); - if (NULL != casted_pointer.mObject) { - casted_pointer.mReferenceCounter = pointer.mReferenceCounter; - - if (0 != casted_pointer.mReferenceCounter) { - atomic_post_inc(casted_pointer.mReferenceCounter); - } - } - - return casted_pointer; -} - -template -ObjectType* utils::SharedPtr::operator->() const { - DCHECK(mObject); - return mObject; -} - -template -ObjectType& utils::SharedPtr::operator*() const { - DCHECK(mObject); - return *mObject; -} - -template -utils::SharedPtr::operator bool() const { - return valid(); -} - -template -void utils::SharedPtr::reset() { - reset_impl(0); -} - -template -void utils::SharedPtr::reset(ObjectType* other) { - DCHECK(other != NULL); - reset_impl(other); -} - -template -void SharedPtr::release() { - deleter_(mObject); - mObject = 0; - - delete mReferenceCounter; - mReferenceCounter = 0; -} - -template -void utils::SharedPtr::reset_impl(ObjectType* other) { - dropReference(); - mObject = other; - mReferenceCounter = new uint32_t(1); -} - -template -inline void SharedPtr::dropReference() { - if (0 != mReferenceCounter) { - if (1 == atomic_post_dec(mReferenceCounter)) { - release(); - } - } -} - -template -ObjectType* SharedPtr::get() const { - return mObject; -} - -template -inline bool SharedPtr::valid() const { - if (mReferenceCounter && (0 < *mReferenceCounter)) { - return (mObject != NULL); - } - return false; -} - -} // namespace utils - -#endif // SRC_COMPONENTS_INCLUDE_UTILS_SHARED_PTR_H_ - -// vim: set ts=2 sw=2 et: diff --git a/src/components/include/utils/threads/message_loop_thread.h b/src/components/include/utils/threads/message_loop_thread.h index 15023f02dd..add7fc38b8 100644 --- a/src/components/include/utils/threads/message_loop_thread.h +++ b/src/components/include/utils/threads/message_loop_thread.h @@ -40,7 +40,7 @@ #include "utils/macro.h" #include "utils/message_queue.h" #include "utils/threads/thread.h" -#include "utils/shared_ptr.h" + #include "utils/lock.h" namespace threads { diff --git a/src/components/media_manager/include/media_manager/media_adapter_impl.h b/src/components/media_manager/include/media_manager/media_adapter_impl.h index 75c48c98b7..37401f9c2b 100644 --- a/src/components/media_manager/include/media_manager/media_adapter_impl.h +++ b/src/components/media_manager/include/media_manager/media_adapter_impl.h @@ -40,7 +40,7 @@ namespace media_manager { -typedef utils::SharedPtr MediaListenerPtr; +typedef std::shared_ptr MediaListenerPtr; class MediaAdapterImpl : public MediaAdapter { public: @@ -57,7 +57,7 @@ class MediaAdapterImpl : public MediaAdapter { DISALLOW_COPY_AND_ASSIGN(MediaAdapterImpl); }; -typedef utils::SharedPtr MediaAdapterImplPtr; +typedef std::shared_ptr MediaAdapterImplPtr; } // namespace media_manager diff --git a/src/components/media_manager/include/media_manager/media_manager_impl.h b/src/components/media_manager/include/media_manager/media_manager_impl.h index 7fbd4f2f6f..749356e656 100644 --- a/src/components/media_manager/include/media_manager/media_manager_impl.h +++ b/src/components/media_manager/include/media_manager/media_manager_impl.h @@ -86,10 +86,10 @@ class MediaManagerImpl : public MediaManager, void set_mock_mic_listener(MediaListenerPtr media_listener); void set_mock_mic_recorder(MediaAdapterImpl* media_adapter); void set_mock_streamer(protocol_handler::ServiceType stype, - ::utils::SharedPtr mock_stream); + std::shared_ptr mock_stream); void set_mock_streamer_listener( protocol_handler::ServiceType stype, - ::utils::SharedPtr mock_stream); + std::shared_ptr mock_stream); #endif // BUILD_TESTS protected: diff --git a/src/components/media_manager/include/media_manager/streamer_adapter.h b/src/components/media_manager/include/media_manager/streamer_adapter.h index 5ac8e05cac..997d602cfe 100644 --- a/src/components/media_manager/include/media_manager/streamer_adapter.h +++ b/src/components/media_manager/include/media_manager/streamer_adapter.h @@ -38,7 +38,7 @@ #include "utils/threads/thread.h" #include "utils/threads/thread_delegate.h" #include "utils/atomic_object.h" -#include "utils/shared_ptr.h" + #include "protocol/raw_message.h" namespace media_manager { @@ -96,7 +96,7 @@ class StreamerAdapter : public MediaAdapterImpl { DISALLOW_COPY_AND_ASSIGN(StreamerAdapter); }; -typedef utils::SharedPtr StreamerAdapterPtr; +typedef std::shared_ptr StreamerAdapterPtr; } // namespace media_manager diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc index 1aacbe4c28..e1b932b611 100644 --- a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc +++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc @@ -145,7 +145,7 @@ void AudioStreamSenderThread::SendAudioPassThroughNotification( data.binary_data = binary_data; smart_objects::SmartObjectSPtr on_audio_pass = - new smart_objects::SmartObject(); + std::make_shared(); if (!on_audio_pass) { LOG4CXX_ERROR(logger_, "OnAudioPassThru NULL pointer"); diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc index 6a9ded9029..1a95227461 100644 --- a/src/components/media_manager/src/media_manager_impl.cc +++ b/src/components/media_manager/src/media_manager_impl.cc @@ -98,13 +98,13 @@ void MediaManagerImpl::set_mock_mic_recorder(MediaAdapterImpl* media_adapter) { void MediaManagerImpl::set_mock_streamer( protocol_handler::ServiceType stype, - ::utils::SharedPtr mock_stream) { + std::shared_ptr mock_stream) { streamer_[stype] = mock_stream; } void MediaManagerImpl::set_mock_streamer_listener( protocol_handler::ServiceType stype, - ::utils::SharedPtr mock_stream) { + std::shared_ptr mock_stream) { streamer_listener_[stype] = mock_stream; } @@ -116,33 +116,33 @@ void MediaManagerImpl::Init() { #if defined(EXTENDED_MEDIA_MODE) LOG4CXX_INFO(logger_, "Called Init with default configuration."); - from_mic_recorder_ = new FromMicRecorderAdapter(); + from_mic_recorder_ = std::make_shared(); #endif if ("socket" == settings().video_server_type()) { - streamer_[ServiceType::kMobileNav] = new SocketVideoStreamerAdapter( + streamer_[ServiceType::kMobileNav]= std::make_shared( settings().server_address(), settings().video_streaming_port()); } else if ("pipe" == settings().video_server_type()) { - streamer_[ServiceType::kMobileNav] = new PipeVideoStreamerAdapter( + streamer_[ServiceType::kMobileNav]= std::make_shared( settings().named_video_pipe_path(), settings().app_storage_folder()); } else if ("file" == settings().video_server_type()) { - streamer_[ServiceType::kMobileNav] = new FileVideoStreamerAdapter( + streamer_[ServiceType::kMobileNav]= std::make_shared( settings().video_stream_file(), settings().app_storage_folder()); } if ("socket" == settings().audio_server_type()) { - streamer_[ServiceType::kAudio] = new SocketAudioStreamerAdapter( + streamer_[ServiceType::kAudio]= std::make_shared( settings().server_address(), settings().audio_streaming_port()); } else if ("pipe" == settings().audio_server_type()) { - streamer_[ServiceType::kAudio] = new PipeAudioStreamerAdapter( + streamer_[ServiceType::kAudio]= std::make_shared( settings().named_audio_pipe_path(), settings().app_storage_folder()); } else if ("file" == settings().audio_server_type()) { - streamer_[ServiceType::kAudio] = new FileAudioStreamerAdapter( + streamer_[ServiceType::kAudio]= std::make_shared( settings().audio_stream_file(), settings().app_storage_folder()); } - streamer_listener_[ServiceType::kMobileNav] = new StreamerListener(*this); - streamer_listener_[ServiceType::kAudio] = new StreamerListener(*this); + streamer_listener_[ServiceType::kMobileNav] = std::make_shared(*this); + streamer_listener_[ServiceType::kAudio] = std::make_shared(*this); if (streamer_[ServiceType::kMobileNav]) { streamer_[ServiceType::kMobileNav]->AddListener( @@ -188,7 +188,7 @@ void MediaManagerImpl::StartMicrophoneRecording(int32_t application_key, file_path += "/"; file_path += output_file; from_mic_listener_ = - new FromMicRecorderListener(file_path, application_manager_); + std::make_shared(file_path, application_manager_); #ifdef EXTENDED_MEDIA_MODE if (from_mic_recorder_) { from_mic_recorder_->AddListener(from_mic_listener_); diff --git a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h index 80b2ee3377..6c5bd7b7b9 100644 --- a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h +++ b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h @@ -45,9 +45,9 @@ using namespace media_manager; class MockMediaAdapterImpl : public ::media_manager::MediaAdapterImpl { public: MOCK_METHOD1(AddListener, - void(const utils::SharedPtr&)); + void(const std::shared_ptr&)); MOCK_METHOD1(RemoveListener, - void(const utils::SharedPtr&)); + void(const std::shared_ptr&)); MOCK_METHOD2(SendData, void(int32_t application_key, const ::protocol_handler::RawMessagePtr message)); diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc index a9dc27d7a3..eae7bda680 100644 --- a/src/components/media_manager/test/media_manager_impl_test.cc +++ b/src/components/media_manager/test/media_manager_impl_test.cc @@ -44,8 +44,8 @@ #include "application_manager/state_controller.h" #include "protocol_handler/mock_protocol_handler.h" #include "protocol/common.h" -#include "utils/make_shared.h" -#include "utils/shared_ptr.h" + + #include "utils/file_system.h" #include "utils/scope_guard.h" @@ -58,7 +58,7 @@ using namespace ::media_manager; using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -using ::utils::SharedPtr; + using ::utils::ScopeGuard; using ::utils::MakeGuard; using ::testing::NiceMock; @@ -99,20 +99,20 @@ void dealloc_file(std::ofstream* test_file) { } // namespace typedef NiceMock MockApp; -typedef SharedPtr MockAppPtr; -typedef SharedPtr MockMediaAdapterImplPtr; +typedef std::shared_ptr MockAppPtr; +typedef std::shared_ptr MockMediaAdapterImplPtr; class MediaManagerImplTest : public ::testing::Test { public: // media_adapter_mock_ will be deleted in media_manager_impl (dtor) MediaManagerImplTest() : media_adapter_mock_(new MockMediaAdapter()) { media_adapter_listener_mock_ = - utils::MakeShared(); + std::make_shared(); ON_CALL(mock_media_manager_settings_, video_server_type()) .WillByDefault(ReturnRef(kDefaultValue)); ON_CALL(mock_media_manager_settings_, audio_server_type()) .WillByDefault(ReturnRef(kDefaultValue)); - mock_app_ = ::utils::MakeShared(); + mock_app_ = std::make_shared(); media_manager_impl_.reset( new MediaManagerImpl(app_mngr_, mock_media_manager_settings_)); } @@ -181,7 +181,7 @@ class MediaManagerImplTest : public ::testing::Test { .WillOnce(Return(mock_app_)); EXPECT_CALL(*mock_app_, WakeUpStreaming(service_type)); MockMediaAdapterImplPtr mock_media_streamer = - utils::MakeShared(); + std::make_shared(); media_manager_impl_->set_mock_streamer(service_type, mock_media_streamer); media_manager_impl_->set_mock_streamer_listener( service_type, media_adapter_listener_mock_); @@ -204,11 +204,11 @@ class MediaManagerImplTest : public ::testing::Test { application_manager_test::MockApplicationManager app_mngr_; MockAppPtr mock_app_; - SharedPtr media_adapter_listener_mock_; + std::shared_ptr media_adapter_listener_mock_; MockMediaAdapter* media_adapter_mock_; const ::testing::NiceMock mock_media_manager_settings_; - SharedPtr media_manager_impl_; + std::shared_ptr media_manager_impl_; }; TEST_F(MediaManagerImplTest, @@ -375,11 +375,11 @@ TEST_F(MediaManagerImplTest, StopMicrophoneRecording_SUCCESS) { TEST_F(MediaManagerImplTest, StartStopStreaming_AudioAndVideoServiceType_SUCCESS) { MockMediaAdapterImplPtr mock_audio_media_streamer = - utils::MakeShared(); + std::make_shared(); media_manager_impl_->set_mock_streamer(ServiceType::kAudio, mock_audio_media_streamer); MockMediaAdapterImplPtr mock_nav_media_streamer = - utils::MakeShared(); + std::make_shared(); media_manager_impl_->set_mock_streamer(ServiceType::kMobileNav, mock_nav_media_streamer); diff --git a/src/components/policy/policy_external/include/policy/access_remote_impl.h b/src/components/policy/policy_external/include/policy/access_remote_impl.h index 0fa53b0237..cee2a8774f 100644 --- a/src/components/policy/policy_external/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_external/include/policy/access_remote_impl.h @@ -35,7 +35,7 @@ #include #include "policy/policy_table/types.h" #include "utils/macro.h" -#include "utils/shared_ptr.h" + #include "policy/access_remote.h" #include "policy/cache_manager.h" @@ -46,7 +46,7 @@ namespace policy { class AccessRemoteImpl : public AccessRemote { public: AccessRemoteImpl(); - explicit AccessRemoteImpl(utils::SharedPtr cache); + explicit AccessRemoteImpl(std::shared_ptr cache); /** * @brief CheckModuleType check if module type is allowed for application * @param app_id application id @@ -144,7 +144,7 @@ class AccessRemoteImpl : public AccessRemote { /** * @brief cache_ contains pointer to cache manager instance */ - utils::SharedPtr cache_; + std::shared_ptr cache_; /** * @brief hmi_types_ contains list of default HMI types for applications diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index f41ddb14cd..36ddaf0415 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -35,7 +35,7 @@ #include -#include "utils/shared_ptr.h" + #include "policy/pt_representation.h" #include "policy/pt_ext_representation.h" #include "policy/usage_statistics/statistics_manager.h" @@ -232,7 +232,7 @@ class CacheManager : public CacheManagerInterface { * device_info, statistics, excluding user messages * @return Generated structure for obtaining Json string. */ - virtual utils::SharedPtr GenerateSnapshot(); + virtual std::shared_ptr GenerateSnapshot(); /** * Applies policy table to the current table @@ -720,7 +720,7 @@ class CacheManager : public CacheManagerInterface { void SetExternalConsentForApp(const PermissionConsent& permissions) OVERRIDE; #ifdef BUILD_TESTS - utils::SharedPtr GetPT() const { + std::shared_ptr GetPT() const { return pt_; } #endif @@ -782,10 +782,10 @@ class CacheManager : public CacheManagerInterface { policy::Permissions& permission); private: - utils::SharedPtr pt_; - utils::SharedPtr snapshot_; - utils::SharedPtr backup_; - utils::SharedPtr ex_backup_; + std::shared_ptr pt_; + std::shared_ptr snapshot_; + std::shared_ptr backup_; + std::shared_ptr ex_backup_; bool update_required; typedef std::set UnpairedDevices; UnpairedDevices is_unpaired_; diff --git a/src/components/policy/policy_external/include/policy/cache_manager_interface.h b/src/components/policy/policy_external/include/policy/cache_manager_interface.h index 1d74780f19..bb9ce14c7f 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_external/include/policy/cache_manager_interface.h @@ -38,7 +38,7 @@ #include "policy/policy_table/types.h" #include "policy/pt_representation.h" -#include "utils/shared_ptr.h" + #include "policy/usage_statistics/counter.h" #include "policy/policy_types.h" #include "policy/policy_settings.h" @@ -237,7 +237,7 @@ class CacheManagerInterface { * device_info, statistics, excluding user messages * @return Generated structure for obtaining Json string. */ - virtual utils::SharedPtr GenerateSnapshot() = 0; + virtual std::shared_ptr GenerateSnapshot() = 0; /** * Applies policy table to the current table @@ -823,16 +823,16 @@ class CacheManagerInterface { #ifdef BUILD_TESTS /** - * @brief GetPT allows to obtain SharedPtr to PT. + * @brief GetPT allows to obtain std::shared_ptr to PT. * Used ONLY in Unit tests - * @return SharedPTR to PT + * @return std::shared_ptr to PT * */ - virtual utils::SharedPtr GetPT() const = 0; + virtual std::shared_ptr GetPT() const = 0; #endif }; -typedef utils::SharedPtr CacheManagerInterfaceSPtr; +typedef std::shared_ptr CacheManagerInterfaceSPtr; } // namespace policy diff --git a/src/components/policy/policy_external/include/policy/policy_helper.h b/src/components/policy/policy_external/include/policy/policy_helper.h index e399b44719..e446c0b2e3 100644 --- a/src/components/policy/policy_external/include/policy/policy_helper.h +++ b/src/components/policy/policy_external/include/policy/policy_helper.h @@ -34,7 +34,7 @@ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_HELPER_H_ #include "policy/policy_table/functions.h" -#include "utils/shared_ptr.h" + #include "policy/policy_types.h" namespace policy { @@ -85,8 +85,8 @@ bool operator!=(const policy_table::ApplicationParams& first, */ struct CheckAppPolicy { CheckAppPolicy(PolicyManagerImpl* pm, - const utils::SharedPtr update, - const utils::SharedPtr snapshot, + const std::shared_ptr update, + const std::shared_ptr snapshot, CheckAppPolicyResults& out_results); bool operator()(const AppPoliciesValueType& app_policy); @@ -202,8 +202,8 @@ struct CheckAppPolicy { private: PolicyManagerImpl* pm_; - const utils::SharedPtr update_; - const utils::SharedPtr snapshot_; + const std::shared_ptr update_; + const std::shared_ptr snapshot_; CheckAppPolicyResults& out_results_; }; diff --git a/src/components/policy/policy_external/include/policy/policy_manager_impl.h b/src/components/policy/policy_external/include/policy/policy_manager_impl.h index 67756c053d..3837dda1fa 100644 --- a/src/components/policy/policy_external/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_external/include/policy/policy_manager_impl.h @@ -34,7 +34,7 @@ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_MANAGER_IMPL_H_ #include -#include "utils/shared_ptr.h" + #include "utils/lock.h" #include "policy/policy_manager.h" #include "policy/policy_table.h" @@ -472,7 +472,7 @@ class PolicyManagerImpl : public PolicyManager { * @brief Setter for access_remote instance * @param access_remote pointer to new access_remote instance */ - void set_access_remote(utils::SharedPtr access_remote) OVERRIDE; + void set_access_remote(std::shared_ptr access_remote) OVERRIDE; /** * @brief Sends notification about application HMI level changed @@ -717,7 +717,7 @@ class PolicyManagerImpl : public PolicyManager { * @param pt_content binary content of PT * @return pointer to converted PT */ - virtual utils::SharedPtr Parse( + virtual std::shared_ptr Parse( const BinaryMessage& pt_content); private: @@ -736,8 +736,8 @@ class PolicyManagerImpl : public PolicyManager { * @return Collection per-application results */ CheckAppPolicyResults CheckPermissionsChanges( - const utils::SharedPtr update, - const utils::SharedPtr snapshot); + const std::shared_ptr update, + const std::shared_ptr snapshot); /** * @brief Processes results from policy table update analysis done by @@ -860,7 +860,7 @@ class PolicyManagerImpl : public PolicyManager { * @param type policy table type * @return true if policy table valid, otherwise false */ - bool IsPTValid(utils::SharedPtr policy_table, + bool IsPTValid(std::shared_ptr policy_table, policy_table::PolicyTableType type) const; /** @@ -1017,7 +1017,7 @@ class PolicyManagerImpl : public PolicyManager { /** * @brief pointer to AccessRemote instance for working with RC applications */ - utils::SharedPtr access_remote_; + std::shared_ptr access_remote_; /** * @brief lock guard for protecting applications list access diff --git a/src/components/policy/policy_external/include/policy/policy_table.h b/src/components/policy/policy_external/include/policy/policy_table.h index ecbd56c2e4..27f4cc33a2 100644 --- a/src/components/policy/policy_external/include/policy/policy_table.h +++ b/src/components/policy/policy_external/include/policy/policy_table.h @@ -33,7 +33,7 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_ -#include "utils/shared_ptr.h" + #include "policy/pt_representation.h" #include "policy/pt_ext_representation.h" @@ -42,7 +42,7 @@ namespace policy { class PolicyTable { public: PolicyTable(); - explicit PolicyTable(utils::SharedPtr pt_data); + explicit PolicyTable(std::shared_ptr pt_data); virtual ~PolicyTable(); /** @@ -50,12 +50,12 @@ class PolicyTable { * actual class storing policy table. * @return PTRepresentation* Policy Table Content Handler */ - utils::SharedPtr pt_data() const { + std::shared_ptr pt_data() const { return pt_data_; } private: - utils::SharedPtr pt_data_; + std::shared_ptr pt_data_; }; } // namespace policy diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h index 9682b3d58d..078595e8b1 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -39,7 +39,7 @@ #include #include #include -#include "utils/shared_ptr.h" + #include "utils/helpers.h" #include "transport_manager/common.h" @@ -79,7 +79,7 @@ enum PolicyTableStatus { // Code generator uses String class name, so this typedef was renamed to PTSring typedef std::string PTString; typedef std::vector BinaryMessage; -typedef utils::SharedPtr BinaryMessageSptr; +typedef std::shared_ptr BinaryMessageSptr; typedef std::string HMILevel; typedef std::string Parameter; diff --git a/src/components/policy/policy_external/include/policy/pt_representation.h b/src/components/policy/policy_external/include/policy/pt_representation.h index 66a9218771..f25fcc6cab 100644 --- a/src/components/policy/policy_external/include/policy/pt_representation.h +++ b/src/components/policy/policy_external/include/policy/pt_representation.h @@ -213,7 +213,7 @@ class PTRepresentation { * device_info, statistics, excluding user messages * @return Generated structure for obtaining Json string. */ - virtual utils::SharedPtr GenerateSnapshot() const = 0; + virtual std::shared_ptr GenerateSnapshot() const = 0; virtual bool Save(const policy_table::Table& table) = 0; diff --git a/src/components/policy/policy_external/include/policy/sql_pt_representation.h b/src/components/policy/policy_external/include/policy/sql_pt_representation.h index d56f6aeba2..13816eb6c5 100644 --- a/src/components/policy/policy_external/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_external/include/policy/sql_pt_representation.h @@ -85,7 +85,7 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool Clear(); bool Drop(); virtual void WriteDb(); - virtual utils::SharedPtr GenerateSnapshot() const; + virtual std::shared_ptr GenerateSnapshot() const; virtual bool Save(const policy_table::Table& table); bool GetInitialAppData(const std::string& app_id, StringArray* nicknames = NULL, diff --git a/src/components/policy/policy_external/include/policy/update_status_manager.h b/src/components/policy/policy_external/include/policy/update_status_manager.h index b663610a5b..cdd1225ef7 100644 --- a/src/components/policy/policy_external/include/policy/update_status_manager.h +++ b/src/components/policy/policy_external/include/policy/update_status_manager.h @@ -66,14 +66,14 @@ class UpdateStatusManager { * @brief Set next status during event processing * @param status Status shared pointer */ - void SetNextStatus(utils::SharedPtr status); + void SetNextStatus(std::shared_ptr status); /** * @brief Set postponed status (will be set after next status) during event * processing * @param status Status shared pointer */ - void SetPostponedStatus(utils::SharedPtr status); + void SetPostponedStatus(std::shared_ptr status); /** * @brief Sets listener pointer @@ -199,17 +199,17 @@ class UpdateStatusManager { /** * @brief Current update status */ - utils::SharedPtr current_status_; + std::shared_ptr current_status_; /** * @brief Next status after current to be set */ - utils::SharedPtr next_status_; + std::shared_ptr next_status_; /** * @brief Status to be set after 'next' status */ - utils::SharedPtr postponed_status_; + std::shared_ptr postponed_status_; sync_primitives::Lock status_lock_; UpdateEvent last_processed_event_; diff --git a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h index adaef0eb28..c145bb432b 100644 --- a/src/components/policy/policy_external/include/policy/usage_statistics/counter.h +++ b/src/components/policy/policy_external/include/policy/usage_statistics/counter.h @@ -36,7 +36,7 @@ #include #include "policy/usage_statistics/statistics_manager.h" #include "policy/usage_statistics/app_stopwatch.h" -#include "utils/shared_ptr.h" + #include "utils/timer.h" #include "utils/macro.h" @@ -46,18 +46,18 @@ using timer::Timer; class GlobalCounter { public: - GlobalCounter(utils::SharedPtr statistics_manager, + GlobalCounter(std::shared_ptr statistics_manager, GlobalCounterId counter_type); void operator++() const; private: GlobalCounterId counter_type_; - utils::SharedPtr statistics_manager_; + std::shared_ptr statistics_manager_; }; class AppCounter { public: - AppCounter(utils::SharedPtr statistics_manager, + AppCounter(std::shared_ptr statistics_manager, const std::string& app_id, AppCounterId counter_type); void operator++() const; @@ -65,12 +65,12 @@ class AppCounter { private: std::string app_id_; AppCounterId counter_type_; - utils::SharedPtr statistics_manager_; + std::shared_ptr statistics_manager_; }; class AppInfo { public: - AppInfo(utils::SharedPtr statistics_manager, + AppInfo(std::shared_ptr statistics_manager, const std::string& app_id, AppInfoId info_type); void Update(const std::string& new_info) const; @@ -78,14 +78,14 @@ class AppInfo { private: std::string app_id_; AppInfoId info_type_; - utils::SharedPtr statistics_manager_; + std::shared_ptr statistics_manager_; }; class AppStopwatchImpl : public AppStopwatch { public: - AppStopwatchImpl(utils::SharedPtr statistics_manager, + AppStopwatchImpl(std::shared_ptr statistics_manager, const std::string& app_id); - AppStopwatchImpl(utils::SharedPtr statistics_manager, + AppStopwatchImpl(std::shared_ptr statistics_manager, const std::string& app_id, std::uint32_t timeout); ~AppStopwatchImpl(); @@ -97,7 +97,7 @@ class AppStopwatchImpl : public AppStopwatch { // Fields std::string app_id_; AppStopwatchId stopwatch_type_; - utils::SharedPtr statistics_manager_; + std::shared_ptr statistics_manager_; timer::Timer timer_; const std::uint32_t time_out_; DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl); diff --git a/src/components/policy/policy_external/src/access_remote_impl.cc b/src/components/policy/policy_external/src/access_remote_impl.cc index d042d8c402..26c8c5e38e 100644 --- a/src/components/policy/policy_external/src/access_remote_impl.cc +++ b/src/components/policy/policy_external/src/access_remote_impl.cc @@ -89,7 +89,7 @@ struct ToModuleType { AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {} -AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) +AccessRemoteImpl::AccessRemoteImpl(std::shared_ptr cache) : cache_(cache) {} bool AccessRemoteImpl::CheckModuleType(const PTString& app_id, diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 00bb1e4a1c..b30ed3c224 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1627,8 +1627,8 @@ void CacheManager::CheckSnapshotInitialization() { void CacheManager::PersistData() { LOG4CXX_AUTO_TRACE(logger_); - if (backup_.valid()) { - if (pt_.valid()) { + if (backup_.use_count() != 0) { + if (pt_.use_count() != 0) { // Comma expression is used to hold the lock only during the constructor // call policy_table::Table copy_pt( @@ -1670,7 +1670,7 @@ void CacheManager::PersistData() { } // In case of extended policy the meta info should be backuped as well. - if (ex_backup_.valid()) { + if (ex_backup_.use_count() != 0) { ex_backup_->SetMetaInfo( *(*copy_pt.policy_table.module_meta).ccpu_version, *(*copy_pt.policy_table.module_meta).wers_country_code, @@ -1750,7 +1750,7 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id, return false; } -utils::SharedPtr CacheManager::GenerateSnapshot() { +std::shared_ptr CacheManager::GenerateSnapshot() { CACHE_MANAGER_CHECK(snapshot_); snapshot_ = new policy_table::Table(); sync_primitives::AutoLock auto_lock(cache_lock_); @@ -2237,7 +2237,7 @@ bool CacheManager::Init(const std::string& file_name, LOG4CXX_AUTO_TRACE(logger_); settings_ = settings; InitResult init_result = backup_->Init(settings); - ex_backup_ = utils::SharedPtr::dynamic_pointer_cast< + ex_backup_ = std::dynamic_pointer_cast< PTExtRepresentation>(backup_); bool result = true; @@ -2261,7 +2261,7 @@ bool CacheManager::Init(const std::string& file_name, case InitResult::SUCCESS: { LOG4CXX_INFO(logger_, "Policy Table was inited successfully"); result = LoadFromFile(file_name, *pt_); - utils::SharedPtr snapshot = GenerateSnapshot(); + std::shared_ptr snapshot = GenerateSnapshot(); result &= snapshot->is_valid(); LOG4CXX_DEBUG(logger_, diff --git a/src/components/policy/policy_external/src/policy_helper.cc b/src/components/policy/policy_external/src/policy_helper.cc index 39b9399c24..ed12cdde3a 100644 --- a/src/components/policy/policy_external/src/policy_helper.cc +++ b/src/components/policy/policy_external/src/policy_helper.cc @@ -122,8 +122,8 @@ bool operator!=(const policy_table::ApplicationParams& first, CheckAppPolicy::CheckAppPolicy( PolicyManagerImpl* pm, - const utils::SharedPtr update, - const utils::SharedPtr snapshot, + const std::shared_ptr update, + const std::shared_ptr snapshot, CheckAppPolicyResults& out_results) : pm_(pm) , update_(update) diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 4ac66c0d53..c75d14a67a 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -49,7 +49,7 @@ #include "policy/cache_manager.h" #include "policy/update_status_manager.h" #include "config_profile/profile.h" -#include "utils/make_shared.h" + #include "policy/access_remote.h" #include "policy/access_remote_impl.h" @@ -214,7 +214,7 @@ PolicyManagerImpl::PolicyManagerImpl() , listener_(NULL) , cache_(new CacheManager) , access_remote_(new AccessRemoteImpl( - CacheManagerInterfaceSPtr::static_pointer_cast(cache_))) + std::static_pointer_cast(cache_))) , retry_sequence_timeout_(60) , retry_sequence_index_(0) , ignition_check(true) @@ -225,7 +225,7 @@ PolicyManagerImpl::PolicyManagerImpl(bool in_memory) , listener_(NULL) , cache_(new CacheManager(in_memory)) , access_remote_(new AccessRemoteImpl( - CacheManagerInterfaceSPtr::static_pointer_cast(cache_))) + std::static_pointer_cast(cache_))) , retry_sequence_timeout_(60) , retry_sequence_index_(0) , ignition_check(true) @@ -239,7 +239,7 @@ void PolicyManagerImpl::set_listener(PolicyListener* listener) { update_status_manager_.set_listener(listener); } -utils::SharedPtr PolicyManagerImpl::Parse( +std::shared_ptr PolicyManagerImpl::Parse( const BinaryMessage& pt_content) { std::string json(pt_content.begin(), pt_content.end()); Json::Value value; @@ -247,7 +247,7 @@ utils::SharedPtr PolicyManagerImpl::Parse( if (reader.parse(json.c_str(), value)) { return new policy_table::Table(&value); } else { - return utils::SharedPtr(); + return std::shared_ptr(); } } @@ -279,7 +279,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, "PTU content is: " << std::string(pt_content.begin(), pt_content.end())); // Parse message into table struct - utils::SharedPtr pt_update = Parse(pt_content); + std::shared_ptr pt_update = Parse(pt_content); if (!pt_update) { LOG4CXX_WARN(logger_, "Parsed table pointer is NULL."); update_status_manager_.OnWrongUpdateReceived(); @@ -301,7 +301,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, sync_primitives::AutoLock lock(apps_registration_lock_); // Get current DB data, since it could be updated during awaiting of PTU - utils::SharedPtr policy_table_snapshot = + std::shared_ptr policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { LOG4CXX_ERROR( @@ -363,8 +363,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, } CheckAppPolicyResults PolicyManagerImpl::CheckPermissionsChanges( - const utils::SharedPtr pt_update, - const utils::SharedPtr snapshot) { + const std::shared_ptr pt_update, + const std::shared_ptr snapshot) { LOG4CXX_INFO(logger_, "Checking incoming permissions."); // Replace predefined policies with its actual setting, e.g. "123":"default" @@ -468,7 +468,7 @@ void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type, void PolicyManagerImpl::RequestPTUpdate() { LOG4CXX_AUTO_TRACE(logger_); - utils::SharedPtr policy_table_snapshot = + std::shared_ptr policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table"); @@ -1276,7 +1276,7 @@ bool PolicyManagerImpl::ExceededIgnitionCycles() { } bool PolicyManagerImpl::IsPTValid( - utils::SharedPtr policy_table, + std::shared_ptr policy_table, policy_table::PolicyTableType type) const { policy_table->SetPolicyTableType(type); if (!policy_table->is_valid()) { @@ -1367,7 +1367,7 @@ void PolicyManagerImpl::SendPermissionsToApp( Permissions notification_data; // Need to get rid of this call - utils::SharedPtr policy_table_snapshot = + std::shared_ptr policy_table_snapshot = cache_->GenerateSnapshot(); PrepareNotificationData( @@ -1775,11 +1775,11 @@ StatusNotifier PolicyManagerImpl::AddApplication( sync_primitives::AutoLock lock(apps_registration_lock_); if (IsNewApplication(application_id)) { AddNewApplication(application_id, device_consent); - return utils::MakeShared(update_status_manager_, + return std::make_shared(update_status_manager_, device_consent); } else { PromoteExistedApplication(application_id, device_consent); - return utils::MakeShared(); + return std::make_shared(); } } @@ -2024,7 +2024,7 @@ bool PolicyManagerImpl::GetModuleTypes( } void PolicyManagerImpl::set_access_remote( - utils::SharedPtr access_remote) { + std::shared_ptr access_remote) { access_remote_ = access_remote; } diff --git a/src/components/policy/policy_external/src/policy_table.cc b/src/components/policy/policy_external/src/policy_table.cc index 7a63fac50d..8ca6b698d1 100644 --- a/src/components/policy/policy_external/src/policy_table.cc +++ b/src/components/policy/policy_external/src/policy_table.cc @@ -42,7 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy") PolicyTable::PolicyTable() : pt_data_(new SQLPTExtRepresentation()) {} -PolicyTable::PolicyTable(utils::SharedPtr pt_data) +PolicyTable::PolicyTable(std::shared_ptr pt_data) : pt_data_(pt_data) {} PolicyTable::~PolicyTable() { diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 3cd7388672..47a7cb6623 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -513,10 +513,10 @@ bool SQLPTRepresentation::RefreshDB() { return true; } -utils::SharedPtr SQLPTRepresentation::GenerateSnapshot() +std::shared_ptr SQLPTRepresentation::GenerateSnapshot() const { LOG4CXX_AUTO_TRACE(logger_); - utils::SharedPtr table = new policy_table::Table(); + std::shared_ptr table = new policy_table::Table(); GatherModuleMeta(&*table->policy_table.module_meta); GatherModuleConfig(&table->policy_table.module_config); GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts); diff --git a/src/components/policy/policy_external/src/status.cc b/src/components/policy/policy_external/src/status.cc index 31fc7f110b..34f65339c1 100644 --- a/src/components/policy/policy_external/src/status.cc +++ b/src/components/policy/policy_external/src/status.cc @@ -32,7 +32,7 @@ #include "policy/status.h" #include "policy/update_status_manager.h" -#include "utils/make_shared.h" + policy::UpToDateStatus::UpToDateStatus() : Status(kUpToDate, policy::PolicyTableStatus::StatusUpToDate) {} @@ -45,7 +45,7 @@ void policy::UpToDateStatus::ProcessEvent(UpdateStatusManager* manager, case kScheduleUpdate: case kScheduleManualUpdate: case kOnResetRetrySequence: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; default: break; @@ -59,14 +59,14 @@ void policy::UpdateNeededStatus::ProcessEvent( policy::UpdateStatusManager* manager, policy::UpdateEvent event) { switch (event) { case kOnUpdateSentOut: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; case kOnResetPolicyTableRequireUpdate: - manager->SetNextStatus(utils::MakeShared()); - manager->SetPostponedStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); + manager->SetPostponedStatus(std::make_shared()); break; case kOnResetPolicyTableNoUpdate: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; default: break; @@ -85,23 +85,23 @@ void policy::UpdatingStatus::ProcessEvent(policy::UpdateStatusManager* manager, switch (event) { case kOnValidUpdateReceived: case kOnResetPolicyTableNoUpdate: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; case kOnNewAppRegistered: - manager->SetPostponedStatus(utils::MakeShared()); + manager->SetPostponedStatus(std::make_shared()); break; case kOnWrongUpdateReceived: case kOnUpdateTimeout: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; case kOnResetPolicyTableRequireUpdate: - manager->SetNextStatus(utils::MakeShared()); - manager->SetPostponedStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); + manager->SetPostponedStatus(std::make_shared()); break; case kScheduleUpdate: case kScheduleManualUpdate: case kOnResetRetrySequence: - manager->SetPostponedStatus(utils::MakeShared()); + manager->SetPostponedStatus(std::make_shared()); break; default: break; diff --git a/src/components/policy/policy_external/src/update_status_manager.cc b/src/components/policy/policy_external/src/update_status_manager.cc index 087db1149b..aee22a3b0c 100644 --- a/src/components/policy/policy_external/src/update_status_manager.cc +++ b/src/components/policy/policy_external/src/update_status_manager.cc @@ -33,7 +33,7 @@ #include "policy/update_status_manager.h" #include "policy/policy_listener.h" #include "utils/logger.h" -#include "utils/make_shared.h" + namespace policy { @@ -41,7 +41,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy") UpdateStatusManager::UpdateStatusManager() : listener_(NULL) - , current_status_(utils::MakeShared()) + , current_status_(std::make_shared()) , last_processed_event_(kNoEvent) , apps_search_in_progress_(false) , app_registered_from_non_consented_device_(true) { @@ -67,11 +67,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) { DoTransition(); } -void UpdateStatusManager::SetNextStatus(utils::SharedPtr status) { +void UpdateStatusManager::SetNextStatus(std::shared_ptr status) { next_status_ = status; } -void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr status) { +void UpdateStatusManager::SetPostponedStatus(std::shared_ptr status) { postponed_status_ = status; } diff --git a/src/components/policy/policy_external/src/usage_statistics/counter.cc b/src/components/policy/policy_external/src/usage_statistics/counter.cc index 661ea29704..a7e8368239 100644 --- a/src/components/policy/policy_external/src/usage_statistics/counter.cc +++ b/src/components/policy/policy_external/src/usage_statistics/counter.cc @@ -36,13 +36,13 @@ #include #include "policy/usage_statistics/counter.h" #include "utils/date_time.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" namespace usage_statistics { GlobalCounter::GlobalCounter( - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, GlobalCounterId counter_type) : counter_type_(counter_type), statistics_manager_(statistics_manager) {} @@ -53,7 +53,7 @@ void GlobalCounter::operator++() const { } AppCounter::AppCounter( - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, const std::string& app_id, AppCounterId counter_type) : app_id_(app_id) @@ -67,7 +67,7 @@ void AppCounter::operator++() const { } AppInfo::AppInfo( - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, const std::string& app_id, AppInfoId info_type) : app_id_(app_id) @@ -81,7 +81,7 @@ void AppInfo::Update(const std::string& new_info) const { } AppStopwatchImpl::AppStopwatchImpl( - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, const std::string& app_id) : app_id_(app_id) , stopwatch_type_(SECONDS_HMI_NONE) @@ -92,7 +92,7 @@ AppStopwatchImpl::AppStopwatchImpl( , time_out_(60) {} AppStopwatchImpl::AppStopwatchImpl( - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, const std::string& app_id, uint32_t timeout) : app_id_(app_id) diff --git a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h index 995c63ed20..3870e4ece1 100644 --- a/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h +++ b/src/components/policy/policy_external/test/include/policy/mock_pt_representation.h @@ -78,7 +78,7 @@ class MockPTRepresentation : virtual public ::policy::PTRepresentation { MOCK_METHOD0(Close, bool()); MOCK_METHOD0(Clear, bool()); MOCK_METHOD0(Drop, bool()); - MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr()); + MOCK_CONST_METHOD0(GenerateSnapshot, std::shared_ptr()); MOCK_METHOD1(Save, bool(const policy_table::Table& table)); MOCK_CONST_METHOD0(UpdateRequired, bool()); MOCK_METHOD1(SaveUpdateRequired, void(bool value)); diff --git a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h index e753751308..23701e86de 100644 --- a/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h +++ b/src/components/policy/policy_external/test/include/policy/policy_manager_impl_test_base.h @@ -54,7 +54,7 @@ using ::policy::PolicyManagerImpl; typedef std::multimap UserConsentPromptToRpcsConnections; -typedef utils::SharedPtr PolicyTableSPtr; +typedef std::shared_ptr PolicyTableSPtr; namespace { const std::string kSdlPreloadedPtJson = "json/sdl_preloaded_pt.json"; @@ -203,7 +203,7 @@ class PolicyManagerImplTest2 : public ::testing::Test { void EmulatePTAppRevoked(const std::string& ptu_name); - utils::SharedPtr PreconditionForBasicValidateSnapshot(); + std::shared_ptr PreconditionForBasicValidateSnapshot(); template bool IsKeyExisted(const ParentType& parent, const Value& value) const { @@ -236,7 +236,7 @@ class PolicyManagerImplTest_RequestTypes : public ::testing::Test { const std::string app_storage_folder_; const std::string preloaded_pt_filename_; - utils::SharedPtr policy_manager_impl_sptr_; + std::shared_ptr policy_manager_impl_sptr_; NiceMock listener_; NiceMock policy_settings_; diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc index 947bb5d3ad..537e40e170 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc @@ -1092,7 +1092,7 @@ TEST_F(PolicyManagerImplTest2, // Arrange CreateLocalPT(preloaded_pt_filename_); GetPTU(kValidSdlPtUpdateJson); - utils::SharedPtr pt = + std::shared_ptr pt = (policy_manager_->GetCache())->GetPT(); policy_table::ModuleConfig& module_config = pt->policy_table.module_config; ::policy::VehicleInfo vehicle_info = policy_manager_->GetVehicleInfo(); @@ -1202,7 +1202,7 @@ TEST_F( HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) { // Arrange CreateLocalPT(preloaded_pt_filename_); - utils::SharedPtr pt = + std::shared_ptr pt = (policy_manager_->GetCache())->GetPT(); ::policy_table::PolicyTableType type1 = ::policy_table::PolicyTableType::PT_PRELOADED; @@ -1302,7 +1302,7 @@ TEST_F(PolicyManagerImplTest2, actual_groups_permissions[index].group_name); EXPECT_EQ(group1_perm.group_id, actual_groups_permissions[index].group_id); EXPECT_EQ(group1_perm.state, actual_groups_permissions[index].state); - utils::SharedPtr pt = + std::shared_ptr pt = (policy_manager_->GetCache())->GetPT(); uint32_t ucr_size = 0; ::policy_table::DeviceData& device_data = *pt->policy_table.device_data; diff --git a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc index e666ac82de..c1ff31f748 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_snapshot_test.cc @@ -84,7 +84,7 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) { EXPECT_TRUE(cache->IsPTPreloaded()); // Arrange - utils::SharedPtr table = cache->GenerateSnapshot(); + std::shared_ptr table = cache->GenerateSnapshot(); // Get FunctionalGroupings policy_table::FunctionalGroupings& fc = table->policy_table.functional_groupings; @@ -119,7 +119,7 @@ TEST_F(PolicyManagerImplTest2, // Arrange CreateLocalPT(preloaded_pt_filename_); policy_manager_->SetSystemLanguage("it-it"); - utils::SharedPtr pt = + std::shared_ptr pt = (policy_manager_->GetCache())->GetPT(); ::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta); EXPECT_EQ("it-it", static_cast(*(ModuleMeta.language))); @@ -130,7 +130,7 @@ TEST_F(PolicyManagerImplTest2, SetVINValue_ExpectVINSetSuccessfully) { CreateLocalPT(preloaded_pt_filename_); std::string vin_code("1FAPP6242VH100001"); policy_manager_->SetVINValue(vin_code); - utils::SharedPtr pt = + std::shared_ptr pt = (policy_manager_->GetCache())->GetPT(); ::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta); EXPECT_EQ(vin_code, static_cast(*(ModuleMeta.vin))); @@ -141,7 +141,7 @@ TEST_F(PolicyManagerImplTest2, SetSystemInfo_ExpectSystemInfoSetSuccessfully) { CreateLocalPT(preloaded_pt_filename_); policy_manager_->SetSystemInfo("4.1.3.B_EB355B", "WAEGB", "ru-ru"); policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache(); - utils::SharedPtr pt = cache->GetPT(); + std::shared_ptr pt = cache->GetPT(); ::policy_table::ModuleMeta& ModuleMeta = *(pt->policy_table.module_meta); EXPECT_EQ("ru-ru", static_cast(*(ModuleMeta.language))); EXPECT_EQ("4.1.3.B_EB355B", @@ -189,7 +189,7 @@ TEST_F(PolicyManagerImplTest2, CleanUnpairedDevice_ExpectDevicesDeleted) { policy_manager_->AddDevice("AAA123456789RRR", "Bluetooth"); policy_manager_->SetDeviceInfo("AAA123456789RRR", dev_info3); - utils::SharedPtr pt = + std::shared_ptr pt = (policy_manager_->GetCache())->GetPT(); // Try to find first device in PT policy_table::DeviceData::const_iterator iter = @@ -316,7 +316,7 @@ TEST_F(PolicyManagerImplTest2, AddDevice_RegisterDevice_TRUE) { const bool result = (policy_manager_->GetCache())->AddDevice(device_id_1_, connection_type); // Get Policy table - const utils::SharedPtr policy_table = + const std::shared_ptr policy_table = policy_manager_->GetCache()->GetPT(); // Get preloaded_pt flag from Policy table const bool is_preloaded_pt = diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc index f4e922e647..f049018848 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc @@ -37,8 +37,8 @@ #include #include "policy/policy_manager_impl_test_base.h" -#include "utils/make_shared.h" -#include "utils/shared_ptr.h" + + using ::testing::_; using ::testing::Return; @@ -148,7 +148,7 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) { std::string json = table.toStyledString(); ::policy::BinaryMessage msg(json.begin(), json.end()); - utils::SharedPtr snapshot = + std::shared_ptr snapshot = new policy_table::Table(update.policy_table); // Assert EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(snapshot)); @@ -236,8 +236,8 @@ TEST_F(PolicyManagerImplTest2, TimeOutExchange) { TEST_F(PolicyManagerImplTest, RequestPTUpdate_SetPT_GeneratedSnapshotAndPTUpdate) { Json::Value table = createPTforLoad(); - utils::SharedPtr p_table = - utils::MakeShared(&table); + std::shared_ptr p_table = + std::make_shared(&table); ASSERT_TRUE(p_table); p_table->SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE); EXPECT_TRUE(IsValid(*p_table)); @@ -249,8 +249,8 @@ TEST_F(PolicyManagerImplTest, } TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidPT_PTUpdateFail) { - utils::SharedPtr p_table = - utils::MakeShared(); + std::shared_ptr p_table = + std::make_shared(); ASSERT_TRUE(p_table); EXPECT_FALSE(IsValid(*p_table)); @@ -261,7 +261,7 @@ TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidPT_PTUpdateFail) { } TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidSnapshot_PTUpdateFail) { - utils::SharedPtr p_table; + std::shared_ptr p_table; EXPECT_FALSE(p_table); EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0); @@ -355,7 +355,7 @@ TEST_F( PreconditionExternalConsentPreparePTWithAppGroupsAndConsents(); - utils::SharedPtr pt = + std::shared_ptr pt = policy_manager_->GetCache()->GetPT(); // Checking groups consents before setting ExternalConsent status @@ -420,7 +420,7 @@ TEST_F( PreconditionExternalConsentPreparePTWithAppGroupsAndConsents(); // Act - utils::SharedPtr pt = + std::shared_ptr pt = policy_manager_->GetCache()->GetPT(); // Checking ExternalConsent consents before setting new ExternalConsent status @@ -484,7 +484,7 @@ TEST_F( PreconditionExternalConsentPreparePTWithAppPolicy(); // Act - utils::SharedPtr pt = + std::shared_ptr pt = policy_manager_->GetCache()->GetPT(); ExternalConsentStatus status; @@ -552,7 +552,7 @@ TEST_F( PreconditionExternalConsentPreparePTWithAppPolicy(); // Act - utils::SharedPtr pt = + std::shared_ptr pt = policy_manager_->GetCache()->GetPT(); ExternalConsentStatus status; @@ -634,7 +634,7 @@ TEST_F( HmiTypes(policy_table::AHT_DEFAULT)); // Act - utils::SharedPtr pt = + std::shared_ptr pt = policy_manager_->GetCache()->GetPT(); ExternalConsentStatus status; @@ -724,7 +724,7 @@ TEST_F( HmiTypes(policy_table::AHT_DEFAULT)); // Act - utils::SharedPtr pt = + std::shared_ptr pt = policy_manager_->GetCache()->GetPT(); ExternalConsentStatus status; @@ -818,7 +818,7 @@ TEST_F(PolicyManagerImplTest_ExternalConsent, policy_manager_->AddApplication(app_id_1_, HmiTypes(policy_table::AHT_DEFAULT)); - utils::SharedPtr pt = + std::shared_ptr pt = policy_manager_->GetCache()->GetPT(); // Check ExternalConsent consents for application @@ -943,7 +943,7 @@ TEST_F(PolicyManagerImplTest_ExternalConsent, policy_manager_->AddApplication(app_id_1_, HmiTypes(policy_table::AHT_DEFAULT)); - utils::SharedPtr pt = + std::shared_ptr pt = policy_manager_->GetCache()->GetPT(); // Check ExternalConsent consents for application @@ -1046,7 +1046,7 @@ TEST_F( PreconditionExternalConsentPreparePTWithAppGroupsAndConsents(); // Act - utils::SharedPtr pt = + std::shared_ptr pt = policy_manager_->GetCache()->GetPT(); // Checking ExternalConsent consents before setting new ExternalConsent status diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc index 48e86d24b7..86b7cdc9ef 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_test_base.cc @@ -38,7 +38,7 @@ #include "policy/policy_manager_impl_test_base.h" #include "utils/file_system.h" -#include "utils/make_shared.h" + #include "utils/gen_hash.h" #include "json/reader.h" @@ -414,7 +414,7 @@ void PolicyManagerImplTest2::GetFunctionalGroupingsFromManager( // Get cache ::policy::CacheManagerInterfaceSPtr cache = policy_manager_->GetCache(); // Get table_snapshot - utils::SharedPtr table = cache->GenerateSnapshot(); + std::shared_ptr table = cache->GenerateSnapshot(); // Set functional groupings from policy table input_functional_groupings = table->policy_table.functional_groupings; } @@ -639,7 +639,7 @@ void PolicyManagerImplTest_RequestTypes::SetUp() { file_system::CreateDirectory(app_storage_folder_); const bool in_memory = true; - policy_manager_impl_sptr_ = utils::MakeShared(in_memory); + policy_manager_impl_sptr_ = std::make_shared(in_memory); policy_manager_impl_sptr_->set_listener(&listener_); } diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc index 2f2162494f..404991c969 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc @@ -395,7 +395,7 @@ TEST_F(PolicyManagerImplTest2, uint32_t size = result.size(); EXPECT_GT(size, 0u); std::vector< ::policy::UserFriendlyMessage>::iterator result_iter; - utils::SharedPtr pt = + std::shared_ptr pt = (policy_manager_->GetCache())->GetPT(); policy_table::ConsumerFriendlyMessages& consumer_friendly_messages = @@ -456,7 +456,7 @@ TEST_F(PolicyManagerImplTest2, TEST_F(PolicyManagerImplTest2, SetDeviceInfo_ExpectDevInfoAddedToPT) { // Arrange ::policy::DeviceInfo dev_info; - utils::SharedPtr pt = + std::shared_ptr pt = (policy_manager_->GetCache())->GetPT(); dev_info.hardware = "hardware IPX"; dev_info.firmware_rev = "v.8.0.1"; diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc index 92525c646d..fc4b0ae7b0 100644 --- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc @@ -44,8 +44,8 @@ #include "rpc_base/rpc_base.h" #include "policy/policy_table/types.h" #include "policy/mock_policy_settings.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + using namespace ::policy; namespace policy_table = rpc::policy_table_interface_base; @@ -393,7 +393,7 @@ TEST_F(SQLPTExtRepresentationTest, ASSERT_TRUE(reps_->Save(update)); // Act - utils::SharedPtr snapshot = reps_->GenerateSnapshot(); + std::shared_ptr snapshot = reps_->GenerateSnapshot(); snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT); policy_table["module_meta"] = Json::Value(Json::objectValue); @@ -1506,7 +1506,7 @@ TEST_F(SQLPTExtRepresentationTest, SaveUserConsentRecords_ExpectedSaved) { // Act EXPECT_TRUE(reps_->Save(original_table)); - utils::SharedPtr loaded_table = reps_->GenerateSnapshot(); + std::shared_ptr
loaded_table = reps_->GenerateSnapshot(); // GetData/GetKeyData methods do internal existence check - no need to do it // separately. In case of data is missing expectations will be violated. @@ -1591,7 +1591,7 @@ TEST_F(SQLPTExtRepresentationTest, SaveFunctionalGroupings_ExpectedSaved) { // Act EXPECT_TRUE(reps_->Save(original_table)); - utils::SharedPtr
loaded_table = reps_->GenerateSnapshot(); + std::shared_ptr
loaded_table = reps_->GenerateSnapshot(); FunctionalGroupings loaded_groupings = GetData(*loaded_table); diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc index a5589cc904..bfcf9f2172 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc @@ -49,7 +49,7 @@ #include "policy/policy_table/enums.h" #include "rpc_base/rpc_base.h" #include "policy/mock_policy_settings.h" -#include "utils/shared_ptr.h" + namespace policy_table = rpc::policy_table_interface_base; using policy::SQLPTRepresentation; @@ -1585,7 +1585,7 @@ TEST_F(SQLPTRepresentationTest, ASSERT_TRUE(reps->Save(update)); // Act - utils::SharedPtr snapshot = reps->GenerateSnapshot(); + std::shared_ptr snapshot = reps->GenerateSnapshot(); snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT); // Remove fields which must be absent in snapshot table["policy_table"]["consumer_friendly_messages"].removeMember("messages"); diff --git a/src/components/policy/policy_external/test/update_status_manager_test.cc b/src/components/policy/policy_external/test/update_status_manager_test.cc index 5546984ff4..278c4fc43a 100644 --- a/src/components/policy/policy_external/test/update_status_manager_test.cc +++ b/src/components/policy/policy_external/test/update_status_manager_test.cc @@ -34,7 +34,7 @@ #include "policy/mock_policy_listener.h" #include "policy/policy_manager_impl.h" #include "policy/update_status_manager.h" -#include "utils/make_shared.h" + #include "utils/conditional_variable.h" namespace test { @@ -48,7 +48,7 @@ using testing::NiceMock; class UpdateStatusManagerTest : public ::testing::Test { protected: - utils::SharedPtr manager_; + std::shared_ptr manager_; PolicyTableStatus status_; const uint32_t k_timeout_; NiceMock listener_; @@ -58,7 +58,7 @@ class UpdateStatusManagerTest : public ::testing::Test { public: UpdateStatusManagerTest() - : manager_(utils::MakeShared()) + : manager_(std::make_shared()) , k_timeout_(1000) , listener_() , up_to_date_status_("UP_TO_DATE") diff --git a/src/components/policy/policy_regular/include/policy/access_remote_impl.h b/src/components/policy/policy_regular/include/policy/access_remote_impl.h index 933690dc49..dbe317667a 100644 --- a/src/components/policy/policy_regular/include/policy/access_remote_impl.h +++ b/src/components/policy/policy_regular/include/policy/access_remote_impl.h @@ -35,7 +35,7 @@ #include #include "policy/policy_table/types.h" #include "utils/macro.h" -#include "utils/shared_ptr.h" + #include "policy/access_remote.h" #include "policy/cache_manager.h" @@ -46,7 +46,7 @@ namespace policy { class AccessRemoteImpl : public AccessRemote { public: AccessRemoteImpl(); - explicit AccessRemoteImpl(utils::SharedPtr cache); + explicit AccessRemoteImpl(std::shared_ptr cache); /** * @brief CheckModuleType check if module type is allowed for application * @param app_id application id @@ -139,7 +139,7 @@ class AccessRemoteImpl : public AccessRemote { /** * @brief cache_ contains pointer to cache manager instance */ - utils::SharedPtr cache_; + std::shared_ptr cache_; /** * @brief hmi_types_ contains list of default HMI types for applications diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index 4a0a09db83..236722415f 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -35,7 +35,7 @@ #include -#include "utils/shared_ptr.h" + #include "policy/pt_representation.h" #include "policy/pt_ext_representation.h" #include "policy/usage_statistics/statistics_manager.h" @@ -216,7 +216,7 @@ class CacheManager : public CacheManagerInterface { * device_info, statistics, excluding user messages * @return Generated structure for obtaining Json string. */ - virtual utils::SharedPtr GenerateSnapshot(); + virtual std::shared_ptr GenerateSnapshot(); /** * Applies policy table to the current table @@ -723,7 +723,7 @@ class CacheManager : public CacheManagerInterface { const PolicySettings& get_settings() const; - utils::SharedPtr pt() const { + std::shared_ptr pt() const { return pt_; } @@ -775,9 +775,9 @@ class CacheManager : public CacheManagerInterface { policy::Permissions& permission); private: - utils::SharedPtr pt_; - utils::SharedPtr snapshot_; - utils::SharedPtr backup_; + std::shared_ptr pt_; + std::shared_ptr snapshot_; + std::shared_ptr backup_; bool update_required; typedef std::set UnpairedDevices; UnpairedDevices is_unpaired_; diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index 3dd2953865..ba6728c520 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -36,7 +36,7 @@ #include #include -#include "utils/shared_ptr.h" + #include "policy/usage_statistics/counter.h" #include "policy/policy_types.h" #include "policy/policy_settings.h" @@ -222,7 +222,7 @@ class CacheManagerInterface { * device_info, statistics, excluding user messages * @return Generated structure for obtaining Json string. */ - virtual utils::SharedPtr GenerateSnapshot() = 0; + virtual std::shared_ptr GenerateSnapshot() = 0; /** * Applies policy table to the current table @@ -670,12 +670,12 @@ class CacheManagerInterface { virtual std::string GetCertificate() const = 0; /** - * @brief pt allows to obtain SharedPtr to PT. + * @brief pt allows to obtain std::shared_ptr to PT. * Used ONLY in Unit tests - * @return SharedPTR to PT + * @return std::shared_ptr to PT * */ - virtual utils::SharedPtr pt() const = 0; + virtual std::shared_ptr pt() const = 0; /** * @brief OnDeviceSwitching Processes existing policy permissions for devices @@ -687,7 +687,7 @@ class CacheManagerInterface { const std::string& device_id_to) = 0; }; -typedef utils::SharedPtr CacheManagerInterfaceSPtr; +typedef std::shared_ptr CacheManagerInterfaceSPtr; } // namespace policy diff --git a/src/components/policy/policy_regular/include/policy/policy_helper.h b/src/components/policy/policy_regular/include/policy/policy_helper.h index 7f27ab2676..3ca0f93ebd 100644 --- a/src/components/policy/policy_regular/include/policy/policy_helper.h +++ b/src/components/policy/policy_regular/include/policy/policy_helper.h @@ -34,7 +34,7 @@ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_HELPER_H_ #include "policy/policy_table/functions.h" -#include "utils/shared_ptr.h" + #include "policy/policy_types.h" namespace policy { @@ -82,8 +82,8 @@ bool operator!=(const policy_table::ApplicationParams& first, */ struct CheckAppPolicy { CheckAppPolicy(PolicyManagerImpl* pm, - const utils::SharedPtr update, - const utils::SharedPtr snapshot); + const std::shared_ptr update, + const std::shared_ptr snapshot); bool operator()(const AppPoliciesValueType& app_policy); private: @@ -131,8 +131,8 @@ struct CheckAppPolicy { private: PolicyManagerImpl* pm_; - const utils::SharedPtr update_; - const utils::SharedPtr snapshot_; + const std::shared_ptr update_; + const std::shared_ptr snapshot_; }; /* diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index c162d73011..549fdd5a53 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -37,7 +37,7 @@ #include #include -#include "utils/shared_ptr.h" + #include "utils/lock.h" #include "policy/policy_manager.h" #include "policy/policy_table.h" @@ -467,7 +467,7 @@ class PolicyManagerImpl : public PolicyManager { * @brief Setter for access_remote instance * @param access_remote pointer to new access_remote instance */ - void set_access_remote(utils::SharedPtr access_remote) OVERRIDE; + void set_access_remote(std::shared_ptr access_remote) OVERRIDE; /** * @brief Sends notification about application HMI level changed @@ -671,7 +671,7 @@ class PolicyManagerImpl : public PolicyManager { * @param pt_content binary content of PT * @return pointer to converted PT */ - virtual utils::SharedPtr Parse( + virtual std::shared_ptr Parse( const BinaryMessage& pt_content); #else /** @@ -679,7 +679,7 @@ class PolicyManagerImpl : public PolicyManager { * @param pt_content binary content of PT * @return pointer to converted PT */ - virtual utils::SharedPtr ParseArray( + virtual std::shared_ptr ParseArray( const BinaryMessage& pt_content); #endif @@ -705,8 +705,8 @@ class PolicyManagerImpl : public PolicyManager { * @return Collection per-application results */ void CheckPermissionsChanges( - const utils::SharedPtr update, - const utils::SharedPtr snapshot); + const std::shared_ptr update, + const std::shared_ptr snapshot); /** * @brief Fill structure to be sent with OnPermissionsChanged notification @@ -803,7 +803,7 @@ class PolicyManagerImpl : public PolicyManager { * @param type policy table type * @return true if policy table valid, otherwise false */ - bool IsPTValid(utils::SharedPtr policy_table, + bool IsPTValid(std::shared_ptr policy_table, policy_table::PolicyTableType type) const; /** @@ -867,7 +867,7 @@ class PolicyManagerImpl : public PolicyManager { /** * @brief pointer to AccessRemote instance for working with RC applications */ - utils::SharedPtr access_remote_; + std::shared_ptr access_remote_; /** * @brief lock guard for protecting applications list access diff --git a/src/components/policy/policy_regular/include/policy/policy_table.h b/src/components/policy/policy_regular/include/policy/policy_table.h index afee8a34e4..9531bb8c79 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table.h +++ b/src/components/policy/policy_regular/include/policy/policy_table.h @@ -33,7 +33,7 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_ -#include "utils/shared_ptr.h" + #include "policy/pt_representation.h" #include "policy/pt_ext_representation.h" @@ -42,7 +42,7 @@ namespace policy { class PolicyTable { public: PolicyTable(); - explicit PolicyTable(utils::SharedPtr pt_data); + explicit PolicyTable(std::shared_ptr pt_data); virtual ~PolicyTable(); /** @@ -50,12 +50,12 @@ class PolicyTable { * actual class storing policy table. * @return PTRepresentation* Policy Table Content Handler */ - utils::SharedPtr pt_data() const { + std::shared_ptr pt_data() const { return pt_data_; } private: - utils::SharedPtr pt_data_; + std::shared_ptr pt_data_; }; } // namespace policy diff --git a/src/components/policy/policy_regular/include/policy/policy_types.h b/src/components/policy/policy_regular/include/policy/policy_types.h index e0fc808e2f..276a0a5dca 100644 --- a/src/components/policy/policy_regular/include/policy/policy_types.h +++ b/src/components/policy/policy_regular/include/policy/policy_types.h @@ -39,7 +39,8 @@ #include #include #include -#include "utils/shared_ptr.h" +#include + #include "utils/helpers.h" #include "transport_manager/common.h" @@ -79,7 +80,7 @@ enum PolicyTableStatus { // Code generator uses String class name, so this typedef was renamed to PTSring typedef std::string PTString; typedef std::vector BinaryMessage; -typedef utils::SharedPtr BinaryMessageSptr; +typedef std::shared_ptr BinaryMessageSptr; typedef std::string HMILevel; typedef std::string Parameter; diff --git a/src/components/policy/policy_regular/include/policy/pt_representation.h b/src/components/policy/policy_regular/include/policy/pt_representation.h index 08bd6d4923..378a294532 100644 --- a/src/components/policy/policy_regular/include/policy/pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/pt_representation.h @@ -35,9 +35,11 @@ #include #include +#include #include "policy/policy_types.h" #include "policy/policy_table/types.h" #include "policy/policy_settings.h" +#include "utils/macro.h" namespace policy { namespace policy_table = rpc::policy_table_interface_base; @@ -208,7 +210,7 @@ class PTRepresentation { * device_info, statistics, excluding user messages * @return Generated structure for obtaining Json string. */ - virtual utils::SharedPtr GenerateSnapshot() const = 0; + virtual std::shared_ptr GenerateSnapshot() const = 0; virtual bool Save(const policy_table::Table& table) = 0; diff --git a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h index b26b2c9ede..0e9302dfac 100644 --- a/src/components/policy/policy_regular/include/policy/sql_pt_representation.h +++ b/src/components/policy/policy_regular/include/policy/sql_pt_representation.h @@ -84,7 +84,7 @@ class SQLPTRepresentation : public virtual PTRepresentation { bool Clear(); bool Drop(); virtual void WriteDb(); - virtual utils::SharedPtr GenerateSnapshot() const; + virtual std::shared_ptr GenerateSnapshot() const; virtual bool Save(const policy_table::Table& table); bool GetInitialAppData(const std::string& app_id, StringArray* nicknames = NULL, diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager.h b/src/components/policy/policy_regular/include/policy/update_status_manager.h index a68d986d10..52d5b92b8a 100644 --- a/src/components/policy/policy_regular/include/policy/update_status_manager.h +++ b/src/components/policy/policy_regular/include/policy/update_status_manager.h @@ -66,14 +66,14 @@ class UpdateStatusManager : public UpdateStatusManagerInterface { * @brief Set next status during event processing * @param status Status shared pointer */ - void SetNextStatus(utils::SharedPtr status); + void SetNextStatus(std::shared_ptr status); /** * @brief Set postponed status (will be set after next status) during event * processing * @param status Status shared pointer */ - void SetPostponedStatus(utils::SharedPtr status); + void SetPostponedStatus(std::shared_ptr status); /** * @brief Sets listener pointer @@ -198,17 +198,17 @@ class UpdateStatusManager : public UpdateStatusManagerInterface { /** * @brief Current update status */ - utils::SharedPtr current_status_; + std::shared_ptr current_status_; /** * @brief Next status after current to be set */ - utils::SharedPtr next_status_; + std::shared_ptr next_status_; /** * @brief Status to be set after 'next' status */ - utils::SharedPtr postponed_status_; + std::shared_ptr postponed_status_; sync_primitives::Lock status_lock_; UpdateEvent last_processed_event_; diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h index e118f9974f..520615489a 100644 --- a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h @@ -33,7 +33,7 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_ -#include "utils/shared_ptr.h" + #include "policy/policy_types.h" #include "policy/status.h" @@ -55,14 +55,14 @@ class UpdateStatusManagerInterface { * @brief Set next status during event processing * @param status Status shared pointer */ - virtual void SetNextStatus(utils::SharedPtr status) = 0; + virtual void SetNextStatus(std::shared_ptr status) = 0; /** * @brief Set postponed status (will be set after next status) during event * processing * @param status Status shared pointer */ - virtual void SetPostponedStatus(utils::SharedPtr status) = 0; + virtual void SetPostponedStatus(std::shared_ptr status) = 0; /** * @brief Sets listener pointer * @param listener Pointer to policy listener implementation @@ -112,7 +112,7 @@ class UpdateStatusManagerInterface { virtual void OnPolicyInit(bool is_update_required) = 0; }; -typedef utils::SharedPtr +typedef std::shared_ptr UpdateStatusManagerInterfaceSPtr; } // namespace policy diff --git a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h index 1e263ec9df..72ae5fd9e0 100644 --- a/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h +++ b/src/components/policy/policy_regular/include/policy/usage_statistics/counter.h @@ -36,7 +36,7 @@ #include #include "policy/usage_statistics/statistics_manager.h" #include "policy/usage_statistics/app_stopwatch.h" -#include "utils/shared_ptr.h" + #include "utils/timer.h" #include "utils/macro.h" @@ -46,18 +46,18 @@ using timer::Timer; class GlobalCounter { public: - GlobalCounter(utils::SharedPtr statistics_manager, + GlobalCounter(std::shared_ptr statistics_manager, GlobalCounterId counter_type); void operator++() const; private: GlobalCounterId counter_type_; - utils::SharedPtr statistics_manager_; + std::shared_ptr statistics_manager_; }; class AppCounter { public: - AppCounter(utils::SharedPtr statistics_manager, + AppCounter(std::shared_ptr statistics_manager, const std::string& app_id, AppCounterId counter_type); void operator++() const; @@ -65,12 +65,12 @@ class AppCounter { private: std::string app_id_; AppCounterId counter_type_; - utils::SharedPtr statistics_manager_; + std::shared_ptr statistics_manager_; }; class AppInfo { public: - AppInfo(utils::SharedPtr statistics_manager, + AppInfo(std::shared_ptr statistics_manager, const std::string& app_id, AppInfoId info_type); void Update(const std::string& new_info) const; @@ -78,14 +78,14 @@ class AppInfo { private: std::string app_id_; AppInfoId info_type_; - utils::SharedPtr statistics_manager_; + std::shared_ptr statistics_manager_; }; class AppStopwatchImpl : public AppStopwatch { public: - AppStopwatchImpl(utils::SharedPtr statistics_manager, + AppStopwatchImpl(std::shared_ptr statistics_manager, const std::string& app_id); - AppStopwatchImpl(utils::SharedPtr statistics_manager, + AppStopwatchImpl(std::shared_ptr statistics_manager, const std::string& app_id, std::uint32_t timeout); void Start(AppStopwatchId stopwatch_type) OVERRIDE; @@ -96,7 +96,7 @@ class AppStopwatchImpl : public AppStopwatch { // Fields std::string app_id_; AppStopwatchId stopwatch_type_; - utils::SharedPtr statistics_manager_; + std::shared_ptr statistics_manager_; timer::Timer timer_; const std::uint32_t time_out_; DISALLOW_COPY_AND_ASSIGN(AppStopwatchImpl); diff --git a/src/components/policy/policy_regular/src/access_remote_impl.cc b/src/components/policy/policy_regular/src/access_remote_impl.cc index f99b226f2e..f743a4d56e 100644 --- a/src/components/policy/policy_regular/src/access_remote_impl.cc +++ b/src/components/policy/policy_regular/src/access_remote_impl.cc @@ -89,7 +89,7 @@ struct ToModuleType { AccessRemoteImpl::AccessRemoteImpl() : cache_(new CacheManager()) {} -AccessRemoteImpl::AccessRemoteImpl(utils::SharedPtr cache) +AccessRemoteImpl::AccessRemoteImpl(std::shared_ptr cache) : cache_(cache) {} bool AccessRemoteImpl::CheckModuleType(const PTString& app_id, diff --git a/src/components/policy/policy_regular/src/cache_manager.cc b/src/components/policy/policy_regular/src/cache_manager.cc index 1d51b81af4..4530e6692b 100644 --- a/src/components/policy/policy_regular/src/cache_manager.cc +++ b/src/components/policy/policy_regular/src/cache_manager.cc @@ -934,8 +934,8 @@ void CacheManager::CheckSnapshotInitialization() { void CacheManager::PersistData() { LOG4CXX_AUTO_TRACE(logger_); - if (backup_.valid()) { - if (pt_.valid()) { + if (backup_.use_count() != 0) { + if (pt_.use_count() != 0) { // Comma expression is used to hold the lock only during the constructor // call policy_table::Table copy_pt( @@ -1029,10 +1029,10 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id, return false; } -utils::SharedPtr CacheManager::GenerateSnapshot() { +std::shared_ptr CacheManager::GenerateSnapshot() { CACHE_MANAGER_CHECK(snapshot_); - snapshot_ = new policy_table::Table(); + snapshot_ = std::make_shared(); // Copy all members of policy table except messages in consumer friendly // messages @@ -1426,7 +1426,7 @@ bool CacheManager::Init(const std::string& file_name, result = LoadFromFile(file_name, *pt_); - utils::SharedPtr snapshot = GenerateSnapshot(); + std::shared_ptr snapshot = GenerateSnapshot(); result &= snapshot->is_valid(); LOG4CXX_DEBUG(logger_, "Check if snapshot is valid: " << std::boolalpha << result); diff --git a/src/components/policy/policy_regular/src/policy_helper.cc b/src/components/policy/policy_regular/src/policy_helper.cc index 796dd25ec4..bae9fceb49 100644 --- a/src/components/policy/policy_regular/src/policy_helper.cc +++ b/src/components/policy/policy_regular/src/policy_helper.cc @@ -121,8 +121,8 @@ bool operator!=(const policy_table::ApplicationParams& first, CheckAppPolicy::CheckAppPolicy( PolicyManagerImpl* pm, - const utils::SharedPtr update, - const utils::SharedPtr snapshot) + const std::shared_ptr update, + const std::shared_ptr snapshot) : pm_(pm), update_(update), snapshot_(snapshot) {} bool policy::CheckAppPolicy::HasRevokedGroups( diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index d01631a2a2..f1e51f3f83 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -44,12 +44,12 @@ #include "utils/file_system.h" #include "utils/logger.h" #include "utils/date_time.h" -#include "utils/make_shared.h" + #include "policy/cache_manager.h" #include "policy/update_status_manager.h" #include "config_profile/profile.h" #include "utils/timer_task_impl.h" -#include "utils/make_shared.h" + #include "policy/access_remote.h" #include "policy/access_remote_impl.h" @@ -74,7 +74,7 @@ PolicyManagerImpl::PolicyManagerImpl() , listener_(NULL) , cache_(new CacheManager) , access_remote_(new AccessRemoteImpl( - CacheManagerInterfaceSPtr::static_pointer_cast(cache_))) + std::static_pointer_cast(cache_))) , retry_sequence_timeout_(kDefaultRetryTimeoutInMSec) , retry_sequence_index_(0) , timer_retry_sequence_("Retry sequence timer", @@ -93,21 +93,21 @@ void PolicyManagerImpl::set_listener(PolicyListener* listener) { #ifdef USE_HMI_PTU_DECRYPTION -utils::SharedPtr PolicyManagerImpl::Parse( +std::shared_ptr PolicyManagerImpl::Parse( const BinaryMessage& pt_content) { std::string json(pt_content.begin(), pt_content.end()); Json::Value value; Json::Reader reader; if (reader.parse(json.c_str(), value)) { - return new policy_table::Table(&value); + return std::make_shared(&value); } else { - return utils::SharedPtr(); + return std::make_shared(); } } #else -utils::SharedPtr PolicyManagerImpl::ParseArray( +std::shared_ptr PolicyManagerImpl::ParseArray( const BinaryMessage& pt_content) { std::string json(pt_content.begin(), pt_content.end()); Json::Value value; @@ -121,7 +121,7 @@ utils::SharedPtr PolicyManagerImpl::ParseArray( return new policy_table::Table(&value); } } else { - return utils::SharedPtr(); + return std::shared_ptr(); } } @@ -154,11 +154,11 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, // Assuemes Policy Table was parsed, formatted, and/or decrypted by // the HMI after system request before calling OnReceivedPolicyUpdate // Parse message into table struct - utils::SharedPtr pt_update = Parse(pt_content); + std::shared_ptr pt_update = Parse(pt_content); #else // Message Received from server unecnrypted with PTU in first element // of 'data' array. No Parsing was done by HMI. - utils::SharedPtr pt_update = ParseArray(pt_content); + std::shared_ptr pt_update = ParseArray(pt_content); #endif if (!pt_update) { LOG4CXX_WARN(logger_, "Parsed table pointer is 0."); @@ -187,7 +187,7 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, sync_primitives::AutoLock lock(apps_registration_lock_); // Get current DB data, since it could be updated during awaiting of PTU - utils::SharedPtr policy_table_snapshot = + std::shared_ptr policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { LOG4CXX_ERROR( @@ -238,8 +238,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, } void PolicyManagerImpl::CheckPermissionsChanges( - const utils::SharedPtr pt_update, - const utils::SharedPtr snapshot) { + const std::shared_ptr pt_update, + const std::shared_ptr snapshot) { LOG4CXX_INFO(logger_, "Checking incoming permissions."); // Replace predefined policies with its actual setting, e.g. "123":"default" @@ -274,7 +274,7 @@ void PolicyManagerImpl::GetUpdateUrls(const uint32_t service_type, bool PolicyManagerImpl::RequestPTUpdate() { LOG4CXX_AUTO_TRACE(logger_); - utils::SharedPtr policy_table_snapshot = + std::shared_ptr policy_table_snapshot = cache_->GenerateSnapshot(); if (!policy_table_snapshot) { LOG4CXX_ERROR(logger_, "Failed to create snapshot of policy table"); @@ -806,7 +806,7 @@ bool PolicyManagerImpl::ExceededIgnitionCycles() { } bool PolicyManagerImpl::IsPTValid( - utils::SharedPtr policy_table, + std::shared_ptr policy_table, policy_table::PolicyTableType type) const { policy_table->SetPolicyTableType(type); if (!policy_table->is_valid()) { @@ -1066,11 +1066,11 @@ StatusNotifier PolicyManagerImpl::AddApplication( sync_primitives::AutoLock lock(apps_registration_lock_); if (IsNewApplication(application_id)) { AddNewApplication(application_id, device_consent); - return utils::MakeShared(update_status_manager_, + return std::make_shared(update_status_manager_, device_consent); } else { PromoteExistedApplication(application_id, device_consent); - return utils::MakeShared(); + return std::make_shared(); } } @@ -1164,8 +1164,8 @@ void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) { } void PolicyManagerImpl::set_cache_manager( - CacheManagerInterface* cache_manager) { - cache_ = cache_manager; + CacheManagerInterface* cache_manager) { + cache_ = std::shared_ptr(cache_manager); } void PolicyManagerImpl::RetrySequence() { @@ -1287,7 +1287,7 @@ bool PolicyManagerImpl::GetModuleTypes( } void PolicyManagerImpl::set_access_remote( - utils::SharedPtr access_remote) { + std::shared_ptr access_remote) { access_remote_ = access_remote; } diff --git a/src/components/policy/policy_regular/src/policy_table.cc b/src/components/policy/policy_regular/src/policy_table.cc index c5c6e3e132..b0fa5739da 100644 --- a/src/components/policy/policy_regular/src/policy_table.cc +++ b/src/components/policy/policy_regular/src/policy_table.cc @@ -42,7 +42,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy") PolicyTable::PolicyTable() : pt_data_(new SQLPTRepresentation()) {} -PolicyTable::PolicyTable(utils::SharedPtr pt_data) +PolicyTable::PolicyTable(std::shared_ptr pt_data) : pt_data_(pt_data) {} PolicyTable::~PolicyTable() { diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc index b1e574578e..00f3349050 100644 --- a/src/components/policy/policy_regular/src/sql_pt_representation.cc +++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc @@ -483,10 +483,10 @@ bool SQLPTRepresentation::RefreshDB() { return true; } -utils::SharedPtr SQLPTRepresentation::GenerateSnapshot() +std::shared_ptr SQLPTRepresentation::GenerateSnapshot() const { LOG4CXX_AUTO_TRACE(logger_); - utils::SharedPtr table = new policy_table::Table(); + auto table = std::make_shared(); GatherModuleMeta(&*table->policy_table.module_meta); GatherModuleConfig(&table->policy_table.module_config); GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts); diff --git a/src/components/policy/policy_regular/src/status.cc b/src/components/policy/policy_regular/src/status.cc index 8d65c606d0..306fa87529 100644 --- a/src/components/policy/policy_regular/src/status.cc +++ b/src/components/policy/policy_regular/src/status.cc @@ -32,7 +32,7 @@ #include "policy/status.h" #include "policy/update_status_manager_interface.h" -#include "utils/make_shared.h" + policy::UpToDateStatus::UpToDateStatus() : Status("UP_TO_DATE", policy::PolicyTableStatus::StatusUpToDate) {} @@ -44,7 +44,7 @@ void policy::UpToDateStatus::ProcessEvent(UpdateStatusManagerInterface* manager, case kOnResetPolicyTableRequireUpdate: case kScheduleUpdate: case kOnResetRetrySequence: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; default: break; @@ -59,17 +59,17 @@ void policy::UpdateNeededStatus::ProcessEvent( policy::UpdateStatusManagerInterface* manager, policy::UpdateEvent event) { switch (event) { case kOnUpdateSentOut: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; case kOnResetPolicyTableRequireUpdate: - manager->SetNextStatus(utils::MakeShared()); - manager->SetPostponedStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); + manager->SetPostponedStatus(std::make_shared()); break; case kOnResetPolicyTableNoUpdate: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; case kOnNewAppRegistered: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; default: break; @@ -88,22 +88,22 @@ void policy::UpdatingStatus::ProcessEvent( switch (event) { case kOnValidUpdateReceived: case kOnResetPolicyTableNoUpdate: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; case kOnNewAppRegistered: - manager->SetPostponedStatus(utils::MakeShared()); + manager->SetPostponedStatus(std::make_shared()); break; case kOnWrongUpdateReceived: case kOnUpdateTimeout: - manager->SetNextStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); break; case kOnResetPolicyTableRequireUpdate: - manager->SetNextStatus(utils::MakeShared()); - manager->SetPostponedStatus(utils::MakeShared()); + manager->SetNextStatus(std::make_shared()); + manager->SetPostponedStatus(std::make_shared()); break; case kScheduleUpdate: case kOnResetRetrySequence: - manager->SetPostponedStatus(utils::MakeShared()); + manager->SetPostponedStatus(std::make_shared()); break; default: break; diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc index 941113c753..401de1ea79 100644 --- a/src/components/policy/policy_regular/src/update_status_manager.cc +++ b/src/components/policy/policy_regular/src/update_status_manager.cc @@ -33,7 +33,7 @@ #include "policy/update_status_manager.h" #include "policy/policy_listener.h" #include "utils/logger.h" -#include "utils/make_shared.h" + namespace policy { @@ -41,7 +41,7 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "Policy") UpdateStatusManager::UpdateStatusManager() : listener_(NULL) - , current_status_(utils::MakeShared()) + , current_status_(std::make_shared()) , last_processed_event_(kNoEvent) , apps_search_in_progress_(false) , app_registered_from_non_consented_device_(true) {} @@ -55,11 +55,11 @@ void UpdateStatusManager::ProcessEvent(UpdateEvent event) { DoTransition(); } -void UpdateStatusManager::SetNextStatus(utils::SharedPtr status) { +void UpdateStatusManager::SetNextStatus(std::shared_ptr status) { next_status_ = status; } -void UpdateStatusManager::SetPostponedStatus(utils::SharedPtr status) { +void UpdateStatusManager::SetPostponedStatus(std::shared_ptr status) { postponed_status_ = status; } diff --git a/src/components/policy/policy_regular/src/usage_statistics/counter.cc b/src/components/policy/policy_regular/src/usage_statistics/counter.cc index 60e34a929d..199b5ae779 100644 --- a/src/components/policy/policy_regular/src/usage_statistics/counter.cc +++ b/src/components/policy/policy_regular/src/usage_statistics/counter.cc @@ -36,13 +36,13 @@ #include #include "policy/usage_statistics/counter.h" #include "utils/date_time.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" namespace usage_statistics { GlobalCounter::GlobalCounter( - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, GlobalCounterId counter_type) : counter_type_(counter_type), statistics_manager_(statistics_manager) {} @@ -52,7 +52,7 @@ void GlobalCounter::operator++() const { } } -AppCounter::AppCounter(utils::SharedPtr statistics_manager, +AppCounter::AppCounter(std::shared_ptr statistics_manager, const std::string& app_id, AppCounterId counter_type) : app_id_(app_id) @@ -65,7 +65,7 @@ void AppCounter::operator++() const { } } -AppInfo::AppInfo(utils::SharedPtr statistics_manager, +AppInfo::AppInfo(std::shared_ptr statistics_manager, const std::string& app_id, AppInfoId info_type) : app_id_(app_id) @@ -79,7 +79,7 @@ void AppInfo::Update(const std::string& new_info) const { } AppStopwatchImpl::AppStopwatchImpl( - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, const std::string& app_id) : app_id_(app_id) , stopwatch_type_(SECONDS_HMI_NONE) @@ -90,7 +90,7 @@ AppStopwatchImpl::AppStopwatchImpl( , time_out_(60) {} AppStopwatchImpl::AppStopwatchImpl( - utils::SharedPtr statistics_manager, + std::shared_ptr statistics_manager, const std::string& app_id, uint32_t timeout) : app_id_(app_id) diff --git a/src/components/policy/policy_regular/test/access_remote_impl_test.cc b/src/components/policy/policy_regular/test/access_remote_impl_test.cc index d086144d86..f79bb683f8 100644 --- a/src/components/policy/policy_regular/test/access_remote_impl_test.cc +++ b/src/components/policy/policy_regular/test/access_remote_impl_test.cc @@ -37,7 +37,7 @@ namespace policy { TEST(AccessRemoteImplTest, CheckModuleType) { AccessRemoteImpl access_remote; - access_remote.cache_->pt_ = new policy_table::Table(); + access_remote.cache_->pt_ = std::make_shared(); // No application EXPECT_FALSE(access_remote.CheckModuleType("1234", policy_table::MT_RADIO)); @@ -81,7 +81,7 @@ TEST(AccessRemoteImplTest, GetGroups) { ApplicationOnDevice who = {"dev1", "1234"}; access_remote.hmi_types_[who].push_back(policy_table::AHT_REMOTE_CONTROL); - access_remote.cache_->pt_ = new policy_table::Table(); + access_remote.cache_->pt_ = std::make_shared(); policy_table::ApplicationPolicies& apps = access_remote.cache_->pt_->policy_table.app_policies_section.apps; apps["1234"].groups.push_back("group_default"); diff --git a/src/components/policy/policy_regular/test/counter_test.cc b/src/components/policy/policy_regular/test/counter_test.cc index 2c0ab73c0b..a333ec2ee5 100644 --- a/src/components/policy/policy_regular/test/counter_test.cc +++ b/src/components/policy/policy_regular/test/counter_test.cc @@ -53,7 +53,7 @@ TEST( StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared>(); GlobalCounter reboots_counter(msm, SYNC_REBOOTS); // Assert @@ -67,7 +67,7 @@ TEST( StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared>(); GlobalCounter reboots_counter(msm, SYNC_REBOOTS); // Assert @@ -82,7 +82,7 @@ TEST( StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared>(); AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS); // Assert @@ -96,7 +96,7 @@ TEST( StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared>(); AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS); // Assert @@ -110,7 +110,7 @@ TEST( TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared>(); AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI); // Assert @@ -123,7 +123,7 @@ TEST(StatisticsManagerSetMethod, TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared>(); AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI); // Assert @@ -138,7 +138,7 @@ TEST(StatisticsManagerSetMethod, TEST(StatisticsManagerAddMethod, AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared>(); const std::uint32_t time_out = 1; AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out); @@ -155,7 +155,7 @@ TEST(StatisticsManagerAddMethod, TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared>(); AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp"); hmi_full_stopwatch.Start(SECONDS_HMI_FULL); @@ -171,7 +171,7 @@ TEST( StatisticsManagerAddMethod, DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared>(); const std::uint32_t time_out = 1; AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out); diff --git a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h index 8a47e7ca97..72f183175c 100644 --- a/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h +++ b/src/components/policy/policy_regular/test/include/policy/mock_pt_representation.h @@ -76,7 +76,7 @@ class MockPTRepresentation : virtual public PTRepresentation { MOCK_METHOD0(Close, bool()); MOCK_METHOD0(Clear, bool()); MOCK_METHOD0(Drop, bool()); - MOCK_CONST_METHOD0(GenerateSnapshot, utils::SharedPtr()); + MOCK_CONST_METHOD0(GenerateSnapshot, std::shared_ptr()); MOCK_METHOD1(Save, bool(const policy_table::Table& table)); MOCK_CONST_METHOD0(UpdateRequired, bool()); MOCK_METHOD1(SaveUpdateRequired, void(bool value)); diff --git a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc index e4e361c52c..86df87d534 100644 --- a/src/components/policy/policy_regular/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_regular/test/policy_manager_impl_test.cc @@ -51,7 +51,7 @@ #include "utils/macro.h" #include "utils/file_system.h" #include "utils/date_time.h" -#include "utils/make_shared.h" + #include "utils/gen_hash.h" #include "policy/mock_access_remote.h" @@ -145,14 +145,14 @@ class PolicyManagerImplTest : public ::testing::Test { MockCacheManagerInterface* cache_manager; NiceMock listener; const std::string device_id; - utils::SharedPtr access_remote; + std::shared_ptr access_remote; void SetUp() OVERRIDE { manager = new PolicyManagerImpl(); manager->set_listener(&listener); cache_manager = new MockCacheManagerInterface(); manager->set_cache_manager(cache_manager); - access_remote = new access_remote_test::MockAccessRemote(); + access_remote = std::shared_ptr(); manager->set_access_remote(access_remote); } @@ -352,7 +352,7 @@ class PolicyManagerImplTest2 : public ::testing::Test { // Get cache ::policy::CacheManagerInterfaceSPtr cache = manager->GetCache(); // Get table_snapshot - utils::SharedPtr table = cache->GenerateSnapshot(); + std::shared_ptr table = cache->GenerateSnapshot(); // Set functional groupings from policy table input_functional_groupings = table->policy_table.functional_groupings; } @@ -720,8 +720,8 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) { const std::string json = table.toStyledString(); ::policy::BinaryMessage msg(json.begin(), json.end()); - utils::SharedPtr snapshot = - utils::MakeShared(update.policy_table); + std::shared_ptr snapshot = + std::make_shared(update.policy_table); // Assert EXPECT_CALL(*cache_manager, GenerateSnapshot()).WillOnce(Return(snapshot)); EXPECT_CALL(*cache_manager, ApplyUpdate(_)).WillOnce(Return(true)); @@ -961,7 +961,7 @@ TEST_F(PolicyManagerImplTest2, UpdatedPreloadedPT_ExpectLPT_IsUpdated) { // Arrange ::policy::CacheManagerInterfaceSPtr cache = manager->GetCache(); - utils::SharedPtr table = cache->GenerateSnapshot(); + std::shared_ptr table = cache->GenerateSnapshot(); // Get FunctionalGroupings policy_table::FunctionalGroupings& fc = table->policy_table.functional_groupings; @@ -1253,7 +1253,7 @@ TEST_F(PolicyManagerImplTest2, // Arrange CreateLocalPT("sdl_preloaded_pt.json"); GetPTU("valid_sdl_pt_update.json"); - utils::SharedPtr pt = (manager->GetCache())->pt(); + std::shared_ptr pt = (manager->GetCache())->pt(); policy_table::ModuleConfig& module_config = pt->policy_table.module_config; ::policy::VehicleInfo vehicle_info = manager->GetVehicleInfo(); @@ -1334,7 +1334,7 @@ TEST_F( HertBeatTimeout_AddApp_UpdateAppPolicies_ExpectReceivedHertBeatTimeoutCorrect) { // Arrange CreateLocalPT("sdl_preloaded_pt.json"); - utils::SharedPtr pt = (manager->GetCache())->pt(); + std::shared_ptr pt = (manager->GetCache())->pt(); ::policy_table::PolicyTableType type1 = ::policy_table::PolicyTableType::PT_PRELOADED; pt->SetPolicyTableType(type1); diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc index 40dae10a4f..70db02b8a7 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc @@ -47,8 +47,8 @@ #include "json/writer.h" #include "json/reader.h" #include "rpc_base/rpc_base.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "utils/file_system.h" #include "utils/sqlite_wrapper/sql_database.h" @@ -1517,7 +1517,7 @@ TEST_F(SQLPTRepresentationTest, ASSERT_TRUE(reps->Save(update)); // Act - utils::SharedPtr snapshot = reps->GenerateSnapshot(); + std::shared_ptr snapshot = reps->GenerateSnapshot(); snapshot->SetPolicyTableType(rpc::policy_table_interface_base::PT_SNAPSHOT); // Remove fields which must be absent in snapshot table["policy_table"]["consumer_friendly_messages"].removeMember("messages"); diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc index 9d0326d0be..7c73a11175 100644 --- a/src/components/policy/policy_regular/test/update_status_manager_test.cc +++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc @@ -34,7 +34,7 @@ #include "policy/mock_policy_listener.h" #include "policy/policy_manager_impl.h" #include "policy/update_status_manager.h" -#include "utils/make_shared.h" + namespace test { namespace components { @@ -46,13 +46,13 @@ using ::testing::Return; class UpdateStatusManagerTest : public ::testing::Test { protected: - utils::SharedPtr manager_; - utils::SharedPtr listener_; + std::shared_ptr manager_; + std::shared_ptr listener_; public: UpdateStatusManagerTest() - : manager_(utils::MakeShared()) - , listener_(utils::MakeShared()) {} + : manager_(std::make_shared()) + , listener_(std::make_shared()) {} void SetUp() OVERRIDE { manager_->set_listener(listener_.get()); diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h index fb685f33d3..58877ac611 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_handler_impl.h @@ -42,7 +42,7 @@ #include "utils/prioritized_queue.h" #include "utils/message_queue.h" #include "utils/threads/message_loop_thread.h" -#include "utils/shared_ptr.h" + #include "utils/messagemeter.h" #include "utils/custom_string.h" diff --git a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h index d3e3ec5809..ff084beff8 100644 --- a/src/components/protocol_handler/include/protocol_handler/protocol_packet.h +++ b/src/components/protocol_handler/include/protocol_handler/protocol_packet.h @@ -375,7 +375,7 @@ class ProtocolPacket { * @brief Type definition for variable that hold shared pointer to protocolol * packet */ -typedef utils::SharedPtr ProtocolFramePtr; +typedef std::shared_ptr ProtocolFramePtr; typedef std::list ProtocolFramePtrList; template diff --git a/src/components/protocol_handler/src/multiframe_builder.cc b/src/components/protocol_handler/src/multiframe_builder.cc index cf8a23ddc1..5afae51292 100644 --- a/src/components/protocol_handler/src/multiframe_builder.cc +++ b/src/components/protocol_handler/src/multiframe_builder.cc @@ -35,7 +35,7 @@ #include #include "utils/logger.h" -#include "utils/make_shared.h" + #include "utils/lock.h" #include "utils/date_time.h" diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 6548f86c6a..57b2b8682d 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -925,8 +925,8 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message, } #ifdef TELEMETRY_MONITOR if (metric_observer_) { - PHTelemetryObserver::MessageMetric* metric = - new PHTelemetryObserver::MessageMetric(); + auto metric = + std::make_shared(); metric->message_id = message_id; metric->connection_key = message->connection_key(); metric->raw_msg = message; @@ -1384,8 +1384,8 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage( } #ifdef TELEMETRY_MONITOR if (metric_observer_) { - PHTelemetryObserver::MessageMetric* metric = - new PHTelemetryObserver::MessageMetric(); + auto metric = + std::make_shared(); metric->message_id = packet->message_id(); metric->connection_key = connection_key; metric->raw_msg = rawMessage; @@ -2054,8 +2054,8 @@ void ProtocolHandlerImpl::PopValideAndExpirateMultiframes() { #ifdef TELEMETRY_MONITOR if (metric_observer_) { - PHTelemetryObserver::MessageMetric* metric = - new PHTelemetryObserver::MessageMetric(); + auto metric = + std::make_shared(); metric->raw_msg = rawMessage; metric_observer_->EndMessageProcess(metric); } diff --git a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h index a1c1f188d1..2bfe9c925f 100644 --- a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h +++ b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h @@ -35,7 +35,7 @@ #include "gmock/gmock.h" #include "protocol_handler/time_metric_observer.h" -#include "utils/shared_ptr.h" + namespace test { namespace components { @@ -44,7 +44,7 @@ namespace protocol_handler_test { class MockPHTelemetryObserver : public ::protocol_handler::PHTelemetryObserver { public: MOCK_METHOD2(StartMessageProcess, void(uint32_t, const TimevalStruct&)); - MOCK_METHOD2(EndMessageProcess, void(utils::SharedPtr)); + MOCK_METHOD2(EndMessageProcess, void(std::shared_ptr)); }; } // namespace protocol_handler_test diff --git a/src/components/protocol_handler/test/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc index 393579927c..6274cf4e10 100644 --- a/src/components/protocol_handler/test/incoming_data_handler_test.cc +++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc @@ -74,7 +74,7 @@ class IncomingDataHandlerTest : public ::testing::Test { void AppendPacketToTMData(const ProtocolPacket& packet) { const RawMessagePtr msg = packet.serializePacket(); - EXPECT_TRUE(msg.valid()); + EXPECT_TRUE(msg.use_count() != 0); EXPECT_GT(msg->data_size(), 0u); tm_data.insert(tm_data.end(), msg->data(), msg->data() + msg->data_size()); } @@ -192,7 +192,7 @@ TEST_F(IncomingDataHandlerTest, Heartbeat_pack) { TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) { FrameList mobile_packets; // single packet RPC - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_SINGLE, @@ -203,7 +203,7 @@ TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) { protov1_message_id, some_data)); // consecutive packet Audio - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_2, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, @@ -214,7 +214,7 @@ TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) { some_message_id, some_data2)); // single packet Nav - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_SINGLE, @@ -225,7 +225,7 @@ TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) { ++some_message_id, some_data)); // consecutive packet Bulk - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, @@ -268,7 +268,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Version) { malformed_versions.push_back(version); } for (size_t i = 0; i < malformed_versions.size(); ++i) { - malformed_packets.push_back(new ProtocolPacket(uid1, + malformed_packets.push_back(std::make_shared(uid1, malformed_versions[i], PROTECTION_OFF, FRAME_TYPE_CONTROL, @@ -277,7 +277,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Version) { some_session_id, 0u, some_message_id, - NULL)); + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -316,7 +316,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_ServiceType) { malformed_serv_types.push_back(0x0D); malformed_serv_types.push_back(0x0E); for (size_t i = 0; i < malformed_serv_types.size(); ++i) { - malformed_packets.push_back(new ProtocolPacket(uid1, + malformed_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL, @@ -325,7 +325,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_ServiceType) { some_session_id, 0u, some_message_id, - NULL)); + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -360,7 +360,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FrameType) { malformed_frame_types.push_back(frame_type); } for (size_t i = 0; i < malformed_frame_types.size(); ++i) { - malformed_packets.push_back(new ProtocolPacket(uid1, + malformed_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, malformed_frame_types[i], @@ -369,7 +369,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FrameType) { some_session_id, 0u, some_message_id, - NULL)); + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -404,7 +404,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_ControlFrame) { malformed_frame_data.push_back(frame_type); } for (size_t i = 0; i < malformed_frame_data.size(); ++i) { - malformed_packets.push_back(new ProtocolPacket(uid1, + malformed_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL, @@ -413,7 +413,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_ControlFrame) { some_session_id, 0u, some_message_id, - NULL)); + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -448,7 +448,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_SingleFrame) { } malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE); for (size_t i = 0; i < malformed_frame_data.size(); ++i) { - malformed_packets.push_back(new ProtocolPacket(uid1, + malformed_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE, @@ -457,7 +457,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_SingleFrame) { some_session_id, 0u, some_message_id, - NULL)); + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -492,7 +492,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) { } malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE); for (size_t i = 0; i < malformed_frame_data.size(); ++i) { - malformed_packets.push_back(new ProtocolPacket(uid1, + malformed_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_SINGLE, @@ -501,7 +501,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) { some_session_id, 0u, some_message_id, - NULL)); + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -529,7 +529,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) { TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { FrameList mobile_packets; // single packet RPC - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_SINGLE, @@ -544,7 +544,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { tm_data.insert(tm_data.end(), 1, 0x1); // consecutive packet Audio - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_2, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, @@ -559,7 +559,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { tm_data.insert(tm_data.end(), 2, 0x2); // single packet Nav - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_SINGLE, @@ -574,7 +574,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { tm_data.insert(tm_data.end(), 3, 0x3); // consecutive packet Bulk - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, @@ -589,7 +589,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { tm_data.insert(tm_data.end(), 4, 0x4); // single packet RPC - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_CONTROL, @@ -604,7 +604,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { tm_data.insert(tm_data.end(), 5, 0x5); // single packet Audio - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_CONTROL, @@ -619,7 +619,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { tm_data.insert(tm_data.end(), 6, 0x6); // single packet RPC - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_SINGLE, @@ -651,7 +651,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) { FrameList mobile_packets; // single packet RPC - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_1, PROTECTION_OFF, FRAME_TYPE_SINGLE, @@ -664,7 +664,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) { AppendPacketToTMData(*mobile_packets.back()); // consecutive packet Audio - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_2, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, @@ -691,7 +691,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) { AppendPacketToTMData(malformed_packet1); // consecutive packet Bulk - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_ON, FRAME_TYPE_CONSECUTIVE, @@ -718,7 +718,7 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) { AppendPacketToTMData(malformed_packet2); // Audio packet - mobile_packets.push_back(new ProtocolPacket(uid1, + mobile_packets.push_back(std::make_shared(uid1, PROTOCOL_VERSION_3, PROTECTION_OFF, FRAME_TYPE_CONTROL, diff --git a/src/components/protocol_handler/test/multiframe_builder_test.cc b/src/components/protocol_handler/test/multiframe_builder_test.cc index ad8a39f79a..f919ec92af 100644 --- a/src/components/protocol_handler/test/multiframe_builder_test.cc +++ b/src/components/protocol_handler/test/multiframe_builder_test.cc @@ -35,7 +35,7 @@ #include #include #include -#include "utils/make_shared.h" + #include "protocol_handler/multiframe_builder.h" namespace test { @@ -149,7 +149,7 @@ class MultiFrameBuilderTest : public ::testing::Test { const ProtocolFramePtrList::const_iterator it_last = --(multiframes.end()); while (it != it_last) { const ProtocolFramePtr frame = *it; - ASSERT_TRUE(frame); + ASSERT_TRUE((bool)frame); EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(frame)) << "Non final CONSECUTIVE frame: " << frame; EXPECT_EQ(ProtocolFramePtrList(), multiframe_builder_.PopMultiframes()) @@ -331,7 +331,7 @@ TEST_F(MultiFrameBuilderTest, Add_FirstFrames_NoConnections) { const ProtocolFramePtrList& multiframes = multiframe_data.multiframes; ASSERT_FALSE(multiframes.empty()); const ProtocolFramePtr first_frame = multiframes.front(); - ASSERT_TRUE(first_frame); + ASSERT_TRUE((bool)first_frame); EXPECT_EQ(RESULT_FAIL, multiframe_builder_.AddFrame(first_frame)) << "Non-existed connection " << connection_id << "- to be skipped first frame: " << first_frame; @@ -365,7 +365,7 @@ TEST_F(MultiFrameBuilderTest, Add_FirstFrames_only) { const ProtocolFramePtrList& multiframes = multiframe_data.multiframes; ASSERT_FALSE(multiframes.empty()); const ProtocolFramePtr first_frame = multiframes.front(); - ASSERT_TRUE(first_frame); + ASSERT_TRUE((bool)first_frame); EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(first_frame)) << "First frame: " << first_frame; @@ -440,7 +440,7 @@ TEST_F(MultiFrameBuilderTest, Add_ConsecutiveFrames_per1) { ASSERT_FALSE(multiframes.empty()); const ProtocolFramePtr frame = multiframes.front(); - ASSERT_TRUE(frame); + ASSERT_TRUE((bool)frame); EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(frame)) << "Frame: " << frame; @@ -501,7 +501,7 @@ TEST_F(MultiFrameBuilderTest, FrameExpired_OneMSec) { const ProtocolFramePtrList& multiframes = multiframe_data.multiframes; ASSERT_FALSE(multiframes.empty()); const ProtocolFramePtr first_frame = multiframes.front(); - ASSERT_TRUE(first_frame); + ASSERT_TRUE((bool)first_frame); EXPECT_EQ(RESULT_OK, multiframe_builder_.AddFrame(first_frame)) << "First frame: " << first_frame; diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index 2e06cd702e..6ee57548b4 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -48,7 +48,7 @@ #endif // ENABLE_SECURITY #include "transport_manager/mock_transport_manager.h" #include "utils/mock_system_time_handler.h" -#include "utils/make_shared.h" + #include "utils/test_async_waiter.h" #include @@ -243,7 +243,7 @@ class ProtocolHandlerImplTest : public ::testing::Test { protection_flag); } - void AddSession(const ::utils::SharedPtr& waiter, + void AddSession(const std::shared_ptr& waiter, uint32_t& times) { using namespace protocol_handler; ASSERT_TRUE(NULL != waiter.get()); @@ -368,7 +368,7 @@ class ProtocolHandlerImplTest : public ::testing::Test { const std::vector& expected_video_service_transports); testing::NiceMock protocol_handler_settings_mock; - ::utils::SharedPtr protocol_handler_impl; + std::shared_ptr protocol_handler_impl; TransportManagerListener* tm_listener; // Uniq connection ::transport_manager::ConnectionUID connection_id; @@ -621,8 +621,8 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) { SetProtocolVersion2(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -836,8 +836,8 @@ TEST_F(ProtocolHandlerImplTest, * ProtocolHandler shall send NAck on session_observer rejection */ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) { - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -870,8 +870,8 @@ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) { * ProtocolHandler shall send NAck on wrong hash code */ TEST_F(ProtocolHandlerImplTest, EndSession_Success) { - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -904,8 +904,8 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) { #ifdef ENABLE_SECURITY TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { using namespace protocol_handler; - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2653,8 +2653,8 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2691,8 +2691,8 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_ThresholdValue) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2728,8 +2728,8 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_VideoFrameSkip) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2757,8 +2757,8 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_AudioFrameSkip) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2786,8 +2786,8 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerificationDisable) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2815,8 +2815,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) { InitProtocolHandlerImpl(0u, 0u, false, period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2848,8 +2848,8 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_MalformedLimitVerification) { InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2896,8 +2896,8 @@ TEST_F(ProtocolHandlerImplTest, InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2968,8 +2968,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) { InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3029,8 +3029,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullTimePeriod) { InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3063,8 +3063,8 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullCount) { InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3107,8 +3107,8 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, DISABLED_SendEndServicePrivate_EndSession_MessageSent) { // Arrange - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3132,8 +3132,8 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, SendEndServicePrivate_ServiceTypeControl_MessageSent) { // Arrange - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3172,8 +3172,8 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_NoConnection_NotSent) { TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) { // Arrange - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3198,8 +3198,8 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) { TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) { // Arrange - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3228,8 +3228,8 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) { TEST_F(ProtocolHandlerImplTest, DISABLED_SendHeartBeatAck_WrongProtocolVersion_NotSent) { // Arrange - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3258,8 +3258,8 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendSingleControlMessage) { // Arrange - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3267,7 +3267,7 @@ TEST_F(ProtocolHandlerImplTest, const bool is_final = true; const uint32_t total_data_size = 1; UCharDataVector data(total_data_size); - RawMessagePtr message = utils::MakeShared( + RawMessagePtr message = std::make_shared( connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kControl); // Expect getting pair from key from session observer EXPECT_CALL(session_observer_mock, @@ -3297,8 +3297,8 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendSingleNonControlMessage) { // Arrange - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3306,7 +3306,7 @@ TEST_F(ProtocolHandlerImplTest, const bool is_final = true; const uint32_t total_data_size = 1; UCharDataVector data(total_data_size); - RawMessagePtr message = utils::MakeShared( + RawMessagePtr message = std::make_shared( connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kRpc); // Expect getting pair from key from session observer EXPECT_CALL(session_observer_mock, @@ -3340,8 +3340,8 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) { // Arrange - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3350,7 +3350,7 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) { const uint32_t total_data_size = MAXIMUM_FRAME_DATA_V2_SIZE * 2; UCharDataVector data(total_data_size); const uint8_t first_consecutive_frame = 0x01; - RawMessagePtr message = utils::MakeShared( + RawMessagePtr message = std::make_shared( connection_key, PROTOCOL_VERSION_3, &data[0], total_data_size, kBulk); // Expect getting pair from key from session observer EXPECT_CALL(session_observer_mock, @@ -3395,8 +3395,8 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) { } TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) { - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3422,8 +3422,8 @@ TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) { } TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_AfterVersion5) { - ::utils::SharedPtr waiter = - utils::MakeShared(); + std::shared_ptr waiter = + std::make_shared(); uint32_t times = 0; AddSession(waiter, times); diff --git a/src/components/security_manager/include/security_manager/crypto_manager_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_impl.h index aa3be0f430..7a42c3d773 100644 --- a/src/components/security_manager/include/security_manager/crypto_manager_impl.h +++ b/src/components/security_manager/include/security_manager/crypto_manager_impl.h @@ -46,7 +46,7 @@ #include "utils/macro.h" #include "utils/lock.h" -#include "utils/shared_ptr.h" + namespace security_manager { class CryptoManagerImpl : public CryptoManager { @@ -138,7 +138,7 @@ class CryptoManagerImpl : public CryptoManager { public: explicit CryptoManagerImpl( - const utils::SharedPtr set); + const std::shared_ptr set); ~CryptoManagerImpl(); bool Init() OVERRIDE; @@ -203,7 +203,7 @@ class CryptoManagerImpl : public CryptoManager { */ bool SaveModuleKeyToFile(EVP_PKEY* key) const; - const utils::SharedPtr settings_; + const std::shared_ptr settings_; SSL_CTX* context_; static uint32_t instance_count_; static sync_primitives::Lock instance_lock_; diff --git a/src/components/security_manager/src/crypto_manager_impl.cc b/src/components/security_manager/src/crypto_manager_impl.cc index 84c5db7c0e..1dabb00bcd 100644 --- a/src/components/security_manager/src/crypto_manager_impl.cc +++ b/src/components/security_manager/src/crypto_manager_impl.cc @@ -87,7 +87,7 @@ void free_ctx(SSL_CTX** ctx) { } CryptoManagerImpl::CryptoManagerImpl( - const utils::SharedPtr set) + const std::shared_ptr set) : settings_(set), context_(NULL) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock lock(instance_lock_); diff --git a/src/components/security_manager/src/security_manager_impl.cc b/src/components/security_manager/src/security_manager_impl.cc index 1faaddee1c..c5d14406a9 100644 --- a/src/components/security_manager/src/security_manager_impl.cc +++ b/src/components/security_manager/src/security_manager_impl.cc @@ -69,7 +69,7 @@ void SecurityManagerImpl::OnMessageReceived( return; } - SecurityMessage securityMessagePtr(new SecurityQuery()); + SecurityMessage securityMessagePtr(std::make_shared()); const bool result = securityMessagePtr->SerializeQuery(message->data(), message->data_size()); if (!result) { diff --git a/src/components/security_manager/test/crypto_manager_impl_test.cc b/src/components/security_manager/test/crypto_manager_impl_test.cc index 74b071793d..9b1cd28539 100644 --- a/src/components/security_manager/test/crypto_manager_impl_test.cc +++ b/src/components/security_manager/test/crypto_manager_impl_test.cc @@ -39,7 +39,7 @@ #include #include -#include "utils/make_shared.h" + #include "gtest/gtest.h" #include "security_manager/crypto_manager_impl.h" #include "security_manager/mock_security_manager_settings.h" @@ -90,9 +90,9 @@ class CryptoManagerTest : public testing::Test { void SetUp() OVERRIDE { ASSERT_FALSE(certificate_data_base64_.empty()); mock_security_manager_settings_ = - utils::MakeShared(); + std::make_shared(); crypto_manager_ = - utils::MakeShared(mock_security_manager_settings_); + std::make_shared(mock_security_manager_settings_); forced_protected_services_.reserve(kMaxSizeVector); forced_unprotected_services_.reserve(kMaxSizeVector); } @@ -129,8 +129,8 @@ class CryptoManagerTest : public testing::Test { .WillByDefault(Return(false)); } - utils::SharedPtr crypto_manager_; - utils::SharedPtr mock_security_manager_settings_; + std::shared_ptr crypto_manager_; + std::shared_ptr mock_security_manager_settings_; static std::string certificate_data_base64_; std::vector forced_protected_services_; std::vector forced_unprotected_services_; diff --git a/src/components/security_manager/test/security_manager_test.cc b/src/components/security_manager/test/security_manager_test.cc index 3523bb7f44..aff7cbca2d 100644 --- a/src/components/security_manager/test/security_manager_test.cc +++ b/src/components/security_manager/test/security_manager_test.cc @@ -45,7 +45,7 @@ #include "security_manager/mock_crypto_manager.h" #include "security_manager/mock_security_manager_listener.h" #include "utils/mock_system_time_handler.h" -#include "utils/make_shared.h" + #include "utils/test_async_waiter.h" namespace test { @@ -120,7 +120,7 @@ class SecurityManagerTest : public ::testing::Test { void call_OnMessageReceived(const uint8_t* const data, uint32_t dataSize, const ServiceType serviceType) { - const RawMessagePtr rawMessagePtr(utils::MakeShared( + const RawMessagePtr rawMessagePtr(std::make_shared( kKey, kProtocolVersion, data, dataSize, serviceType)); security_manager_->OnMessageReceived(rawMessagePtr); } @@ -305,7 +305,7 @@ TEST_F(SecurityManagerTest, SecurityManager_NULLCryptoManager) { TEST_F(SecurityManagerTest, OnMobileMessageSent) { const uint8_t* data_param = NULL; const RawMessagePtr rawMessagePtr( - utils::MakeShared(kKey, kProtocolVersion, data_param, 0)); + std::make_shared(kKey, kProtocolVersion, data_param, 0)); security_manager_->OnMobileMessageSent(rawMessagePtr); } /* diff --git a/src/components/security_manager/test/ssl_certificate_handshake_test.cc b/src/components/security_manager/test/ssl_certificate_handshake_test.cc index 83ffa33b44..1034bb3c83 100644 --- a/src/components/security_manager/test/ssl_certificate_handshake_test.cc +++ b/src/components/security_manager/test/ssl_certificate_handshake_test.cc @@ -87,14 +87,14 @@ class SSLHandshakeTest : public testing::TestWithParam { security_manager_test::MockCryptoManagerSettings>(); server_manager_ = new security_manager::CryptoManagerImpl( - utils::SharedPtr( + std::shared_ptr( mock_server_manager_settings_)); ASSERT_TRUE(server_manager_); mock_client_manager_settings_ = new testing::NiceMock< security_manager_test::MockCryptoManagerSettings>(); client_manager_ = new security_manager::CryptoManagerImpl( - utils::SharedPtr( + std::shared_ptr( mock_client_manager_settings_)); ASSERT_TRUE(client_manager_); server_ctx_ = NULL; diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc index 20e509ebc6..47fa3c5560 100644 --- a/src/components/security_manager/test/ssl_context_test.cc +++ b/src/components/security_manager/test/ssl_context_test.cc @@ -41,8 +41,8 @@ #include "security_manager/ssl_context.h" #include "utils/custom_string.h" #include "security_manager/mock_security_manager_settings.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + using ::testing::Return; using ::testing::ReturnRef; @@ -111,9 +111,9 @@ class SSLTest : public testing::Test { } virtual void SetUp() OVERRIDE { - mock_crypto_manager_settings_ = utils::MakeShared< + mock_crypto_manager_settings_ = std::make_shared< NiceMock >(); - utils::SharedPtr crypto_set( + std::shared_ptr crypto_set( mock_crypto_manager_settings_); crypto_manager_ = new security_manager::CryptoManagerImpl(crypto_set); @@ -143,9 +143,9 @@ class SSLTest : public testing::Test { const bool crypto_manager_initialization = crypto_manager_->Init(); EXPECT_TRUE(crypto_manager_initialization); - mock_client_manager_settings_ = utils::MakeShared< + mock_client_manager_settings_ = std::make_shared< NiceMock >(); - utils::SharedPtr client_crypto( + std::shared_ptr client_crypto( mock_client_manager_settings_); client_manager_ = new security_manager::CryptoManagerImpl(client_crypto); @@ -213,9 +213,9 @@ class SSLTest : public testing::Test { const size_t kMaximumPayloadSize = 1000u; security_manager::CryptoManager* crypto_manager_; security_manager::CryptoManager* client_manager_; - utils::SharedPtr > + std::shared_ptr > mock_crypto_manager_settings_; - utils::SharedPtr > + std::shared_ptr > mock_client_manager_settings_; security_manager::SSLContext* server_ctx_; security_manager::SSLContext* client_ctx_; @@ -244,9 +244,9 @@ class SSLTestParam : public testing::TestWithParam { ASSERT_FALSE(certificate.empty()) << "Certificate data file is empty"; certificate_data_base64_ = certificate; - mock_crypto_manager_settings_ = utils::MakeShared< + mock_crypto_manager_settings_ = std::make_shared< NiceMock >(); - utils::SharedPtr server_crypto( + std::shared_ptr server_crypto( mock_crypto_manager_settings_); crypto_manager_ = new security_manager::CryptoManagerImpl(server_crypto); @@ -256,10 +256,10 @@ class SSLTestParam : public testing::TestWithParam { const bool crypto_manager_initialization = crypto_manager_->Init(); EXPECT_TRUE(crypto_manager_initialization); - mock_client_manager_settings_ = utils::MakeShared< + mock_client_manager_settings_ = std::make_shared< NiceMock >(); - utils::SharedPtr client_crypto( + std::shared_ptr client_crypto( mock_client_manager_settings_); client_manager_ = new security_manager::CryptoManagerImpl(client_crypto); @@ -343,9 +343,9 @@ class SSLTestParam : public testing::TestWithParam { .WillByDefault(ReturnRef(kClientPrivateKeyPath)); } - utils::SharedPtr > + std::shared_ptr > mock_crypto_manager_settings_; - utils::SharedPtr > + std::shared_ptr > mock_client_manager_settings_; security_manager::CryptoManager* crypto_manager_; security_manager::CryptoManager* client_manager_; diff --git a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h index cdddcfed55..a25155afad 100644 --- a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h @@ -33,7 +33,7 @@ #ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_ #define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_ -#include "utils/shared_ptr.h" + #include "smart_objects/schema_item.h" namespace NsSmartDeviceLink { @@ -47,7 +47,7 @@ class CAlwaysFalseSchemaItem : public ISchemaItem { * @brief Create a new schema item. * @return Shared pointer to a new schema item. **/ - static utils::SharedPtr create(); + static std::shared_ptr create(); /** * @deprecated * @brief Validate smart object. diff --git a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h index e078ae3240..c99cf97fb1 100644 --- a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h @@ -33,7 +33,7 @@ #ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_ #define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_ -#include "utils/shared_ptr.h" + #include "smart_objects/schema_item.h" namespace NsSmartDeviceLink { @@ -47,7 +47,7 @@ class CAlwaysTrueSchemaItem : public ISchemaItem { * @brief Create a new schema item. * @return Shared pointer to a new schema item. **/ - static utils::SharedPtr create(); + static std::shared_ptr create(); /** * @deprecated * @brief Validate smart object. diff --git a/src/components/smart_objects/include/smart_objects/array_schema_item.h b/src/components/smart_objects/include/smart_objects/array_schema_item.h index 937979f2fa..27d7180d5a 100644 --- a/src/components/smart_objects/include/smart_objects/array_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/array_schema_item.h @@ -34,7 +34,7 @@ #include -#include "utils/shared_ptr.h" + #include "smart_objects/schema_item.h" #include "smart_objects/always_true_schema_item.h" #include "smart_objects/schema_item_parameter.h" @@ -55,7 +55,7 @@ class CArraySchemaItem : public ISchemaItem { * * @return Shared pointer to a new schema item. **/ - static utils::SharedPtr create( + static std::shared_ptr create( const ISchemaItemPtr ElementSchemaItem = CAlwaysTrueSchemaItem::create(), const TSchemaItemParameter& MinSize = TSchemaItemParameter(), diff --git a/src/components/smart_objects/include/smart_objects/bool_schema_item.h b/src/components/smart_objects/include/smart_objects/bool_schema_item.h index eca5a0e063..a4db49c95f 100644 --- a/src/components/smart_objects/include/smart_objects/bool_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/bool_schema_item.h @@ -33,7 +33,7 @@ #ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_ #define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_ -#include "utils/shared_ptr.h" + #include "smart_objects/default_shema_item.h" @@ -49,7 +49,7 @@ class CBoolSchemaItem : public CDefaultSchemaItem { * @param DefaultValue Default value of a parameter. * @return Shared pointer to a new schema item. **/ - static utils::SharedPtr create( + static std::shared_ptr create( const TSchemaItemParameter& DefaultValue = TSchemaItemParameter()); diff --git a/src/components/smart_objects/include/smart_objects/default_shema_item.h b/src/components/smart_objects/include/smart_objects/default_shema_item.h index 56952dbac1..b364fe7982 100644 --- a/src/components/smart_objects/include/smart_objects/default_shema_item.h +++ b/src/components/smart_objects/include/smart_objects/default_shema_item.h @@ -33,7 +33,7 @@ #define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_DEFAULT_SHEMA_ITEM_H_ #include "utils/macro.h" -#include "utils/shared_ptr.h" + #include "smart_objects/schema_item.h" #include "smart_objects/schema_item_parameter.h" diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h index 524d966188..8679d7e9dd 100644 --- a/src/components/smart_objects/include/smart_objects/enum_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h @@ -39,7 +39,7 @@ #include #include -#include "utils/shared_ptr.h" + #include "smart_objects/default_shema_item.h" namespace NsSmartDeviceLink { @@ -60,7 +60,7 @@ class TEnumSchemaItem : public CDefaultSchemaItem { * @param DefaultValue Default value. * @return Shared pointer to a new schema item. **/ - static utils::SharedPtr create( + static std::shared_ptr create( const std::set& AllowedElements, const TSchemaItemParameter& DefaultValue = TSchemaItemParameter()); @@ -208,10 +208,10 @@ class EnumConversionHelper { }; template -utils::SharedPtr > TEnumSchemaItem::create( +std::shared_ptr> TEnumSchemaItem::create( const std::set& AllowedElements, const TSchemaItemParameter& DefaultValue) { - return new TEnumSchemaItem(AllowedElements, DefaultValue); + return std::shared_ptr> (new TEnumSchemaItem(AllowedElements, DefaultValue)); } template diff --git a/src/components/smart_objects/include/smart_objects/number_schema_item.h b/src/components/smart_objects/include/smart_objects/number_schema_item.h index 34c5e3a8a6..c6d42066b5 100644 --- a/src/components/smart_objects/include/smart_objects/number_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/number_schema_item.h @@ -35,7 +35,7 @@ #include #include -#include "utils/shared_ptr.h" + #include "smart_objects/default_shema_item.h" #include "smart_objects/schema_item_parameter.h" #include "utils/convert_utils.h" @@ -57,7 +57,7 @@ class TNumberSchemaItem : public CDefaultSchemaItem { * @param DefaultValue Default value. * @return Shared pointer to a new schema item. **/ - static utils::SharedPtr create( + static std::shared_ptr create( const TSchemaItemParameter& MinValue = TSchemaItemParameter(), const TSchemaItemParameter& MaxValue = @@ -112,11 +112,11 @@ class TNumberSchemaItem : public CDefaultSchemaItem { }; template -utils::SharedPtr > TNumberSchemaItem< +std::shared_ptr> TNumberSchemaItem< NumberType>::create(const TSchemaItemParameter& MinValue, const TSchemaItemParameter& MaxValue, const TSchemaItemParameter& DefaultValue) { - return new TNumberSchemaItem(MinValue, MaxValue, DefaultValue); + return std::shared_ptr>(new TNumberSchemaItem(MinValue, MaxValue, DefaultValue)); } template diff --git a/src/components/smart_objects/include/smart_objects/object_schema_item.h b/src/components/smart_objects/include/smart_objects/object_schema_item.h index 8922caba45..4c0def558b 100644 --- a/src/components/smart_objects/include/smart_objects/object_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/object_schema_item.h @@ -37,7 +37,6 @@ #include #include "utils/macro.h" -#include "utils/shared_ptr.h" #include "smart_objects/schema_item.h" #include "smart_objects/schema_item_parameter.h" @@ -82,7 +81,7 @@ class CObjectSchemaItem : public ISchemaItem { * * @return Shared pointer to a new schema item. **/ - static utils::SharedPtr create(const Members& Members); + static std::shared_ptr create(const Members& Members); /** * @deprecated * @brief Validate smart object. diff --git a/src/components/smart_objects/include/smart_objects/schema_item.h b/src/components/smart_objects/include/smart_objects/schema_item.h index 446c7fa65f..2b15a1d47a 100644 --- a/src/components/smart_objects/include/smart_objects/schema_item.h +++ b/src/components/smart_objects/include/smart_objects/schema_item.h @@ -33,11 +33,14 @@ #define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_ #include -#include "utils/shared_ptr.h" + #include "rpc_base/validation_report.h" #include "smart_objects/errors.h" +#include +#include "utils/macro.h" + namespace NsSmartDeviceLink { namespace NsSmartObjects { class SmartObject; @@ -126,7 +129,7 @@ class ISchemaItem { virtual ~ISchemaItem() {} }; -typedef utils::SharedPtr ISchemaItemPtr; +typedef std::shared_ptr ISchemaItemPtr; } // namespace NsSmartObjects } // namespace NsSmartDeviceLink #endif // SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_SCHEMA_ITEM_H_ diff --git a/src/components/smart_objects/include/smart_objects/smart_object.h b/src/components/smart_objects/include/smart_objects/smart_object.h index cc2bc7e22c..6a2cbdb911 100644 --- a/src/components/smart_objects/include/smart_objects/smart_object.h +++ b/src/components/smart_objects/include/smart_objects/smart_object.h @@ -126,7 +126,7 @@ typedef std::map SmartMap; **/ typedef std::vector SmartBinary; -typedef utils::SharedPtr SmartObjectSPtr; +typedef std::shared_ptr SmartObjectSPtr; /** * @brief List of SmartObjects diff --git a/src/components/smart_objects/include/smart_objects/string_schema_item.h b/src/components/smart_objects/include/smart_objects/string_schema_item.h index 6c98dcc3b3..4783a91fea 100644 --- a/src/components/smart_objects/include/smart_objects/string_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/string_schema_item.h @@ -36,7 +36,7 @@ #include #include -#include "utils/shared_ptr.h" + #include "smart_objects/default_shema_item.h" #include "smart_objects/schema_item_parameter.h" @@ -54,7 +54,7 @@ class CStringSchemaItem : public CDefaultSchemaItem { * @param DefaultValue Default value. * @return Shared pointer to a new schema item. **/ - static utils::SharedPtr create( + static std::shared_ptr create( const TSchemaItemParameter& MinLength = TSchemaItemParameter(), const TSchemaItemParameter& MaxLength = diff --git a/src/components/smart_objects/src/always_false_schema_item.cc b/src/components/smart_objects/src/always_false_schema_item.cc index 1893ed24d1..203ae11236 100644 --- a/src/components/smart_objects/src/always_false_schema_item.cc +++ b/src/components/smart_objects/src/always_false_schema_item.cc @@ -37,8 +37,8 @@ namespace NsSmartObjects { CAlwaysFalseSchemaItem::CAlwaysFalseSchemaItem() {} -utils::SharedPtr CAlwaysFalseSchemaItem::create() { - return new CAlwaysFalseSchemaItem(); +std::shared_ptr CAlwaysFalseSchemaItem::create() { + return std::shared_ptr(new CAlwaysFalseSchemaItem()); } Errors::eType CAlwaysFalseSchemaItem::validate(const SmartObject& object) { diff --git a/src/components/smart_objects/src/always_true_schema_item.cc b/src/components/smart_objects/src/always_true_schema_item.cc index 1e7115316d..774bcea121 100644 --- a/src/components/smart_objects/src/always_true_schema_item.cc +++ b/src/components/smart_objects/src/always_true_schema_item.cc @@ -35,8 +35,8 @@ namespace NsSmartObjects { CAlwaysTrueSchemaItem::CAlwaysTrueSchemaItem() {} -utils::SharedPtr CAlwaysTrueSchemaItem::create() { - return new CAlwaysTrueSchemaItem(); +std::shared_ptr CAlwaysTrueSchemaItem::create() { + return std::shared_ptr(new CAlwaysTrueSchemaItem()); } Errors::eType CAlwaysTrueSchemaItem::validate(const SmartObject& object) { diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc index dca0a815e0..9bd3a9a70d 100644 --- a/src/components/smart_objects/src/array_schema_item.cc +++ b/src/components/smart_objects/src/array_schema_item.cc @@ -34,11 +34,11 @@ namespace NsSmartDeviceLink { namespace NsSmartObjects { -utils::SharedPtr CArraySchemaItem::create( +std::shared_ptr CArraySchemaItem::create( const ISchemaItemPtr ElementSchemaItem, const TSchemaItemParameter& MinSize, const TSchemaItemParameter& MaxSize) { - return new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize); + return std::shared_ptr(new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize)); } Errors::eType CArraySchemaItem::validate(const SmartObject& Object) { diff --git a/src/components/smart_objects/src/bool_schema_item.cc b/src/components/smart_objects/src/bool_schema_item.cc index c1da95528a..dcf1e13918 100644 --- a/src/components/smart_objects/src/bool_schema_item.cc +++ b/src/components/smart_objects/src/bool_schema_item.cc @@ -35,9 +35,9 @@ namespace NsSmartDeviceLink { namespace NsSmartObjects { -utils::SharedPtr CBoolSchemaItem::create( +std::shared_ptr CBoolSchemaItem::create( const TSchemaItemParameter& DefaultValue) { - return new CBoolSchemaItem(DefaultValue); + return std::shared_ptr(new CBoolSchemaItem(DefaultValue)); } CBoolSchemaItem::CBoolSchemaItem(const TSchemaItemParameter& DefaultValue) diff --git a/src/components/smart_objects/src/object_schema_item.cc b/src/components/smart_objects/src/object_schema_item.cc index 2bed3d9a26..c79b97689d 100644 --- a/src/components/smart_objects/src/object_schema_item.cc +++ b/src/components/smart_objects/src/object_schema_item.cc @@ -51,9 +51,9 @@ CObjectSchemaItem::SMember::SMember(const ISchemaItemPtr SchemaItem, const bool IsMandatory) : mSchemaItem(SchemaItem), mIsMandatory(IsMandatory) {} -utils::SharedPtr CObjectSchemaItem::create( +std::shared_ptr CObjectSchemaItem::create( const Members& members) { - return new CObjectSchemaItem(members); + return std::shared_ptr(new CObjectSchemaItem(members)); } Errors::eType CObjectSchemaItem::validate(const SmartObject& object) { diff --git a/src/components/smart_objects/src/string_schema_item.cc b/src/components/smart_objects/src/string_schema_item.cc index 1e4c8372f0..2f71533b53 100644 --- a/src/components/smart_objects/src/string_schema_item.cc +++ b/src/components/smart_objects/src/string_schema_item.cc @@ -38,11 +38,11 @@ namespace NsSmartObjects { namespace custom_str = utils::custom_string; -utils::SharedPtr CStringSchemaItem::create( +std::shared_ptr CStringSchemaItem::create( const TSchemaItemParameter& MinLength, const TSchemaItemParameter& MaxLength, const TSchemaItemParameter& DefaultValue) { - return new CStringSchemaItem(MinLength, MaxLength, DefaultValue); + return std::shared_ptr(new CStringSchemaItem(MinLength, MaxLength, DefaultValue)); } Errors::eType CStringSchemaItem::validate(const SmartObject& Object) { diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc index 8d67aa59b2..8299635c6a 100644 --- a/src/components/smart_objects/test/BoolSchemaItem_test.cc +++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc @@ -34,7 +34,7 @@ #include "gmock/gmock.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "smart_objects/bool_schema_item.h" diff --git a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc index b11560914e..1eb0b31cb3 100644 --- a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc +++ b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc @@ -36,7 +36,7 @@ #include "gmock/gmock.h" -#include "utils/shared_ptr.h" + #include "smart_objects/smart_object.h" #include "smart_objects/smart_schema.h" diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h index 3c3de20e0e..eabaf0a5e4 100644 --- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h +++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_metric_wrapper.h @@ -44,7 +44,7 @@ class ApplicationManagerObserver; class ApplicationManagerMetricWrapper : public MetricWrapper { public: - utils::SharedPtr + std::shared_ptr message_metric; virtual Json::Value GetJsonMetric(); }; diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h index ecb9c8002a..31a3ceea12 100644 --- a/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h +++ b/src/components/telemetry_monitor/include/telemetry_monitor/application_manager_observer.h @@ -45,7 +45,7 @@ class ApplicationManagerObserver : public application_manager::AMTelemetryObserver { public: explicit ApplicationManagerObserver(TelemetryMonitor* telemetry_monitor); - virtual void OnMessage(utils::SharedPtr metric); + virtual void OnMessage(std::shared_ptr metric); private: TelemetryMonitor* telemetry_monitor_; diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h index daf602e9ca..dfe7f4b964 100644 --- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h +++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_metric_wrapper.h @@ -34,7 +34,7 @@ #define SRC_COMPONENTS_TELEMETRY_MONITOR_INCLUDE_TELEMETRY_MONITOR_PROTOCOL_HANDLER_METRIC_WRAPPER_H_ #include -#include "utils/shared_ptr.h" + #include "telemetry_monitor/metric_wrapper.h" #include "protocol_handler_observer.h" @@ -42,7 +42,7 @@ namespace telemetry_monitor { class ProtocolHandlerMecticWrapper : public MetricWrapper { public: - utils::SharedPtr + std::shared_ptr message_metric; virtual Json::Value GetJsonMetric(); }; diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h index 69e5658382..fabf8042d0 100644 --- a/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h +++ b/src/components/telemetry_monitor/include/telemetry_monitor/protocol_handler_observer.h @@ -47,7 +47,7 @@ class ProtocolHandlerObserver : public protocol_handler::PHTelemetryObserver { virtual void StartMessageProcess(uint32_t message_id, const TimevalStruct& start_time); - virtual void EndMessageProcess(utils::SharedPtr m); + virtual void EndMessageProcess(std::shared_ptr m); private: TelemetryMonitor* telemetry_monitor_; diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h index 618901ffa8..ccdfe3ea2e 100644 --- a/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h +++ b/src/components/telemetry_monitor/include/telemetry_monitor/telemetry_monitor.h @@ -46,11 +46,6 @@ #include "protocol_handler_observer.h" #include "protocol_handler/protocol_handler_impl.h" -namespace utils { -template -class SharedPtr; -} - namespace telemetry_monitor { using ::utils::MessageQueue; @@ -62,7 +57,7 @@ class Streamer : public threads::ThreadDelegate { void threadMain() OVERRIDE; void exitThreadMain() OVERRIDE; - virtual void PushMessage(utils::SharedPtr metric); + virtual void PushMessage(std::shared_ptr metric); volatile bool is_client_connected_; private: @@ -75,7 +70,7 @@ class Streamer : public threads::ThreadDelegate { int32_t server_socket_fd_; int32_t client_socket_fd_; volatile bool stop_flag_; - MessageQueue > messages_; + MessageQueue > messages_; DISALLOW_COPY_AND_ASSIGN(Streamer); }; @@ -91,9 +86,9 @@ class TelemetryMonitor { transport_manager); virtual void Stop(); virtual void Start(); - virtual void SendMetric(utils::SharedPtr metric); + virtual void SendMetric(std::shared_ptr metric); DEPRECATED void set_streamer(Streamer* streamer); - void set_streamer(utils::SharedPtr streamer); + void set_streamer(std::shared_ptr streamer); const std::string& ip() const; int16_t port() const; @@ -101,7 +96,7 @@ class TelemetryMonitor { std::string server_address_; int16_t port_; threads::Thread* thread_; - utils::SharedPtr streamer_; + std::shared_ptr streamer_; ApplicationManagerObserver app_observer; TransportManagerObserver tm_observer; ProtocolHandlerObserver ph_observer; diff --git a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h index b601e89b18..d1239c9d1b 100644 --- a/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h +++ b/src/components/telemetry_monitor/include/telemetry_monitor/transport_manager_metric_wrapper.h @@ -41,7 +41,7 @@ namespace telemetry_monitor { class TransportManagerMecticWrapper : public MetricWrapper { public: - utils::SharedPtr + std::shared_ptr message_metric; virtual Json::Value GetJsonMetric(); }; diff --git a/src/components/telemetry_monitor/src/application_manager_observer.cc b/src/components/telemetry_monitor/src/application_manager_observer.cc index cb390eddeb..1e621c8a6e 100644 --- a/src/components/telemetry_monitor/src/application_manager_observer.cc +++ b/src/components/telemetry_monitor/src/application_manager_observer.cc @@ -30,7 +30,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include "telemetry_monitor/application_manager_observer.h" -#include "utils/shared_ptr.h" + #include "telemetry_monitor/telemetry_monitor.h" #include "telemetry_monitor/application_manager_metric_wrapper.h" @@ -41,8 +41,8 @@ ApplicationManagerObserver::ApplicationManagerObserver( : telemetry_monitor_(telemetry_monitor) {} void ApplicationManagerObserver::OnMessage( - utils::SharedPtr metric) { - ApplicationManagerMetricWrapper* m = new ApplicationManagerMetricWrapper(); + std::shared_ptr metric) { + auto m = std::make_shared(); m->message_metric = metric; m->grabResources(); telemetry_monitor_->SendMetric(m); diff --git a/src/components/telemetry_monitor/src/protocol_handler_observer.cc b/src/components/telemetry_monitor/src/protocol_handler_observer.cc index 2244cb2259..95f1a87b67 100644 --- a/src/components/telemetry_monitor/src/protocol_handler_observer.cc +++ b/src/components/telemetry_monitor/src/protocol_handler_observer.cc @@ -58,7 +58,7 @@ void ProtocolHandlerObserver::StartMessageProcess( } void ProtocolHandlerObserver::EndMessageProcess( - utils::SharedPtr m) { + std::shared_ptr m) { uint32_t message_id = m->message_id; std::map::const_iterator it = time_starts.find(message_id); @@ -68,7 +68,7 @@ void ProtocolHandlerObserver::EndMessageProcess( } m->begin = time_starts[message_id]; m->end = date_time::DateTime::getCurrentTime(); - ProtocolHandlerMecticWrapper* metric = new ProtocolHandlerMecticWrapper(); + auto metric = std::make_shared(); metric->message_metric = m; metric->grabResources(); telemetry_monitor_->SendMetric(metric); diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc index 53a5a2dc70..6d95553a59 100644 --- a/src/components/telemetry_monitor/src/telemetry_monitor.cc +++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc @@ -42,8 +42,8 @@ #include "transport_manager/transport_manager_default.h" #include "utils/resource_usage.h" -#include "utils/make_shared.h" -#include "utils/shared_ptr.h" + + #include "telemetry_monitor/telemetry_observable.h" namespace telemetry_monitor { @@ -60,13 +60,13 @@ TelemetryMonitor::TelemetryMonitor(const std::string& server_address, , ph_observer(this) {} void TelemetryMonitor::Start() { - streamer_ = streamer_ ? streamer_ : utils::MakeShared(this); + streamer_ = streamer_ ? streamer_ : std::make_shared(this); thread_ = threads::CreateThread("TelemetryMonitor", streamer_.get()); } void TelemetryMonitor::set_streamer(Streamer* streamer) {} -void TelemetryMonitor::set_streamer(utils::SharedPtr streamer) { +void TelemetryMonitor::set_streamer(std::shared_ptr streamer) { LOG4CXX_AUTO_TRACE(logger_); if (thread_ && !thread_->is_running()) { streamer_ = streamer; @@ -115,7 +115,7 @@ void TelemetryMonitor::Stop() { thread_ = NULL; } -void TelemetryMonitor::SendMetric(utils::SharedPtr metric) { +void TelemetryMonitor::SendMetric(std::shared_ptr metric) { if (streamer_ && streamer_->is_client_connected_) { streamer_->PushMessage(metric); } @@ -149,7 +149,7 @@ void Streamer::threadMain() { is_client_connected_ = true; while (is_client_connected_) { while (!messages_.empty()) { - utils::SharedPtr metric; + std::shared_ptr metric; if (!messages_.pop(metric)) { continue; } @@ -282,7 +282,7 @@ bool Streamer::Send(const std::string& msg) { return true; } -void Streamer::PushMessage(utils::SharedPtr metric) { +void Streamer::PushMessage(std::shared_ptr metric) { messages_.push(metric); } } // namespace telemetry_monitor diff --git a/src/components/telemetry_monitor/src/transport_manager_observer.cc b/src/components/telemetry_monitor/src/transport_manager_observer.cc index b3e57ac22a..d0c7fe42d9 100644 --- a/src/components/telemetry_monitor/src/transport_manager_observer.cc +++ b/src/components/telemetry_monitor/src/transport_manager_observer.cc @@ -53,9 +53,9 @@ void TransportManagerObserver::StopRawMsg( it; it = time_starts.find(ptr); if (it != time_starts.end()) { - TransportManagerMecticWrapper* m = new TransportManagerMecticWrapper(); + auto m = std::make_shared(); m->message_metric = - new transport_manager::TMTelemetryObserver::MessageMetric(); + std::make_shared(); m->message_metric->begin = it->second; m->message_metric->end = date_time::DateTime::getCurrentTime(); m->message_metric->data_size = ptr->data_size(); diff --git a/src/components/telemetry_monitor/test/application_manager_metric_test.cc b/src/components/telemetry_monitor/test/application_manager_metric_test.cc index 9029c41bc4..cd0d599690 100644 --- a/src/components/telemetry_monitor/test/application_manager_metric_test.cc +++ b/src/components/telemetry_monitor/test/application_manager_metric_test.cc @@ -58,14 +58,14 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetric) { end_time.tv_sec = 10; end_time.tv_usec = 0; metric_test.message_metric = - new application_manager::AMTelemetryObserver::MessageMetric(); + std::make_shared(); metric_test.message_metric->begin = start_time; metric_test.message_metric->end = end_time; NsSmartDeviceLink::NsSmartObjects::SmartObject obj; obj["params"][application_manager::strings::correlation_id] = 11; obj["params"][application_manager::strings::connection_key] = 12; metric_test.message_metric->message = - new NsSmartDeviceLink::NsSmartObjects::SmartObject(obj); + std::make_shared(obj); Json::Value jvalue = metric_test.GetJsonMetric(); EXPECT_EQ("null\n", @@ -99,14 +99,14 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetricWithGrabResources) { end_time.tv_usec = 0; metric_test.message_metric = - new application_manager::AMTelemetryObserver::MessageMetric(); + std::make_shared(); metric_test.message_metric->begin = start_time; metric_test.message_metric->end = end_time; NsSmartDeviceLink::NsSmartObjects::SmartObject obj; obj["params"][application_manager::strings::correlation_id] = 11; obj["params"][application_manager::strings::connection_key] = 12; metric_test.message_metric->message = - new NsSmartDeviceLink::NsSmartObjects::SmartObject(obj); + std::make_shared(obj); Json::Value jvalue = metric_test.GetJsonMetric(); EXPECT_EQ(date_time::DateTime::getuSecs(start_time), diff --git a/src/components/telemetry_monitor/test/application_manager_observer_test.cc b/src/components/telemetry_monitor/test/application_manager_observer_test.cc index 5b7a551247..deecfa57b7 100644 --- a/src/components/telemetry_monitor/test/application_manager_observer_test.cc +++ b/src/components/telemetry_monitor/test/application_manager_observer_test.cc @@ -35,7 +35,7 @@ #include "application_manager/telemetry_observer.h" #include "telemetry_monitor/application_manager_metric_wrapper.h" #include "telemetry_monitor/application_manager_observer.h" -#include "utils/shared_ptr.h" + #include "telemetry_monitor/telemetry_monitor.h" namespace test { @@ -49,7 +49,7 @@ TEST(ApplicationManagerObserver, CallOnMessage) { MockTelemetryMonitor mock_telemetry_monitor; ApplicationManagerObserver app_observer(&mock_telemetry_monitor); typedef application_manager::AMTelemetryObserver::MessageMetric AMMetric; - utils::SharedPtr ptr = + std::shared_ptr ptr = application_manager::AMTelemetryObserver::MessageMetricSharedPtr(); EXPECT_CALL(mock_telemetry_monitor, SendMetric(_)); app_observer.OnMessage(ptr); diff --git a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h index fdda58bd08..201220c863 100644 --- a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h +++ b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h @@ -37,7 +37,7 @@ #include "gmock/gmock.h" #include "telemetry_monitor/telemetry_monitor.h" #include "telemetry_monitor/metric_wrapper.h" -#include "utils/shared_ptr.h" + namespace test { namespace components { @@ -50,7 +50,7 @@ class MockTelemetryMonitor : public telemetry_monitor::TelemetryMonitor { MOCK_METHOD0(Stop, void()); MOCK_METHOD0(Start, void()); MOCK_METHOD1(SendMetric, - void(utils::SharedPtr metric)); + void(std::shared_ptr metric)); }; } // namespace transport_manager_test } // namespace components diff --git a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc index 8253cf2553..f247f76866 100644 --- a/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc +++ b/src/components/telemetry_monitor/test/protocol_handler_metric_test.cc @@ -59,7 +59,7 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetric) { end_time.tv_sec = 10; end_time.tv_usec = 0; metric_test.message_metric = - new protocol_handler::PHTelemetryObserver::MessageMetric(); + std::make_shared(); metric_test.message_metric->begin = start_time; metric_test.message_metric->end = end_time; metric_test.message_metric->message_id = 5; @@ -93,7 +93,7 @@ TEST(ProtocolHandlerMetricTest, GetJsonMetricWithGrabResources) { end_time.tv_sec = 10; end_time.tv_usec = 0; metric_test.message_metric = - new protocol_handler::PHTelemetryObserver::MessageMetric(); + std::make_shared(); metric_test.message_metric->begin = start_time; metric_test.message_metric->end = end_time; metric_test.message_metric->message_id = 5; diff --git a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc index 784e809da6..3b2691bf72 100644 --- a/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc +++ b/src/components/telemetry_monitor/test/protocol_handler_observer_test.cc @@ -53,7 +53,7 @@ TEST(ProtocolHandlerObserverTest, MessageProcess) { pr_handler.StartMessageProcess(message_id, start_time); typedef protocol_handler::PHTelemetryObserver::MessageMetric MetricType; - utils::SharedPtr message_metric = new MetricType(); + std::shared_ptr message_metric = std::make_shared(); message_metric->message_id = 1; EXPECT_CALL(mock_telemetry_monitor, SendMetric(_)); pr_handler.EndMessageProcess(message_metric); @@ -70,7 +70,7 @@ TEST(ProtocolHandlerObserverTest, MessageProcessWithZeroMessageId) { pr_handler.StartMessageProcess(message_id, start_time); typedef protocol_handler::PHTelemetryObserver::MessageMetric MetricType; - utils::SharedPtr message_metric = new MetricType(); + std::shared_ptr message_metric = std::make_shared(); message_metric->message_id = 0; EXPECT_CALL(mock_telemetry_monitor, SendMetric(_)).Times(0); pr_handler.EndMessageProcess(message_metric); diff --git a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc index 5235f0a469..d0f82103d4 100644 --- a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc +++ b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc @@ -40,8 +40,8 @@ #include "connection_handler/mock_connection_handler.h" #include "transport_manager/mock_transport_manager.h" #include "telemetry_monitor/mock_telemetry_observable.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + using testing::Return; using testing::_; @@ -57,7 +57,7 @@ class StreamerMock : public Streamer { StreamerMock(TelemetryMonitor* const server) : Streamer(server) { is_client_connected_ = true; } - MOCK_METHOD1(PushMessage, void(utils::SharedPtr metric)); + MOCK_METHOD1(PushMessage, void(std::shared_ptr metric)); }; TEST(TelemetryMonitorTest, MessageProcess) { @@ -92,14 +92,14 @@ TEST(TelemetryMonitorTest, MessageProcess) { EXPECT_CALL(am_observeble, SetTelemetryObserver(_)); EXPECT_CALL(transport_manager_mock, SetTelemetryObserver(_)); telemetry_monitor::TelemetryMonitor telemetry_monitor(server_address, port); - utils::SharedPtr streamer_mock = - utils::MakeShared(&telemetry_monitor); + std::shared_ptr streamer_mock = + std::make_shared(&telemetry_monitor); // streamer_mock will be freed by telemetry_monitor on destruction telemetry_monitor.Start(); telemetry_monitor.set_streamer(streamer_mock); telemetry_monitor.Init( &protocol_handler_mock, &am_observeble, &transport_manager_mock); - utils::SharedPtr test_metric; + std::shared_ptr test_metric; EXPECT_CALL(*streamer_mock, PushMessage(test_metric)); telemetry_monitor.SendMetric(test_metric); } diff --git a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc index 6eb479387a..99006c03ba 100644 --- a/src/components/telemetry_monitor/test/transport_manager_metric_test.cc +++ b/src/components/telemetry_monitor/test/transport_manager_metric_test.cc @@ -59,7 +59,7 @@ TEST(TransportManagerMetricWrapper, GetJsonMetric) { end_time.tv_sec = 10; end_time.tv_usec = 0; metric_test.message_metric = - new transport_manager::TMTelemetryObserver::MessageMetric(); + std::make_shared(); metric_test.message_metric->begin = start_time; metric_test.message_metric->end = end_time; metric_test.message_metric->data_size = 1000; @@ -90,7 +90,7 @@ TEST(TransportManagerMetricWrapper, GetJsonMetricWithGrabResources) { end_time.tv_sec = 10; end_time.tv_usec = 0; metric_test.message_metric = - new transport_manager::TMTelemetryObserver::MessageMetric(); + std::make_shared(); metric_test.message_metric->begin = start_time; metric_test.message_metric->end = end_time; diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h index 537e94b055..e3be189b50 100644 --- a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h +++ b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h @@ -35,7 +35,7 @@ #ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_ #define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_ -#include "utils/shared_ptr.h" + #include "transport_manager/transport_adapter/transport_adapter.h" namespace transport_manager { @@ -67,7 +67,7 @@ class Connection { virtual TransportAdapter::Error Disconnect() = 0; }; -typedef utils::SharedPtr ConnectionSPtr; +typedef std::shared_ptr ConnectionSPtr; } // namespace transport_adapter } // namespace transport_manager diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h index eaa71ce3bb..356776cea9 100644 --- a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h +++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h @@ -64,7 +64,7 @@ typedef threads::MessageLoopThread > RawMessageLoopThread; typedef threads::MessageLoopThread > TransportAdapterEventLoopThread; -typedef utils::SharedPtr TimerSPtr; +typedef std::shared_ptr TimerSPtr; typedef std::map DeviceToAdapterMap; /** diff --git a/src/components/transport_manager/include/transport_manager/usb/common.h b/src/components/transport_manager/include/transport_manager/usb/common.h index 1c6011dbb2..8fa0d8468e 100644 --- a/src/components/transport_manager/include/transport_manager/usb/common.h +++ b/src/components/transport_manager/include/transport_manager/usb/common.h @@ -35,7 +35,7 @@ #include -#include "utils/shared_ptr.h" + #if defined(__QNXNTO__) #include "transport_manager/usb/qnx/usb_handler.h" @@ -64,7 +64,7 @@ static const uint16_t kApplePid8 = 0x12a8; // iPhone 5 static const int kUsbConfiguration = 1; -typedef utils::SharedPtr UsbHandlerSptr; +typedef std::shared_ptr UsbHandlerSptr; class UsbDeviceListener { public: diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device.h b/src/components/transport_manager/include/transport_manager/usb/usb_device.h index 8ca1a32a28..b66943561b 100644 --- a/src/components/transport_manager/include/transport_manager/usb/usb_device.h +++ b/src/components/transport_manager/include/transport_manager/usb/usb_device.h @@ -54,8 +54,8 @@ class UsbDevice : public Device { return usb_device_; } - protected: virtual ~UsbDevice() {} + protected: virtual bool IsSameAs(const Device* other_device) const { return unique_device_id() == other_device->unique_device_id(); @@ -69,6 +69,7 @@ class UsbDevice : public Device { private: PlatformUsbDevice* usb_device_; + }; } // namespace transport_adapter diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc index 0d8a77c88f..f5dc498db9 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc @@ -37,7 +37,7 @@ #include "transport_manager/bluetooth/bluetooth_connection_factory.h" #include "transport_manager/bluetooth/bluetooth_socket_connection.h" #include "utils/logger.h" -#include "utils/make_shared.h" + namespace transport_manager { namespace transport_adapter { @@ -55,8 +55,8 @@ TransportAdapter::Error BluetoothConnectionFactory::Init() { TransportAdapter::Error BluetoothConnectionFactory::CreateConnection( const DeviceUID& device_uid, const ApplicationHandle& app_handle) { LOG4CXX_AUTO_TRACE(logger_); - utils::SharedPtr connection = - utils::MakeShared( + std::shared_ptr connection = + std::make_shared( device_uid, app_handle, controller_); controller_->ConnectionCreated(connection, device_uid, app_handle); TransportAdapter::Error error = connection->Start(); diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc index 743c95f2e6..4a214a7610 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc @@ -262,8 +262,8 @@ void BluetoothDeviceScanner::CheckSDLServiceOnDevices( deviceName[name_len - 1] = '\0'; } - Device* bluetooth_device = - new BluetoothDevice(bd_address, deviceName, sdl_rfcomm_channels[i]); + auto bluetooth_device = + std::make_shared(bd_address, deviceName, sdl_rfcomm_channels[i]); if (bluetooth_device) { LOG4CXX_INFO(logger_, "Bluetooth device created successfully"); discovered_devices->push_back(bluetooth_device); diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc index 0f83f32c60..b373744f79 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc @@ -80,8 +80,8 @@ void BluetoothTransportAdapter::Store() const { if (!device) { // device could have been disconnected continue; } - utils::SharedPtr bluetooth_device = - DeviceSptr::static_pointer_cast(device); + std::shared_ptr bluetooth_device = + std::static_pointer_cast(device); Json::Value device_dictionary; device_dictionary["name"] = bluetooth_device->name(); char address[18]; diff --git a/src/components/transport_manager/src/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc index 4b590318e6..1697165d08 100644 --- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc +++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc @@ -59,7 +59,7 @@ #include #include "utils/logger.h" -#include "utils/make_shared.h" + #include "utils/threads/thread.h" #include "transport_manager/transport_adapter/transport_adapter_controller.h" #include "transport_manager/tcp/network_interface_listener_impl.h" @@ -303,20 +303,20 @@ void TcpClientListener::Loop() { device_name + std::string(":") + std::to_string(port_); #if defined(BUILD_TESTS) - TcpDevice* tcp_device = new TcpDevice( + auto tcp_device = std::make_shared( client_address.sin_addr.s_addr, device_uid, device_name); #else - TcpDevice* tcp_device = - new TcpDevice(client_address.sin_addr.s_addr, device_uid); + auto tcp_device = + std::make_shared(client_address.sin_addr.s_addr, device_uid); #endif // BUILD_TESTS DeviceSptr device = controller_->AddDevice(tcp_device); - tcp_device = static_cast(device.get()); + auto tcp_device_raw = static_cast(device.get()); const ApplicationHandle app_handle = - tcp_device->AddIncomingApplication(connection_fd); + tcp_device_raw->AddIncomingApplication(connection_fd); - utils::SharedPtr connection = - utils::MakeShared( + std::shared_ptr connection = + std::make_shared( device->unique_device_id(), app_handle, controller_); controller_->ConnectionCreated( connection, device->unique_device_id(), app_handle); diff --git a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc index 114425076a..e76fadfd35 100644 --- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc +++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc @@ -35,7 +35,7 @@ #include "transport_manager/tcp/tcp_server_originated_socket_connection.h" #include "utils/logger.h" -#include "utils/make_shared.h" + namespace transport_manager { namespace transport_adapter { @@ -56,8 +56,8 @@ TransportAdapter::Error TcpConnectionFactory::CreateConnection( LOG4CXX_DEBUG(logger_, "DeviceUID: " << &device_uid << ", ApplicationHandle: " << &app_handle); - utils::SharedPtr connection = - utils::MakeShared( + std::shared_ptr connection = + std::make_shared( device_uid, app_handle, controller_); controller_->ConnectionCreated(connection, device_uid, app_handle); const TransportAdapter::Error error = connection->Start(); diff --git a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc index 516f2d3ec4..2f10bd9454 100644 --- a/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc +++ b/src/components/transport_manager/src/tcp/tcp_server_originated_socket_connection.cc @@ -56,7 +56,7 @@ bool TcpServerOriginatedSocketConnection::Establish(ConnectError** error) { DCHECK(error); LOG4CXX_DEBUG(logger_, "error " << error); DeviceSptr device = controller()->FindDevice(device_handle()); - if (!device.valid()) { + if (device.use_count() == 0) { LOG4CXX_ERROR(logger_, "Device " << device_handle() << " not found"); *error = new ConnectError(); return false; diff --git a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc index f475912401..27ff893df3 100644 --- a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc +++ b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc @@ -103,8 +103,8 @@ void TcpTransportAdapter::Store() const { if (!device) { // device could have been disconnected continue; } - utils::SharedPtr tcp_device = - DeviceSptr::static_pointer_cast(device); + std::shared_ptr tcp_device = + std::static_pointer_cast(device); Json::Value device_dictionary; device_dictionary["name"] = tcp_device->name(); struct in_addr address; diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc index 89459b8ebb..96f8afd2ea 100644 --- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc +++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc @@ -826,16 +826,16 @@ ApplicationList TransportAdapterImpl::GetApplicationList( const DeviceUID& device_id) const { LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id); DeviceSptr device = FindDevice(device_id); - if (device.valid()) { + if (device.use_count() != 0) { ApplicationList lst = device->GetApplicationList(); LOG4CXX_TRACE(logger_, "exit with ApplicationList. It's size = " - << lst.size() << " Condition: device.valid()"); + << lst.size() << " Condition: device.use_count() != 0"); return lst; } LOG4CXX_TRACE( logger_, - "exit with empty ApplicationList. Condition: NOT device.valid()"); + "exit with empty ApplicationList. Condition: NOT device.use_count() != 0"); return ApplicationList(); } @@ -898,7 +898,7 @@ bool TransportAdapterImpl::IsInitialised() const { std::string TransportAdapterImpl::DeviceName(const DeviceUID& device_id) const { DeviceSptr device = FindDevice(device_id); - if (device.valid()) { + if (device.use_count() != 0) { return device->name(); } else { return ""; diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc index b0ec3c8f8e..5bf9036a4e 100644 --- a/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc +++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_listener_impl.cc @@ -278,7 +278,7 @@ void TransportAdapterListenerImpl::OnDataSendDone( device, app_id, data_container, - new BaseError()); + std::make_shared()); if (transport_manager_ != NULL && transport_manager::E_SUCCESS != transport_manager_->ReceiveEventFromDevice(event)) { diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc index 764accf7fe..68cfb0bc8d 100644 --- a/src/components/transport_manager/src/transport_manager_impl.cc +++ b/src/components/transport_manager/src/transport_manager_impl.cc @@ -47,7 +47,7 @@ #include "utils/macro.h" #include "utils/logger.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" #include "transport_manager/common.h" #include "transport_manager/transport_manager_listener.h" @@ -1069,7 +1069,7 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { LOG4CXX_ERROR(logger_, "Transport adapter failed to send data"); // TODO(YK): potential error case -> thread unsafe // update of message content - if (event.event_data.valid()) { + if (event.event_data.use_count() != 0) { event.event_data->set_waiting(true); } else { LOG4CXX_DEBUG(logger_, "Data is invalid"); @@ -1213,7 +1213,7 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal( const DeviceHandle device_handle) : transport_manager(transport_manager) , transport_adapter(transport_adapter) - , timer(utils::MakeShared*>( "TM DiscRoutine", diff --git a/src/components/transport_manager/src/usb/libusb/usb_connection.cc b/src/components/transport_manager/src/usb/libusb/usb_connection.cc index e9ab2bae8e..212e6e0ec3 100644 --- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc +++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc @@ -224,7 +224,7 @@ void UsbConnection::OnOutTransfer(libusb_transfer* transfer) { device_uid_, app_handle_, current_out_message_, DataSendError()); PopOutMessage(); } - if (!current_out_message_.valid()) { + if (current_out_message_.use_count() == 0) { libusb_free_transfer(transfer); out_transfer_ = NULL; waiting_out_transfer_cancel_ = false; @@ -242,7 +242,7 @@ TransportAdapter::Error UsbConnection::SendData( return TransportAdapter::BAD_STATE; } sync_primitives::AutoLock locker(out_messages_mutex_); - if (current_out_message_.valid()) { + if (current_out_message_.use_count() != 0) { out_messages_.push_back(message); } else { current_out_message_ = message; diff --git a/src/components/transport_manager/src/usb/qnx/usb_connection.cc b/src/components/transport_manager/src/usb/qnx/usb_connection.cc index 516a367ebc..b9386c5d9f 100644 --- a/src/components/transport_manager/src/usb/qnx/usb_connection.cc +++ b/src/components/transport_manager/src/usb/qnx/usb_connection.cc @@ -230,7 +230,7 @@ void UsbConnection::OnOutTransfer(usbd_urb* urb) { } } - if ((!disconnecting_) && current_out_message_.valid()) { + if ((!disconnecting_) && (current_out_message_.use_count() != 0)) { PostOutTransfer(); } else { pending_out_transfer_ = false; @@ -243,7 +243,7 @@ TransportAdapter::Error UsbConnection::SendData( return TransportAdapter::BAD_STATE; } sync_primitives::AutoLock locker(out_messages_mutex_); - if (current_out_message_.valid()) { + if (current_out_message_.use_count() != 0) { out_messages_.push_back(message); } else { current_out_message_ = message; diff --git a/src/components/transport_manager/src/usb/usb_connection_factory.cc b/src/components/transport_manager/src/usb/usb_connection_factory.cc index 1136dfad21..c34292e758 100644 --- a/src/components/transport_manager/src/usb/usb_connection_factory.cc +++ b/src/components/transport_manager/src/usb/usb_connection_factory.cc @@ -34,7 +34,7 @@ #include "transport_manager/usb/usb_device.h" #include "transport_manager/transport_adapter/transport_adapter_impl.h" #include "utils/logger.h" -#include "utils/make_shared.h" + #if defined(__QNXNTO__) #include "transport_manager/usb/qnx/usb_connection.h" @@ -65,17 +65,17 @@ TransportAdapter::Error UsbConnectionFactory::CreateConnection( "enter DeviceUID: " << &device_uid << ", ApplicationHandle: " << &app_handle); DeviceSptr device = controller_->FindDevice(device_uid); - if (!device.valid()) { + if (device.use_count() == 0) { LOG4CXX_ERROR(logger_, "device " << device_uid << " not found"); LOG4CXX_TRACE( logger_, - "exit with TransportAdapter::BAD_PARAM. Condition: !device.valid()"); + "exit with TransportAdapter::BAD_PARAM. Condition: device.use_count() == 0"); return TransportAdapter::BAD_PARAM; } UsbDevice* usb_device = static_cast(device.get()); - utils::SharedPtr connection = - utils::MakeShared(device_uid, + std::shared_ptr connection = + std::make_shared(device_uid, app_handle, controller_, usb_handler_, diff --git a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h index bb15c19d3b..9c7327e6fb 100644 --- a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h +++ b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h @@ -57,8 +57,8 @@ class RawMessageMatcher : public MatcherInterface { virtual bool MatchAndExplain(const RawMessagePtr ptr, MatchResultListener* listener) const; - virtual void DescribeTo(::std::ostream* os) const; - virtual void DescribeNegationTo(::std::ostream* os) const; + virtual void DescribeTo(std::ostream* os) const; + virtual void DescribeNegationTo(std::ostream* os) const; private: const RawMessagePtr ptr_; diff --git a/src/components/transport_manager/test/tcp_client_listener_test.cc b/src/components/transport_manager/test/tcp_client_listener_test.cc index 7ab53915fe..496851c0ef 100644 --- a/src/components/transport_manager/test/tcp_client_listener_test.cc +++ b/src/components/transport_manager/test/tcp_client_listener_test.cc @@ -46,7 +46,7 @@ #include "transport_manager/mock_transport_manager.h" #include "transport_manager/transport_adapter/transport_adapter_controller.h" #include "transport_manager/transport_adapter/mock_device.h" -#include "utils/make_shared.h" + #include "utils/test_async_waiter.h" #include "utils/threads/thread.h" @@ -310,7 +310,7 @@ TEST_P(TcpClientListenerTest, ClientConnection) { TestAsyncWaiter waiter; // controller should be notified of AddDevice event - DeviceSptr mock_device = utils::MakeShared( + DeviceSptr mock_device = std::make_shared( htonl(INADDR_LOOPBACK), "dummy_tcp_device"); EXPECT_CALL(adapter_controller_mock_, AddDevice(_)) .WillOnce(Return(mock_device)); diff --git a/src/components/transport_manager/test/tcp_transport_adapter_test.cc b/src/components/transport_manager/test/tcp_transport_adapter_test.cc index a6896dc48a..d56cb5dbdd 100644 --- a/src/components/transport_manager/test/tcp_transport_adapter_test.cc +++ b/src/components/transport_manager/test/tcp_transport_adapter_test.cc @@ -41,7 +41,7 @@ #include "transport_manager/tcp/mock_tcp_transport_adapter.h" #include "transport_manager/mock_transport_manager_settings.h" -#include "utils/make_shared.h" + namespace test { namespace components { @@ -76,7 +76,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) { MockTCPTransportAdapter transport_adapter( port, last_state_, transport_manager_settings); std::string uniq_id = "unique_device_name"; - utils::SharedPtr mockdev = new MockTCPDevice(port, uniq_id); + std::shared_ptr mockdev = std::make_shared(port, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); @@ -87,7 +87,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) { std::vector intList = {app_handle}; EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList)); - ConnectionSPtr mock_connection = new MockConnection(); + ConnectionSPtr mock_connection = std::make_shared(); EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev)); EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle)) .WillOnce(Return(mock_connection)); @@ -115,13 +115,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) { MockTCPTransportAdapter transport_adapter( port, last_state_, transport_manager_settings); const uint32_t count_dev = 10; - utils::SharedPtr mockdev[count_dev]; + std::shared_ptr mockdev[count_dev]; std::string uniq_id[count_dev]; for (uint32_t i = 0; i < count_dev; i++) { char numb[12]; std::snprintf(numb, 12, "%d", i); uniq_id[i] = "unique_device_name" + std::string(numb); - mockdev[i] = new MockTCPDevice(port, uniq_id[i]); + mockdev[i] = std::make_shared(port, uniq_id[i]); EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false)); transport_adapter.AddDevice(mockdev[i]); } @@ -133,7 +133,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) { const int app_handle = 1; std::vector intList = {app_handle}; - ConnectionSPtr mock_connection = new MockConnection(); + ConnectionSPtr mock_connection = std::make_shared(); for (uint32_t i = 0; i < count_dev; i++) { EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i])) .WillOnce(Return(mockdev[i])); @@ -170,13 +170,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) { port, last_state_, transport_manager_settings); const uint32_t count_dev = 10; - utils::SharedPtr mockdev[count_dev]; + std::shared_ptr mockdev[count_dev]; std::string uniq_id[count_dev]; for (uint32_t i = 0; i < count_dev; i++) { char numb[12]; std::snprintf(numb, 12, "%d", i); uniq_id[i] = "unique_device_name" + std::string(numb); - mockdev[i] = new MockTCPDevice(port, uniq_id[i]); + mockdev[i] = std::make_shared(port, uniq_id[i]); EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false)); transport_adapter.AddDevice(mockdev[i]); } @@ -190,7 +190,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) { std::vector intList = {app_handle[0], app_handle[1], app_handle[2]}; const std::string ports[connection_count] = {"11111", "67890", "98765"}; const int int_port[connection_count] = {11111, 67890, 98765}; - ConnectionSPtr mock_connection = new MockConnection(); + ConnectionSPtr mock_connection = std::make_shared(); for (uint32_t i = 0; i < count_dev; i++) { EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i])) .WillOnce(Return(mockdev[i])); @@ -228,7 +228,7 @@ TEST_F(TcpAdapterTest, StoreData_ConnectionNotExist_DataNotStored) { MockTCPTransportAdapter transport_adapter( port, last_state_, transport_manager_settings); std::string uniq_id = "unique_device_name"; - utils::SharedPtr mockdev = new MockTCPDevice(port, uniq_id); + auto mockdev = std::make_shared(port, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); @@ -265,7 +265,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) { MockTCPTransportAdapter transport_adapter( port, last_state_, transport_manager_settings); std::string uniq_id = "unique_device_name"; - utils::SharedPtr mockdev = new MockTCPDevice(port, uniq_id); + std::shared_ptr mockdev = std::make_shared(port, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); @@ -276,7 +276,7 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) { std::vector intList = {app_handle}; EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList)); - ConnectionSPtr mock_connection = new MockConnection(); + ConnectionSPtr mock_connection = std::make_shared(); EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev)); EXPECT_CALL(transport_adapter, FindEstablishedConnection(uniq_id, app_handle)) .WillOnce(Return(mock_connection)); @@ -300,13 +300,13 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) { port, last_state_, transport_manager_settings); const uint32_t count_dev = 10; - utils::SharedPtr mockdev[count_dev]; + std::shared_ptr mockdev[count_dev]; std::string uniq_id[count_dev]; for (uint32_t i = 0; i < count_dev; i++) { char numb[12]; std::snprintf(numb, 12, "%d", i); uniq_id[i] = "unique_device_name" + std::string(numb); - mockdev[i] = new MockTCPDevice(port, uniq_id[i]); + mockdev[i] = std::make_shared(port, uniq_id[i]); EXPECT_CALL(*(mockdev[i]), IsSameAs(_)).WillRepeatedly(Return(false)); transport_adapter.AddDevice(mockdev[i]); } @@ -318,7 +318,7 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) { const int app_handle = 1; std::vector intList = {app_handle}; - ConnectionSPtr mock_connection = new MockConnection(); + ConnectionSPtr mock_connection = std::make_shared(); for (uint32_t i = 0; i < count_dev; i++) { EXPECT_CALL(transport_adapter, FindDevice(uniq_id[i])) .WillOnce(Return(mockdev[i])); diff --git a/src/components/transport_manager/test/transport_adapter_listener_test.cc b/src/components/transport_manager/test/transport_adapter_listener_test.cc index 1494844519..acf9d3dcb3 100644 --- a/src/components/transport_manager/test/transport_adapter_listener_test.cc +++ b/src/components/transport_manager/test/transport_adapter_listener_test.cc @@ -129,7 +129,7 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveFailed) { TEST_F(TransportAdapterListenerTest, OnDataSendDone) { unsigned char data[3] = {0x20, 0x07, 0x01}; ::protocol_handler::RawMessagePtr data_container = - new ::protocol_handler::RawMessage(1, 1, data, 3); + std::make_shared<::protocol_handler::RawMessage>(1, 1, data, 3); EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_SEND_DONE, @@ -145,7 +145,7 @@ TEST_F(TransportAdapterListenerTest, OnDataSendDone) { TEST_F(TransportAdapterListenerTest, OnDataSendFailed) { unsigned char data[3] = {0x20, 0x07, 0x01}; ::protocol_handler::RawMessagePtr data_container = - new ::protocol_handler::RawMessage(1, 1, data, 3); + std::make_shared<::protocol_handler::RawMessage>(1, 1, data, 3); DataSendError err; EXPECT_CALL(tr_mock, diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc index 68758f418f..d5b9c40821 100644 --- a/src/components/transport_manager/test/transport_adapter_test.cc +++ b/src/components/transport_manager/test/transport_adapter_test.cc @@ -45,7 +45,7 @@ #include "transport_manager/transport_adapter/transport_adapter_controller.h" #include "transport_manager/transport_adapter/connection.h" #include "protocol/raw_message.h" -#include "utils/make_shared.h" + #include "resumption/last_state_impl.h" #include "config_profile/profile.h" @@ -156,10 +156,10 @@ TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) { EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - utils::SharedPtr mockdev = new MockDevice(dev_id, uniq_id); + auto mockdev = std::make_shared(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); - std::vector > devList; + std::vector > devList; devList.push_back(mockdev); EXPECT_CALL(*mockdev, IsSameAs(_)).WillOnce(Return(true)); @@ -189,8 +189,8 @@ TEST_F(TransportAdapterTest, AddDevice) { MockTransportAdapterListener mock_listener; transport_adapter.AddListener(&mock_listener); - utils::SharedPtr mockdev = - utils::MakeShared(dev_id, uniq_id); + std::shared_ptr mockdev = + std::make_shared(dev_id, uniq_id); EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter)); transport_adapter.AddDevice(mockdev); @@ -277,8 +277,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) { EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - utils::SharedPtr mockdev = - utils::MakeShared(dev_id, uniq_id); + std::shared_ptr mockdev = + std::make_shared(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); @@ -307,7 +307,7 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceNotAdded) { EXPECT_CALL(*serverMock, IsInitialised()).Times(0); EXPECT_CALL(*serverMock, CreateConnection(_, _)).Times(0); EXPECT_CALL(transport_adapter, FindDevice(uniq_id)) - .WillOnce(Return(utils::SharedPtr())); + .WillOnce(Return(std::shared_ptr())); TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id); EXPECT_EQ(TransportAdapter::BAD_PARAM, res); @@ -323,8 +323,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) { EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - utils::SharedPtr mockdev = - utils::MakeShared(dev_id, uniq_id); + std::shared_ptr mockdev = + std::make_shared(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); @@ -354,8 +354,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) { EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - utils::SharedPtr mockdev = - utils::MakeShared(dev_id, uniq_id); + std::shared_ptr mockdev = + std::make_shared(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); @@ -401,7 +401,7 @@ TEST_F(TransportAdapterTest, Disconnect_ConnectDoneSuccess) { TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle); EXPECT_EQ(TransportAdapter::OK, res); - MockConnection* mock_connection = new MockConnection(); + auto mock_connection = std::make_shared(); transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle); EXPECT_CALL(transport_adapter, Store()); @@ -425,8 +425,8 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) { EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - utils::SharedPtr mockdev = - utils::MakeShared(dev_id, uniq_id); + std::shared_ptr mockdev = + std::make_shared(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); @@ -443,7 +443,7 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) { TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id); EXPECT_EQ(TransportAdapter::OK, res); - MockConnection* mock_connection = new MockConnection(); + auto mock_connection = std::make_shared(); transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle); EXPECT_CALL(*mock_connection, Disconnect()) @@ -467,8 +467,8 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) { MockTransportAdapterListener mock_listener; transport_adapter.AddListener(&mock_listener); - utils::SharedPtr mockdev = - utils::MakeShared(dev_id, uniq_id); + std::shared_ptr mockdev = + std::make_shared(dev_id, uniq_id); EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter)); transport_adapter.AddDevice(mockdev); @@ -485,8 +485,8 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) { TransportAdapter::Error res = transport_adapter.ConnectDevice(uniq_id); EXPECT_EQ(TransportAdapter::OK, res); - utils::SharedPtr mock_connection = - utils::MakeShared(); + std::shared_ptr mock_connection = + std::make_shared(); transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle); EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter)); @@ -545,7 +545,7 @@ TEST_F(TransportAdapterTest, SendData) { TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle); EXPECT_EQ(TransportAdapter::OK, res); - MockConnection* mock_connection = new MockConnection(); + auto mock_connection = std::make_shared(); transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle); EXPECT_CALL(transport_adapter, Store()); @@ -553,7 +553,7 @@ TEST_F(TransportAdapterTest, SendData) { const unsigned int kSize = 3; unsigned char data[kSize] = {0x20, 0x07, 0x01}; - const RawMessagePtr kMessage = new RawMessage(1, 1, data, kSize); + const RawMessagePtr kMessage = std::make_shared(1, 1, data, kSize); EXPECT_CALL(*mock_connection, SendData(kMessage)) .WillOnce(Return(TransportAdapter::OK)); @@ -586,12 +586,12 @@ TEST_F(TransportAdapterTest, SendData_ConnectionNotEstablished) { TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle); EXPECT_EQ(TransportAdapter::OK, res); - MockConnection* mock_connection = new MockConnection(); + auto mock_connection = std::make_shared(); transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle); const unsigned int kSize = 3; unsigned char data[kSize] = {0x20, 0x07, 0x01}; - const RawMessagePtr kMessage = new RawMessage(1, 1, data, kSize); + const RawMessagePtr kMessage = std::make_shared(1, 1, data, kSize); EXPECT_CALL(*mock_connection, SendData(kMessage)).Times(0); res = transport_adapter.SendData(dev_id, app_handle, kMessage); @@ -712,8 +712,8 @@ TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) { EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - utils::SharedPtr mockdev = - utils::MakeShared(dev_id, uniq_id); + std::shared_ptr mockdev = + std::make_shared(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); @@ -744,7 +744,7 @@ TEST_F(TransportAdapterTest, FindEstablishedConnection) { TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle); EXPECT_EQ(TransportAdapter::OK, res); - ConnectionSPtr mock_connection = new MockConnection(); + ConnectionSPtr mock_connection = std::make_shared(); transport_adapter.ConnectionCreated(mock_connection, dev_id, app_handle); EXPECT_CALL(transport_adapter, Store()); @@ -763,14 +763,14 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_NoDeviseWithAskedId_UNSUCCESS) { MockTransportAdapterImpl transport_adapter( NULL, NULL, NULL, last_state_, transport_manager_settings); - utils::SharedPtr mock_device = - utils::MakeShared("test_device_name", "test_device_uid0"); + std::shared_ptr mock_device = + std::make_shared("test_device_name", "test_device_uid0"); transport_adapter.AddDevice(mock_device); EXPECT_CALL(*mock_device, LaunchApp(bundle_id)).Times(0); EXPECT_CALL(transport_adapter, FindDevice("test_device_uid1")) - .WillOnce(Return(utils::SharedPtr())); + .WillOnce(Return(std::shared_ptr())); transport_adapter.RunAppOnDevice("test_device_uid1", bundle_id); } @@ -782,8 +782,8 @@ TEST_F(TransportAdapterTest, RunAppOnDevice_DeviseWithAskedIdWasFound_SUCCESS) { MockTransportAdapterImpl transport_adapter( NULL, NULL, NULL, last_state_, transport_manager_settings); - utils::SharedPtr mock_device = - utils::MakeShared("test_device_name", device_uid); + std::shared_ptr mock_device = + std::make_shared("test_device_name", device_uid); transport_adapter.AddDevice(mock_device); @@ -800,7 +800,7 @@ TEST_F(TransportAdapterTest, StopDevice) { EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - auto mockdev = utils::MakeShared(dev_id, uniq_id); + auto mockdev = std::make_shared(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); EXPECT_CALL(transport_adapter, FindDevice(uniq_id)).WillOnce(Return(mockdev)); diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc index 9ba95ea99a..863c32f2ab 100644 --- a/src/components/transport_manager/test/transport_manager_impl_test.cc +++ b/src/components/transport_manager/test/transport_manager_impl_test.cc @@ -42,8 +42,8 @@ #include "transport_manager/mock_transport_manager_impl.h" #include "transport_manager/mock_transport_manager_settings.h" #include "resumption/last_state_impl.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "utils/test_async_waiter.h" using ::testing::_; @@ -55,7 +55,7 @@ using ::testing::DoAll; using ::protocol_handler::RawMessage; using ::protocol_handler::RawMessagePtr; -using utils::MakeShared; +using std::make_shared; namespace test { namespace components { @@ -85,7 +85,7 @@ class TransportManagerImplTest : public ::testing::Test { "app_info_storage"); tm_.Init(last_state_); mock_adapter_ = new MockTransportAdapter(); - tm_listener_ = MakeShared(); + tm_listener_ = std::make_shared(); #ifdef TELEMETRY_MONITOR tm_.SetTelemetryObserver(&mock_metric_observer_); @@ -96,14 +96,14 @@ class TransportManagerImplTest : public ::testing::Test { EXPECT_EQ(E_SUCCESS, tm_.AddTransportAdapter(mock_adapter_)); connection_key_ = 1; - error_ = MakeShared(); + error_ = std::make_shared(); const unsigned int version_protocol_ = 1; const unsigned int kSize = 12; unsigned char data[kSize] = { 0x20, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; test_message_ = - MakeShared(connection_key_, version_protocol_, data, kSize); + std::make_shared(connection_key_, version_protocol_, data, kSize); } DeviceInfo ConstructDeviceInfo(const std::string& mac_address, @@ -331,7 +331,7 @@ class TransportManagerImplTest : public ::testing::Test { #endif // TELEMETRY_MONITOR MockTransportAdapter* mock_adapter_; - utils::SharedPtr tm_listener_; + std::shared_ptr tm_listener_; MockTransportManagerImpl tm_; const ApplicationHandle application_id_ = 1; ConnectionUID connection_key_; @@ -1144,7 +1144,7 @@ TEST_F(TransportManagerImplTest, test_message_, error_)); - auto second_mock_adapter = utils::MakeShared(); + auto second_mock_adapter = std::make_shared(); const auto usb_serial = "USB_serial"; DeviceInfo second_device = @@ -1220,7 +1220,7 @@ TEST_F(TransportManagerImplTest, test_message_, error_)); - auto second_mock_adapter = utils::MakeShared(); + auto second_mock_adapter = std::make_shared(); DeviceInfo second_device = ConstructDeviceInfo("MA:CA:DR:ES:S", "USB_IOS", "SecondDeviceName"); diff --git a/src/components/utils/test/async_runner_test.cc b/src/components/utils/test/async_runner_test.cc index 65abad65c2..bd6e743291 100644 --- a/src/components/utils/test/async_runner_test.cc +++ b/src/components/utils/test/async_runner_test.cc @@ -36,8 +36,8 @@ #include "utils/lock.h" #include "utils/threads/async_runner.h" #include "utils/conditional_variable.h" -#include "utils/shared_ptr.h" -#include "utils/make_shared.h" + + #include "gtest/gtest.h" #include "gmock/gmock.h" @@ -92,7 +92,7 @@ class AsyncRunnerTest : public ::testing::Test { protected: ThreadDelegate** delegates_; - ::utils::SharedPtr async_runner_; + std::shared_ptr async_runner_; void CreateThreadsArray() { delegates_ = new ThreadDelegate* [kDelegatesAmount]; @@ -103,7 +103,7 @@ class AsyncRunnerTest : public ::testing::Test { } void CreateAsyncRunner() { - async_runner_ = ::utils::MakeShared("test"); + async_runner_ = std::make_shared("test"); } }; @@ -128,8 +128,8 @@ TEST_F(AsyncRunnerTest, StopThenRun_ExpectDelegateNotStarted) { // Check that delegate was not started due to Stop() called before AsyncRun() EXPECT_CALL(mock_thread_delegate, threadMain()).Times(0); { - ::utils::SharedPtr async_runner = - ::utils::MakeShared("test"); + std::shared_ptr async_runner = + std::make_shared("test"); async_runner->Stop(); async_runner->AsyncRun(&mock_thread_delegate); } diff --git a/src/components/utils/test/shared_ptr_test.cc b/src/components/utils/test/shared_ptr_test.cc deleted file mode 100644 index 99fe4f7dd7..0000000000 --- a/src/components/utils/test/shared_ptr_test.cc +++ /dev/null @@ -1,542 +0,0 @@ -/* - * Copyright (c) 2015, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include "gmock/gmock.h" -#include "utils/shared_ptr.h" - -namespace test { -namespace components { -namespace utils_test { - -class CMockObject { - public: - CMockObject(int id); - virtual ~CMockObject(); - virtual int getId() const; - - MOCK_METHOD0(destructor, void()); - - private: - int mId_; -}; - -class CExtendedMockObject : public CMockObject { - public: - CExtendedMockObject(int id); -}; - -using ::testing::NiceMock; - -CMockObject::CMockObject(int id) : mId_(id) {} - -CMockObject::~CMockObject() { - destructor(); -} - -int CMockObject::getId() const { - return mId_; -} - -CExtendedMockObject::CExtendedMockObject(int id) : CMockObject(id) {} - -typedef utils::SharedPtr tMockObjectPtr; -typedef utils::SharedPtr tExtendedMockObjectPtr; - -TEST(SharedPtrTest, DefaultConstructorTest) { - // Constructor checks - tMockObjectPtr p0; - ASSERT_EQ(0, p0.get()); - ASSERT_FALSE(p0.valid()); -} - -TEST(SharedPtrTest, ConstructorWithOneParameterTest) { - // Arrange - CMockObject* object1 = new CMockObject(1); - EXPECT_CALL(*object1, destructor()).Times(1); - - // Constructor checks - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); -} - -TEST(SharedPtrTest, CopyConstructorTest) { - // Arrange - CMockObject* object1 = new CMockObject(1); - EXPECT_CALL(*object1, destructor()).Times(1); - - // Constructor checks - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tMockObjectPtr p2(p1); - ASSERT_EQ(1, p2->getId()); - ASSERT_EQ(2u, *(p2.get_ReferenceCounter())); - tMockObjectPtr p3 = p2; - ASSERT_EQ(1, p3->getId()); - ASSERT_EQ(3u, *(p3.get_ReferenceCounter())); - { - tMockObjectPtr p4 = p3; - ASSERT_EQ(1, p4->getId()); - ASSERT_EQ(4u, *(p3.get_ReferenceCounter())); - } - // Check reference counter decreased - ASSERT_EQ(3u, *(p3.get_ReferenceCounter())); -} - -TEST(SharedPtrTest, SecondConstructorWithOneParameterTest) { - // Arrange - CExtendedMockObject* object1 = new CExtendedMockObject(2); - EXPECT_CALL(*object1, destructor()).Times(0); - - // Constructors checks - tExtendedMockObjectPtr p1(object1); - ASSERT_EQ(2, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tMockObjectPtr p2(p1); - ASSERT_EQ(2, p2->getId()); - ASSERT_EQ(2u, *(p2.get_ReferenceCounter())); - EXPECT_CALL(*object1, destructor()); -} - -TEST(SharedPtrTest, AssignmentOperatorTest) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CMockObject* object2 = new CMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(0); - EXPECT_CALL(*object2, destructor()).Times(0); - - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tMockObjectPtr p2(object2); - ASSERT_EQ(2, p2->getId()); - ASSERT_EQ(1u, *(p2.get_ReferenceCounter())); - - tMockObjectPtr p3(p1); - ASSERT_EQ(1, p3->getId()); - ASSERT_EQ(2u, *(p3.get_ReferenceCounter())); - - tMockObjectPtr p4(p3); - ASSERT_EQ(1, p4->getId()); - ASSERT_EQ(3u, *(p4.get_ReferenceCounter())); - - tMockObjectPtr p5(p4); - ASSERT_EQ(1, p5->getId()); - ASSERT_EQ(4u, *(p5.get_ReferenceCounter())); - - p5 = p2; - - // Check reference counter for new SharedPtr increased - ASSERT_EQ(2, p5->getId()); - ASSERT_EQ(2u, *(p5.get_ReferenceCounter())); - - // Check reference counter for old SharedPtr decreased - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(3u, *(p1.get_ReferenceCounter())); - - EXPECT_CALL(*object1, destructor()); - EXPECT_CALL(*object2, destructor()); -} - -TEST(SharedPtrTest, SecondAssignmentOperatorTest) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CExtendedMockObject* object2 = new CExtendedMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(0); - EXPECT_CALL(*object2, destructor()).Times(0); - - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tExtendedMockObjectPtr p2(object2); - ASSERT_EQ(2, p2->getId()); - ASSERT_EQ(1u, *(p2.get_ReferenceCounter())); - - tMockObjectPtr p3(p1); - ASSERT_EQ(1, p3->getId()); - ASSERT_EQ(2u, *(p3.get_ReferenceCounter())); - - tMockObjectPtr p4(p3); - ASSERT_EQ(1, p4->getId()); - ASSERT_EQ(3u, *(p4.get_ReferenceCounter())); - - tMockObjectPtr p5(p4); - ASSERT_EQ(1, p5->getId()); - ASSERT_EQ(4u, *(p5.get_ReferenceCounter())); - // Use assignment operator - p5 = p2; - - // Check reference counter for new SharedPtr increased - ASSERT_EQ(2, p5->getId()); - ASSERT_EQ(2u, *(p5.get_ReferenceCounter())); - - // Check reference counter for old SharedPtr decreased - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(3u, *(p1.get_ReferenceCounter())); - - EXPECT_CALL(*object1, destructor()); - EXPECT_CALL(*object2, destructor()); -} - -TEST(SharedPtrTest, EqualOperatorTest) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CMockObject* object2 = new CMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(0); - EXPECT_CALL(*object2, destructor()).Times(0); - - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tMockObjectPtr p2(object2); - ASSERT_EQ(2, p2->getId()); - ASSERT_EQ(1u, *(p2.get_ReferenceCounter())); - - tMockObjectPtr p3(p1); - ASSERT_EQ(1, p3->getId()); - ASSERT_EQ(2u, *(p3.get_ReferenceCounter())); - - tMockObjectPtr p4(p3); - ASSERT_EQ(1, p4->getId()); - ASSERT_EQ(3u, *(p4.get_ReferenceCounter())); - - tMockObjectPtr p5(p4); - ASSERT_EQ(1, p5->getId()); - ASSERT_EQ(4u, *(p5.get_ReferenceCounter())); - // Checks - ASSERT_TRUE(p1 == p3); - ASSERT_TRUE(p1 == p4); - ASSERT_TRUE(p4 == p3); - ASSERT_FALSE(p1 == p2); - - EXPECT_CALL(*object1, destructor()); - EXPECT_CALL(*object2, destructor()); -} - -TEST(SharedPtrTest, LessThanOperatorTest) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CMockObject* object2 = new CMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(0); - EXPECT_CALL(*object2, destructor()).Times(0); - - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tMockObjectPtr p2(object2); - ASSERT_EQ(2, p2->getId()); - ASSERT_EQ(1u, *(p2.get_ReferenceCounter())); - - // Checks - if (object1 < object2) { - ASSERT_TRUE(p1 < p2); - } else { - ASSERT_FALSE(p1 < p2); - } - - EXPECT_CALL(*object1, destructor()); - EXPECT_CALL(*object2, destructor()); -} - -TEST(SharedPtrTest, StaticPointerCastTest_DerivedToBase_ExpectCastOk) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CExtendedMockObject* object2 = new CExtendedMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(1); - EXPECT_CALL(*object2, destructor()).Times(0); - - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tExtendedMockObjectPtr ep1(object2); - ASSERT_EQ(2, ep1->getId()); - ASSERT_EQ(1u, *(ep1.get_ReferenceCounter())); - // Cast from SharedPtr to Derived class to SharedPtr to Base class - p1 = utils::SharedPtr::static_pointer_cast( - ep1); - // Checks - ASSERT_EQ(2, p1->getId()); - ASSERT_EQ(2u, *(p1.get_ReferenceCounter())); - ASSERT_TRUE(p1 == ep1); - - EXPECT_CALL(*object2, destructor()); -} - -TEST(SharedPtrTest, StaticPointerCastTest_BaseToDerived_ExpectCastOk) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CExtendedMockObject* object2 = new CExtendedMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(0); - EXPECT_CALL(*object2, destructor()).Times(1); - - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tExtendedMockObjectPtr ep1(object2); - ASSERT_EQ(2, ep1->getId()); - ASSERT_EQ(1u, *(ep1.get_ReferenceCounter())); - // Cast from SharedPtr to Base class to SharedPtr to Derived class - ep1 = utils::SharedPtr::static_pointer_cast( - p1); - // Checks - ASSERT_EQ(1, ep1->getId()); - ASSERT_EQ(2u, *(ep1.get_ReferenceCounter())); - ASSERT_TRUE(p1 == ep1); - - EXPECT_CALL(*object1, destructor()); -} - -TEST(SharedPtrTest, DynamicPointerCastTest_DerivedToBase_ExpectCastOk) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CExtendedMockObject* object2 = new CExtendedMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(1); - EXPECT_CALL(*object2, destructor()).Times(0); - - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tExtendedMockObjectPtr ep1(object2); - ASSERT_EQ(2, ep1->getId()); - ASSERT_EQ(1u, *(ep1.get_ReferenceCounter())); - // Cast from SharedPtr to Derived class to SharedPtr to Base class - p1 = utils::SharedPtr::dynamic_pointer_cast( - ep1); - // Checks - ASSERT_EQ(2, p1->getId()); - ASSERT_EQ(2u, *(p1.get_ReferenceCounter())); - ASSERT_TRUE(p1 == ep1); - - EXPECT_CALL(*object2, destructor()); -} - -TEST(SharedPtrTest, DynamicPointerCastTest_BaseToDerived_ExpectNullPtr) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CExtendedMockObject* object2 = new CExtendedMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(0); - EXPECT_CALL(*object2, destructor()).Times(1); - - tMockObjectPtr p1(object1); - ASSERT_EQ(1, p1->getId()); - ASSERT_EQ(1u, *(p1.get_ReferenceCounter())); - - tExtendedMockObjectPtr ep1(object2); - ASSERT_EQ(2, ep1->getId()); - ASSERT_EQ(1u, *(ep1.get_ReferenceCounter())); - // Cast from SharedPtr to Base class to SharedPtr to Derived class - ep1 = - utils::SharedPtr::dynamic_pointer_cast( - p1); - // Checks - ASSERT_EQ(NULL, ep1); - - EXPECT_CALL(*object1, destructor()); -} - -TEST(SharedPtrTest, ArrowOperatorTest) { - // Arrange - CExtendedMockObject* object1 = new CExtendedMockObject(1); - CExtendedMockObject* object2 = new CExtendedMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(1); - EXPECT_CALL(*object2, destructor()).Times(1); - - tExtendedMockObjectPtr ep1(object1); - // Check - ASSERT_EQ(1, ep1->getId()); - - tMockObjectPtr p1(ep1); - // Check - ASSERT_EQ(1, p1->getId()); - - tExtendedMockObjectPtr ep2(object2); - // Check - ASSERT_EQ(2, ep2->getId()); -} - -TEST(SharedPtrTest, DereferenceOperatorTest) { - // Arrange - CExtendedMockObject* object1 = new CExtendedMockObject(1); - CExtendedMockObject* object2 = new CExtendedMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(1); - EXPECT_CALL(*object2, destructor()).Times(1); - - tExtendedMockObjectPtr ep1(object1); - // Check - ASSERT_EQ(1, (*ep1).getId()); - - tMockObjectPtr p1(ep1); - // Check - ASSERT_EQ(1, (*p1).getId()); - - tExtendedMockObjectPtr ep2(object2); - // Check - ASSERT_EQ(2, (*ep2).getId()); -} - -TEST(SharedPtrTest, BoolOperatorTest) { - // Arrange - CMockObject* object1 = new CMockObject(1); - tMockObjectPtr p1(object1); - tMockObjectPtr p2; - - // Checks - ASSERT_TRUE(p1); - ASSERT_FALSE(p2); - EXPECT_CALL(*object1, destructor()); -} - -TEST(SharedPtrTest, ResetWithoutArgsTest) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CMockObject* object2 = new CMockObject(2); - - EXPECT_CALL(*object1, destructor()).Times(1); - EXPECT_CALL(*object2, destructor()).Times(1); - - tMockObjectPtr p1(object1); - tMockObjectPtr p2(object2); - ASSERT_EQ(2, p2->getId()); - ASSERT_EQ(1u, *(p2.get_ReferenceCounter())); - - tMockObjectPtr p3(p1); - tMockObjectPtr p4(p3); - ASSERT_EQ(1, p4->getId()); - ASSERT_EQ(3u, *(p4.get_ReferenceCounter())); - // Act - p2.reset(); - // Check - EXPECT_EQ(NULL, p2.get()); - EXPECT_EQ(1u, *(p2.get_ReferenceCounter())); - p4.reset(); - // Check - EXPECT_EQ(NULL, p4.get()); - EXPECT_EQ(1u, *(p4.get_ReferenceCounter())); -} - -TEST(SharedPtrTest, ResetWithArgumentTest) { - // Arrange - CMockObject* object1 = new CMockObject(1); - CMockObject* object2 = new CMockObject(27); - - EXPECT_CALL(*object1, destructor()).Times(1); - EXPECT_CALL(*object2, destructor()).Times(1); - - tMockObjectPtr p1(object1); - tMockObjectPtr p3(p1); - tMockObjectPtr p4(p3); - ASSERT_EQ(1, p4->getId()); - ASSERT_EQ(3u, *(p4.get_ReferenceCounter())); - // Act - p4.reset(object2); - // Check - EXPECT_EQ(27, (*p4).getId()); - EXPECT_EQ(1u, *(p4.get_ReferenceCounter())); -} - -TEST(SharedPtrTest, GetMethodTest_ExpectObjPointer) { - // Arrange - CMockObject* object1 = new CMockObject(1); - EXPECT_CALL(*object1, destructor()).Times(1); - tMockObjectPtr p1(object1); - // Check - ASSERT_EQ(object1, p1.get()); -} - -TEST(SharedPtrTest, ValidMethodTest_ExpectCorrectValidation) { - // Arrange - CMockObject* object1 = new CMockObject(1); - EXPECT_CALL(*object1, destructor()).Times(1); - - tMockObjectPtr p1(object1); - tMockObjectPtr p2; - // Check - ASSERT_TRUE(p1.valid()); - ASSERT_FALSE(p2.valid()); -} - -TEST(SharedPtrTest, DISABLED_StressTest) { - // Arrange - const size_t kNumIterations = 1024U * 1024U; - - size_t objectCreated = 0U; - size_t pointersCopied = 0U; - std::vector objects; - - for (size_t i = 0U; i < kNumIterations; ++i) { - if ((true == objects.empty()) || (0 == rand() % 256)) { - CMockObject* object = new CMockObject(0); - EXPECT_CALL(*object, destructor()); - objects.push_back(object); - ++objectCreated; - } else { - size_t objectIndex = static_cast(rand()) % objects.size(); - - if (rand() % 2) { - objects.push_back(objects[objectIndex]); - ++pointersCopied; - } else { - objects.erase(objects.begin() + objectIndex); - } - } - } - printf("%zu objects created, %zu pointers copied\n", - objectCreated, - pointersCopied); -} - -} // namespace utils_test -} // namespace components -} // namespace test -- cgit v1.2.1 From 81fb6ddaf3ba4ecb5e0129401239af75db45d84d Mon Sep 17 00:00:00 2001 From: Conlain Kelly Date: Wed, 18 Jul 2018 11:24:11 -0400 Subject: style fix --- .../include/application_manager/app_extension.h | 2 - .../include/application_manager/command_holder.h | 1 - .../include/application_manager/commands/command.h | 1 - .../include/application_manager/message.h | 1 - .../include/application_manager/rpc_handler_impl.h | 2 - .../rc_on_remote_control_settings_notification.cc | 4 +- .../on_interior_vehicle_data_notification.cc | 5 +- .../rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc | 3 +- .../src/resource_allocation_manager_impl.cc | 5 +- .../test/commands/button_press_request_test.cc | 30 +- .../get_interior_vehicle_data_request_test.cc | 15 +- .../on_interior_vehicle_data_notification_test.cc | 18 +- .../commands/on_remote_control_settings_test.cc | 13 +- .../rc_get_interior_vehicle_data_consent_test.cc | 14 +- .../set_interior_vehicle_data_request_test.cc | 13 +- .../test/resource_allocation_manager_impl_test.cc | 1 - .../hmi/on_app_permission_consent_notification.cc | 1 - .../hmi/on_driver_distraction_notification.cc | 1 - .../hmi/on_exit_all_applications_notification.cc | 3 +- .../src/commands/mobile/put_file_request.cc | 3 +- .../sdl_rpc_plugin/src/mobile_command_factory.cc | 1 - .../test/commands/hmi/close_popup_response_test.cc | 1 - .../commands/hmi/get_system_info_request_test.cc | 1 - .../test/commands/hmi/hmi_notifications_test.cc | 1 - .../hmi/navi_set_video_config_response_test.cc | 1 - .../hmi/on_driver_distraction_notification_test.cc | 1 - .../hmi/rc_get_capabilities_response_test.cc | 1 - .../test/commands/hmi/response_from_hmi_test.cc | 1 - .../commands/hmi/sdl_activate_app_response_test.cc | 1 - .../test/commands/hmi/simple_notifications_test.cc | 3 +- .../commands/hmi/simple_request_from_hmi_test.cc | 1 - .../commands/hmi/simple_requests_to_hmi_test.cc | 11 +- .../commands/hmi/simple_response_from_hmi_test.cc | 7 +- .../commands/hmi/simple_response_to_hmi_test.cc | 4 +- .../commands/hmi/tts_get_language_response_test.cc | 1 - .../hmi/ui_get_capabilities_response_test.cc | 2 - .../commands/hmi/ui_get_language_response_test.cc | 1 - .../hmi/update_device_list_request_test.cc | 1 - .../test/commands/hmi/update_sdl_request_test.cc | 1 - .../test/commands/hmi/update_sdl_response_test.cc | 1 - .../hmi/vr_get_capabilities_response_test.cc | 1 - .../commands/hmi/vr_get_language_response_test.cc | 1 - .../mobile/on_button_notification_commands_test.cc | 1 - .../test/commands/mobile/put_file_test.cc | 1 - .../mobile/register_app_interface_request_test.cc | 22 +- .../mobile/reset_global_properties_test.cc | 4 +- .../commands/mobile/set_global_properties_test.cc | 10 +- .../test/commands/mobile/slider_test.cc | 3 +- .../test/commands/mobile/speak_request_test.cc | 3 +- .../src/vehicle_info_app_extension.cc | 3 +- .../vehicle_info_plugin/src/vehicle_info_plugin.cc | 3 +- .../test/commands/mobile/read_did_request_test.cc | 1 - .../src/app_launch/app_launch_ctrl_impl.cc | 1 - .../src/app_launch/app_launch_data_db.cc | 1 - .../src/app_launch/device_apps_launcher.cc | 4 +- .../application_manager/src/application_impl.cc | 1 - .../src/application_manager_impl.cc | 6 +- .../src/commands/command_request_impl.cc | 9 +- .../src/commands/notification_from_hmi.cc | 3 +- .../src/commands/request_from_hmi.cc | 1 - .../src/commands/response_from_hmi.cc | 3 +- .../src/help_prompt_manager_impl.cc | 1 - .../src/hmi_language_handler.cc | 3 +- .../src/message_helper/message_helper.cc | 10 +- .../application_manager/src/rpc_handler_impl.cc | 3 +- .../application_manager/src/usage_statistics.cc | 1 - .../test/application_helper_test.cc | 1 - .../test/application_impl_test.cc | 1 - .../test/application_manager_impl_mock_hmi_test.cc | 9 +- .../test/application_manager_impl_test.cc | 12 +- .../test/application_state_test.cc | 2 - .../test/command_holder_test.cc | 2 - .../test/commands/command_impl_test.cc | 1 - .../test/commands/command_request_impl_test.cc | 1 - .../test/commands/command_response_impl_test.cc | 5 +- .../test/help_prompt_manager_test.cc | 8 +- .../test/hmi_language_handler_test.cc | 2 - .../application_manager/commands/commands_test.h | 23 +- .../application_manager/mock_command_factory.h | 1 - .../test/mobile_message_handler_test.cc | 11 +- .../test/mobile_message_handler_v1_test.cc | 1 - .../test/policy_handler_test.cc | 4 +- .../application_manager/test/request_info_test.cc | 2 - .../test/resumption/resume_ctrl_test.cc | 3 +- .../test/resumption/resumption_data_json_test.cc | 3 +- .../test/resumption/resumption_data_test.cc | 5 +- .../test/state_controller/state_controller_test.cc | 13 +- .../test/usage_statistics_test.cc | 5 +- .../test/hmi_message_adapter_test.cc | 2 - .../hmi_message_handler/hmi_message_observer.h | 2 - .../transport_adapter/transport_adapter.h | 2 - src/components/include/utils/data_accessor.h | 1 - .../media_manager/src/media_manager_impl.cc | 35 +- .../media_manager/mock_media_adapter_impl.h | 3 +- .../media_manager/test/media_manager_impl_test.cc | 4 +- .../policy_external/include/policy/cache_manager.h | 1 - .../policy_external/include/policy/policy_table.h | 1 - .../policy/policy_external/src/cache_manager.cc | 3 +- .../policy_external/src/policy_manager_impl.cc | 10 +- .../policy/policy_external/src/status.cc | 1 - .../policy_external/src/update_status_manager.cc | 1 - .../test/policy_manager_impl_test.cc | 2 - .../test/sql_pt_ext_representation_test.cc | 2 - .../test/sql_pt_representation_test.cc | 1 - .../policy_regular/include/policy/cache_manager.h | 1 - .../include/policy/cache_manager_interface.h | 1 - .../include/policy/policy_manager_impl.h | 1 - .../policy_regular/include/policy/policy_table.h | 1 - .../policy/update_status_manager_interface.h | 1 - .../policy_regular/src/policy_manager_impl.cc | 8 +- src/components/policy/policy_regular/src/status.cc | 1 - .../policy_regular/src/update_status_manager.cc | 1 - .../policy/policy_regular/test/counter_test.cc | 18 +- .../test/sql_pt_representation_test.cc | 1 - .../test/update_status_manager_test.cc | 1 - .../protocol_handler/src/protocol_handler_impl.cc | 9 +- .../protocol_handler/mock_telemetry_observer.h | 1 - .../test/incoming_data_handler_test.cc | 423 +++++++++++---------- .../test/protocol_handler_tm_test.cc | 75 ++-- .../include/security_manager/crypto_manager_impl.h | 1 - .../test/crypto_manager_impl_test.cc | 1 - .../security_manager/test/ssl_context_test.cc | 2 - .../smart_objects/always_false_schema_item.h | 1 - .../smart_objects/always_true_schema_item.h | 1 - .../include/smart_objects/array_schema_item.h | 1 - .../include/smart_objects/bool_schema_item.h | 2 - .../include/smart_objects/default_shema_item.h | 1 - .../include/smart_objects/enum_schema_item.h | 6 +- .../include/smart_objects/number_schema_item.h | 5 +- .../include/smart_objects/string_schema_item.h | 2 - .../smart_objects/src/array_schema_item.cc | 3 +- .../smart_objects/src/string_schema_item.cc | 3 +- .../smart_objects/test/BoolSchemaItem_test.cc | 2 - .../test/SmartObjectConvertionTime_test.cc | 2 - .../telemetry_monitor/src/telemetry_monitor.cc | 1 - .../src/transport_manager_observer.cc | 4 +- .../test/application_manager_metric_test.cc | 8 +- .../telemetry_monitor/mock_telemetry_monitor.h | 1 - .../test/telemetry_monitor_test.cc | 2 - .../transport_adapter/connection.h | 1 - .../include/transport_manager/usb/common.h | 2 - .../include/transport_manager/usb/usb_device.h | 3 +- .../src/bluetooth/bluetooth_connection_factory.cc | 1 - .../src/bluetooth/bluetooth_device_scanner.cc | 4 +- .../src/tcp/tcp_client_listener.cc | 4 +- .../src/tcp/tcp_connection_factory.cc | 1 - .../transport_adapter/transport_adapter_impl.cc | 6 +- .../src/transport_manager_impl.cc | 4 +- .../src/usb/usb_connection_factory.cc | 15 +- .../test/tcp_transport_adapter_test.cc | 8 +- .../test/transport_adapter_listener_test.cc | 4 +- .../test/transport_adapter_test.cc | 6 +- .../test/transport_manager_impl_test.cc | 5 +- src/components/utils/test/async_runner_test.cc | 2 - 154 files changed, 496 insertions(+), 626 deletions(-) (limited to 'src/components') diff --git a/src/components/application_manager/include/application_manager/app_extension.h b/src/components/application_manager/include/application_manager/app_extension.h index 5f193bf331..91bef0753a 100644 --- a/src/components/application_manager/include/application_manager/app_extension.h +++ b/src/components/application_manager/include/application_manager/app_extension.h @@ -33,8 +33,6 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_APP_EXTENSION_H_ - - namespace NsSmartDeviceLink { namespace NsSmartObjects { class SmartObject; diff --git a/src/components/application_manager/include/application_manager/command_holder.h b/src/components/application_manager/include/application_manager/command_holder.h index 3551a13707..8cfe5f0889 100644 --- a/src/components/application_manager/include/application_manager/command_holder.h +++ b/src/components/application_manager/include/application_manager/command_holder.h @@ -37,7 +37,6 @@ #include "application_manager/application.h" #include "smart_objects/smart_object.h" - namespace application_manager { /** * @brief The CommandHolder class should hold commands for particular diff --git a/src/components/application_manager/include/application_manager/commands/command.h b/src/components/application_manager/include/application_manager/commands/command.h index 1bd6441c76..f8ea7db24d 100644 --- a/src/components/application_manager/include/application_manager/commands/command.h +++ b/src/components/application_manager/include/application_manager/commands/command.h @@ -35,7 +35,6 @@ #include #include "smart_objects/smart_object.h" - namespace application_manager { namespace commands { diff --git a/src/components/application_manager/include/application_manager/message.h b/src/components/application_manager/include/application_manager/message.h index 908305015b..7c3f0a13c9 100644 --- a/src/components/application_manager/include/application_manager/message.h +++ b/src/components/application_manager/include/application_manager/message.h @@ -36,7 +36,6 @@ #include #include - #include "protocol/message_priority.h" #include "protocol/rpc_type.h" #include "protocol/common.h" diff --git a/src/components/application_manager/include/application_manager/rpc_handler_impl.h b/src/components/application_manager/include/application_manager/rpc_handler_impl.h index 515e289400..44954d41f7 100644 --- a/src/components/application_manager/include/application_manager/rpc_handler_impl.h +++ b/src/components/application_manager/include/application_manager/rpc_handler_impl.h @@ -58,8 +58,6 @@ #include "utils/threads/message_loop_thread.h" - - namespace application_manager { namespace rpc_handler { 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 7bc72faced..8bcb6b08ed 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 @@ -105,8 +105,8 @@ void RCOnRemoteControlSettingsNotification::DisallowRCFunctionality() { app->app_id(), mobile_apis::HMILevel::eType::HMI_NONE); const RCAppExtensionPtr extension = - std::static_pointer_cast< - RCAppExtension>(app->QueryInterface(RCRPCPlugin::kRCPluginID)); + std::static_pointer_cast( + app->QueryInterface(RCRPCPlugin::kRCPluginID)); if (extension) { UnsubscribeFromInteriorVehicleDataForAllModules(extension); } diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc index 8238e9a943..fca9962fb5 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/commands/mobile/on_interior_vehicle_data_notification.cc @@ -70,9 +70,8 @@ void OnInteriorVehicleDataNotification::Run() { DCHECK(*it); application_manager::Application& app = **it; - RCAppExtensionPtr extension = - std::static_pointer_cast< - RCAppExtension>(app.QueryInterface(RCRPCPlugin::kRCPluginID)); + RCAppExtensionPtr extension = std::static_pointer_cast( + app.QueryInterface(RCRPCPlugin::kRCPluginID)); DCHECK(extension); LOG4CXX_TRACE(logger_, "Check subscription for " diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc index a562e45b1d..984d6ec9a0 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_rpc_plugin.cc @@ -91,7 +91,8 @@ void RCRPCPlugin::OnApplicationEvent( } switch (event) { case plugins::kApplicationRegistered: { - application->AddExtension(std::shared_ptr(new RCAppExtension(kRCPluginID))); + application->AddExtension( + std::shared_ptr(new RCAppExtension(kRCPluginID))); resource_allocation_manager_->SendOnRCStatusNotifications( NotificationTrigger::APP_REGISTRATION, application); break; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc index 01c2e3a7c6..011950b35a 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/resource_allocation_manager_impl.cc @@ -42,7 +42,6 @@ #include "json/json.h" #include "utils/helpers.h" - namespace rc_rpc_plugin { CREATE_LOGGERPTR_GLOBAL(logger_, "RemoteControlModule") @@ -197,9 +196,7 @@ RCAppExtensionPtr ResourceAllocationManagerImpl::GetApplicationExtention( return rc_app_extension; } - rc_app_extension = - std::static_pointer_cast( - app_extension); + rc_app_extension = std::static_pointer_cast(app_extension); return rc_app_extension; } 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 329f4de5a6..8613fb1829 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 @@ -42,7 +42,6 @@ #include "application_manager/commands/command_request_test.h" #include "application_manager/policies/mock_policy_handler_interface.h" - #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" @@ -147,15 +146,14 @@ class ButtonPressRequestTest } template - std::shared_ptr CreateRCCommand( - MessageSharedPtr& msg) { + std::shared_ptr CreateRCCommand(MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); return std::make_shared(msg ? msg : msg = CreateMessage(), - app_mngr_, - mock_rpc_service_, - mock_hmi_capabilities_, - mock_policy_handler_, - mock_allocation_manager_); + app_mngr_, + mock_rpc_service_, + mock_hmi_capabilities_, + mock_policy_handler_, + mock_allocation_manager_); } protected: @@ -195,8 +193,8 @@ TEST_F(ButtonPressRequestTest, .WillOnce(Return(true)); // Act - std::shared_ptr - command = CreateRCCommand( + std::shared_ptr command = + CreateRCCommand( mobile_message); ASSERT_TRUE(command->Init()); command->Run(); @@ -234,8 +232,8 @@ TEST_F( .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true))); // Act - std::shared_ptr - command = CreateRCCommand( + std::shared_ptr command = + CreateRCCommand( mobile_message); ASSERT_TRUE(command->Init()); command->Run(); @@ -273,8 +271,8 @@ TEST_F(ButtonPressRequestTest, OnEvent_ExpectSuccessfullResponseSentToMobile) { application_manager::event_engine::Event event( hmi_apis::FunctionID::Buttons_ButtonPress); event.set_smart_object(*hmi_message); - std::shared_ptr - command = CreateRCCommand( + std::shared_ptr command = + CreateRCCommand( mobile_message); command->on_event(event); } @@ -312,8 +310,8 @@ TEST_F(ButtonPressRequestTest, application_manager::event_engine::Event event( hmi_apis::FunctionID::Buttons_ButtonPress); event.set_smart_object(*hmi_message); - std::shared_ptr - command = CreateRCCommand( + std::shared_ptr command = + CreateRCCommand( mobile_message); command->on_event(event); } 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 8f69b29275..a6f0ee12ca 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 @@ -41,8 +41,6 @@ #include "application_manager/commands/command_request_test.h" #include "rc_rpc_plugin/mock/mock_resource_allocation_manager.h" - - using ::testing::_; using ::testing::Mock; using ::testing::NiceMock; @@ -116,15 +114,14 @@ class GetInteriorVehicleDataRequestTest return message; } template - std::shared_ptr CreateRCCommand( - MessageSharedPtr& msg) { + std::shared_ptr CreateRCCommand(MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); return std::make_shared(msg ? msg : msg = CreateMessage(), - app_mngr_, - mock_rpc_service_, - mock_hmi_capabilities_, - mock_policy_handler_, - mock_allocation_manager_); + app_mngr_, + mock_rpc_service_, + mock_hmi_capabilities_, + mock_policy_handler_, + mock_allocation_manager_); } protected: 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 690586d0e1..df11bf8c88 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 @@ -85,15 +85,14 @@ class OnInteriorVehicleDataNotificationTest } template - std::shared_ptr CreateRCCommand( - MessageSharedPtr& msg) { + std::shared_ptr CreateRCCommand(MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); return std::make_shared(msg ? msg : msg = CreateMessage(), - app_mngr_, - mock_rpc_service_, - mock_hmi_capabilities_, - mock_policy_handler_, - mock_allocation_manager_); + app_mngr_, + mock_rpc_service_, + mock_hmi_capabilities_, + mock_policy_handler_, + mock_allocation_manager_); } protected: @@ -126,9 +125,8 @@ TEST_F(OnInteriorVehicleDataNotificationTest, EXPECT_CALL(mock_rpc_service_, SendMessageToMobile(_, false)) .WillOnce(SaveArg<0>(&message)); // Act - std::shared_ptr< - rc_rpc_plugin::commands::OnInteriorVehicleDataNotification> command = - CreateRCCommand< + std::shared_ptr + command = CreateRCCommand< rc_rpc_plugin::commands::OnInteriorVehicleDataNotification>( mobile_message); command->Run(); 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 907292f150..9054ce4830 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 @@ -85,15 +85,14 @@ class RCOnRemoteControlSettingsNotificationTest } template - std::shared_ptr CreateRCCommand( - MessageSharedPtr& msg) { + std::shared_ptr CreateRCCommand(MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); return std::make_shared(msg ? msg : msg = CreateMessage(), - app_mngr_, - mock_rpc_service_, - mock_hmi_capabilities_, - mock_policy_handler_, - mock_allocation_manager_); + app_mngr_, + mock_rpc_service_, + mock_hmi_capabilities_, + mock_policy_handler_, + mock_allocation_manager_); } protected: 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 a1fff199ee..7d32d64a87 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 @@ -54,7 +54,6 @@ #include "include/test/protocol_handler/mock_protocol_handler.h" #include "test/application_manager/mock_application_manager_settings.h" - using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; @@ -146,15 +145,14 @@ class RCGetInteriorVehicleDataConsentTest } template - std::shared_ptr CreateRCCommand( - MessageSharedPtr& msg) { + std::shared_ptr CreateRCCommand(MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); return std::make_shared(msg ? msg : msg = CreateMessage(), - app_mngr_, - rpc_service, - mock_hmi_capabilities_, - mock_policy_handler_, - mock_allocation_manager_); + app_mngr_, + rpc_service, + mock_hmi_capabilities_, + mock_policy_handler_, + mock_allocation_manager_); } MessageSharedPtr CreateBasicMessage() { 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 fdee55a30c..8072783a71 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 @@ -106,15 +106,14 @@ class SetInteriorVehicleDataRequestTest } template - std::shared_ptr CreateRCCommand( - MessageSharedPtr& msg) { + std::shared_ptr CreateRCCommand(MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); return std::make_shared(msg ? msg : msg = CreateMessage(), - app_mngr_, - mock_rpc_service_, - mock_hmi_capabilities_, - mock_policy_handler_, - mock_allocation_manager_); + app_mngr_, + mock_rpc_service_, + mock_hmi_capabilities_, + mock_policy_handler_, + mock_allocation_manager_); } protected: diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc index 3842814f84..3358dfbe4c 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc @@ -40,7 +40,6 @@ #include "application_manager/mock_rpc_service.h" #include "application_manager/policies/mock_policy_handler_interface.h" - #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" 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 ae8806c4eb..cf83c48a5a 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 @@ -41,7 +41,6 @@ #include "policy/policy_types.h" #include "smart_objects/smart_object.h" - namespace { /** diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc index 32dd8caefd..a5fb9b206e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_driver_distraction_notification.cc @@ -38,7 +38,6 @@ #include "interfaces/MOBILE_API.h" #include "interfaces/HMI_API.h" - namespace sdl_rpc_plugin { using namespace application_manager; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc index 1ba092a446..9d250d288e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_exit_all_applications_notification.cc @@ -109,7 +109,8 @@ void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr message = - std::make_shared(smart_objects::SmartType_Map); + std::make_shared( + smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete; (*message)[strings::params][strings::message_type] = 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 92d44d4fe8..4d1e4339f5 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 @@ -301,7 +301,8 @@ void PutFileRequest::Run() { void PutFileRequest::SendOnPutFileNotification() { LOG4CXX_INFO(logger_, "SendOnPutFileNotification"); smart_objects::SmartObjectSPtr notification = - std::make_shared(smart_objects::SmartType_Map); + std::make_shared( + smart_objects::SmartType_Map); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc index 32113228f5..3d7e2f6437 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/mobile_command_factory.cc @@ -126,7 +126,6 @@ #include "sdl_rpc_plugin/commands/mobile/send_haptic_data_response.h" #include "interfaces/MOBILE_API.h" - CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") namespace sdl_rpc_plugin { using namespace application_manager; 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 775f3b653f..6914a4ca7e 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 @@ -49,7 +49,6 @@ namespace commands_test { namespace hmi_commands_test { namespace close_popup_response { - namespace am = ::application_manager; using application_manager::commands::ResponseFromHMI; using sdl_rpc_plugin::commands::ClosePopupResponse; 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 ee576aedb6..4cbe7305ea 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 @@ -49,7 +49,6 @@ namespace commands_test { namespace hmi_commands_test { namespace get_system_info_request { - namespace am = ::application_manager; namespace strings = ::application_manager::strings; using am::commands::RequestToHMI; 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 bdbf2db216..c2ff08a6d9 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 @@ -91,7 +91,6 @@ #include "utils/data_accessor.h" #include "utils/signals.h" - #include "utils/file_system.h" #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" 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 4140d18110..06fa61db29 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 @@ -44,7 +44,6 @@ namespace commands_test { namespace hmi_commands_test { namespace navi_set_video_config_response { - using sdl_rpc_plugin::commands::NaviSetVideoConfigResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::_; 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 1ec04c68ae..007aef3a0f 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 @@ -57,7 +57,6 @@ using ::testing::_; using ::testing::Return; using ::testing::Eq; - namespace am = ::application_manager; using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification; 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 d62a2897f8..8e62c1a409 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 @@ -48,7 +48,6 @@ namespace commands_test { namespace hmi_commands_test { namespace rc_get_capabilities_response { - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = am::strings; 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 3e084bd6cc..010cbab1ff 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 @@ -51,7 +51,6 @@ using ::testing::Return; using ::testing::SaveArg; using ::testing::DoAll; - using ::test::components::event_engine_test::MockEventDispatcher; namespace am = ::application_manager; 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 1dc41e1486..77b94690cc 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 @@ -47,7 +47,6 @@ namespace commands_test { namespace hmi_commands_test { namespace sdl_activate_app_response { - namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::SDLActivateAppResponse; 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 e610628416..581913d3a5 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 @@ -62,7 +62,8 @@ TYPED_TEST_CASE(SimpleNotificationsTest, CommandsList); TYPED_TEST(SimpleNotificationsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - std::shared_ptr command = this->template CreateCommand(); + std::shared_ptr command = + this->template CreateCommand(); // Current implementation always return `true` EXPECT_TRUE(command->Init()); 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 028054c626..4950dc0a41 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 @@ -51,7 +51,6 @@ using ::testing::Types; using ::testing::NotNull; using ::testing::NiceMock; - namespace commands = ::application_manager::commands; using commands::MessageSharedPtr; using ::application_manager::event_engine::EventObserver; 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 42b1b9a182..2e4d695251 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 @@ -120,8 +120,6 @@ using ::testing::_; using ::testing::Types; using ::testing::NotNull; - - namespace am_commands = application_manager::commands; using am_commands::MessageSharedPtr; using event_engine_test::MockEventDispatcher; @@ -235,7 +233,8 @@ TYPED_TEST_CASE(RequestToHMICommandsTest3, RequestCommandsList3); TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - std::shared_ptr command = this->template CreateCommand(); + std::shared_ptr command = + this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull())); @@ -245,7 +244,8 @@ TYPED_TEST(RequestToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - std::shared_ptr command = this->template CreateCommand(); + std::shared_ptr command = + this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull())); command->Run(); @@ -254,7 +254,8 @@ TYPED_TEST(RequestToHMICommandsTest2, Run_SendMessageToHMI_SUCCESS) { TYPED_TEST(RequestToHMICommandsTest3, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - std::shared_ptr command = this->template CreateCommand(); + std::shared_ptr command = + this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull())); command->Run(); 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 c3b9809814..1874a13b7b 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 @@ -109,7 +109,6 @@ using ::testing::ReturnRef; using ::testing::Types; using ::testing::Eq; - using ::test::components::event_engine_test::MockEventDispatcher; namespace am = ::application_manager; @@ -244,7 +243,8 @@ TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandData CommandData; typedef typename CommandData::CommandType CommandType; - std::shared_ptr command = this->template CreateCommand(); + std::shared_ptr command = + this->template CreateCommand(); EXPECT_CALL(this->event_dispatcher_, raise_event(EventIdIsEqualTo(CommandData::kEventId))); @@ -255,7 +255,8 @@ TYPED_TEST(ResponseFromHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { TYPED_TEST(EmptyResponseFromHMICommandsTest, Run_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - std::shared_ptr command = this->template CreateCommand(); + std::shared_ptr command = + this->template CreateCommand(); command->Run(); } 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 2a52601a44..f556f544b6 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 @@ -52,7 +52,6 @@ using ::testing::_; using ::testing::Types; using ::testing::NotNull; - namespace commands = sdl_rpc_plugin::commands; using application_manager::commands::MessageSharedPtr; @@ -73,7 +72,8 @@ TYPED_TEST_CASE(ResponseToHMICommandsTest, ResponseCommandsList); TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { typedef typename TestFixture::CommandType CommandType; - std::shared_ptr command = this->template CreateCommand(); + std::shared_ptr command = + this->template CreateCommand(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull())); command->Run(); 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 b67976cc07..0d22500f48 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 @@ -44,7 +44,6 @@ namespace commands_test { namespace hmi_commands_test { namespace tts_get_language_response { - using sdl_rpc_plugin::commands::TTSGetLanguageResponse; using test::components::application_manager_test::MockHMICapabilities; using test::components::event_engine_test::MockEventDispatcher; 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 36581ba665..a98ea7c23a 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 @@ -34,7 +34,6 @@ #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "interfaces/MOBILE_API.h" #include "application_manager/mock_hmi_capabilities.h" @@ -49,7 +48,6 @@ namespace commands_test { namespace hmi_commands_test { namespace ui_get_capabilities_response { - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = am::strings; 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 01a7ae41f4..de69c5de5c 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 @@ -44,7 +44,6 @@ namespace commands_test { namespace hmi_commands_test { namespace ui_get_language_response { - using sdl_rpc_plugin::commands::UIGetLanguageResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::_; 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 b29a0fde57..0cc75c3d07 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 @@ -54,7 +54,6 @@ namespace commands_test { namespace hmi_commands_test { namespace update_device_list_request { - using testing::_; using testing::ReturnRef; using testing::Return; 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 b22dba73e5..5e6116abbd 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 @@ -48,7 +48,6 @@ namespace commands_test { namespace hmi_commands_test { namespace update_sdl_request { - using ::testing::ReturnRef; using ::testing::NiceMock; namespace am = ::application_manager; 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 3e09ce29fd..92049a147e 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 @@ -47,7 +47,6 @@ namespace commands_test { namespace hmi_commands_test { namespace update_sdl_response { - namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::UpdateSDLResponse; 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 954925731c..3258182b59 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 @@ -48,7 +48,6 @@ namespace commands_test { namespace hmi_commands_test { namespace vr_get_capabilities_response { - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = am::strings; 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 287ea3b7f3..05ed186963 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 @@ -44,7 +44,6 @@ namespace commands_test { namespace hmi_commands_test { namespace vr_get_language_response { - using sdl_rpc_plugin::commands::VRGetLanguageResponse; using test::components::event_engine_test::MockEventDispatcher; using testing::_; 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 2ea0091332..869a17c630 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 @@ -61,7 +61,6 @@ using ::testing::_; using ::testing::Types; using ::testing::Return; - using am::commands::MessageSharedPtr; namespace { 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 6f151d4080..df4f69f0d0 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 @@ -42,7 +42,6 @@ #include "mobile/put_file_response.h" #include "mobile/put_file_request.h" - #include "utils/file_system.h" #include "smart_objects/smart_object.h" #include "interfaces/MOBILE_API.h" 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 807d59fac2..41a7fded62 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 @@ -70,7 +70,6 @@ using ::testing::DoAll; namespace am = ::application_manager; - using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::RegisterAppInterfaceRequest; @@ -217,11 +216,10 @@ class RegisterAppInterfaceRequestTest ManageHMICommand(HMIResultCodeIs( hmi_apis::FunctionID::VR_ChangeRegistration))).Times(0); - EXPECT_CALL( - app_mngr_, - OnApplicationSwitched( - std::static_pointer_cast( - mock_app))); + EXPECT_CALL(app_mngr_, + OnApplicationSwitched( + std::static_pointer_cast( + mock_app))); } MessageSharedPtr msg_; @@ -434,8 +432,7 @@ TEST_F(RegisterAppInterfaceRequestTest, EXPECT_CALL( mock_resume_crt_, CheckApplicationHash( - std::static_pointer_cast( - mock_app), + std::static_pointer_cast(mock_app), request_hash_id)).WillOnce(Return(true)); EXPECT_CALL(mock_resume_crt_, RemoveApplicationFromSaved(_)).Times(0); @@ -469,15 +466,13 @@ TEST_F(RegisterAppInterfaceRequestTest, EXPECT_CALL( mock_resume_crt_, CheckApplicationHash( - std::static_pointer_cast( - mock_app), + std::static_pointer_cast(mock_app), request_hash_id)).WillOnce(Return(false)); EXPECT_CALL( mock_application_helper_, RecallApplicationData( - std::static_pointer_cast( - mock_app), + std::static_pointer_cast(mock_app), _)); EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0); @@ -506,8 +501,7 @@ TEST_F(RegisterAppInterfaceRequestTest, EXPECT_CALL( mock_application_helper_, RecallApplicationData( - std::static_pointer_cast( - mock_app), + std::static_pointer_cast(mock_app), _)); EXPECT_CALL(app_mngr_, RegisterApplication(msg_)).Times(0); 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 6eafae16c2..33c0911835 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 @@ -39,7 +39,6 @@ #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" @@ -69,7 +68,8 @@ using am::commands::MessageSharedPtr; using am::event_engine::Event; using am::MockMessageHelper; -typedef std::shared_ptr ResetGlobalPropertiesRequestPtr; +typedef std::shared_ptr + ResetGlobalPropertiesRequestPtr; typedef std::shared_ptr ResetGlobalPropertiesResponsePtr; 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 e849866c1a..06ddf4069c 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 @@ -126,8 +126,9 @@ class SetGlobalPropertiesRequestTest .WillOnce(Return(mock_app_)); } - void OnEventUISetupHelper(MessageSharedPtr msg, - std::shared_ptr command) { + void OnEventUISetupHelper( + MessageSharedPtr msg, + std::shared_ptr command) { SmartObject vr_help_title("yes"); SmartObject vr_help_array(smart_objects::SmartType_Array); VRArraySetupHelper(msg, vr_help_title, vr_help_array); @@ -153,8 +154,9 @@ class SetGlobalPropertiesRequestTest command->Run(); } - void OnEventTTSSetupHelper(MessageSharedPtr msg, - std::shared_ptr command) { + void OnEventTTSSetupHelper( + MessageSharedPtr msg, + std::shared_ptr command) { SmartObject help_prompt(smart_objects::SmartType_Array); help_prompt[0][am::strings::text] = "Help_Prompt_One"; (*msg)[am::strings::msg_params][am::strings::help_prompt] = help_prompt; 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 9e7d826f2a..7c7319975b 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 @@ -140,8 +140,7 @@ TEST_F(SliderRequestTest, OnEvent_UI_UNSUPPORTED_RESOURCE) { MessageSharedPtr msg_ui = CreateFullParamsUISO(); (*msg_ui)[am::strings::params][am::strings::connection_key] = kConnectionKey; - std::shared_ptr command = - CreateCommand(msg_ui); + std::shared_ptr command = CreateCommand(msg_ui); MockAppPtr mock_app = CreateMockApp(); ON_CALL(app_mngr_, application(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 dfb8452003..9eb23eeee3 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 @@ -129,8 +129,7 @@ class SpeakRequestTest : public CommandRequestTest { }; TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) { - std::shared_ptr command = - CreateCommand(request_); + std::shared_ptr command = CreateCommand(request_); (*response_)[strings::params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS; diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc index a19fdbee97..3b1d411841 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_app_extension.cc @@ -118,8 +118,7 @@ VehicleInfoAppExtension& VehicleInfoAppExtension::ExtractVIExtension( DCHECK(ext_ptr); DCHECK(dynamic_cast(ext_ptr.get())); auto vi_app_extension = - std::static_pointer_cast< - VehicleInfoAppExtension>(ext_ptr); + std::static_pointer_cast(ext_ptr); DCHECK(vi_app_extension); return *vi_app_extension; } diff --git a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc index b16993b002..bd8eb1920d 100644 --- a/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc +++ b/src/components/application_manager/rpc_plugins/vehicle_info_plugin/src/vehicle_info_plugin.cc @@ -74,7 +74,8 @@ void VehicleInfoPlugin::OnApplicationEvent( plugins::ApplicationEvent event, app_mngr::ApplicationSharedPtr application) { if (plugins::ApplicationEvent::kApplicationRegistered == event) { - application->AddExtension(std::make_shared(*this, *application)); + application->AddExtension( + std::make_shared(*this, *application)); } } 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 c468a82bad..c0a07fb57c 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 @@ -63,7 +63,6 @@ using vehicle_info_plugin::commands::ReadDIDRequest; using am::commands::MessageSharedPtr; using am::event_engine::Event; - class ReadDIDRequestTest : public CommandRequestTest {}; diff --git a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc index 25cb5a7e1e..8df3d436bd 100644 --- a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc +++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc @@ -39,7 +39,6 @@ #include "application_manager/application.h" #include "utils/timer_task_impl.h" - namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") 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 9a7ae0dee8..393b01c952 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 @@ -38,7 +38,6 @@ #include "application_manager/smart_object_keys.h" #include "application_manager/message_helper.h" - namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") 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 3532cb819a..a4468d87bc 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 @@ -7,7 +7,6 @@ #include "application_manager/app_launch/apps_launcher.h" #include "application_manager/resumption/resume_ctrl.h" - #include "utils/timer.h" #include "utils/timer_task_impl.h" #include @@ -107,8 +106,7 @@ struct LauncherGenerator { , apps_launcher_(apps_launcher) {} LauncherPtr operator()() const { - return std::make_shared( - resume_ctrl_, interface_, apps_launcher_); + return std::make_shared(resume_ctrl_, interface_, apps_launcher_); } resumption::ResumeCtrl& resume_ctrl_; diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index aca4b9ba05..a26418d917 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -42,7 +42,6 @@ #include "utils/logger.h" #include "utils/gen_hash.h" - #include "utils/timer_task_impl.h" #include "application_manager/policies/policy_handler_interface.h" #include "application_manager/resumption/resume_ctrl.h" diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 41dcdf3885..8efd92a0d1 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -1021,7 +1021,8 @@ void ApplicationManagerImpl::OnDeviceListUpdated( return; } - smart_objects::SmartObjectSPtr update_list = std::make_shared(); + smart_objects::SmartObjectSPtr update_list = + std::make_shared(); smart_objects::SmartObject& so_to_send = *update_list; so_to_send[jhs::S_PARAMS][jhs::S_FUNCTION_ID] = hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList; @@ -2421,7 +2422,8 @@ void ApplicationManagerImpl::SendOnSDLClose() { // must be sent to PASA HMI on shutdown synchronously smart_objects::SmartObjectSPtr msg = - std::make_shared(smart_objects::SmartType_Map); + std::make_shared( + smart_objects::SmartType_Map); (*msg)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_OnSDLClose; diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index 18b3d2a94e..420dbf6156 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -145,7 +145,8 @@ struct DisallowedParamsInserter { VehicleData::const_iterator it = vehicle_data.find(param); if (vehicle_data.end() != it) { smart_objects::SmartObjectSPtr disallowed_param = - std::make_shared(smart_objects::SmartType_Map); + std::make_shared( + smart_objects::SmartType_Map); (*disallowed_param)[strings::data_type] = (*it).second; (*disallowed_param)[strings::result_code] = code_; response_[strings::msg_params][param.c_str()] = *disallowed_param; @@ -417,7 +418,8 @@ uint32_t CommandRequestImpl::SendHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject* msg_params, bool use_events) { - smart_objects::SmartObjectSPtr result = std::make_shared(); + smart_objects::SmartObjectSPtr result = + std::make_shared(); const uint32_t hmi_correlation_id = application_manager_.GetNextHMICorrelationID(); @@ -455,7 +457,8 @@ uint32_t CommandRequestImpl::SendHMIRequest( void CommandRequestImpl::CreateHMINotification( const hmi_apis::FunctionID::eType& function_id, const NsSmart::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = std::make_shared(); + smart_objects::SmartObjectSPtr result = + std::make_shared(); if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); return; diff --git a/src/components/application_manager/src/commands/notification_from_hmi.cc b/src/components/application_manager/src/commands/notification_from_hmi.cc index 649b52fde9..c8765be18a 100644 --- a/src/components/application_manager/src/commands/notification_from_hmi.cc +++ b/src/components/application_manager/src/commands/notification_from_hmi.cc @@ -76,7 +76,8 @@ void NotificationFromHMI::SendNotificationToMobile( void NotificationFromHMI::CreateHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = std::make_shared(); + smart_objects::SmartObjectSPtr result = + std::make_shared(); if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); return; diff --git a/src/components/application_manager/src/commands/request_from_hmi.cc b/src/components/application_manager/src/commands/request_from_hmi.cc index b993ab033e..ff760c2d2a 100644 --- a/src/components/application_manager/src/commands/request_from_hmi.cc +++ b/src/components/application_manager/src/commands/request_from_hmi.cc @@ -34,7 +34,6 @@ #include "application_manager/application_manager.h" #include "application_manager/rpc_service.h" - namespace application_manager { namespace commands { diff --git a/src/components/application_manager/src/commands/response_from_hmi.cc b/src/components/application_manager/src/commands/response_from_hmi.cc index bf732830f2..bdf5686159 100644 --- a/src/components/application_manager/src/commands/response_from_hmi.cc +++ b/src/components/application_manager/src/commands/response_from_hmi.cc @@ -80,7 +80,8 @@ void ResponseFromHMI::SendResponseToMobile( void ResponseFromHMI::CreateHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = std::make_shared(); + smart_objects::SmartObjectSPtr result = + std::make_shared(); if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); diff --git a/src/components/application_manager/src/help_prompt_manager_impl.cc b/src/components/application_manager/src/help_prompt_manager_impl.cc index 6fb88ddd3b..803a0e6743 100644 --- a/src/components/application_manager/src/help_prompt_manager_impl.cc +++ b/src/components/application_manager/src/help_prompt_manager_impl.cc @@ -39,7 +39,6 @@ #include "smart_objects/smart_object.h" #include "utils/logger.h" - CREATE_LOGGERPTR_GLOBAL(logger_, "HelpPromptManagerImpl") namespace { diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc index b1872dfaab..6e89b2419c 100644 --- a/src/components/application_manager/src/hmi_language_handler.cc +++ b/src/components/application_manager/src/hmi_language_handler.cc @@ -223,7 +223,8 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile( const uint32_t connection_key) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr notification =std::make_shared(); + smart_objects::SmartObjectSPtr notification = + std::make_shared(); DCHECK_OR_RETURN_VOID(notification); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = 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 aa3f2449ee..978724a671 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -62,7 +62,6 @@ #include "utils/macro.h" #include "utils/logger.h" - #include "formatters/formatter_json_rpc.h" #include "formatters/CFormatterJsonSDLRPCv2.h" #include "formatters/CFormatterJsonSDLRPCv1.h" @@ -698,7 +697,8 @@ void MessageHelper::SendHMIStatusNotification( const Application& application_impl, ApplicationManager& application_manager) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr notification = std::make_shared(); + smart_objects::SmartObjectSPtr notification = + std::make_shared(); if (!notification) { LOG4CXX_ERROR(logger_, "Failed to create smart object"); return; @@ -740,7 +740,8 @@ void MessageHelper::SendActivateAppToHMI( } std::shared_ptr message = - std::make_shared(smart_objects::SmartType_Map); + std::make_shared( + smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_ActivateApp; @@ -1833,7 +1834,8 @@ void MessageHelper::SendGetUserFriendlyMessageResponse( ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr message = - std::make_shared(smart_objects::SmartType_Map); + std::make_shared( + smart_objects::SmartType_Map); if (!message) { return; } diff --git a/src/components/application_manager/src/rpc_handler_impl.cc b/src/components/application_manager/src/rpc_handler_impl.cc index 3152d1f749..e6cc0fc849 100644 --- a/src/components/application_manager/src/rpc_handler_impl.cc +++ b/src/components/application_manager/src/rpc_handler_impl.cc @@ -93,7 +93,8 @@ void RPCHandlerImpl::ProcessMessageFromMobile( void RPCHandlerImpl::ProcessMessageFromHMI( const std::shared_ptr message) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr smart_object = std::make_shared(); + smart_objects::SmartObjectSPtr smart_object = + std::make_shared(); if (!smart_object) { LOG4CXX_ERROR(logger_, "Null pointer"); diff --git a/src/components/application_manager/src/usage_statistics.cc b/src/components/application_manager/src/usage_statistics.cc index 8081dee139..1146d60717 100644 --- a/src/components/application_manager/src/usage_statistics.cc +++ b/src/components/application_manager/src/usage_statistics.cc @@ -36,7 +36,6 @@ #include "policy/usage_statistics/statistics_manager.h" #include "utils/macro.h" - using namespace mobile_apis; using namespace NsSmartDeviceLink::NsSmartObjects; using namespace usage_statistics; diff --git a/src/components/application_manager/test/application_helper_test.cc b/src/components/application_manager/test/application_helper_test.cc index e84dc5f7be..3203839fc2 100644 --- a/src/components/application_manager/test/application_helper_test.cc +++ b/src/components/application_manager/test/application_helper_test.cc @@ -51,7 +51,6 @@ #include "utils/custom_string.h" #include "utils/macro.h" - #include "test/resumption/mock_last_state.h" #include "media_manager/mock_media_manager.h" diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index ce1d4ed326..301ed227b8 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -39,7 +39,6 @@ #include "application_manager/hmi_state.h" #include "utils/file_system.h" - #include "application_manager/mock_message_helper.h" #include "utils/custom_string.h" #include "application_manager/mock_application_manager.h" 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 b168f7a480..8ab852779a 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 @@ -146,8 +146,7 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test { Return(0))); } - std::shared_ptr > - mock_storage_; + std::shared_ptr > mock_storage_; application_manager_test::MockApplicationManager mock_app_mngr_; NiceMock mock_policy_settings_; NiceMock @@ -214,13 +213,13 @@ TEST_F(ApplicationManagerImplMockHmiTest, const uint32_t correlation_id_3 = 3u; std::shared_ptr > cmd_1 = std::make_shared >(connection_key, - correlation_id_1); + correlation_id_1); std::shared_ptr > cmd_2 = std::make_shared >(connection_key, - correlation_id_2); + correlation_id_2); std::shared_ptr > cmd_3 = std::make_shared >(connection_key, - correlation_id_3); + correlation_id_3); EXPECT_CALL(mock_command_factory, CreateCommand(_, _)) .WillOnce(Return(cmd_1)) 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 5b3a148357..e368163cca 100644 --- a/src/components/application_manager/test/application_manager_impl_test.cc +++ b/src/components/application_manager/test/application_manager_impl_test.cc @@ -196,8 +196,7 @@ class ApplicationManagerImplTest : public ::testing::Test { uint32_t app_id_; NiceMock mock_policy_settings_; - std::shared_ptr > - mock_storage_; + std::shared_ptr > mock_storage_; std::unique_ptr mock_rpc_service_; NiceMock mock_connection_handler_; @@ -232,16 +231,14 @@ TEST_F(ApplicationManagerImplTest, ProcessQueryApp_ExpectSuccess) { TEST_F(ApplicationManagerImplTest, SubscribeAppForWayPoints_ExpectSubscriptionApp) { - auto app_ptr = - std::static_pointer_cast(mock_app_ptr_); + auto app_ptr = std::static_pointer_cast(mock_app_ptr_); app_manager_impl_->SubscribeAppForWayPoints(app_ptr); EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr)); } TEST_F(ApplicationManagerImplTest, UnsubscribeAppForWayPoints_ExpectUnsubscriptionApp) { - auto app_ptr = - std::static_pointer_cast(mock_app_ptr_); + auto app_ptr = std::static_pointer_cast(mock_app_ptr_); app_manager_impl_->SubscribeAppForWayPoints(app_ptr); EXPECT_TRUE(app_manager_impl_->IsAppSubscribedForWayPoints(app_ptr)); app_manager_impl_->UnsubscribeAppFromWayPoints(app_ptr); @@ -262,8 +259,7 @@ TEST_F( TEST_F( ApplicationManagerImplTest, GetAppsSubscribedForWayPoints_SubcribeAppForWayPoints_ExpectCorrectResult) { - auto app_ptr = - std::static_pointer_cast(mock_app_ptr_); + auto app_ptr = std::static_pointer_cast(mock_app_ptr_); app_manager_impl_->SubscribeAppForWayPoints(app_ptr); std::set result = app_manager_impl_->GetAppsSubscribedForWayPoints(); EXPECT_EQ(1u, result.size()); diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc index c19fd00930..a0bfa2890f 100644 --- a/src/components/application_manager/test/application_state_test.cc +++ b/src/components/application_manager/test/application_state_test.cc @@ -41,8 +41,6 @@ #include "application_manager/state_controller.h" #include "application_manager/resumption/resume_ctrl.h" - - namespace test { namespace components { namespace application_manager_test { diff --git a/src/components/application_manager/test/command_holder_test.cc b/src/components/application_manager/test/command_holder_test.cc index 588dc8e6ab..56e24b8d29 100644 --- a/src/components/application_manager/test/command_holder_test.cc +++ b/src/components/application_manager/test/command_holder_test.cc @@ -36,8 +36,6 @@ #include "application_manager/commands/command.h" #include "smart_objects/smart_object.h" - - #include "application_manager/mock_application_manager.h" #include "application_manager/mock_application.h" #include "application_manager/mock_rpc_service.h" 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 2b15397769..222f16ef46 100644 --- a/src/components/application_manager/test/commands/command_impl_test.cc +++ b/src/components/application_manager/test/commands/command_impl_test.cc @@ -55,7 +55,6 @@ using ::testing::Return; using ::testing::AtLeast; using ::testing::_; - namespace strings = ::application_manager::strings; using ::application_manager::commands::CommandImpl; using ::application_manager::ApplicationManager; 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 968c606855..c70dd14852 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 @@ -65,7 +65,6 @@ using ::testing::Return; using ::testing::SaveArg; using ::testing::DoAll; - using am::commands::MessageSharedPtr; using am::CommandParametersPermissions; using am::event_engine::EventObserver; 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 eb1cb473e0..41cc654a24 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 @@ -57,7 +57,8 @@ class CommandResponseImplTest : public CommandsTest {}; TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) { - std::shared_ptr command = CreateCommand(); + std::shared_ptr command = + CreateCommand(); // Current implementation always return `true` EXPECT_TRUE(command->Init()); EXPECT_TRUE(command->CleanUp()); @@ -108,7 +109,7 @@ TEST_F(CommandResponseImplTest, TEST_F(CommandResponseImplTest, SendResponse_EmptyMessageInvalidResultCode_SUCCESS) { MessageSharedPtr msg; - std::shared_ptr command = + std::shared_ptr command = CreateCommand(msg); const bool kSuccess = true; 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 3be730c2c9..f921eb1dde 100644 --- a/src/components/application_manager/test/help_prompt_manager_test.cc +++ b/src/components/application_manager/test/help_prompt_manager_test.cc @@ -126,10 +126,10 @@ class HelpPromptManagerTest : public ::testing::Test { template std::shared_ptr CreateCommand(MessageSharedPtr& msg) { return std::make_shared(msg, - app_mngr_, - mock_rpc_service_, - mock_hmi_capabilities_, - mock_policy_handler_); + app_mngr_, + mock_rpc_service_, + mock_hmi_capabilities_, + mock_policy_handler_); } protected: 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 9777183b8b..ec88075212 100644 --- a/src/components/application_manager/test/hmi_language_handler_test.cc +++ b/src/components/application_manager/test/hmi_language_handler_test.cc @@ -46,7 +46,6 @@ #include "application_manager/smart_object_keys.h" #include "test/resumption/mock_last_state.h" - #include "utils/lock.h" namespace test { @@ -58,7 +57,6 @@ namespace am = ::application_manager; using am::event_engine::Event; using am::ApplicationSet; - using ::testing::Return; using ::testing::ReturnRef; using ::testing::NiceMock; diff --git a/src/components/application_manager/test/include/application_manager/commands/commands_test.h b/src/components/application_manager/test/include/application_manager/commands/commands_test.h index a93e33b373..d795557f80 100644 --- a/src/components/application_manager/test/include/application_manager/commands/commands_test.h +++ b/src/components/application_manager/test/include/application_manager/commands/commands_test.h @@ -36,7 +36,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/commands/command.h" @@ -60,7 +59,6 @@ using ::testing::NiceMock; using ::testing::Mock; using ::testing::_; - using ::smart_objects::SmartObject; using am::commands::MessageSharedPtr; using ::test::components::application_manager_test::MockApplicationManager; @@ -121,13 +119,13 @@ class CommandsTest : public ::testing::Test { template std::shared_ptr CreateCommand(const uint32_t timeout, - MessageSharedPtr& msg) { + MessageSharedPtr& msg) { InitCommand(timeout); return std::make_shared((msg ? msg : msg = CreateMessage()), - app_mngr_, - mock_rpc_service_, - mock_hmi_capabilities_, - mock_policy_handler_); + app_mngr_, + mock_rpc_service_, + mock_hmi_capabilities_, + mock_policy_handler_); } template @@ -136,14 +134,15 @@ class CommandsTest : public ::testing::Test { } template - std::shared_ptr CreateCommand(const uint32_t timeout = kDefaultTimeout_) { + std::shared_ptr CreateCommand( + const uint32_t timeout = kDefaultTimeout_) { InitCommand(timeout); MessageSharedPtr msg = CreateMessage(); return std::make_shared(msg, - app_mngr_, - mock_rpc_service_, - mock_hmi_capabilities_, - mock_policy_handler_); + app_mngr_, + mock_rpc_service_, + mock_hmi_capabilities_, + mock_policy_handler_); } enum { kDefaultTimeout_ = 100 }; diff --git a/src/components/application_manager/test/include/application_manager/mock_command_factory.h b/src/components/application_manager/test/include/application_manager/mock_command_factory.h index cb48f2220e..e4bdc3abe1 100644 --- a/src/components/application_manager/test/include/application_manager/mock_command_factory.h +++ b/src/components/application_manager/test/include/application_manager/mock_command_factory.h @@ -38,7 +38,6 @@ #include "application_manager/commands/command.h" #include "smart_objects/smart_object.h" - namespace test { namespace components { namespace application_manager_test { 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 2122dc463e..23957b61fb 100644 --- a/src/components/application_manager/test/mobile_message_handler_test.cc +++ b/src/components/application_manager/test/mobile_message_handler_test.cc @@ -42,7 +42,6 @@ #include "application_manager/message.h" #include "protocol/raw_message.h" - namespace test { namespace components { namespace application_manager_test { @@ -107,11 +106,11 @@ class MobileMessageHandlerTest : public testing::Test { size_t full_size = sizeof(uint8_t) * full_data.size(); message_ptr_ = std::make_shared(connection_key_, - protocol_version, - &full_data[0], - full_size, - ServiceType::kRpc, - payload_size); + protocol_version, + &full_data[0], + full_size, + ServiceType::kRpc, + payload_size); return MobileMessageHandler::HandleIncomingMessageProtocol(message_ptr_); } 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 72edf741f9..5cbc28b20c 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 @@ -41,7 +41,6 @@ #include "application_manager/message.h" #include "protocol/raw_message.h" - using protocol_handler::RawMessage; using protocol_handler::RawMessagePtr; using protocol_handler::PROTOCOL_HEADER_V1_SIZE; diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc index c7baac7923..855d318f24 100644 --- a/src/components/application_manager/test/policy_handler_test.cc +++ b/src/components/application_manager/test/policy_handler_test.cc @@ -2109,8 +2109,8 @@ TEST_F(PolicyHandlerTest, // Expected to get 0 as application id so SDL does not have valid application // with such id EXPECT_CALL(app_manager_, application(0)) - .WillOnce(Return( - std::shared_ptr())); + .WillOnce( + Return(std::shared_ptr())); EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, url)); } diff --git a/src/components/application_manager/test/request_info_test.cc b/src/components/application_manager/test/request_info_test.cc index 85cb4f3a37..7275f9b343 100644 --- a/src/components/application_manager/test/request_info_test.cc +++ b/src/components/application_manager/test/request_info_test.cc @@ -37,8 +37,6 @@ #include #include "gmock/gmock.h" - - namespace request_info = application_manager::request_controller; namespace test { 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 2a430ae655..54c76fcf94 100644 --- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc +++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc @@ -158,8 +158,7 @@ class ResumeCtrlTest : public ::testing::Test { mock_app_extension_; MockStateController mock_state_controller_; std::shared_ptr res_ctrl_; - std::shared_ptr > - mock_storage_; + std::shared_ptr > mock_storage_; std::shared_ptr > mock_app_; std::shared_ptr mock_help_prompt_manager_; application_manager::ApplicationConstSharedPtr const_app_; 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 442aacb609..d049d0f541 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 @@ -69,7 +69,8 @@ class ResumptionDataJsonTest : public ResumptionDataTest { : last_state_("app_storage_folder", "app_info_storage") , res_json(last_state_, mock_application_manager_) {} virtual void SetUp() { - app_mock = std::make_shared>(); + app_mock = std::make_shared< + NiceMock >(); policy_app_id_ = "test_policy_app_id"; app_id_ = 10; 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 ced9ca84af..5658ab8535 100644 --- a/src/components/application_manager/test/resumption/resumption_data_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_test.cc @@ -41,7 +41,6 @@ #include "utils/data_accessor.h" #include "application_manager/message_helper.h" - #include "application_manager/resumption_data_test.h" namespace test { @@ -322,8 +321,8 @@ void ResumptionDataTest::CheckVRTitle( } void ResumptionDataTest::PrepareData() { - mock_app_extension_ = std::make_shared< - NiceMock >(); + mock_app_extension_ = + std::make_shared >(); extensions_.insert(extensions_.begin(), mock_app_extension_); ON_CALL(*app_mock, Extensions()).WillByDefault(ReturnRef(extensions_)); SetGlobalProporties(); 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 001a4da3af..fd2503da33 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 @@ -646,8 +646,7 @@ class StateControllerImplTest : public ::testing::Test { app_id = (*it_begin)->app_id(); app_type = AppType(app_id); app = (*it_begin); - am::HmiStatePtr state_first = - std::make_shared(app, app_manager_mock_); + am::HmiStatePtr state_first = std::make_shared(app, app_manager_mock_); am::HmiStatePtr state_second = std::make_shared(app, app_manager_mock_); TestSetSeveralState( @@ -2223,7 +2222,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, SetNaviStreamingStateForNonMediaApplication) { am::HmiStatePtr state_navi_streming = std::make_shared(simple_app_, - app_manager_mock_); + app_manager_mock_); TestSetState(simple_app_, state_navi_streming, APP_TYPE_NON_MEDIA, @@ -2234,7 +2233,7 @@ TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedNotSupported) { am::HmiStatePtr state_navi_streming = std::make_shared(media_app_, - app_manager_mock_); + app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(false)); TestSetState(media_app_, @@ -2247,7 +2246,7 @@ TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateMediaApplicationAttenuatedSupported) { am::HmiStatePtr state_navi_streming = std::make_shared(media_app_, - app_manager_mock_); + app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(true)); TestSetState(media_app_, @@ -2283,7 +2282,7 @@ TEST_F(StateControllerImplTest, TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateNaviApplication) { am::HmiStatePtr state_navi_streming = std::make_shared(navi_app_, - app_manager_mock_); + app_manager_mock_); TestSetState(navi_app_, state_navi_streming, APP_TYPE_NAVI, @@ -2294,7 +2293,7 @@ TEST_F(StateControllerImplTest, DISABLED_SetNaviStreamingStateMediaNaviApplication) { am::HmiStatePtr state_navi_streming = std::make_shared(media_navi_app_, - app_manager_mock_); + app_manager_mock_); TestSetState(media_navi_app_, state_navi_streming, APP_TYPE_NAVI, diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc index 28e71f6f60..8d2ed690b6 100644 --- a/src/components/application_manager/test/usage_statistics_test.cc +++ b/src/components/application_manager/test/usage_statistics_test.cc @@ -37,8 +37,6 @@ #include "policy/usage_statistics/mock_statistics_manager.h" #include "policy/usage_statistics/mock_app_stopwatch.h" - - namespace test { namespace components { namespace usage_statistics_test { @@ -69,8 +67,7 @@ const std::string kAppId = "SPT"; class UsageStatisticsTest : public testing::Test { public: UsageStatisticsTest() - : mock_statistics_manager_sptr_( - std::make_shared()) + : mock_statistics_manager_sptr_(std::make_shared()) , usage_statistics_test_object1_sptr_( new application_manager::UsageStatistics( kAppId, mock_statistics_manager_sptr_)) diff --git a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc index 2ac91ba16d..73fe76640d 100644 --- a/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc +++ b/src/components/hmi_message_handler/test/hmi_message_adapter_test.cc @@ -32,8 +32,6 @@ #include "gtest/gtest.h" - - #include "hmi_message_handler/hmi_message_handler_impl.h" #include "hmi_message_handler/mock_hmi_message_adapter_impl.h" #include "hmi_message_handler/mock_hmi_message_handler_settings.h" diff --git a/src/components/include/hmi_message_handler/hmi_message_observer.h b/src/components/include/hmi_message_handler/hmi_message_observer.h index d9ae422b8f..e7ba2619ee 100644 --- a/src/components/include/hmi_message_handler/hmi_message_observer.h +++ b/src/components/include/hmi_message_handler/hmi_message_observer.h @@ -33,8 +33,6 @@ #ifndef SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_ #define SRC_COMPONENTS_INCLUDE_HMI_MESSAGE_HANDLER_HMI_MESSAGE_OBSERVER_H_ - - namespace application_manager { class Message; } diff --git a/src/components/include/transport_manager/transport_adapter/transport_adapter.h b/src/components/include/transport_manager/transport_adapter/transport_adapter.h index 630ec4e85f..8bba7ade8b 100644 --- a/src/components/include/transport_manager/transport_adapter/transport_adapter.h +++ b/src/components/include/transport_manager/transport_adapter/transport_adapter.h @@ -44,8 +44,6 @@ #include #include - - #include "transport_manager/transport_adapter/device.h" #include "transport_manager/common.h" #include "transport_manager/error.h" diff --git a/src/components/include/utils/data_accessor.h b/src/components/include/utils/data_accessor.h index 0c1eb6ebbd..b828f513eb 100644 --- a/src/components/include/utils/data_accessor.h +++ b/src/components/include/utils/data_accessor.h @@ -35,7 +35,6 @@ #include #include "utils/lock.h" - // This class is for thread-safe const access to data template class DataAccessor { diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc index 1a95227461..15b58aee1f 100644 --- a/src/components/media_manager/src/media_manager_impl.cc +++ b/src/components/media_manager/src/media_manager_impl.cc @@ -120,29 +120,36 @@ void MediaManagerImpl::Init() { #endif if ("socket" == settings().video_server_type()) { - streamer_[ServiceType::kMobileNav]= std::make_shared( - settings().server_address(), settings().video_streaming_port()); + streamer_[ServiceType::kMobileNav] = + std::make_shared( + settings().server_address(), settings().video_streaming_port()); } else if ("pipe" == settings().video_server_type()) { - streamer_[ServiceType::kMobileNav]= std::make_shared( - settings().named_video_pipe_path(), settings().app_storage_folder()); + streamer_[ServiceType::kMobileNav] = + std::make_shared( + settings().named_video_pipe_path(), + settings().app_storage_folder()); } else if ("file" == settings().video_server_type()) { - streamer_[ServiceType::kMobileNav]= std::make_shared( - settings().video_stream_file(), settings().app_storage_folder()); + streamer_[ServiceType::kMobileNav] = + std::make_shared( + settings().video_stream_file(), settings().app_storage_folder()); } if ("socket" == settings().audio_server_type()) { - streamer_[ServiceType::kAudio]= std::make_shared( - settings().server_address(), settings().audio_streaming_port()); + streamer_[ServiceType::kAudio] = + std::make_shared( + settings().server_address(), settings().audio_streaming_port()); } else if ("pipe" == settings().audio_server_type()) { - streamer_[ServiceType::kAudio]= std::make_shared( + streamer_[ServiceType::kAudio] = std::make_shared( settings().named_audio_pipe_path(), settings().app_storage_folder()); } else if ("file" == settings().audio_server_type()) { - streamer_[ServiceType::kAudio]= std::make_shared( + streamer_[ServiceType::kAudio] = std::make_shared( settings().audio_stream_file(), settings().app_storage_folder()); } - streamer_listener_[ServiceType::kMobileNav] = std::make_shared(*this); - streamer_listener_[ServiceType::kAudio] = std::make_shared(*this); + streamer_listener_[ServiceType::kMobileNav] = + std::make_shared(*this); + streamer_listener_[ServiceType::kAudio] = + std::make_shared(*this); if (streamer_[ServiceType::kMobileNav]) { streamer_[ServiceType::kMobileNav]->AddListener( @@ -187,8 +194,8 @@ void MediaManagerImpl::StartMicrophoneRecording(int32_t application_key, std::string file_path = settings().app_storage_folder(); file_path += "/"; file_path += output_file; - from_mic_listener_ = - std::make_shared(file_path, application_manager_); + from_mic_listener_ = std::make_shared( + file_path, application_manager_); #ifdef EXTENDED_MEDIA_MODE if (from_mic_recorder_) { from_mic_recorder_->AddListener(from_mic_listener_); diff --git a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h index 6c5bd7b7b9..96499d9358 100644 --- a/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h +++ b/src/components/media_manager/test/include/media_manager/mock_media_adapter_impl.h @@ -44,8 +44,7 @@ using namespace media_manager; class MockMediaAdapterImpl : public ::media_manager::MediaAdapterImpl { public: - MOCK_METHOD1(AddListener, - void(const std::shared_ptr&)); + MOCK_METHOD1(AddListener, void(const std::shared_ptr&)); MOCK_METHOD1(RemoveListener, void(const std::shared_ptr&)); MOCK_METHOD2(SendData, diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc index eae7bda680..ca0dac761a 100644 --- a/src/components/media_manager/test/media_manager_impl_test.cc +++ b/src/components/media_manager/test/media_manager_impl_test.cc @@ -45,7 +45,6 @@ #include "protocol_handler/mock_protocol_handler.h" #include "protocol/common.h" - #include "utils/file_system.h" #include "utils/scope_guard.h" @@ -106,8 +105,7 @@ class MediaManagerImplTest : public ::testing::Test { public: // media_adapter_mock_ will be deleted in media_manager_impl (dtor) MediaManagerImplTest() : media_adapter_mock_(new MockMediaAdapter()) { - media_adapter_listener_mock_ = - std::make_shared(); + media_adapter_listener_mock_ = std::make_shared(); ON_CALL(mock_media_manager_settings_, video_server_type()) .WillByDefault(ReturnRef(kDefaultValue)); ON_CALL(mock_media_manager_settings_, audio_server_type()) diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h index 36ddaf0415..6c7bbeb9c9 100644 --- a/src/components/policy/policy_external/include/policy/cache_manager.h +++ b/src/components/policy/policy_external/include/policy/cache_manager.h @@ -35,7 +35,6 @@ #include - #include "policy/pt_representation.h" #include "policy/pt_ext_representation.h" #include "policy/usage_statistics/statistics_manager.h" diff --git a/src/components/policy/policy_external/include/policy/policy_table.h b/src/components/policy/policy_external/include/policy/policy_table.h index 27f4cc33a2..fe27f1cb57 100644 --- a/src/components/policy/policy_external/include/policy/policy_table.h +++ b/src/components/policy/policy_external/include/policy/policy_table.h @@ -33,7 +33,6 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_ #define SRC_COMPONENTS_POLICY_POLICY_EXTERNAL_INCLUDE_POLICY_POLICY_TABLE_H_ - #include "policy/pt_representation.h" #include "policy/pt_ext_representation.h" diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index b30ed3c224..38c6d50e99 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -2237,8 +2237,7 @@ bool CacheManager::Init(const std::string& file_name, LOG4CXX_AUTO_TRACE(logger_); settings_ = settings; InitResult init_result = backup_->Init(settings); - ex_backup_ = std::dynamic_pointer_cast< - PTExtRepresentation>(backup_); + ex_backup_ = std::dynamic_pointer_cast(backup_); bool result = true; switch (init_result) { diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index c75d14a67a..4a5731f24f 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -213,8 +213,8 @@ PolicyManagerImpl::PolicyManagerImpl() : PolicyManager() , listener_(NULL) , cache_(new CacheManager) - , access_remote_(new AccessRemoteImpl( - std::static_pointer_cast(cache_))) + , access_remote_( + new AccessRemoteImpl(std::static_pointer_cast(cache_))) , retry_sequence_timeout_(60) , retry_sequence_index_(0) , ignition_check(true) @@ -224,8 +224,8 @@ PolicyManagerImpl::PolicyManagerImpl(bool in_memory) : PolicyManager() , listener_(NULL) , cache_(new CacheManager(in_memory)) - , access_remote_(new AccessRemoteImpl( - std::static_pointer_cast(cache_))) + , access_remote_( + new AccessRemoteImpl(std::static_pointer_cast(cache_))) , retry_sequence_timeout_(60) , retry_sequence_index_(0) , ignition_check(true) @@ -1776,7 +1776,7 @@ StatusNotifier PolicyManagerImpl::AddApplication( if (IsNewApplication(application_id)) { AddNewApplication(application_id, device_consent); return std::make_shared(update_status_manager_, - device_consent); + device_consent); } else { PromoteExistedApplication(application_id, device_consent); return std::make_shared(); diff --git a/src/components/policy/policy_external/src/status.cc b/src/components/policy/policy_external/src/status.cc index 34f65339c1..c2ee4e4bbc 100644 --- a/src/components/policy/policy_external/src/status.cc +++ b/src/components/policy/policy_external/src/status.cc @@ -33,7 +33,6 @@ #include "policy/status.h" #include "policy/update_status_manager.h" - policy::UpToDateStatus::UpToDateStatus() : Status(kUpToDate, policy::PolicyTableStatus::StatusUpToDate) {} diff --git a/src/components/policy/policy_external/src/update_status_manager.cc b/src/components/policy/policy_external/src/update_status_manager.cc index aee22a3b0c..1f00a440b3 100644 --- a/src/components/policy/policy_external/src/update_status_manager.cc +++ b/src/components/policy/policy_external/src/update_status_manager.cc @@ -34,7 +34,6 @@ #include "policy/policy_listener.h" #include "utils/logger.h" - namespace policy { CREATE_LOGGERPTR_GLOBAL(logger_, "Policy") diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc index f049018848..cbefc12cc7 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc @@ -38,8 +38,6 @@ #include "policy/policy_manager_impl_test_base.h" - - using ::testing::_; using ::testing::Return; using ::testing::SetArgReferee; diff --git a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc index fc4b0ae7b0..b87598b986 100644 --- a/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_ext_representation_test.cc @@ -45,8 +45,6 @@ #include "policy/policy_table/types.h" #include "policy/mock_policy_settings.h" - - using namespace ::policy; namespace policy_table = rpc::policy_table_interface_base; using std::string; diff --git a/src/components/policy/policy_external/test/sql_pt_representation_test.cc b/src/components/policy/policy_external/test/sql_pt_representation_test.cc index bfcf9f2172..b0f340b0f2 100644 --- a/src/components/policy/policy_external/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_external/test/sql_pt_representation_test.cc @@ -50,7 +50,6 @@ #include "rpc_base/rpc_base.h" #include "policy/mock_policy_settings.h" - namespace policy_table = rpc::policy_table_interface_base; using policy::SQLPTRepresentation; using policy::CheckPermissionResult; diff --git a/src/components/policy/policy_regular/include/policy/cache_manager.h b/src/components/policy/policy_regular/include/policy/cache_manager.h index 236722415f..e84c0fb782 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager.h @@ -35,7 +35,6 @@ #include - #include "policy/pt_representation.h" #include "policy/pt_ext_representation.h" #include "policy/usage_statistics/statistics_manager.h" diff --git a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h index ba6728c520..10a6ea7f89 100644 --- a/src/components/policy/policy_regular/include/policy/cache_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/cache_manager_interface.h @@ -36,7 +36,6 @@ #include #include - #include "policy/usage_statistics/counter.h" #include "policy/policy_types.h" #include "policy/policy_settings.h" diff --git a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h index 549fdd5a53..51d4ee88aa 100644 --- a/src/components/policy/policy_regular/include/policy/policy_manager_impl.h +++ b/src/components/policy/policy_regular/include/policy/policy_manager_impl.h @@ -37,7 +37,6 @@ #include #include - #include "utils/lock.h" #include "policy/policy_manager.h" #include "policy/policy_table.h" diff --git a/src/components/policy/policy_regular/include/policy/policy_table.h b/src/components/policy/policy_regular/include/policy/policy_table.h index 9531bb8c79..353cdda871 100644 --- a/src/components/policy/policy_regular/include/policy/policy_table.h +++ b/src/components/policy/policy_regular/include/policy/policy_table.h @@ -33,7 +33,6 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_POLICY_TABLE_H_ - #include "policy/pt_representation.h" #include "policy/pt_ext_representation.h" diff --git a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h index 520615489a..b9da90f929 100644 --- a/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h +++ b/src/components/policy/policy_regular/include/policy/update_status_manager_interface.h @@ -33,7 +33,6 @@ #ifndef SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_ #define SRC_COMPONENTS_POLICY_POLICY_REGULAR_INCLUDE_POLICY_UPDATE_STATUS_MANAGER_INTERFACE_H_ - #include "policy/policy_types.h" #include "policy/status.h" diff --git a/src/components/policy/policy_regular/src/policy_manager_impl.cc b/src/components/policy/policy_regular/src/policy_manager_impl.cc index f1e51f3f83..297d538165 100644 --- a/src/components/policy/policy_regular/src/policy_manager_impl.cc +++ b/src/components/policy/policy_regular/src/policy_manager_impl.cc @@ -73,8 +73,8 @@ PolicyManagerImpl::PolicyManagerImpl() : PolicyManager() , listener_(NULL) , cache_(new CacheManager) - , access_remote_(new AccessRemoteImpl( - std::static_pointer_cast(cache_))) + , access_remote_( + new AccessRemoteImpl(std::static_pointer_cast(cache_))) , retry_sequence_timeout_(kDefaultRetryTimeoutInMSec) , retry_sequence_index_(0) , timer_retry_sequence_("Retry sequence timer", @@ -1067,7 +1067,7 @@ StatusNotifier PolicyManagerImpl::AddApplication( if (IsNewApplication(application_id)) { AddNewApplication(application_id, device_consent); return std::make_shared(update_status_manager_, - device_consent); + device_consent); } else { PromoteExistedApplication(application_id, device_consent); return std::make_shared(); @@ -1164,7 +1164,7 @@ void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) { } void PolicyManagerImpl::set_cache_manager( - CacheManagerInterface* cache_manager) { + CacheManagerInterface* cache_manager) { cache_ = std::shared_ptr(cache_manager); } diff --git a/src/components/policy/policy_regular/src/status.cc b/src/components/policy/policy_regular/src/status.cc index 306fa87529..00a6a95af3 100644 --- a/src/components/policy/policy_regular/src/status.cc +++ b/src/components/policy/policy_regular/src/status.cc @@ -33,7 +33,6 @@ #include "policy/status.h" #include "policy/update_status_manager_interface.h" - policy::UpToDateStatus::UpToDateStatus() : Status("UP_TO_DATE", policy::PolicyTableStatus::StatusUpToDate) {} diff --git a/src/components/policy/policy_regular/src/update_status_manager.cc b/src/components/policy/policy_regular/src/update_status_manager.cc index 401de1ea79..66d21dea54 100644 --- a/src/components/policy/policy_regular/src/update_status_manager.cc +++ b/src/components/policy/policy_regular/src/update_status_manager.cc @@ -34,7 +34,6 @@ #include "policy/policy_listener.h" #include "utils/logger.h" - namespace policy { CREATE_LOGGERPTR_GLOBAL(logger_, "Policy") diff --git a/src/components/policy/policy_regular/test/counter_test.cc b/src/components/policy/policy_regular/test/counter_test.cc index a333ec2ee5..d11bcec2ac 100644 --- a/src/components/policy/policy_regular/test/counter_test.cc +++ b/src/components/policy/policy_regular/test/counter_test.cc @@ -53,7 +53,7 @@ TEST( StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { // Arrange - auto msm = std::make_shared>(); + auto msm = std::make_shared >(); GlobalCounter reboots_counter(msm, SYNC_REBOOTS); // Assert @@ -67,7 +67,7 @@ TEST( StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { // Arrange - auto msm = std::make_shared>(); + auto msm = std::make_shared >(); GlobalCounter reboots_counter(msm, SYNC_REBOOTS); // Assert @@ -82,7 +82,7 @@ TEST( StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { // Arrange - auto msm = std::make_shared>(); + auto msm = std::make_shared >(); AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS); // Assert @@ -96,7 +96,7 @@ TEST( StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { // Arrange - auto msm = std::make_shared>(); + auto msm = std::make_shared >(); AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS); // Assert @@ -110,7 +110,7 @@ TEST( TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) { // Arrange - auto msm = std::make_shared>(); + auto msm = std::make_shared >(); AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI); // Assert @@ -123,7 +123,7 @@ TEST(StatisticsManagerSetMethod, TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) { // Arrange - auto msm = std::make_shared>(); + auto msm = std::make_shared >(); AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI); // Assert @@ -138,7 +138,7 @@ TEST(StatisticsManagerSetMethod, TEST(StatisticsManagerAddMethod, AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) { // Arrange - auto msm = std::make_shared>(); + auto msm = std::make_shared >(); const std::uint32_t time_out = 1; AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out); @@ -155,7 +155,7 @@ TEST(StatisticsManagerAddMethod, TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) { // Arrange - auto msm = std::make_shared>(); + auto msm = std::make_shared >(); AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp"); hmi_full_stopwatch.Start(SECONDS_HMI_FULL); @@ -171,7 +171,7 @@ TEST( StatisticsManagerAddMethod, DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) { // Arrange - auto msm = std::make_shared>(); + auto msm = std::make_shared >(); const std::uint32_t time_out = 1; AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out); diff --git a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc index 70db02b8a7..7d192515dc 100644 --- a/src/components/policy/policy_regular/test/sql_pt_representation_test.cc +++ b/src/components/policy/policy_regular/test/sql_pt_representation_test.cc @@ -48,7 +48,6 @@ #include "json/reader.h" #include "rpc_base/rpc_base.h" - #include "utils/file_system.h" #include "utils/sqlite_wrapper/sql_database.h" diff --git a/src/components/policy/policy_regular/test/update_status_manager_test.cc b/src/components/policy/policy_regular/test/update_status_manager_test.cc index 7c73a11175..6f301c6720 100644 --- a/src/components/policy/policy_regular/test/update_status_manager_test.cc +++ b/src/components/policy/policy_regular/test/update_status_manager_test.cc @@ -35,7 +35,6 @@ #include "policy/policy_manager_impl.h" #include "policy/update_status_manager.h" - namespace test { namespace components { namespace policy_test { diff --git a/src/components/protocol_handler/src/protocol_handler_impl.cc b/src/components/protocol_handler/src/protocol_handler_impl.cc index 57b2b8682d..872a8dc755 100644 --- a/src/components/protocol_handler/src/protocol_handler_impl.cc +++ b/src/components/protocol_handler/src/protocol_handler_impl.cc @@ -925,8 +925,7 @@ void ProtocolHandlerImpl::SendMessageToMobileApp(const RawMessagePtr message, } #ifdef TELEMETRY_MONITOR if (metric_observer_) { - auto metric = - std::make_shared(); + auto metric = std::make_shared(); metric->message_id = message_id; metric->connection_key = message->connection_key(); metric->raw_msg = message; @@ -1384,8 +1383,7 @@ RESULT_CODE ProtocolHandlerImpl::HandleSingleFrameMessage( } #ifdef TELEMETRY_MONITOR if (metric_observer_) { - auto metric = - std::make_shared(); + auto metric = std::make_shared(); metric->message_id = packet->message_id(); metric->connection_key = connection_key; metric->raw_msg = rawMessage; @@ -2054,8 +2052,7 @@ void ProtocolHandlerImpl::PopValideAndExpirateMultiframes() { #ifdef TELEMETRY_MONITOR if (metric_observer_) { - auto metric = - std::make_shared(); + auto metric = std::make_shared(); metric->raw_msg = rawMessage; metric_observer_->EndMessageProcess(metric); } diff --git a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h index 2bfe9c925f..f42a0b4a15 100644 --- a/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h +++ b/src/components/protocol_handler/test/include/protocol_handler/mock_telemetry_observer.h @@ -36,7 +36,6 @@ #include "gmock/gmock.h" #include "protocol_handler/time_metric_observer.h" - namespace test { namespace components { namespace protocol_handler_test { diff --git a/src/components/protocol_handler/test/incoming_data_handler_test.cc b/src/components/protocol_handler/test/incoming_data_handler_test.cc index 6274cf4e10..9abf5d69af 100644 --- a/src/components/protocol_handler/test/incoming_data_handler_test.cc +++ b/src/components/protocol_handler/test/incoming_data_handler_test.cc @@ -193,48 +193,50 @@ TEST_F(IncomingDataHandlerTest, MixedPayloadData_TwoConnections) { FrameList mobile_packets; // single packet RPC mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_1, - PROTECTION_OFF, - FRAME_TYPE_SINGLE, - kRpc, - FRAME_DATA_SINGLE, - some_session_id, - some_data_size, - protov1_message_id, - some_data)); + PROTOCOL_VERSION_1, + PROTECTION_OFF, + FRAME_TYPE_SINGLE, + kRpc, + FRAME_DATA_SINGLE, + some_session_id, + some_data_size, + protov1_message_id, + some_data)); // consecutive packet Audio - mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_2, - PROTECTION_ON, - FRAME_TYPE_CONSECUTIVE, - kAudio, - FRAME_DATA_LAST_CONSECUTIVE, - ++some_session_id, - some_data2_size, - some_message_id, - some_data2)); + mobile_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_2, + PROTECTION_ON, + FRAME_TYPE_CONSECUTIVE, + kAudio, + FRAME_DATA_LAST_CONSECUTIVE, + ++some_session_id, + some_data2_size, + some_message_id, + some_data2)); // single packet Nav mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_ON, - FRAME_TYPE_SINGLE, - kMobileNav, - FRAME_DATA_SINGLE, - ++some_session_id, - some_data_size, - ++some_message_id, - some_data)); + PROTOCOL_VERSION_3, + PROTECTION_ON, + FRAME_TYPE_SINGLE, + kMobileNav, + FRAME_DATA_SINGLE, + ++some_session_id, + some_data_size, + ++some_message_id, + some_data)); // consecutive packet Bulk - mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_ON, - FRAME_TYPE_CONSECUTIVE, - kBulk, - FRAME_DATA_LAST_CONSECUTIVE, - ++some_session_id, - some_data2_size, - ++some_message_id, - some_data2)); + mobile_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_3, + PROTECTION_ON, + FRAME_TYPE_CONSECUTIVE, + kBulk, + FRAME_DATA_LAST_CONSECUTIVE, + ++some_session_id, + some_data2_size, + ++some_message_id, + some_data2)); for (FrameList::iterator it = mobile_packets.begin(); it != mobile_packets.end(); ++it) { @@ -268,16 +270,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Version) { malformed_versions.push_back(version); } for (size_t i = 0; i < malformed_versions.size(); ++i) { - malformed_packets.push_back(std::make_shared(uid1, - malformed_versions[i], - PROTECTION_OFF, - FRAME_TYPE_CONTROL, - kControl, - FRAME_DATA_HEART_BEAT, - some_session_id, - 0u, - some_message_id, - nullptr)); + malformed_packets.push_back( + std::make_shared(uid1, + malformed_versions[i], + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + kControl, + FRAME_DATA_HEART_BEAT, + some_session_id, + 0u, + some_message_id, + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -316,16 +319,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_ServiceType) { malformed_serv_types.push_back(0x0D); malformed_serv_types.push_back(0x0E); for (size_t i = 0; i < malformed_serv_types.size(); ++i) { - malformed_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_OFF, - FRAME_TYPE_CONTROL, - malformed_serv_types[i], - FRAME_DATA_HEART_BEAT, - some_session_id, - 0u, - some_message_id, - nullptr)); + malformed_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_3, + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + malformed_serv_types[i], + FRAME_DATA_HEART_BEAT, + some_session_id, + 0u, + some_message_id, + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -360,16 +364,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FrameType) { malformed_frame_types.push_back(frame_type); } for (size_t i = 0; i < malformed_frame_types.size(); ++i) { - malformed_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_OFF, - malformed_frame_types[i], - kControl, - FRAME_DATA_HEART_BEAT, - some_session_id, - 0u, - some_message_id, - nullptr)); + malformed_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_3, + PROTECTION_OFF, + malformed_frame_types[i], + kControl, + FRAME_DATA_HEART_BEAT, + some_session_id, + 0u, + some_message_id, + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -404,16 +409,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_ControlFrame) { malformed_frame_data.push_back(frame_type); } for (size_t i = 0; i < malformed_frame_data.size(); ++i) { - malformed_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_OFF, - FRAME_TYPE_CONTROL, - kControl, - malformed_frame_data[i], - some_session_id, - 0u, - some_message_id, - nullptr)); + malformed_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_3, + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + kControl, + malformed_frame_data[i], + some_session_id, + 0u, + some_message_id, + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -448,16 +454,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_SingleFrame) { } malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE); for (size_t i = 0; i < malformed_frame_data.size(); ++i) { - malformed_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_OFF, - FRAME_TYPE_SINGLE, - kControl, - malformed_frame_data[i], - some_session_id, - 0u, - some_message_id, - nullptr)); + malformed_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_3, + PROTECTION_OFF, + FRAME_TYPE_SINGLE, + kControl, + malformed_frame_data[i], + some_session_id, + 0u, + some_message_id, + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -492,16 +499,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_FirstFrame) { } malformed_frame_data.push_back(FRAME_DATA_MAX_VALUE); for (size_t i = 0; i < malformed_frame_data.size(); ++i) { - malformed_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_OFF, - FRAME_TYPE_SINGLE, - kControl, - malformed_frame_data[i], - some_session_id, - 0u, - some_message_id, - nullptr)); + malformed_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_3, + PROTECTION_OFF, + FRAME_TYPE_SINGLE, + kControl, + malformed_frame_data[i], + some_session_id, + 0u, + some_message_id, + nullptr)); } // We count malformed only first time when it occurs after correct message @@ -530,105 +538,109 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_AdditionalByte) { FrameList mobile_packets; // single packet RPC mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_1, - PROTECTION_OFF, - FRAME_TYPE_SINGLE, - kRpc, - FRAME_DATA_SINGLE, - some_session_id, - some_data_size, - protov1_message_id, - some_data)); + PROTOCOL_VERSION_1, + PROTECTION_OFF, + FRAME_TYPE_SINGLE, + kRpc, + FRAME_DATA_SINGLE, + some_session_id, + some_data_size, + protov1_message_id, + some_data)); AppendPacketToTMData(*mobile_packets.back()); // Add malformed byte tm_data.insert(tm_data.end(), 1, 0x1); // consecutive packet Audio - mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_2, - PROTECTION_ON, - FRAME_TYPE_CONSECUTIVE, - kAudio, - FRAME_DATA_LAST_CONSECUTIVE, - ++some_session_id, - some_data2_size, - some_message_id, - some_data2)); + mobile_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_2, + PROTECTION_ON, + FRAME_TYPE_CONSECUTIVE, + kAudio, + FRAME_DATA_LAST_CONSECUTIVE, + ++some_session_id, + some_data2_size, + some_message_id, + some_data2)); AppendPacketToTMData(*mobile_packets.back()); // Add malformed bytes tm_data.insert(tm_data.end(), 2, 0x2); // single packet Nav mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_ON, - FRAME_TYPE_SINGLE, - kMobileNav, - FRAME_DATA_SINGLE, - ++some_session_id, - some_data_size, - ++some_message_id, - some_data)); + PROTOCOL_VERSION_3, + PROTECTION_ON, + FRAME_TYPE_SINGLE, + kMobileNav, + FRAME_DATA_SINGLE, + ++some_session_id, + some_data_size, + ++some_message_id, + some_data)); AppendPacketToTMData(*mobile_packets.back()); // Add malformed bytes tm_data.insert(tm_data.end(), 3, 0x3); // consecutive packet Bulk - mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_ON, - FRAME_TYPE_CONSECUTIVE, - kBulk, - FRAME_DATA_LAST_CONSECUTIVE, - ++some_session_id, - some_data2_size, - ++some_message_id, - some_data2)); + mobile_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_3, + PROTECTION_ON, + FRAME_TYPE_CONSECUTIVE, + kBulk, + FRAME_DATA_LAST_CONSECUTIVE, + ++some_session_id, + some_data2_size, + ++some_message_id, + some_data2)); AppendPacketToTMData(*mobile_packets.back()); // Add malformed bytes tm_data.insert(tm_data.end(), 4, 0x4); // single packet RPC - mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_1, - PROTECTION_OFF, - FRAME_TYPE_CONTROL, - kRpc, - FRAME_DATA_HEART_BEAT, - some_session_id, - some_data_size, - protov1_message_id, - some_data)); + mobile_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_1, + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + kRpc, + FRAME_DATA_HEART_BEAT, + some_session_id, + some_data_size, + protov1_message_id, + some_data)); AppendPacketToTMData(*mobile_packets.back()); // Add malformed bytes tm_data.insert(tm_data.end(), 5, 0x5); // single packet Audio - mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_1, - PROTECTION_OFF, - FRAME_TYPE_CONTROL, - kAudio, - FRAME_DATA_HEART_BEAT, - some_session_id, - some_data_size, - protov1_message_id, - some_data)); + mobile_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_1, + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + kAudio, + FRAME_DATA_HEART_BEAT, + some_session_id, + some_data_size, + protov1_message_id, + some_data)); AppendPacketToTMData(*mobile_packets.back()); // Add malformed bytes tm_data.insert(tm_data.end(), 6, 0x6); // single packet RPC mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_1, - PROTECTION_OFF, - FRAME_TYPE_SINGLE, - kRpc, - FRAME_DATA_SINGLE, - some_session_id, - some_data_size, - protov1_message_id, - some_data)); + PROTOCOL_VERSION_1, + PROTECTION_OFF, + FRAME_TYPE_SINGLE, + kRpc, + FRAME_DATA_SINGLE, + some_session_id, + some_data_size, + protov1_message_id, + some_data)); AppendPacketToTMData(*mobile_packets.back()); ProcessData(uid1, &tm_data[0], tm_data.size()); @@ -652,28 +664,29 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) { FrameList mobile_packets; // single packet RPC mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_1, - PROTECTION_OFF, - FRAME_TYPE_SINGLE, - kRpc, - FRAME_DATA_SINGLE, - some_session_id, - some_data_size, - protov1_message_id, - some_data)); + PROTOCOL_VERSION_1, + PROTECTION_OFF, + FRAME_TYPE_SINGLE, + kRpc, + FRAME_DATA_SINGLE, + some_session_id, + some_data_size, + protov1_message_id, + some_data)); AppendPacketToTMData(*mobile_packets.back()); // consecutive packet Audio - mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_2, - PROTECTION_ON, - FRAME_TYPE_CONSECUTIVE, - kAudio, - FRAME_DATA_LAST_CONSECUTIVE, - ++some_session_id, - some_data2_size, - some_message_id, - some_data2)); + mobile_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_2, + PROTECTION_ON, + FRAME_TYPE_CONSECUTIVE, + kAudio, + FRAME_DATA_LAST_CONSECUTIVE, + ++some_session_id, + some_data2_size, + some_message_id, + some_data2)); AppendPacketToTMData(*mobile_packets.back()); // Malformed packet 1 @@ -691,16 +704,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) { AppendPacketToTMData(malformed_packet1); // consecutive packet Bulk - mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_ON, - FRAME_TYPE_CONSECUTIVE, - kBulk, - FRAME_DATA_LAST_CONSECUTIVE, - ++some_session_id, - some_data2_size, - ++some_message_id, - some_data2)); + mobile_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_3, + PROTECTION_ON, + FRAME_TYPE_CONSECUTIVE, + kBulk, + FRAME_DATA_LAST_CONSECUTIVE, + ++some_session_id, + some_data2_size, + ++some_message_id, + some_data2)); AppendPacketToTMData(*mobile_packets.back()); // Malformed packet 2 @@ -718,16 +732,17 @@ TEST_F(IncomingDataHandlerTest, MalformedPacket_Mix) { AppendPacketToTMData(malformed_packet2); // Audio packet - mobile_packets.push_back(std::make_shared(uid1, - PROTOCOL_VERSION_3, - PROTECTION_OFF, - FRAME_TYPE_CONTROL, - kAudio, - FRAME_DATA_HEART_BEAT, - some_session_id, - some_data_size, - protov1_message_id, - some_data)); + mobile_packets.push_back( + std::make_shared(uid1, + PROTOCOL_VERSION_3, + PROTECTION_OFF, + FRAME_TYPE_CONTROL, + kAudio, + FRAME_DATA_HEART_BEAT, + some_session_id, + some_data_size, + protov1_message_id, + some_data)); AppendPacketToTMData(*mobile_packets.back()); ProcessData(uid1, &tm_data[0], tm_data.size()); diff --git a/src/components/protocol_handler/test/protocol_handler_tm_test.cc b/src/components/protocol_handler/test/protocol_handler_tm_test.cc index 6ee57548b4..cfda0a550a 100644 --- a/src/components/protocol_handler/test/protocol_handler_tm_test.cc +++ b/src/components/protocol_handler/test/protocol_handler_tm_test.cc @@ -621,8 +621,7 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, StartSession_Protected_SessionObserverAccept) { SetProtocolVersion2(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -836,8 +835,7 @@ TEST_F(ProtocolHandlerImplTest, * ProtocolHandler shall send NAck on session_observer rejection */ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) { - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -870,8 +868,7 @@ TEST_F(ProtocolHandlerImplTest, EndSession_SessionObserverReject) { * ProtocolHandler shall send NAck on wrong hash code */ TEST_F(ProtocolHandlerImplTest, EndSession_Success) { - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -904,8 +901,7 @@ TEST_F(ProtocolHandlerImplTest, EndSession_Success) { #ifdef ENABLE_SECURITY TEST_F(ProtocolHandlerImplTest, SecurityEnable_StartSessionProtocoloV1) { using namespace protocol_handler; - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2653,8 +2649,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2691,8 +2686,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_ThresholdValue) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2728,8 +2722,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_VideoFrameSkip) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2757,8 +2750,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerification_AudioFrameSkip) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2786,8 +2778,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_FloodVerificationDisable) { InitProtocolHandlerImpl(period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2815,8 +2806,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedVerificationDisable) { InitProtocolHandlerImpl(0u, 0u, false, period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2848,8 +2838,7 @@ TEST_F(ProtocolHandlerImplTest, DISABLED_MalformedLimitVerification) { InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2896,8 +2885,7 @@ TEST_F(ProtocolHandlerImplTest, InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -2968,8 +2956,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_MalformedOnly) { InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3029,8 +3016,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullTimePeriod) { InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3063,8 +3049,7 @@ TEST_F(ProtocolHandlerImplTest, MalformedLimitVerification_NullCount) { InitProtocolHandlerImpl(0u, 0u, true, period_msec, max_messages); AddConnection(); - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3107,8 +3092,7 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, DISABLED_SendEndServicePrivate_EndSession_MessageSent) { // Arrange - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3132,8 +3116,7 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, SendEndServicePrivate_ServiceTypeControl_MessageSent) { // Arrange - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3172,8 +3155,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_NoConnection_NotSent) { TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) { // Arrange - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3198,8 +3180,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeat_Successful) { TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) { // Arrange - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3228,8 +3209,7 @@ TEST_F(ProtocolHandlerImplTest, SendHeartBeatAck_Successful) { TEST_F(ProtocolHandlerImplTest, DISABLED_SendHeartBeatAck_WrongProtocolVersion_NotSent) { // Arrange - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3258,8 +3238,7 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendSingleControlMessage) { // Arrange - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3297,8 +3276,7 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendSingleNonControlMessage) { // Arrange - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3340,8 +3318,7 @@ TEST_F(ProtocolHandlerImplTest, TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) { // Arrange - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3395,8 +3372,7 @@ TEST_F(ProtocolHandlerImplTest, SendMessageToMobileApp_SendMultiframeMessage) { } TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) { - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); @@ -3422,8 +3398,7 @@ TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_PreVersion5) { } TEST_F(ProtocolHandlerImplTest, SendServiceDataAck_AfterVersion5) { - std::shared_ptr waiter = - std::make_shared(); + std::shared_ptr waiter = std::make_shared(); uint32_t times = 0; AddSession(waiter, times); diff --git a/src/components/security_manager/include/security_manager/crypto_manager_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_impl.h index 7a42c3d773..5fd7a95155 100644 --- a/src/components/security_manager/include/security_manager/crypto_manager_impl.h +++ b/src/components/security_manager/include/security_manager/crypto_manager_impl.h @@ -47,7 +47,6 @@ #include "utils/macro.h" #include "utils/lock.h" - namespace security_manager { class CryptoManagerImpl : public CryptoManager { private: diff --git a/src/components/security_manager/test/crypto_manager_impl_test.cc b/src/components/security_manager/test/crypto_manager_impl_test.cc index 9b1cd28539..5e096194f3 100644 --- a/src/components/security_manager/test/crypto_manager_impl_test.cc +++ b/src/components/security_manager/test/crypto_manager_impl_test.cc @@ -39,7 +39,6 @@ #include #include - #include "gtest/gtest.h" #include "security_manager/crypto_manager_impl.h" #include "security_manager/mock_security_manager_settings.h" diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc index 47fa3c5560..05eeb802ad 100644 --- a/src/components/security_manager/test/ssl_context_test.cc +++ b/src/components/security_manager/test/ssl_context_test.cc @@ -42,8 +42,6 @@ #include "utils/custom_string.h" #include "security_manager/mock_security_manager_settings.h" - - using ::testing::Return; using ::testing::ReturnRef; using ::testing::NiceMock; diff --git a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h index a25155afad..4510f2292a 100644 --- a/src/components/smart_objects/include/smart_objects/always_false_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/always_false_schema_item.h @@ -33,7 +33,6 @@ #ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_ #define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_FALSE_SCHEMA_ITEM_H_ - #include "smart_objects/schema_item.h" namespace NsSmartDeviceLink { diff --git a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h index c99cf97fb1..8a211339ba 100644 --- a/src/components/smart_objects/include/smart_objects/always_true_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/always_true_schema_item.h @@ -33,7 +33,6 @@ #ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_ #define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_ALWAYS_TRUE_SCHEMA_ITEM_H_ - #include "smart_objects/schema_item.h" namespace NsSmartDeviceLink { diff --git a/src/components/smart_objects/include/smart_objects/array_schema_item.h b/src/components/smart_objects/include/smart_objects/array_schema_item.h index 27d7180d5a..3e8be98ee0 100644 --- a/src/components/smart_objects/include/smart_objects/array_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/array_schema_item.h @@ -34,7 +34,6 @@ #include - #include "smart_objects/schema_item.h" #include "smart_objects/always_true_schema_item.h" #include "smart_objects/schema_item_parameter.h" diff --git a/src/components/smart_objects/include/smart_objects/bool_schema_item.h b/src/components/smart_objects/include/smart_objects/bool_schema_item.h index a4db49c95f..14bca2f487 100644 --- a/src/components/smart_objects/include/smart_objects/bool_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/bool_schema_item.h @@ -33,8 +33,6 @@ #ifndef SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_ #define SRC_COMPONENTS_SMART_OBJECTS_INCLUDE_SMART_OBJECTS_BOOL_SCHEMA_ITEM_H_ - - #include "smart_objects/default_shema_item.h" namespace NsSmartDeviceLink { diff --git a/src/components/smart_objects/include/smart_objects/default_shema_item.h b/src/components/smart_objects/include/smart_objects/default_shema_item.h index b364fe7982..fdac77d029 100644 --- a/src/components/smart_objects/include/smart_objects/default_shema_item.h +++ b/src/components/smart_objects/include/smart_objects/default_shema_item.h @@ -34,7 +34,6 @@ #include "utils/macro.h" - #include "smart_objects/schema_item.h" #include "smart_objects/schema_item_parameter.h" #include "smart_objects/smart_object.h" diff --git a/src/components/smart_objects/include/smart_objects/enum_schema_item.h b/src/components/smart_objects/include/smart_objects/enum_schema_item.h index 8679d7e9dd..450bbc6c40 100644 --- a/src/components/smart_objects/include/smart_objects/enum_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/enum_schema_item.h @@ -39,7 +39,6 @@ #include #include - #include "smart_objects/default_shema_item.h" namespace NsSmartDeviceLink { @@ -208,10 +207,11 @@ class EnumConversionHelper { }; template -std::shared_ptr> TEnumSchemaItem::create( +std::shared_ptr > TEnumSchemaItem::create( const std::set& AllowedElements, const TSchemaItemParameter& DefaultValue) { - return std::shared_ptr> (new TEnumSchemaItem(AllowedElements, DefaultValue)); + return std::shared_ptr >( + new TEnumSchemaItem(AllowedElements, DefaultValue)); } template diff --git a/src/components/smart_objects/include/smart_objects/number_schema_item.h b/src/components/smart_objects/include/smart_objects/number_schema_item.h index c6d42066b5..2c64538953 100644 --- a/src/components/smart_objects/include/smart_objects/number_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/number_schema_item.h @@ -112,11 +112,12 @@ class TNumberSchemaItem : public CDefaultSchemaItem { }; template -std::shared_ptr> TNumberSchemaItem< +std::shared_ptr > TNumberSchemaItem< NumberType>::create(const TSchemaItemParameter& MinValue, const TSchemaItemParameter& MaxValue, const TSchemaItemParameter& DefaultValue) { - return std::shared_ptr>(new TNumberSchemaItem(MinValue, MaxValue, DefaultValue)); + return std::shared_ptr >( + new TNumberSchemaItem(MinValue, MaxValue, DefaultValue)); } template diff --git a/src/components/smart_objects/include/smart_objects/string_schema_item.h b/src/components/smart_objects/include/smart_objects/string_schema_item.h index 4783a91fea..50418debc0 100644 --- a/src/components/smart_objects/include/smart_objects/string_schema_item.h +++ b/src/components/smart_objects/include/smart_objects/string_schema_item.h @@ -36,8 +36,6 @@ #include #include - - #include "smart_objects/default_shema_item.h" #include "smart_objects/schema_item_parameter.h" diff --git a/src/components/smart_objects/src/array_schema_item.cc b/src/components/smart_objects/src/array_schema_item.cc index 9bd3a9a70d..f006267f10 100644 --- a/src/components/smart_objects/src/array_schema_item.cc +++ b/src/components/smart_objects/src/array_schema_item.cc @@ -38,7 +38,8 @@ std::shared_ptr CArraySchemaItem::create( const ISchemaItemPtr ElementSchemaItem, const TSchemaItemParameter& MinSize, const TSchemaItemParameter& MaxSize) { - return std::shared_ptr(new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize)); + return std::shared_ptr( + new CArraySchemaItem(ElementSchemaItem, MinSize, MaxSize)); } Errors::eType CArraySchemaItem::validate(const SmartObject& Object) { diff --git a/src/components/smart_objects/src/string_schema_item.cc b/src/components/smart_objects/src/string_schema_item.cc index 2f71533b53..b403607ede 100644 --- a/src/components/smart_objects/src/string_schema_item.cc +++ b/src/components/smart_objects/src/string_schema_item.cc @@ -42,7 +42,8 @@ std::shared_ptr CStringSchemaItem::create( const TSchemaItemParameter& MinLength, const TSchemaItemParameter& MaxLength, const TSchemaItemParameter& DefaultValue) { - return std::shared_ptr(new CStringSchemaItem(MinLength, MaxLength, DefaultValue)); + return std::shared_ptr( + new CStringSchemaItem(MinLength, MaxLength, DefaultValue)); } Errors::eType CStringSchemaItem::validate(const SmartObject& Object) { diff --git a/src/components/smart_objects/test/BoolSchemaItem_test.cc b/src/components/smart_objects/test/BoolSchemaItem_test.cc index 8299635c6a..faad0bf4bb 100644 --- a/src/components/smart_objects/test/BoolSchemaItem_test.cc +++ b/src/components/smart_objects/test/BoolSchemaItem_test.cc @@ -34,8 +34,6 @@ #include "gmock/gmock.h" - - #include "smart_objects/smart_object.h" #include "smart_objects/bool_schema_item.h" diff --git a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc index 1eb0b31cb3..fac9a5441b 100644 --- a/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc +++ b/src/components/smart_objects/test/SmartObjectConvertionTime_test.cc @@ -36,8 +36,6 @@ #include "gmock/gmock.h" - - #include "smart_objects/smart_object.h" #include "smart_objects/smart_schema.h" #include "smart_objects/schema_item.h" diff --git a/src/components/telemetry_monitor/src/telemetry_monitor.cc b/src/components/telemetry_monitor/src/telemetry_monitor.cc index 6d95553a59..c17b09c567 100644 --- a/src/components/telemetry_monitor/src/telemetry_monitor.cc +++ b/src/components/telemetry_monitor/src/telemetry_monitor.cc @@ -43,7 +43,6 @@ #include "transport_manager/transport_manager_default.h" #include "utils/resource_usage.h" - #include "telemetry_monitor/telemetry_observable.h" namespace telemetry_monitor { diff --git a/src/components/telemetry_monitor/src/transport_manager_observer.cc b/src/components/telemetry_monitor/src/transport_manager_observer.cc index d0c7fe42d9..fc598844a4 100644 --- a/src/components/telemetry_monitor/src/transport_manager_observer.cc +++ b/src/components/telemetry_monitor/src/transport_manager_observer.cc @@ -54,8 +54,8 @@ void TransportManagerObserver::StopRawMsg( it = time_starts.find(ptr); if (it != time_starts.end()) { auto m = std::make_shared(); - m->message_metric = - std::make_shared(); + m->message_metric = std::make_shared< + transport_manager::TMTelemetryObserver::MessageMetric>(); m->message_metric->begin = it->second; m->message_metric->end = date_time::DateTime::getCurrentTime(); m->message_metric->data_size = ptr->data_size(); diff --git a/src/components/telemetry_monitor/test/application_manager_metric_test.cc b/src/components/telemetry_monitor/test/application_manager_metric_test.cc index cd0d599690..c3f0c26cde 100644 --- a/src/components/telemetry_monitor/test/application_manager_metric_test.cc +++ b/src/components/telemetry_monitor/test/application_manager_metric_test.cc @@ -57,8 +57,8 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetric) { TimevalStruct end_time; end_time.tv_sec = 10; end_time.tv_usec = 0; - metric_test.message_metric = - std::make_shared(); + metric_test.message_metric = std::make_shared< + application_manager::AMTelemetryObserver::MessageMetric>(); metric_test.message_metric->begin = start_time; metric_test.message_metric->end = end_time; NsSmartDeviceLink::NsSmartObjects::SmartObject obj; @@ -98,8 +98,8 @@ TEST(ApplicationManagerMetricWrapper, GetJsonMetricWithGrabResources) { end_time.tv_sec = 10; end_time.tv_usec = 0; - metric_test.message_metric = - std::make_shared(); + metric_test.message_metric = std::make_shared< + application_manager::AMTelemetryObserver::MessageMetric>(); metric_test.message_metric->begin = start_time; metric_test.message_metric->end = end_time; NsSmartDeviceLink::NsSmartObjects::SmartObject obj; diff --git a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h index 201220c863..c2aebe72b3 100644 --- a/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h +++ b/src/components/telemetry_monitor/test/include/telemetry_monitor/mock_telemetry_monitor.h @@ -38,7 +38,6 @@ #include "telemetry_monitor/telemetry_monitor.h" #include "telemetry_monitor/metric_wrapper.h" - namespace test { namespace components { namespace telemetry_monitor_test { diff --git a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc index d0f82103d4..b8d3f9063f 100644 --- a/src/components/telemetry_monitor/test/telemetry_monitor_test.cc +++ b/src/components/telemetry_monitor/test/telemetry_monitor_test.cc @@ -41,8 +41,6 @@ #include "transport_manager/mock_transport_manager.h" #include "telemetry_monitor/mock_telemetry_observable.h" - - using testing::Return; using testing::_; diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h index e3be189b50..2374d8a126 100644 --- a/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h +++ b/src/components/transport_manager/include/transport_manager/transport_adapter/connection.h @@ -35,7 +35,6 @@ #ifndef SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_ #define SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_CONNECTION_H_ - #include "transport_manager/transport_adapter/transport_adapter.h" namespace transport_manager { diff --git a/src/components/transport_manager/include/transport_manager/usb/common.h b/src/components/transport_manager/include/transport_manager/usb/common.h index 8fa0d8468e..1db1a83a3a 100644 --- a/src/components/transport_manager/include/transport_manager/usb/common.h +++ b/src/components/transport_manager/include/transport_manager/usb/common.h @@ -35,8 +35,6 @@ #include - - #if defined(__QNXNTO__) #include "transport_manager/usb/qnx/usb_handler.h" #else diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_device.h b/src/components/transport_manager/include/transport_manager/usb/usb_device.h index b66943561b..ea31bb0376 100644 --- a/src/components/transport_manager/include/transport_manager/usb/usb_device.h +++ b/src/components/transport_manager/include/transport_manager/usb/usb_device.h @@ -55,8 +55,8 @@ class UsbDevice : public Device { } virtual ~UsbDevice() {} - protected: + protected: virtual bool IsSameAs(const Device* other_device) const { return unique_device_id() == other_device->unique_device_id(); } @@ -69,7 +69,6 @@ class UsbDevice : public Device { private: PlatformUsbDevice* usb_device_; - }; } // namespace transport_adapter diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc index f5dc498db9..62615cb30f 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_connection_factory.cc @@ -38,7 +38,6 @@ #include "transport_manager/bluetooth/bluetooth_socket_connection.h" #include "utils/logger.h" - namespace transport_manager { namespace transport_adapter { diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc index 4a214a7610..75ea799ce8 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_device_scanner.cc @@ -262,8 +262,8 @@ void BluetoothDeviceScanner::CheckSDLServiceOnDevices( deviceName[name_len - 1] = '\0'; } - auto bluetooth_device = - std::make_shared(bd_address, deviceName, sdl_rfcomm_channels[i]); + auto bluetooth_device = std::make_shared( + bd_address, deviceName, sdl_rfcomm_channels[i]); if (bluetooth_device) { LOG4CXX_INFO(logger_, "Bluetooth device created successfully"); discovered_devices->push_back(bluetooth_device); diff --git a/src/components/transport_manager/src/tcp/tcp_client_listener.cc b/src/components/transport_manager/src/tcp/tcp_client_listener.cc index 1697165d08..abcca43509 100644 --- a/src/components/transport_manager/src/tcp/tcp_client_listener.cc +++ b/src/components/transport_manager/src/tcp/tcp_client_listener.cc @@ -306,8 +306,8 @@ void TcpClientListener::Loop() { auto tcp_device = std::make_shared( client_address.sin_addr.s_addr, device_uid, device_name); #else - auto tcp_device = - std::make_shared(client_address.sin_addr.s_addr, device_uid); + auto tcp_device = std::make_shared( + client_address.sin_addr.s_addr, device_uid); #endif // BUILD_TESTS DeviceSptr device = controller_->AddDevice(tcp_device); diff --git a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc index e76fadfd35..e202554f8f 100644 --- a/src/components/transport_manager/src/tcp/tcp_connection_factory.cc +++ b/src/components/transport_manager/src/tcp/tcp_connection_factory.cc @@ -36,7 +36,6 @@ #include "utils/logger.h" - namespace transport_manager { namespace transport_adapter { diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc index 96f8afd2ea..c50309d437 100644 --- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc +++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc @@ -833,9 +833,9 @@ ApplicationList TransportAdapterImpl::GetApplicationList( << lst.size() << " Condition: device.use_count() != 0"); return lst; } - LOG4CXX_TRACE( - logger_, - "exit with empty ApplicationList. Condition: NOT device.use_count() != 0"); + LOG4CXX_TRACE(logger_, + "exit with empty ApplicationList. Condition: NOT " + "device.use_count() != 0"); return ApplicationList(); } diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc index 68cfb0bc8d..abe4edd812 100644 --- a/src/components/transport_manager/src/transport_manager_impl.cc +++ b/src/components/transport_manager/src/transport_manager_impl.cc @@ -1214,8 +1214,8 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal( : transport_manager(transport_manager) , transport_adapter(transport_adapter) , timer(std::make_shared*>( + const char*, + ::timer::TimerTaskImpl*>( "TM DiscRoutine", new ::timer::TimerTaskImpl( this, &ConnectionInternal::DisconnectFailedRoutine))) diff --git a/src/components/transport_manager/src/usb/usb_connection_factory.cc b/src/components/transport_manager/src/usb/usb_connection_factory.cc index c34292e758..528855cd50 100644 --- a/src/components/transport_manager/src/usb/usb_connection_factory.cc +++ b/src/components/transport_manager/src/usb/usb_connection_factory.cc @@ -35,7 +35,6 @@ #include "transport_manager/transport_adapter/transport_adapter_impl.h" #include "utils/logger.h" - #if defined(__QNXNTO__) #include "transport_manager/usb/qnx/usb_connection.h" #else @@ -67,19 +66,19 @@ TransportAdapter::Error UsbConnectionFactory::CreateConnection( DeviceSptr device = controller_->FindDevice(device_uid); if (device.use_count() == 0) { LOG4CXX_ERROR(logger_, "device " << device_uid << " not found"); - LOG4CXX_TRACE( - logger_, - "exit with TransportAdapter::BAD_PARAM. Condition: device.use_count() == 0"); + LOG4CXX_TRACE(logger_, + "exit with TransportAdapter::BAD_PARAM. Condition: " + "device.use_count() == 0"); return TransportAdapter::BAD_PARAM; } UsbDevice* usb_device = static_cast(device.get()); std::shared_ptr connection = std::make_shared(device_uid, - app_handle, - controller_, - usb_handler_, - usb_device->usb_device()); + app_handle, + controller_, + usb_handler_, + usb_device->usb_device()); controller_->ConnectionCreated(connection, device_uid, app_handle); if (connection->Init()) { LOG4CXX_INFO(logger_, "USB connection initialised"); diff --git a/src/components/transport_manager/test/tcp_transport_adapter_test.cc b/src/components/transport_manager/test/tcp_transport_adapter_test.cc index d56cb5dbdd..959180948a 100644 --- a/src/components/transport_manager/test/tcp_transport_adapter_test.cc +++ b/src/components/transport_manager/test/tcp_transport_adapter_test.cc @@ -41,8 +41,6 @@ #include "transport_manager/tcp/mock_tcp_transport_adapter.h" #include "transport_manager/mock_transport_manager_settings.h" - - namespace test { namespace components { namespace transport_manager_test { @@ -76,7 +74,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) { MockTCPTransportAdapter transport_adapter( port, last_state_, transport_manager_settings); std::string uniq_id = "unique_device_name"; - std::shared_ptr mockdev = std::make_shared(port, uniq_id); + std::shared_ptr mockdev = + std::make_shared(port, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); @@ -265,7 +264,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) { MockTCPTransportAdapter transport_adapter( port, last_state_, transport_manager_settings); std::string uniq_id = "unique_device_name"; - std::shared_ptr mockdev = std::make_shared(port, uniq_id); + std::shared_ptr mockdev = + std::make_shared(port, uniq_id); transport_adapter.AddDevice(mockdev); std::vector devList = transport_adapter.GetDeviceList(); diff --git a/src/components/transport_manager/test/transport_adapter_listener_test.cc b/src/components/transport_manager/test/transport_adapter_listener_test.cc index acf9d3dcb3..a5d08035ae 100644 --- a/src/components/transport_manager/test/transport_adapter_listener_test.cc +++ b/src/components/transport_manager/test/transport_adapter_listener_test.cc @@ -129,7 +129,7 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveFailed) { TEST_F(TransportAdapterListenerTest, OnDataSendDone) { unsigned char data[3] = {0x20, 0x07, 0x01}; ::protocol_handler::RawMessagePtr data_container = - std::make_shared<::protocol_handler::RawMessage>(1, 1, data, 3); + std::make_shared< ::protocol_handler::RawMessage>(1, 1, data, 3); EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent(EventTypeEnum::ON_SEND_DONE, @@ -145,7 +145,7 @@ TEST_F(TransportAdapterListenerTest, OnDataSendDone) { TEST_F(TransportAdapterListenerTest, OnDataSendFailed) { unsigned char data[3] = {0x20, 0x07, 0x01}; ::protocol_handler::RawMessagePtr data_container = - std::make_shared<::protocol_handler::RawMessage>(1, 1, data, 3); + std::make_shared< ::protocol_handler::RawMessage>(1, 1, data, 3); DataSendError err; EXPECT_CALL(tr_mock, diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc index d5b9c40821..9e602332c6 100644 --- a/src/components/transport_manager/test/transport_adapter_test.cc +++ b/src/components/transport_manager/test/transport_adapter_test.cc @@ -553,7 +553,8 @@ TEST_F(TransportAdapterTest, SendData) { const unsigned int kSize = 3; unsigned char data[kSize] = {0x20, 0x07, 0x01}; - const RawMessagePtr kMessage = std::make_shared(1, 1, data, kSize); + const RawMessagePtr kMessage = + std::make_shared(1, 1, data, kSize); EXPECT_CALL(*mock_connection, SendData(kMessage)) .WillOnce(Return(TransportAdapter::OK)); @@ -591,7 +592,8 @@ TEST_F(TransportAdapterTest, SendData_ConnectionNotEstablished) { const unsigned int kSize = 3; unsigned char data[kSize] = {0x20, 0x07, 0x01}; - const RawMessagePtr kMessage = std::make_shared(1, 1, data, kSize); + const RawMessagePtr kMessage = + std::make_shared(1, 1, data, kSize); EXPECT_CALL(*mock_connection, SendData(kMessage)).Times(0); res = transport_adapter.SendData(dev_id, app_handle, kMessage); diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc index 863c32f2ab..5f13adcd44 100644 --- a/src/components/transport_manager/test/transport_manager_impl_test.cc +++ b/src/components/transport_manager/test/transport_manager_impl_test.cc @@ -43,7 +43,6 @@ #include "transport_manager/mock_transport_manager_settings.h" #include "resumption/last_state_impl.h" - #include "utils/test_async_waiter.h" using ::testing::_; @@ -102,8 +101,8 @@ class TransportManagerImplTest : public ::testing::Test { const unsigned int kSize = 12; unsigned char data[kSize] = { 0x20, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - test_message_ = - std::make_shared(connection_key_, version_protocol_, data, kSize); + test_message_ = std::make_shared( + connection_key_, version_protocol_, data, kSize); } DeviceInfo ConstructDeviceInfo(const std::string& mac_address, diff --git a/src/components/utils/test/async_runner_test.cc b/src/components/utils/test/async_runner_test.cc index bd6e743291..f01dad8d58 100644 --- a/src/components/utils/test/async_runner_test.cc +++ b/src/components/utils/test/async_runner_test.cc @@ -37,8 +37,6 @@ #include "utils/threads/async_runner.h" #include "utils/conditional_variable.h" - - #include "gtest/gtest.h" #include "gmock/gmock.h" -- cgit v1.2.1 From 37f83528eab07dc9fb606481657e4be9d8414473 Mon Sep 17 00:00:00 2001 From: Conlain Kelly Date: Wed, 18 Jul 2018 14:50:22 -0400 Subject: remove goofy extra whitespace --- .../rc_rpc_plugin/test/commands/button_press_request_test.cc | 1 - .../test/commands/rc_get_interior_vehicle_data_consent_test.cc | 1 - .../rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc | 1 - .../sdl_rpc_plugin/test/commands/hmi/activate_app_request_test.cc | 1 - .../sdl_rpc_plugin/test/commands/hmi/get_system_info_response_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc | 2 -- .../rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc | 2 -- .../test/commands/hmi/mixing_audio_supported_request_test.cc | 2 -- .../test/commands/hmi/mixing_audio_supported_response_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/navi_is_ready_response_test.cc | 1 - .../test/commands/hmi/on_driver_distraction_notification_test.cc | 3 --- .../sdl_rpc_plugin/test/commands/hmi/response_from_hmi_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_response_test.cc | 1 - .../sdl_rpc_plugin/test/commands/hmi/simple_request_from_hmi_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/simple_requests_to_hmi_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/simple_response_from_hmi_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/simple_response_to_hmi_test.cc | 2 -- .../test/commands/hmi/tts_get_supported_languages_response_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/tts_is_ready_response_test.cc | 2 -- .../test/commands/hmi/ui_get_capabilities_response_test.cc | 1 - .../test/commands/hmi/ui_get_supported_languages_response_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/ui_is_ready_response_test.cc | 2 -- .../test/commands/hmi/update_device_list_request_test.cc | 1 - .../sdl_rpc_plugin/test/commands/hmi/update_sdl_request_test.cc | 1 - .../sdl_rpc_plugin/test/commands/hmi/update_sdl_response_test.cc | 1 - .../test/commands/hmi/vr_get_capabilities_response_test.cc | 1 - .../test/commands/hmi/vr_get_supported_languages_response_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/hmi/vr_is_ready_response_test.cc | 2 -- .../sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc | 1 - .../sdl_rpc_plugin/test/commands/mobile/change_registration_test.cc | 3 --- .../test/commands/mobile/create_interaction_choice_set_test.cc | 3 --- .../test/commands/mobile/on_button_notification_commands_test.cc | 2 -- .../test/commands/mobile/perform_audio_pass_thru_test.cc | 1 - .../sdl_rpc_plugin/test/commands/mobile/perform_interaction_test.cc | 3 --- .../test/commands/mobile/register_app_interface_request_test.cc | 1 - .../test/commands/mobile/reset_global_properties_test.cc | 1 - .../sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc | 1 - .../sdl_rpc_plugin/test/commands/mobile/set_app_icon_test.cc | 1 - .../sdl_rpc_plugin/test/commands/mobile/set_display_layout_test.cc | 1 - .../sdl_rpc_plugin/test/commands/mobile/set_global_properties_test.cc | 1 - .../rpc_plugins/sdl_rpc_plugin/test/commands/mobile/show_test.cc | 1 - .../rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc | 1 - 43 files changed, 69 deletions(-) (limited to 'src/components') 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 8613fb1829..8ddcaa469d 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 @@ -41,7 +41,6 @@ #include "application_manager/mock_application_manager.h" #include "application_manager/commands/command_request_test.h" #include "application_manager/policies/mock_policy_handler_interface.h" - #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" 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 7d32d64a87..7f36d251cc 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 @@ -61,7 +61,6 @@ using ::testing::NiceMock; using ::testing::SaveArg; using ::testing::Mock; using ::testing::NiceMock; - namespace am = ::application_manager; using am::ApplicationSet; using am::commands::MessageSharedPtr; diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc index 3358dfbe4c..4e2e4d7895 100644 --- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc +++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/test/resource_allocation_manager_impl_test.cc @@ -39,7 +39,6 @@ #include "application_manager/mock_application_manager.h" #include "application_manager/mock_rpc_service.h" #include "application_manager/policies/mock_policy_handler_interface.h" - #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" 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 20298c7d33..50b7aae42a 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 @@ -32,7 +32,6 @@ #include "gtest/gtest.h" #include "hmi/activate_app_request.h" - #include "smart_objects/smart_object.h" #include "application_manager/commands/command_impl.h" #include "application_manager/commands/commands_test.h" 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 0333102370..6908e21053 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/application.h" @@ -52,7 +51,6 @@ namespace hmi_commands_test { namespace get_system_info_response { using ::testing::Return; - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc index bef49826ce..339a749909 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_response_test.cc @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" @@ -52,7 +51,6 @@ namespace get_urls_response { using ::testing::_; using ::testing::Return; - namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::GetUrlsResponse; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc index 8d785c8a69..e39681498c 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/get_urls_test.cc @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "application_manager/message.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" @@ -58,7 +57,6 @@ namespace get_urls { using namespace hmi_apis; using namespace policy; - using ::testing::NiceMock; using ::testing::_; using ::testing::SetArgReferee; 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 c2ff08a6d9..dd51078614 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 @@ -35,7 +35,6 @@ #include #include "gtest/gtest.h" #include "application_manager/commands/commands_test.h" - #include "sdl_rpc_plugin/commands/hmi/on_button_event_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_navi_tbt_client_state_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_navi_way_point_change_notification.h" @@ -125,7 +124,6 @@ using ::testing::Return; using ::testing::ReturnRef; using ::testing::NiceMock; using ::testing::InSequence; - using ::smart_objects::SmartObject; using ::application_manager::commands::MessageSharedPtr; using ::test::components::application_manager_test::MockApplicationManager; 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 8892fa3809..8164f957cb 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -50,7 +49,6 @@ namespace mixing_audio_supported_request { using ::testing::_; using ::testing::Return; - namespace am = ::application_manager; namespace strings = ::application_manager::strings; using am::commands::RequestToHMI; 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 60b86cf2bd..aa651c2dca 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" @@ -56,7 +55,6 @@ namespace mixing_audio_supported_response { using ::testing::Return; using ::testing::ReturnRef; using ::testing::NiceMock; - namespace am = ::application_manager; namespace strings = ::application_manager::strings; using sdl_rpc_plugin::commands::MixingAudioSupportedResponse; 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 715d788100..23f01fac3f 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 @@ -46,7 +46,6 @@ namespace components { namespace commands_test { namespace hmi_commands_test { namespace navi_is_ready_responce { - namespace am = ::application_manager; namespace commands = sdl_rpc_plugin::commands; 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 007aef3a0f..fc3899e861 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 @@ -36,9 +36,7 @@ #include "gtest/gtest.h" #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" - #include "utils/lock.h" - #include "utils/data_accessor.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" @@ -56,7 +54,6 @@ namespace on_driver_distraction_notification { using ::testing::_; using ::testing::Return; using ::testing::Eq; - namespace am = ::application_manager; using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification; 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 010cbab1ff..0b1f2df491 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 @@ -33,7 +33,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/test/include/application_manager/commands/commands_test.h" @@ -50,7 +49,6 @@ using ::testing::_; using ::testing::Return; using ::testing::SaveArg; using ::testing::DoAll; - using ::test::components::event_engine_test::MockEventDispatcher; namespace am = ::application_manager; 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 77b94690cc..bca316bcfa 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" 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 4950dc0a41..5c42d265c7 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 @@ -31,7 +31,6 @@ */ #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -50,7 +49,6 @@ using ::testing::_; using ::testing::Types; using ::testing::NotNull; using ::testing::NiceMock; - namespace commands = ::application_manager::commands; using commands::MessageSharedPtr; using ::application_manager::event_engine::EventObserver; 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 2e4d695251..9fa864d30d 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 @@ -31,7 +31,6 @@ */ #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -119,7 +118,6 @@ namespace simple_requests_to_hmi_test { using ::testing::_; using ::testing::Types; using ::testing::NotNull; - namespace am_commands = application_manager::commands; using am_commands::MessageSharedPtr; using event_engine_test::MockEventDispatcher; 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 1874a13b7b..4a86fa9458 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 @@ -33,7 +33,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -108,7 +107,6 @@ using ::testing::Return; using ::testing::ReturnRef; using ::testing::Types; using ::testing::Eq; - using ::test::components::event_engine_test::MockEventDispatcher; namespace am = ::application_manager; 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 f556f544b6..643e21d818 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 @@ -31,7 +31,6 @@ */ #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/command.h" @@ -51,7 +50,6 @@ namespace simple_response_to_hmi_test { using ::testing::_; using ::testing::Types; using ::testing::NotNull; - namespace commands = sdl_rpc_plugin::commands; using application_manager::commands::MessageSharedPtr; 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 6495229a2e..417b8e1898 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -54,7 +53,6 @@ namespace tts_get_supported_languages_response { using ::testing::_; using ::testing::Return; - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; 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 24a5c57a23..2fae8a6819 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" @@ -55,7 +54,6 @@ namespace tts_is_ready_response { using ::testing::_; using ::testing::Return; - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; 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 a98ea7c23a..31e4860d4a 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 @@ -33,7 +33,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "interfaces/MOBILE_API.h" #include "application_manager/mock_hmi_capabilities.h" 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 d7fa03cdc0..5626e2b0ee 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/application.h" @@ -51,7 +50,6 @@ namespace hmi_commands_test { namespace ui_get_supported_languages_response { using ::testing::Return; - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; 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 f7e13f06ed..cccdbdc44d 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_hmi_capabilities.h" @@ -48,7 +47,6 @@ namespace hmi_commands_test { namespace ui_is_ready_response { using ::testing::Return; - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; 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 0cc75c3d07..c566702998 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 @@ -33,7 +33,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "interfaces/HMI_API.h" #include "application_manager/smart_object_keys.h" 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 5e6116abbd..af3b9bebf6 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" 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 92049a147e..93c49724ce 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/commands/commands_test.h" 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 3258182b59..15d38d4ef3 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 @@ -33,7 +33,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "interfaces/MOBILE_API.h" #include "application_manager/mock_hmi_capabilities.h" 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 1baf777e69..56b11ad440 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" #include "application_manager/application.h" @@ -51,7 +50,6 @@ namespace hmi_commands_test { namespace vr_get_supported_languages_response { using ::testing::Return; - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; 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 2f70995d83..0e56f5b483 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_hmi_capabilities.h" @@ -48,7 +47,6 @@ namespace hmi_commands_test { namespace vr_is_ready_response { using ::testing::Return; - using ::testing::NiceMock; namespace am = ::application_manager; namespace strings = ::application_manager::strings; 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 895aafa0c8..e32cc2b335 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 @@ -56,7 +56,6 @@ using sdl_rpc_plugin::commands::AlertRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; - using am::event_engine::Event; using policy_test::MockPolicyHandlerInterface; using ::testing::_; 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 56f06890c4..58755c8b36 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 @@ -37,9 +37,7 @@ #include "mobile/change_registration_request.h" #include "gtest/gtest.h" - #include "utils/helpers.h" - #include "utils/custom_string.h" #include "smart_objects/smart_object.h" #include "application_manager/commands/command_request_test.h" @@ -66,7 +64,6 @@ using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; using ::testing::_; - using ::testing::Return; using ::testing::ReturnRef; using ::testing::SetArgPointee; 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 099dc216c8..ed264ff2ab 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 @@ -38,9 +38,7 @@ #include "mobile/create_interaction_choice_set_response.h" #include "gtest/gtest.h" - #include "utils/helpers.h" - #include "smart_objects/smart_object.h" #include "utils/custom_string.h" #include "application_manager/commands/command_request_test.h" @@ -65,7 +63,6 @@ using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; using ::testing::_; - using ::testing::Return; using ::testing::ReturnRef; using ::testing::AtLeast; 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 869a17c630..a0e41cf728 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 @@ -34,7 +34,6 @@ #include #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" @@ -60,7 +59,6 @@ using sdl_rpc_plugin::commands::mobile::OnButtonPressNotification; using ::testing::_; using ::testing::Types; using ::testing::Return; - using am::commands::MessageSharedPtr; namespace { 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 7d01dcb722..f51f1aa655 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 @@ -55,7 +55,6 @@ using sdl_rpc_plugin::commands::PerformAudioPassThruRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; - using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; 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 e4ed330681..3b68d3ea72 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 @@ -37,9 +37,7 @@ #include "mobile/perform_interaction_request.h" #include "gtest/gtest.h" - #include "utils/helpers.h" - #include "smart_objects/smart_object.h" #include "utils/custom_string.h" #include "application_manager/commands/command_request_test.h" @@ -63,7 +61,6 @@ using am::commands::MessageSharedPtr; using am::ApplicationSharedPtr; using am::MockMessageHelper; using ::testing::_; - using ::testing::Return; using ::testing::ReturnRef; using sdl_rpc_plugin::commands::PerformInteractionRequest; 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 41a7fded62..dbaee6b2ad 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 @@ -36,7 +36,6 @@ #include "gtest/gtest.h" #include "mobile/register_app_interface_request.h" - #include "smart_objects/smart_object.h" #include "application_manager/commands/commands_test.h" #include "application_manager/commands/command_request_test.h" 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 33c0911835..0e3cd685fa 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 @@ -38,7 +38,6 @@ #include "mobile/reset_global_properties_response.h" #include "gtest/gtest.h" - #include "smart_objects/smart_object.h" #include "interfaces/HMI_API.h" #include "interfaces/MOBILE_API.h" 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 382ccf4b0e..cf25a82972 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 @@ -61,7 +61,6 @@ using sdl_rpc_plugin::commands::ScrollableMessageRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; - using ::testing::_; using ::testing::Eq; using ::testing::Ref; 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 75d3992c43..d8d1faca47 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 @@ -60,7 +60,6 @@ using am::MockMessageHelper; using am::MockHmiInterfaces; using test::components::protocol_handler_test::MockProtocolHandler; using test::components::protocol_handler_test::MockProtocolHandlerSettings; - using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; 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 1ff65196bf..cd6af1512d 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 @@ -57,7 +57,6 @@ using sdl_rpc_plugin::commands::SetDisplayLayoutRequest; using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; - using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; 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 06ddf4069c..ff85180ad6 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 @@ -58,7 +58,6 @@ using am::commands::MessageSharedPtr; using am::MockMessageHelper; using am::CommandsMap; using utils::custom_string::CustomString; - using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; 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 53e803b415..1ea1300c35 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 @@ -57,7 +57,6 @@ using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; using test::components::policy_test::MockPolicyHandlerInterface; - using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; 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 7c7319975b..be14aebc8f 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 @@ -57,7 +57,6 @@ using am::commands::CommandImpl; using am::commands::MessageSharedPtr; using am::MockMessageHelper; using policy_test::MockPolicyHandlerInterface; - using ::testing::_; using ::testing::Return; using ::testing::ReturnRef; -- cgit v1.2.1 From 79b48dcec650705e42f163defa1ac663d1f1bbb8 Mon Sep 17 00:00:00 2001 From: "Ira Lytvynenko (GitHub)" Date: Fri, 20 Jul 2018 12:25:06 +0300 Subject: Replace utils::SharedPtr with std::shared_ptr and fix its usage for external policy --- .../test/message_helper/message_helper_test.cc | 4 ++-- .../policy_external/include/policy/policy_types.h | 1 + .../policy/policy_external/src/cache_manager.cc | 2 +- .../policy/policy_external/src/policy_manager_impl.cc | 6 +++--- .../policy_external/src/sql_pt_representation.cc | 2 +- .../policy/policy_external/test/counter_test.cc | 19 ++++++++++--------- .../policy_external/test/policy_manager_impl_test.cc | 6 +++--- 7 files changed, 21 insertions(+), 19 deletions(-) (limited to 'src/components') 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 39bd5f4d4d..63d1f4471a 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 @@ -967,7 +967,7 @@ TEST_F(MessageHelperTest, SendGetListOfPermissionsResponse_SUCCESS) { correlation_id, mock_application_manager); - ASSERT_TRUE(result); + ASSERT_TRUE(result.get()); EXPECT_EQ(hmi_apis::FunctionID::SDL_GetListOfPermissions, (*result)[strings::params][strings::function_id].asInt()); @@ -1007,7 +1007,7 @@ TEST_F(MessageHelperTest, correlation_id, mock_application_manager); - ASSERT_TRUE(result); + ASSERT_TRUE(result.get()); smart_objects::SmartObject& msg_params = (*result)[strings::msg_params]; const std::string external_consent_status_key = "externalConsentStatus"; diff --git a/src/components/policy/policy_external/include/policy/policy_types.h b/src/components/policy/policy_external/include/policy/policy_types.h index 078595e8b1..84d9376a93 100644 --- a/src/components/policy/policy_external/include/policy/policy_types.h +++ b/src/components/policy/policy_external/include/policy/policy_types.h @@ -39,6 +39,7 @@ #include #include #include +#include #include "utils/helpers.h" #include "transport_manager/common.h" diff --git a/src/components/policy/policy_external/src/cache_manager.cc b/src/components/policy/policy_external/src/cache_manager.cc index 38c6d50e99..cc9921be14 100644 --- a/src/components/policy/policy_external/src/cache_manager.cc +++ b/src/components/policy/policy_external/src/cache_manager.cc @@ -1752,7 +1752,7 @@ bool CacheManager::IsPermissionsCalculated(const std::string& device_id, std::shared_ptr CacheManager::GenerateSnapshot() { CACHE_MANAGER_CHECK(snapshot_); - snapshot_ = new policy_table::Table(); + snapshot_ = std::make_shared(); sync_primitives::AutoLock auto_lock(cache_lock_); snapshot_->policy_table = pt_->policy_table; diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc index 4a5731f24f..5f651645d9 100644 --- a/src/components/policy/policy_external/src/policy_manager_impl.cc +++ b/src/components/policy/policy_external/src/policy_manager_impl.cc @@ -245,9 +245,9 @@ std::shared_ptr PolicyManagerImpl::Parse( Json::Value value; Json::Reader reader; if (reader.parse(json.c_str(), value)) { - return new policy_table::Table(&value); + return std::make_shared(&value); } else { - return std::shared_ptr(); + return std::make_shared(); } } @@ -1909,7 +1909,7 @@ void PolicyManagerImpl::SaveUpdateStatusRequired(bool is_update_needed) { void PolicyManagerImpl::set_cache_manager( CacheManagerInterface* cache_manager) { - cache_ = cache_manager; + cache_ = std::shared_ptr(cache_manager); } std::ostream& operator<<(std::ostream& output, diff --git a/src/components/policy/policy_external/src/sql_pt_representation.cc b/src/components/policy/policy_external/src/sql_pt_representation.cc index 47a7cb6623..b9b0194199 100644 --- a/src/components/policy/policy_external/src/sql_pt_representation.cc +++ b/src/components/policy/policy_external/src/sql_pt_representation.cc @@ -516,7 +516,7 @@ bool SQLPTRepresentation::RefreshDB() { std::shared_ptr SQLPTRepresentation::GenerateSnapshot() const { LOG4CXX_AUTO_TRACE(logger_); - std::shared_ptr table = new policy_table::Table(); + auto table = std::make_shared(); GatherModuleMeta(&*table->policy_table.module_meta); GatherModuleConfig(&table->policy_table.module_config); GatherUsageAndErrorCounts(&*table->policy_table.usage_and_error_counts); diff --git a/src/components/policy/policy_external/test/counter_test.cc b/src/components/policy/policy_external/test/counter_test.cc index 90f247de31..22b19c878e 100644 --- a/src/components/policy/policy_external/test/counter_test.cc +++ b/src/components/policy/policy_external/test/counter_test.cc @@ -28,6 +28,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + #include "gtest/gtest.h" #include "policy/usage_statistics/mock_statistics_manager.h" #include "policy/usage_statistics/counter.h" @@ -45,7 +46,7 @@ TEST( StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared >(); GlobalCounter reboots_counter(msm, SYNC_REBOOTS); // Assert @@ -59,7 +60,7 @@ TEST( StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared >(); GlobalCounter reboots_counter(msm, SYNC_REBOOTS); // Assert @@ -74,7 +75,7 @@ TEST( StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared >(); AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS); // Assert @@ -88,7 +89,7 @@ TEST( StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared >(); AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS); // Assert @@ -102,7 +103,7 @@ TEST( TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared >(); AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI); // Assert @@ -115,7 +116,7 @@ TEST(StatisticsManagerSetMethod, TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared >(); AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI); // Assert @@ -130,7 +131,7 @@ TEST(StatisticsManagerSetMethod, TEST(StatisticsManagerAddMethod, AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared >(); const std::uint32_t time_out = 1; AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out); @@ -145,7 +146,7 @@ TEST(StatisticsManagerAddMethod, TEST(StatisticsManagerAddMethod, AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared >(); AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp"); hmi_full_stopwatch.Start(SECONDS_HMI_FULL); @@ -161,7 +162,7 @@ TEST( StatisticsManagerAddMethod, AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) { // Arrange - MockStatisticsManager* msm = new StrictMock(); + auto msm = std::make_shared >(); const std::uint32_t time_out = 1; AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp", time_out); diff --git a/src/components/policy/policy_external/test/policy_manager_impl_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_test.cc index cbefc12cc7..6521db7c36 100644 --- a/src/components/policy/policy_external/test/policy_manager_impl_test.cc +++ b/src/components/policy/policy_external/test/policy_manager_impl_test.cc @@ -147,7 +147,7 @@ TEST_F(PolicyManagerImplTest, LoadPT_SetPT_PTIsLoaded) { ::policy::BinaryMessage msg(json.begin(), json.end()); std::shared_ptr snapshot = - new policy_table::Table(update.policy_table); + std::make_shared(update.policy_table); // Assert EXPECT_CALL(*cache_manager_, GenerateSnapshot()).WillOnce(Return(snapshot)); EXPECT_CALL(*cache_manager_, ApplyUpdate(_)).WillOnce(Return(true)); @@ -236,7 +236,7 @@ TEST_F(PolicyManagerImplTest, Json::Value table = createPTforLoad(); std::shared_ptr p_table = std::make_shared(&table); - ASSERT_TRUE(p_table); + ASSERT_TRUE(p_table.get()); p_table->SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE); EXPECT_TRUE(IsValid(*p_table)); @@ -249,7 +249,7 @@ TEST_F(PolicyManagerImplTest, TEST_F(PolicyManagerImplTest, RequestPTUpdate_InvalidPT_PTUpdateFail) { std::shared_ptr p_table = std::make_shared(); - ASSERT_TRUE(p_table); + ASSERT_TRUE(p_table.get()); EXPECT_FALSE(IsValid(*p_table)); EXPECT_CALL(listener_, OnSnapshotCreated(_, _, _)).Times(0); -- cgit v1.2.1