diff options
Diffstat (limited to 'src/components/application_manager')
239 files changed, 1385 insertions, 1378 deletions
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<AppExtension> AppExtensionPtr; +typedef std::shared_ptr<AppExtension> 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 <string> -#include "utils/shared_ptr.h" +#include <memory> namespace application_manager { class Application; -typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr; +typedef std::shared_ptr<const Application> 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<timer::Timer> TimerPtr; +typedef std::shared_ptr<timer::Timer> 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 <stdint.h> #include <vector> #include <string> -#include "utils/shared_ptr.h" +#include <memory> namespace app_launch { @@ -59,7 +59,7 @@ struct ApplicationData { bundle_id_ == app_data.bundle_id_ && device_mac_ == device_mac_; } }; -typedef utils::SharedPtr<ApplicationData> ApplicationDataPtr; +typedef std::shared_ptr<ApplicationData> 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 <memory> 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 <memory> 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 <memory> namespace app_launch { class AppLaunchCtrlImpl; @@ -69,7 +70,7 @@ class AppsLauncher { connection_handler::ConnectionHandler& connection_handler_; AppsLauncher& parent_; }; - typedef utils::SharedPtr<Launcher> LauncherPtr; + typedef std::shared_ptr<Launcher> LauncherPtr; typedef std::vector<LauncherPtr> 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>& launcher) const; + bool operator()(const std::shared_ptr<Launcher>& launcher) const; std::string device_mac_; }; @@ -38,8 +38,8 @@ class DeviceAppsLauncherImpl { private: sync_primitives::Lock launchers_lock_; - std::vector<utils::SharedPtr<Launcher> > free_launchers_; - std::vector<utils::SharedPtr<Launcher> > works_launchers_; + std::vector<std::shared_ptr<Launcher> > free_launchers_; + std::vector<std::shared_ptr<Launcher> > 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 <set> #include <list> #include <vector> -#include "utils/shared_ptr.h" +#include <memory> + #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<Application> ApplicationSharedPtr; -typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr; +typedef std::shared_ptr<Application> ApplicationSharedPtr; +typedef std::shared_ptr<const Application> 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<usage_statistics::StatisticsManager> statistics_manager, + std::shared_ptr<usage_statistics::StatisticsManager> 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<usage_statistics::StatisticsManager> statistics_manager, + std::shared_ptr<usage_statistics::StatisticsManager> 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<std::string, hmi_apis::Common_TransportType::eType> DeviceTypes; CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") -typedef utils::SharedPtr<timer::Timer> TimerSPtr; +typedef std::shared_ptr<timer::Timer> TimerSPtr; class ApplicationManagerImpl : public ApplicationManager, @@ -186,7 +186,7 @@ class ApplicationManagerImpl mobile_apis::HMILevel::eType to) OVERRIDE; void SendHMIStatusNotification( - const utils::SharedPtr<Application> app) OVERRIDE; + const std::shared_ptr<Application> 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<Application> app, + std::shared_ptr<Application> 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<commands::Command> CommandSharedPtr; +typedef std::shared_ptr<commands::Command> 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 <string> #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<ApplicationSharedPtr, - std::vector<utils::SharedPtr<smart_objects::SmartObject> > >; + std::vector<std::shared_ptr<smart_objects::SmartObject> > >; 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 <stdint.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/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 <iosfwd> #include <list> +#include <memory> #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<HmiState> HmiStatePtr; +typedef std::shared_ptr<HmiState> HmiStatePtr; /** * @brief The HmiState class @@ -81,7 +81,7 @@ class HmiState { * @param app Application pointer * @param app_mngr Application manager */ - HmiState(utils::SharedPtr<Application> app, + HmiState(std::shared_ptr<Application> 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<Application> app, + HmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr, StateID state_id); @@ -226,7 +226,7 @@ class HmiState { } protected: - utils::SharedPtr<Application> app_; + std::shared_ptr<Application> 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<Application> app, + VRHmiState(std::shared_ptr<Application> 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<Application> app, + TTSHmiState(std::shared_ptr<Application> 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<Application> app, + VideoStreamingHmiState(std::shared_ptr<Application> 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<Application> app, + NaviStreamingHmiState(std::shared_ptr<Application> 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<Application> app, + PhoneCallHmiState(std::shared_ptr<Application> 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<Application> app, + SafetyModeHmiState(std::shared_ptr<Application> 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<Application> app, + DeactivateHMI(std::shared_ptr<Application> 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<Application> app, + AudioSource(std::shared_ptr<Application> 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<Application> app, + EmbeddedNavi(std::shared_ptr<Application> 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 <string> #include <vector> -#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<application_manager::Message> MobileMessage; -typedef utils::SharedPtr<application_manager::Message> MessagePtr; +typedef std::shared_ptr<application_manager::Message> MobileMessage; +typedef std::shared_ptr<application_manager::Message> 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<application_manager::Message> MobileMessage; +typedef std::shared_ptr<application_manager::Message> 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<usage_statistics::StatisticsManager> GetStatisticManager() + std::shared_ptr<usage_statistics::StatisticsManager> GetStatisticManager() const OVERRIDE; /** @@ -552,7 +552,7 @@ class PolicyHandler : public PolicyHandlerInterface, int32_t timespan_seconds) OVERRIDE; #ifdef BUILD_TESTS - void SetPolicyManager(utils::SharedPtr<PolicyManager> pm) { + void SetPolicyManager(std::shared_ptr<PolicyManager> 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<PolicyManager> policy_manager_; + std::shared_ptr<PolicyManager> policy_manager_; void* dl_handle_; - utils::SharedPtr<PolicyEventObserver> event_observer_; + std::shared_ptr<PolicyEventObserver> 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<StatisticManagerImpl> statistic_manager_impl_; + std::shared_ptr<StatisticManagerImpl> 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 <list> #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<commands::Command> RequestPtr; +typedef std::shared_ptr<commands::Command> RequestPtr; struct RequestInfo { enum RequestType { RequestNone, MobileRequest, HMIRequest }; @@ -136,7 +136,7 @@ struct RequestInfo { uint32_t correlation_id_; }; -typedef utils::SharedPtr<RequestInfo> RequestInfoPtr; +typedef std::shared_ptr<RequestInfo> 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 <stdint.h> -#include "utils/shared_ptr.h" + #include "application_manager/resumption/resumption_data.h" namespace application_manager { class ApplicationManager; class Application; -typedef utils::SharedPtr<Application> ApplicationSharedPtr; -typedef utils::SharedPtr<const Application> ApplicationConstSharedPtr; +typedef std::shared_ptr<Application> ApplicationSharedPtr; +typedef std::shared_ptr<const Application> ApplicationConstSharedPtr; } namespace app_mngr = application_manager; @@ -270,7 +270,7 @@ class ResumeCtrl { #ifdef BUILD_TESTS virtual void set_resumption_storage( - utils::SharedPtr<ResumptionData> mock_storage) = 0; + std::shared_ptr<ResumptionData> 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<ResumptionData> mock_storage) OVERRIDE; + std::shared_ptr<ResumptionData> 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<ResumptionData> resumption_storage_; + std::shared_ptr<ResumptionData> 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<Message> { +struct MessageFromMobile : public std::shared_ptr<Message> { MessageFromMobile() {} - explicit MessageFromMobile(const utils::SharedPtr<Message>& message) - : utils::SharedPtr<Message>(message) {} + explicit MessageFromMobile(const std::shared_ptr<Message>& message) + : std::shared_ptr<Message>(message) {} // PrioritizedQueue requires this method to decide which priority to assign size_t PriorityOrder() const { return (*this)->Priority().OrderingValue(); } }; -struct MessageFromHmi : public utils::SharedPtr<Message> { +struct MessageFromHmi : public std::shared_ptr<Message> { MessageFromHmi() {} - explicit MessageFromHmi(const utils::SharedPtr<Message>& message) - : utils::SharedPtr<Message>(message) {} + explicit MessageFromHmi(const std::shared_ptr<Message>& message) + : std::shared_ptr<Message>(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> message); - void ProcessMessageFromHMI(const utils::SharedPtr<Message> message); + void ProcessMessageFromMobile(const std::shared_ptr<Message> message); + void ProcessMessageFromHMI(const std::shared_ptr<Message> message); bool ConvertMessageToSO(const Message& message, smart_objects::SmartObject& output); - utils::SharedPtr<Message> ConvertRawMsgToMessage( + std::shared_ptr<Message> 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<Message> { +struct MessageToMobile : public std::shared_ptr<Message> { MessageToMobile() : is_final(false) {} - explicit MessageToMobile(const utils::SharedPtr<Message>& message, + explicit MessageToMobile(const std::shared_ptr<Message>& message, bool final_message) - : utils::SharedPtr<Message>(message), is_final(final_message) {} + : std::shared_ptr<Message>(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<Message> { bool is_final; }; -struct MessageToHmi : public utils::SharedPtr<Message> { +struct MessageToHmi : public std::shared_ptr<Message> { MessageToHmi() {} - explicit MessageToHmi(const utils::SharedPtr<Message>& message) - : utils::SharedPtr<Message>(message) {} + explicit MessageToHmi(const std::shared_ptr<Message>& message) + : std::shared_ptr<Message>(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<Application> app, + HmiStatePtr CreateHmiState(std::shared_ptr<Application> 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<smart_objects::SmartObject> message; + std::shared_ptr<smart_objects::SmartObject> message; }; - typedef utils::SharedPtr<MessageMetric> MessageMetricSharedPtr; + typedef std::shared_ptr<MessageMetric> 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<usage_statistics::StatisticsManager> statistics_manager); + std::shared_ptr<usage_statistics::StatisticsManager> statistics_manager); UsageStatistics( const std::string& app_id, - utils::SharedPtr<usage_statistics::StatisticsManager> statistics_manager, + std::shared_ptr<usage_statistics::StatisticsManager> 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 <string> #include <set> +#include <memory> +#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<RCAppExtension> RCAppExtensionPtr; +typedef std::shared_ptr<RCAppExtension> 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 <string> #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 <memory> 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<RCAppExtension>(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<application_manager::Application>()); + std::shared_ptr<application_manager::Application>()); } } } @@ -198,7 +198,7 @@ RCAppExtensionPtr ResourceAllocationManagerImpl::GetApplicationExtention( } rc_app_extension = - application_manager::AppExtensionPtr::static_pointer_cast<RCAppExtension>( + std::static_pointer_cast<RCAppExtension>( 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<application_manager::Application>()); + std::shared_ptr<application_manager::Application>()); } 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<application_manager::Application>()); + std::shared_ptr<application_manager::Application>()); } void ResourceAllocationManagerImpl::SetResourceFree( @@ -511,7 +511,7 @@ void ResourceAllocationManagerImpl::OnApplicationEvent( if (!acquired_modules.empty()) { SendOnRCStatusNotifications( NotificationTrigger::MODULE_ALLOCATION, - utils::SharedPtr<application_manager::Application>()); + std::shared_ptr<application_manager::Application>()); } 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<NiceMock<MockApplication> >()) + , mock_app_(std::make_shared<NiceMock<MockApplication> >()) , rc_app_extention_( - utils::MakeShared<rc_rpc_plugin::RCAppExtension>(kModuleId)) {} + std::make_shared<rc_rpc_plugin::RCAppExtension>(kModuleId)) {} smart_objects::SmartObject ButtonCapability( const mobile_apis::ButtonName::eType button_name) { @@ -147,10 +147,10 @@ class ButtonPressRequestTest } template <class Command> - application_manager::SharedPtr<Command> CreateRCCommand( + std::shared_ptr<Command> CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared<Command>(msg ? msg : msg = CreateMessage(), + return std::make_shared<Command>(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<MockApplication> mock_app_; - utils::SharedPtr<rc_rpc_plugin::RCAppExtension> rc_app_extention_; + std::shared_ptr<MockApplication> mock_app_; + std::shared_ptr<rc_rpc_plugin::RCAppExtension> rc_app_extention_; test::components::policy_test::MockPolicyHandlerInterface mock_policy_handler_; testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager> @@ -195,7 +195,7 @@ TEST_F(ButtonPressRequestTest, .WillOnce(Return(true)); // Act - application_manager::SharedPtr<rc_rpc_plugin::commands::ButtonPressRequest> + std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command = CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>( mobile_message); ASSERT_TRUE(command->Init()); @@ -234,7 +234,7 @@ TEST_F( .WillOnce(DoAll(SaveArg<0>(&command_result), Return(true))); // Act - application_manager::SharedPtr<rc_rpc_plugin::commands::ButtonPressRequest> + std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command = CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>( 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<rc_rpc_plugin::commands::ButtonPressRequest> + std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command = CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>( 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<rc_rpc_plugin::commands::ButtonPressRequest> + std::shared_ptr<rc_rpc_plugin::commands::ButtonPressRequest> command = CreateRCCommand<rc_rpc_plugin::commands::ButtonPressRequest>( 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<CommandsTestMocks::kIsNice> { public: GetInteriorVehicleDataRequestTest() - : mock_app_(utils::MakeShared<NiceMock<MockApplication> >()) - , rc_app_extention_(utils::MakeShared<RCAppExtension>(kModuleId)) { + : mock_app_(std::make_shared<NiceMock<MockApplication> >()) + , rc_app_extention_(std::make_shared<RCAppExtension>(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 <class Command> - application_manager::SharedPtr<Command> CreateRCCommand( + std::shared_ptr<Command> CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared<Command>(msg ? msg : msg = CreateMessage(), + return std::make_shared<Command>(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<MockApplication> mock_app_; - utils::SharedPtr<RCAppExtension> rc_app_extention_; + std::shared_ptr<MockApplication> mock_app_; + std::shared_ptr<RCAppExtension> rc_app_extention_; testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager> 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<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( 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<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( 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<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( 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<rc_rpc_plugin::commands::GetInteriorVehicleDataRequest>( 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<CommandsTestMocks::kIsNice> { public: OnInteriorVehicleDataNotificationTest() - : mock_app_(utils::MakeShared<NiceMock<MockApplication> >()) {} + : mock_app_(std::make_shared<NiceMock<MockApplication> >()) {} MessageSharedPtr CreateBasicMessage() { MessageSharedPtr message = CreateMessage(); @@ -85,10 +85,10 @@ class OnInteriorVehicleDataNotificationTest } template <class Command> - application_manager::SharedPtr<Command> CreateRCCommand( + std::shared_ptr<Command> CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared<Command>(msg ? msg : msg = CreateMessage(), + return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -97,7 +97,7 @@ class OnInteriorVehicleDataNotificationTest } protected: - utils::SharedPtr<MockApplication> mock_app_; + std::shared_ptr<MockApplication> mock_app_; testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager> mock_allocation_manager_; }; @@ -115,7 +115,7 @@ TEST_F(OnInteriorVehicleDataNotificationTest, EXPECT_CALL(app_mngr_, applications()).WillOnce(Return(accessor)); RCAppExtensionPtr rc_extention_ptr = - utils::MakeShared<RCAppExtension>(application_manager::AppExtensionUID( + std::make_shared<RCAppExtension>(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<CommandsTestMocks::kIsNice> { public: RCOnRemoteControlSettingsNotificationTest() - : mock_app_(utils::MakeShared<NiceMock<MockApplication> >()) {} + : mock_app_(std::make_shared<NiceMock<MockApplication> >()) {} MessageSharedPtr CreateBasicMessage() { MessageSharedPtr message = CreateMessage(); (*message)[application_manager::strings::params] @@ -85,10 +85,10 @@ class RCOnRemoteControlSettingsNotificationTest } template <class Command> - application_manager::SharedPtr<Command> CreateRCCommand( + std::shared_ptr<Command> CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared<Command>(msg ? msg : msg = CreateMessage(), + return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -97,7 +97,7 @@ class RCOnRemoteControlSettingsNotificationTest } protected: - utils::SharedPtr<MockApplication> mock_app_; + std::shared_ptr<MockApplication> mock_app_; testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager> 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<RCAppExtension>(application_manager::AppExtensionUID( + std::make_shared<RCAppExtension>(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<CommandsTestMocks::kIsNice> { public: RCGetInteriorVehicleDataConsentTest() - : mock_app_(utils::MakeShared<NiceMock<MockApplication> >()) + : mock_app_(std::make_shared<NiceMock<MockApplication> >()) , 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<RCAppExtension>(kPluginID)) + , rc_app_extention_(std::make_shared<RCAppExtension>(kPluginID)) , mock_rpc_plugin_manager( - utils::MakeShared<NiceMock<MockRPCPluginManager> >()) + std::make_shared<NiceMock<MockRPCPluginManager> >()) , 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 <class Command> - application_manager::SharedPtr<Command> CreateRCCommand( + std::shared_ptr<Command> CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared<Command>(msg ? msg : msg = CreateMessage(), + return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), app_mngr_, rpc_service, mock_hmi_capabilities_, @@ -170,7 +170,7 @@ class RCGetInteriorVehicleDataConsentTest } protected: - utils::SharedPtr<MockApplication> mock_app_; + std::shared_ptr<MockApplication> 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<RCAppExtension> rc_app_extention_; - utils::SharedPtr<am::plugin_manager::MockRPCPluginManager> + std::shared_ptr<RCAppExtension> rc_app_extention_; + std::shared_ptr<am::plugin_manager::MockRPCPluginManager> mock_rpc_plugin_manager; utils::Optional<RPCPlugin> rpc_plugin; utils::Optional<MockRPCPlugin> 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<CommandsTestMocks::kIsNice> { public: SetInteriorVehicleDataRequestTest() - : mock_app_(utils::MakeShared<NiceMock<MockApplication> >()) - , rc_app_extention_(utils::MakeShared<RCAppExtension>(kModuleId)) {} + : mock_app_(std::make_shared<NiceMock<MockApplication> >()) + , rc_app_extention_(std::make_shared<RCAppExtension>(kModuleId)) {} void SetUp() OVERRIDE { ON_CALL(app_mngr_, hmi_interfaces()) @@ -106,10 +106,10 @@ class SetInteriorVehicleDataRequestTest } template <class Command> - application_manager::SharedPtr<Command> CreateRCCommand( + std::shared_ptr<Command> CreateRCCommand( MessageSharedPtr& msg) { InitCommand(kDefaultTimeout_); - return ::utils::MakeShared<Command>(msg ? msg : msg = CreateMessage(), + return std::make_shared<Command>(msg ? msg : msg = CreateMessage(), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -120,8 +120,8 @@ class SetInteriorVehicleDataRequestTest protected: testing::NiceMock<rc_rpc_plugin_test::MockResourceAllocationManager> mock_allocation_manager_; - utils::SharedPtr<MockApplication> mock_app_; - utils::SharedPtr<RCAppExtension> rc_app_extention_; + std::shared_ptr<MockApplication> mock_app_; + std::shared_ptr<RCAppExtension> 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<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( 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<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( 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<rc_rpc_plugin::commands::SetInteriorVehicleDataRequest>( 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<Message>(MessagePriority::FromServiceType( + : message_(std::make_shared<Message>(MessagePriority::FromServiceType( protocol_handler::ServiceType::kRpc))) - , mock_app_1_(utils::MakeShared<NiceMock<MockApplication> >()) - , mock_app_2_(utils::MakeShared<NiceMock<MockApplication> >()) + , mock_app_1_(std::make_shared<NiceMock<MockApplication> >()) + , mock_app_2_(std::make_shared<NiceMock<MockApplication> >()) , apps_lock_ptr_(std::make_shared<sync_primitives::Lock>()) , 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<rc_rpc_plugin::RCAppExtension>(plugin_id); + app_ext_ptr_ = std::make_shared<rc_rpc_plugin::RCAppExtension>(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<NiceMock<MockApplication> > mock_app_1_; - utils::SharedPtr<NiceMock<MockApplication> > mock_app_2_; + std::shared_ptr<NiceMock<MockApplication> > mock_app_1_; + std::shared_ptr<NiceMock<MockApplication> > mock_app_2_; application_manager::ApplicationSet apps_; std::shared_ptr<sync_primitives::Lock> apps_lock_ptr_; DataAccessor<application_manager::ApplicationSet> apps_da_; @@ -301,7 +301,7 @@ TEST_F(RAManagerTest, AnotherAppExit_NoReleaseResource) { .WillRepeatedly(Return(mock_app_2_)); RCAppExtensionPtr rc_extention_ptr = - utils::MakeShared<RCAppExtension>(application_manager::AppExtensionUID( + std::make_shared<RCAppExtension>(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<RCAppExtension>(application_manager::AppExtensionUID( + std::make_shared<RCAppExtension>(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<RCAppExtension>(application_manager::AppExtensionUID( + std::make_shared<RCAppExtension>(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<RCAppExtension>(application_manager::AppExtensionUID( + std::make_shared<RCAppExtension>(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<rc_rpc_plugin::RCAppExtension>( + std::make_shared<rc_rpc_plugin::RCAppExtension>( 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<application_manager::Application>()); + std::shared_ptr<application_manager::Application>()); 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 <string> #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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); 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::SmartObject>(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<smart_objects::SmartObject> get_capabilities( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject> get_language( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject> get_all_languages( + std::shared_ptr<smart_objects::SmartObject> get_all_languages( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::TTS_GetSupportedLanguages, application_manager_)); rpc_service_.ManageHMICommand(get_all_languages); - utils::SharedPtr<smart_objects::SmartObject> get_capabilities( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject> get_language( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject> get_all_languages( + std::shared_ptr<smart_objects::SmartObject> get_all_languages( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::UI_GetSupportedLanguages, application_manager_)); rpc_service_.ManageHMICommand(get_all_languages); - utils::SharedPtr<smart_objects::SmartObject> get_capabilities( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject> get_language( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject> get_all_languages( + std::shared_ptr<smart_objects::SmartObject> get_all_languages( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::VR_GetSupportedLanguages, application_manager_)); rpc_service_.ManageHMICommand(get_all_languages); - utils::SharedPtr<smart_objects::SmartObject> get_capabilities( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject>(); 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<smart_objects::SmartObject>(); 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<int32_t>(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<int32_t>(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::SmartObject>(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 <map> #include <string.h> -#include <utils/make_shared.h> #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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<SmartObject>(SmartType_Map); + SmartObjectSPtr notification = std::make_shared<SmartObject>(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<hmi_apis::Common_Result::eType>( 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<hmi_apis::Common_Result::eType>( 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<smart_objects::SmartObject>(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<MockApplication> MockAppPtr; -typedef ::utils::SharedPtr<ActivateAppRequest> ActivateAppRequestPtr; +typedef std::shared_ptr<MockApplication> MockAppPtr; +typedef std::shared_ptr<ActivateAppRequest> 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<AddStatisticsInfoNotification> NotificationPtr; +typedef std::shared_ptr<AddStatisticsInfoNotification> 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<AllowAllAppsResponse> ResponsePtr; +typedef std::shared_ptr<AllowAllAppsResponse> 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<AllowAppResponse> ResponsePtr; +typedef std::shared_ptr<AllowAppResponse> ResponsePtr; class AllowAppResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> {}; 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<ButtonGetCapabilitiesResponse> ResponsePtr; +typedef std::shared_ptr<ButtonGetCapabilitiesResponse> 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 <string> #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<ResponseFromHMI> ResponseFromHMIPtr; +typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; class ClosePopupResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { }; 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<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); UNUSED(command); } TYPED_TEST(HMICommandsTestSecond, CtorAndDtorCall) { - utils::SharedPtr<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); UNUSED(command); } TYPED_TEST(HMICommandsTestThird, CtorAndDtorCall) { - utils::SharedPtr<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); UNUSED(command); } TYPED_TEST(HMICommandsTestFourth, CtorAndDtorCall) { - utils::SharedPtr<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); UNUSED(command); } TYPED_TEST(HMICommandsTestFifth, CtorAndDtorCall) { - utils::SharedPtr<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); 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 <string> #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<RequestToHMI> RequestToHMIPtr; +typedef std::shared_ptr<RequestToHMI> 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 <string> #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<ResponseFromHMI> ResponseFromHMIPtr; +typedef std::shared_ptr<ResponseFromHMI> 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 <string> #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<ResponseToHMI> ResponseToHMIPtr; +typedef std::shared_ptr<ResponseToHMI> 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 <string> #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<RequestFromHMI> RequestFromHMIPtr; +typedef std::shared_ptr<RequestFromHMI> 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<MockApplication> MockAppPtr; +typedef std::shared_ptr<MockApplication> 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<kIsNice>::CreateMessage(); - utils::SharedPtr<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(message); EXPECT_CALL(commands_test::CommandsTest<kIsNice>::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<kIsNice>::CreateMessage(); - utils::SharedPtr<typename TestFixture::CommandType::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType::CommandType> command = this->template CreateCommand< typename TestFixture::CommandType::CommandType>(message); EXPECT_CALL(commands_test::CommandsTest<kIsNice>::app_mngr_, @@ -381,7 +381,7 @@ TYPED_TEST(HMIOnNotificationsEventDispatcher, // notifications(SendNotificationToMobile) TEST_F(HMICommandsNotificationsTest, OnButtonEventSendNotificationToMobile) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr<Command> command = + std::shared_ptr<Command> command = CreateCommand<hmi::OnButtonEventNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnNaviTBTClientStateNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnNaviWayPointChangeNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnUICommandNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<hmi::OnUIKeyBoardInputNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<hmi::OnUITouchEventNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnAppRegisteredNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnAppUnregisteredNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<hmi::OnButtonPressNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnReadyNotification>(message); EXPECT_CALL(app_mngr_, OnHMIStartedCooperation()); @@ -541,7 +541,7 @@ TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) { TEST_F(HMICommandsNotificationsTest, OnIgnitionCycleOverNotificationPolicyHandler) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr<Command> command = + std::shared_ptr<Command> command = CreateCommand<OnIgnitionCycleOverNotification>(message); EXPECT_CALL(mock_policy_handler_, OnIgnitionCycleOver()); @@ -550,7 +550,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnPolicyUpdateNotificationPolicyHandler) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr<Command> command = CreateCommand<OnPolicyUpdate>(message); + std::shared_ptr<Command> command = CreateCommand<OnPolicyUpdate>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnReceivedPolicyUpdate>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnReceivedPolicyUpdate>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnAppPermissionConsentNotification>(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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*message)[am::strings::msg_params]["consentedFunctions"][0] = *consented_function; - utils::SharedPtr<Command> command = + std::shared_ptr<Command> command = CreateCommand<OnAppPermissionConsentNotification>(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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*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> command = + std::shared_ptr<Command> command = CreateCommand<OnAppPermissionConsentNotification>(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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*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> command = + std::shared_ptr<Command> command = CreateCommand<OnAppPermissionConsentNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemErrorNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemInfoChangedNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnAllowSDLFunctionalityNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnAllowSDLFunctionalityNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnDeviceStateChangedNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnDeviceStateChangedNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnDeviceStateChangedNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnDeviceStateChangedNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnExitAllApplicationsNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnExitAllApplicationsNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnExitAllApplicationsNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnExitAllApplicationsNotification>(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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*notification)[am::strings::params][am::strings::function_id] = static_cast<int32_t>( 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> command = + std::shared_ptr<Command> command = CreateCommand<OnExitApplicationNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnExitApplicationNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnExitApplicationNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnExitApplicationNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnExitApplicationNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnVRCommandNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnVRCommandNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnVRCommandNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnVRCommandNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnVRCommandNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnVRCommandNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnVRLanguageChangeNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnVRLanguageChangeNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnVRLanguageChangeNotification>(message); application_set_.insert(app_); smart_objects::SmartObjectSPtr notification = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*notification)[am::strings::params][am::strings::function_id] = static_cast<int32_t>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnStartDeviceDiscovery>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnDeviceChosenNotification>(message); EXPECT_CALL(app_mngr_, ConnectToDevice( @@ -1390,7 +1390,7 @@ TEST_F(HMICommandsNotificationsTest, TEST_F(HMICommandsNotificationsTest, OnDeviceChosenNotificationDeviceInfoNotExists) { MessageSharedPtr message = CreateMessage(); - utils::SharedPtr<Command> command = + std::shared_ptr<Command> command = CreateCommand<OnDeviceChosenNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemContextNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemContextNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemContextNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemContextNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemContextNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemRequestNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemRequestNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemRequestNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnSystemRequestNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnTTSLanguageChangeNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnTTSLanguageChangeNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnTTSLanguageChangeNotification>(message); application_set_.insert(app_); smart_objects::SmartObjectSPtr notification = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*notification)[am::strings::params][am::strings::function_id] = static_cast<int32_t>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnUILanguageChangeNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnUILanguageChangeNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<OnUILanguageChangeNotification>(message); application_set_.insert(app_); smart_objects::SmartObjectSPtr notification = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*notification)[am::strings::params][am::strings::function_id] = static_cast<int32_t>(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> command = + std::shared_ptr<Command> command = CreateCommand<hmi::OnDriverDistractionNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<hmi::OnDriverDistractionNotification>(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> command = + std::shared_ptr<Command> command = CreateCommand<hmi::OnDriverDistractionNotification>(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 <string> #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<RequestToHMI> RequestToHMIPtr; +typedef std::shared_ptr<RequestToHMI> 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 <string> #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<ResponseFromHMI> ResponseFromHMIPtr; +typedef std::shared_ptr<ResponseFromHMI> 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<uint32_t, int32_t> start_stream_retry_amount_; MessageSharedPtr msg_; - SharedPtr<AudioStartStreamRequest> command_; + std::shared_ptr<AudioStartStreamRequest> 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<NaviIsReadyRequest> NaviIsReadyRequestPtr; +typedef std::shared_ptr<NaviIsReadyRequest> NaviIsReadyRequestPtr; class NaviIsReadyRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { 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<ResponseFromHMI> ResponseFromHMIPtr; +typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; class NaviIsReadyResponseTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; 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<NaviSetVideoConfigRequest> NaviSetVideoConfigRequestPtr; +typedef std::shared_ptr<NaviSetVideoConfigRequest> NaviSetVideoConfigRequestPtr; class NaviSetVideoConfigRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { 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<NaviSetVideoConfigResponse> command( + std::shared_ptr<NaviSetVideoConfigResponse> command( CreateCommand<NaviSetVideoConfigResponse>(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<uint32_t, int32_t> start_stream_retry_amount_; MessageSharedPtr msg_; - SharedPtr<NaviStartStreamRequest> command_; + std::shared_ptr<NaviStartStreamRequest> 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> command_; + std::shared_ptr<Command> command_; }; typedef testing::Types<commands::AudioStopStreamRequest, 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 60a7b01612..1ec04c68ae 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,9 @@ #include "gtest/gtest.h" #include "smart_objects/smart_object.h" #include "application_manager/smart_object_keys.h" -#include "utils/shared_ptr.h" + #include "utils/lock.h" -#include "utils/make_shared.h" + #include "utils/data_accessor.h" #include "application_manager/commands/commands_test.h" #include "application_manager/mock_application.h" @@ -56,14 +56,14 @@ namespace on_driver_distraction_notification { using ::testing::_; using ::testing::Return; using ::testing::Eq; -using ::utils::SharedPtr; + namespace am = ::application_manager; using am::commands::MessageSharedPtr; using sdl_rpc_plugin::commands::hmi::OnDriverDistractionNotification; using namespace am::commands; -typedef ::utils::SharedPtr<OnDriverDistractionNotification> NotificationPtr; +typedef std::shared_ptr<OnDriverDistractionNotification> NotificationPtr; class HMIOnDriverDistractionNotificationTest : public CommandsTest<CommandsTestMocks::kIsNice> { 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 <stdint.h> #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<RCGetCapabilitiesResponse> RCGetCapabilitiesResponsePtr; +typedef std::shared_ptr<RCGetCapabilitiesResponse> 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<RCIsReadyRequest> RCIsReadyRequestPtr; +typedef std::shared_ptr<RCIsReadyRequest> RCIsReadyRequestPtr; class RCIsReadyRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { 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 <string> #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<RCIsReadyResponse> RCIsReadyResponsePtr; +typedef std::shared_ptr<RCIsReadyResponse> RCIsReadyResponsePtr; class RCIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { }; 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 <stdint.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/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<ResponseFromHMI> ResponseFromHMIPtr; +typedef std::shared_ptr<ResponseFromHMI> ResponseFromHMIPtr; class ResponseFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {}; @@ -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<application_manager::MessageType>( 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<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(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<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); EXPECT_CALL(app_mngr_, state_controller()) @@ -176,7 +176,7 @@ TEST_F(SDLActivateAppRequestTest, FindAppToRegister_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -222,7 +222,7 @@ TEST_F(SDLActivateAppRequestTest, AppIdNotFound_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); EXPECT_CALL(app_mngr_, application(kAppID)) @@ -237,7 +237,7 @@ TEST_F(SDLActivateAppRequestTest, DevicesAppsEmpty_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -263,7 +263,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppActive_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -301,7 +301,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotActive_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -322,7 +322,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppIsForeground_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -362,7 +362,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegisteredAndEmpty_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -395,7 +395,7 @@ TEST_F(SDLActivateAppRequestTest, FirstAppNotRegistered_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(msg)); MockAppPtr mock_app(CreateMockApp()); @@ -431,7 +431,7 @@ TEST_F(SDLActivateAppRequestTest, OnTimeout_SUCCESS) { MessageSharedPtr msg = CreateMessage(); SetCorrelationAndAppID(msg); - SharedPtr<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(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<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>()); 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<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>()); 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<SDLActivateAppRequest> command( + std::shared_ptr<SDLActivateAppRequest> command( CreateCommand<SDLActivateAppRequest>(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 <string> #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<SDLActivateAppResponse> SDLActivateAppResponsePtr; +typedef std::shared_ptr<SDLActivateAppResponse> 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<SDLGetListOfPermissionsRequest> command( + std::shared_ptr<SDLGetListOfPermissionsRequest> command( CreateCommand<SDLGetListOfPermissionsRequest>(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<SDLGetListOfPermissionsRequest> command( + std::shared_ptr<SDLGetListOfPermissionsRequest> command( CreateCommand<SDLGetListOfPermissionsRequest>(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<SDLGetStatusUpdateRequest> command( + std::shared_ptr<SDLGetStatusUpdateRequest> command( CreateCommand<SDLGetStatusUpdateRequest>(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<SDLGetUserFriendlyMessageRequest> command( + std::shared_ptr<SDLGetUserFriendlyMessageRequest> command( CreateCommand<SDLGetUserFriendlyMessageRequest>(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<SDLGetUserFriendlyMessageRequest> command( + std::shared_ptr<SDLGetUserFriendlyMessageRequest> command( CreateCommand<SDLGetUserFriendlyMessageRequest>(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<SDLGetUserFriendlyMessageRequest> command( + std::shared_ptr<SDLGetUserFriendlyMessageRequest> command( CreateCommand<SDLGetUserFriendlyMessageRequest>(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<CommandType> command = this->template CreateCommand<CommandType>(); + std::shared_ptr<CommandType> command = this->template CreateCommand<CommandType>(); // 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<CommandsTestMocks::kIsNice> { }; TEST_F(RequestFromHMITest, BasicMethodsOverloads_SUCCESS) { - SharedPtr<commands::RequestFromHMI> command( + std::shared_ptr<commands::RequestFromHMI> command( CreateCommand<commands::RequestFromHMI>()); 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<commands::RequestFromHMI> command( + std::shared_ptr<commands::RequestFromHMI> command( CreateCommand<commands::RequestFromHMI>()); 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<CommandsTestMocks::kIsNice> {}; TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) { - SharedPtr<am_commands::RequestToHMI> command( + std::shared_ptr<am_commands::RequestToHMI> command( CreateCommand<am_commands::RequestToHMI>()); // Current implementation always return `true` @@ -139,7 +139,7 @@ TEST_F(RequestToHMITest, BasicMethodsOverloads_SUCCESS) { } TEST_F(RequestToHMITest, SendRequest_SUCCESS) { - SharedPtr<am_commands::RequestToHMI> command( + std::shared_ptr<am_commands::RequestToHMI> command( CreateCommand<am_commands::RequestToHMI>()); 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<CommandType> command = this->template CreateCommand<CommandType>(); + std::shared_ptr<CommandType> command = this->template CreateCommand<CommandType>(); 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<CommandType> command = this->template CreateCommand<CommandType>(); + std::shared_ptr<CommandType> command = this->template CreateCommand<CommandType>(); 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<CommandType> command = this->template CreateCommand<CommandType>(); + std::shared_ptr<CommandType> command = this->template CreateCommand<CommandType>(); 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 <stdint.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" @@ -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<CommandType> command = this->template CreateCommand<CommandType>(); + std::shared_ptr<CommandType> command = this->template CreateCommand<CommandType>(); 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<CommandType> command = this->template CreateCommand<CommandType>(); + std::shared_ptr<CommandType> command = this->template CreateCommand<CommandType>(); command->Run(); } @@ -277,7 +277,7 @@ class NotificationFromHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {}; TEST_F(NotificationFromHMITest, BasicMethodsOverloads_SUCCESS) { - SharedPtr<application_manager::commands::NotificationFromHMI> command( + std::shared_ptr<application_manager::commands::NotificationFromHMI> command( CreateCommand<application_manager::commands::NotificationFromHMI>()); // 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<int32_t>(am::MessageType::kNotification); - SharedPtr<application_manager::commands::NotificationFromHMI> command( + std::shared_ptr<application_manager::commands::NotificationFromHMI> command( CreateCommand<application_manager::commands::NotificationFromHMI>()); 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<application_manager::commands::NotificationFromHMI> command( + std::shared_ptr<application_manager::commands::NotificationFromHMI> command( CreateCommand<application_manager::commands::NotificationFromHMI>( 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<CommandType> command = this->template CreateCommand<CommandType>(); + std::shared_ptr<CommandType> command = this->template CreateCommand<CommandType>(); EXPECT_CALL(this->mock_rpc_service_, SendMessageToHMI(NotNull())); command->Run(); @@ -82,7 +82,7 @@ TYPED_TEST(ResponseToHMICommandsTest, Run_SendMessageToHMI_SUCCESS) { class ResponseToHMITest : public CommandsTest<CommandsTestMocks::kIsNice> {}; TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) { - SharedPtr<application_manager::commands::ResponseToHMI> command( + std::shared_ptr<application_manager::commands::ResponseToHMI> command( CreateCommand<application_manager::commands::ResponseToHMI>()); // Current implementation always return `true` @@ -91,7 +91,7 @@ TEST_F(ResponseToHMITest, BasicMethodsOverloads_SUCCESS) { } TEST_F(ResponseToHMITest, Run_SUCCESS) { - SharedPtr<application_manager::commands::ResponseToHMI> command( + std::shared_ptr<application_manager::commands::ResponseToHMI> command( CreateCommand<application_manager::commands::ResponseToHMI>()); 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<TTSGetCapabilitiesResponse> command( + std::shared_ptr<TTSGetCapabilitiesResponse> command( CreateCommand<TTSGetCapabilitiesResponse>(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<TTSGetCapabilitiesResponse> command( + std::shared_ptr<TTSGetCapabilitiesResponse> command( CreateCommand<TTSGetCapabilitiesResponse>(msg)); command->Run(); @@ -100,7 +100,7 @@ TEST_F(TTSGetCapabilitiesResponseTest, Run_OnlyPrerecorded_SUCCESS) { EXPECT_CALL(mock_hmi_capabilities_, set_prerecorded_speech(SmartObject(kText))); - SharedPtr<TTSGetCapabilitiesResponse> command( + std::shared_ptr<TTSGetCapabilitiesResponse> command( CreateCommand<TTSGetCapabilitiesResponse>(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<TTSGetCapabilitiesResponse> command( + std::shared_ptr<TTSGetCapabilitiesResponse> command( CreateCommand<TTSGetCapabilitiesResponse>(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<TTSGetLanguageResponse> command( + std::shared_ptr<TTSGetLanguageResponse> command( CreateCommand<TTSGetLanguageResponse>(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<TTSGetLanguageResponse> command( + std::shared_ptr<TTSGetLanguageResponse> command( CreateCommand<TTSGetLanguageResponse>(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 <string> #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<ResponseFromHMI> ResponseFromHMIPtr; +typedef std::shared_ptr<ResponseFromHMI> 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 <string> #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<ResponseFromHMI> ResponseFromHMIPtr; +typedef std::shared_ptr<ResponseFromHMI> 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 <stdint.h> #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<ResponseFromHMI> ResponseFromHMIPtr; +typedef std::shared_ptr<ResponseFromHMI> 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<UIGetLanguageResponse> command( + std::shared_ptr<UIGetLanguageResponse> command( CreateCommand<UIGetLanguageResponse>(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<UIGetLanguageResponse> command( + std::shared_ptr<UIGetLanguageResponse> command( CreateCommand<UIGetLanguageResponse>(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 <string> #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<UIGetSupportedLanguagesResponse> +typedef std::shared_ptr<UIGetSupportedLanguagesResponse> 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<UIIsReadyRequest> UIIsReadyRequestPtr; +typedef std::shared_ptr<UIIsReadyRequest> UIIsReadyRequestPtr; class UIIsReadyRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { 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 <string> #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<UIIsReadyResponse> UIIsReadyResponsePtr; +typedef std::shared_ptr<UIIsReadyResponse> 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 <stdint.h> #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<UpdateDeviceListRequest> UpdateDeviceListRequestPtr; +typedef std::shared_ptr<UpdateDeviceListRequest> 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 <string> #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<UpdateSDLRequest> UpdateSDLRequestPtr; +typedef std::shared_ptr<UpdateSDLRequest> 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 <string> #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<UpdateSDLResponse> UpdateSDLResponsePtr; +typedef std::shared_ptr<UpdateSDLResponse> 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 <stdint.h> #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<VRGetCapabilitiesResponse> VRGetCapabilitiesResponsePtr; +typedef std::shared_ptr<VRGetCapabilitiesResponse> 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<VRGetLanguageResponse> command( + std::shared_ptr<VRGetLanguageResponse> command( CreateCommand<VRGetLanguageResponse>(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<VRGetLanguageResponse> command( + std::shared_ptr<VRGetLanguageResponse> command( CreateCommand<VRGetLanguageResponse>(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 <string> #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<VRGetSupportedLanguagesResponse> +typedef std::shared_ptr<VRGetSupportedLanguagesResponse> 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<VRIsReadyRequest> VRIsReadyRequestPtr; +typedef std::shared_ptr<VRIsReadyRequest> VRIsReadyRequestPtr; class VRIsReadyRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { 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 <string> #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<VRIsReadyResponse> VRIsReadyResponsePtr; +typedef std::shared_ptr<VRIsReadyResponse> VRIsReadyResponsePtr; class VRIsReadyResponseTest : public CommandsTest<CommandsTestMocks::kIsNice> { }; 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<application_manager::CommandsMap>( commands_map, lock_ptr_))); - so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map); + so_ptr_ = std::make_shared<SmartObject>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<SmartObject>(SmartType_Map); + SmartObjectSPtr response = std::make_shared<SmartObject>(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<CommandRequestImpl> base_class_request = - static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr); + std::shared_ptr<CommandRequestImpl> base_class_request = + static_cast<std::shared_ptr<CommandRequestImpl> >(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<SmartObject>(SmartType_Map); + so_ptr_ = std::make_shared<SmartObject>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); request_ptr->Run(); } @@ -421,14 +421,14 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(*mock_app_, commands_map()) .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>( commands_map, lock_ptr_))); - so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map); + so_ptr_ = std::make_shared<SmartObject>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg); request_ptr->Run(); } @@ -466,7 +466,7 @@ TEST_F(AddCommandRequestTest, EXPECT_CALL(*mock_app_, commands_map()) .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>( commands_map, lock_ptr_))); - so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map); + so_ptr_ = std::make_shared<SmartObject>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); request_ptr->Run(); @@ -770,7 +770,7 @@ TEST_F( } EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); - utils::SharedPtr<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); request_ptr->Run(); @@ -813,7 +813,7 @@ TEST_F( ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) .WillOnce(Return(true)); } - utils::SharedPtr<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); request_ptr->Run(); @@ -862,7 +862,7 @@ TEST_F( ManageHMICommand(HMIResultCodeIs(hmi_apis::FunctionID::VR_AddCommand))) .WillOnce(Return(true)); } - utils::SharedPtr<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(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<SmartObject>(SmartType_Map); + SmartObjectSPtr response = std::make_shared<SmartObject>(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<CommandRequestImpl> base_class_request = - static_cast<utils::SharedPtr<CommandRequestImpl> >( + std::shared_ptr<CommandRequestImpl> base_class_request = + static_cast<std::shared_ptr<CommandRequestImpl> >( CreateCommand<AddCommandRequest>(msg_)); base_class_request->onTimeOut(); } @@ -1094,7 +1094,7 @@ TEST_F(AddCommandRequestTest, OnTimeOut_AppRemoveCommandCalled) { EXPECT_CALL(*mock_app_, commands_map()) .WillRepeatedly(Return(DataAccessor<application_manager::CommandsMap>( commands_map, lock_ptr_))); - so_ptr_ = utils::MakeShared<SmartObject>(SmartType_Map); + so_ptr_ = std::make_shared<SmartObject>(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<AddCommandRequest> request_ptr = + std::shared_ptr<AddCommandRequest> request_ptr = CreateCommand<AddCommandRequest>(msg_); request_ptr->Run(); EXPECT_CALL(*mock_app_, RemoveCommand(kCmdId)); - SmartObjectSPtr response = utils::MakeShared<SmartObject>(SmartType_Map); + SmartObjectSPtr response = std::make_shared<SmartObject>(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<CommandRequestImpl> base_class_request = - static_cast<utils::SharedPtr<CommandRequestImpl> >(request_ptr); + std::shared_ptr<CommandRequestImpl> base_class_request = + static_cast<std::shared_ptr<CommandRequestImpl> >(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<AddSubMenuRequest> AddSubMenuPtr; +typedef std::shared_ptr<AddSubMenuRequest> 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<AddSubMenuRequest> request_ptr = + std::shared_ptr<AddSubMenuRequest> request_ptr = CreateCommand<AddSubMenuRequest>(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<AddSubMenuRequest> command = + std::shared_ptr<AddSubMenuRequest> command = CreateCommand<AddSubMenuRequest>(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 <string> #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<AlertManeuverRequest> CommandPtr; +typedef std::shared_ptr<AlertManeuverRequest> CommandPtr; class AlertManeuverRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { @@ -80,7 +80,7 @@ class AlertManeuverRequestTest am::event_engine::Event event(hmi_apis::FunctionID::TTS_Speak); event.set_smart_object(*response); - utils::SharedPtr<AlertManeuverRequest> command = + std::shared_ptr<AlertManeuverRequest> command = CreateCommand<AlertManeuverRequest>(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<AlertRequest> CommandPtr; +typedef std::shared_ptr<AlertRequest> 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<AlertRequest> command = CreateCommand<AlertRequest>(); + std::shared_ptr<AlertRequest> command = CreateCommand<AlertRequest>(); 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<AlertRequest> command = + std::shared_ptr<AlertRequest> command = CreateCommand<AlertRequest>(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<ChangeRegistrationRequest> command = + std::shared_ptr<ChangeRegistrationRequest> command = CreateCommand<ChangeRegistrationRequest>(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<ChangeRegistrationRequest> command = + std::shared_ptr<ChangeRegistrationRequest> command = CreateCommand<ChangeRegistrationRequest>(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<ChangeRegistrationRequest> command = + std::shared_ptr<ChangeRegistrationRequest> command = CreateCommand<ChangeRegistrationRequest>(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<ChangeRegistrationRequest> command = + std::shared_ptr<ChangeRegistrationRequest> command = CreateCommand<ChangeRegistrationRequest>(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<CreateInteractionChoiceSetRequest> +typedef std::shared_ptr<CreateInteractionChoiceSetRequest> CreateInteractionChoiceSetRequestPtr; -typedef SharedPtr<CreateInteractionChoiceSetResponse> +typedef std::shared_ptr<CreateInteractionChoiceSetResponse> 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<CreateInteractionChoiceSetRequest> req_vr = + std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr = CreateCommand<CreateInteractionChoiceSetRequest>(); 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<CreateInteractionChoiceSetRequest> req_vr = + std::shared_ptr<CreateInteractionChoiceSetRequest> req_vr = CreateCommand<CreateInteractionChoiceSetRequest>(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<DeleteCommandRequest> DeleteCommandPtr; +typedef std::shared_ptr<DeleteCommandRequest> 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<DeleteFileRequest> DeleteFileRequestPtr; -typedef SharedPtr<DeleteFileResponse> DeleteFileResponsePtr; +typedef std::shared_ptr<DeleteFileRequest> DeleteFileRequestPtr; +typedef std::shared_ptr<DeleteFileResponse> 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<DeleteInteractionChoiceSetRequest> +typedef std::shared_ptr<DeleteInteractionChoiceSetRequest> DeleteInteractionChoiceSetRequestPtr; -typedef SharedPtr<DeleteInteractionChoiceSetResponse> +typedef std::shared_ptr<DeleteInteractionChoiceSetResponse> 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<DeleteSubMenuRequest> DeleteSubMenuRequestPtr; -typedef SharedPtr<DeleteSubMenuResponse> DeleteSubMenuResponsePtr; +typedef std::shared_ptr<DeleteSubMenuRequest> DeleteSubMenuRequestPtr; +typedef std::shared_ptr<DeleteSubMenuResponse> 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<DeleteSubMenuRequest> command = + std::shared_ptr<DeleteSubMenuRequest> command = CreateCommand<DeleteSubMenuRequest>(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 <vector> #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<DialNumberRequest> DialNumberRequestPtr; +typedef std::shared_ptr<DialNumberRequest> 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<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); UNUSED(command); } TYPED_TEST(MobileCommandsTestSecond, CtorAndDtorCall) { - utils::SharedPtr<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); UNUSED(command); } TYPED_TEST(MobileCommandsTestThird, CtorAndDtorCall) { - utils::SharedPtr<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); 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<EndAudioPassThruRequest> EndAudioPassThruRequestPtr; +typedef std::shared_ptr<EndAudioPassThruRequest> EndAudioPassThruRequestPtr; class EndAudioPassThruRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; 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<GetWayPointsRequest> CommandPtr; +typedef std::shared_ptr<GetWayPointsRequest> 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<SmartObject>(::smart_objects::SmartType_Map); + message_ = std::make_shared<SmartObject>(::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<GetWayPointsRequest> command_sptr_; + std::shared_ptr<GetWayPointsRequest> command_sptr_; }; class GetWayPointsRequestOnEventTest @@ -133,7 +133,7 @@ TEST_F(GetWayPointsRequestTest, (*message_)[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr<am::Application> null_application_sptr; + std::shared_ptr<am::Application> 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 <string> #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<ListFilesRequest> command(CreateCommand<ListFilesRequest>()); + std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>()); ON_CALL(app_mngr_, application(_)) - .WillByDefault(Return(SharedPtr<am::Application>())); + .WillByDefault(Return(std::shared_ptr<am::Application>())); 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<ListFilesRequest> command(CreateCommand<ListFilesRequest>()); + std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>()); 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<ListFilesRequest> command(CreateCommand<ListFilesRequest>()); + std::shared_ptr<ListFilesRequest> command(CreateCommand<ListFilesRequest>()); 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 <string> #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<Notification> command( + std::shared_ptr<Notification> command( this->template CreateCommand<Notification>(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<Notification> command( + std::shared_ptr<Notification> command( this->template CreateCommand<Notification>(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<Notification> command( + std::shared_ptr<Notification> command( this->template CreateCommand<Notification>(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<Notification> command( + std::shared_ptr<Notification> command( this->template CreateCommand<Notification>(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<Notification> command( + std::shared_ptr<Notification> command( this->template CreateCommand<Notification>(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<Notification> command( + std::shared_ptr<Notification> command( this->template CreateCommand<Notification>(notification_msg)); const std::vector<ApplicationSharedPtr> 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<Notification> command( + std::shared_ptr<Notification> command( this->template CreateCommand<Notification>(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<Notification> command( + std::shared_ptr<Notification> command( this->template CreateCommand<Notification>(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<Notification> command( + std::shared_ptr<Notification> command( this->template CreateCommand<Notification>(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 <string> #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<OnCommandNotification> CommandPtr; +typedef std::shared_ptr<OnCommandNotification> 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<OnHashChangeNotification> command = + std::shared_ptr<OnHashChangeNotification> command = CreateCommand<OnHashChangeNotification>(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<OnHashChangeNotification> command = + std::shared_ptr<OnHashChangeNotification> command = CreateCommand<OnHashChangeNotification>(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<OnHMIStatusNotificationFromMobile> command = + std::shared_ptr<OnHMIStatusNotificationFromMobile> command = CreateCommand<OnHMIStatusNotificationFromMobile>(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<OnHMIStatusNotificationFromMobile> command = + std::shared_ptr<OnHMIStatusNotificationFromMobile> command = CreateCommand<OnHMIStatusNotificationFromMobile>(msg); MockAppPtr mock_app = CreateMockApp(); @@ -132,7 +132,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_CurrentStateNotForeground_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND); - SharedPtr<OnHMIStatusNotificationFromMobile> command = + std::shared_ptr<OnHMIStatusNotificationFromMobile> command = CreateCommand<OnHMIStatusNotificationFromMobile>(msg); MockAppPtr mock_app = CreateMockApp(); @@ -161,7 +161,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_ProtocolVersionKV3_NoNotification) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_BACKGROUND); - SharedPtr<OnHMIStatusNotificationFromMobile> command = + std::shared_ptr<OnHMIStatusNotificationFromMobile> command = CreateCommand<OnHMIStatusNotificationFromMobile>(msg); MockAppPtr mock_app = CreateMockApp(); @@ -190,7 +190,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_AppNotRequestedBeforeAndKV3_NoNotification) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr<OnHMIStatusNotificationFromMobile> command = + std::shared_ptr<OnHMIStatusNotificationFromMobile> command = CreateCommand<OnHMIStatusNotificationFromMobile>(msg); MockAppPtr mock_app = CreateMockApp(); @@ -218,7 +218,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_AppNotRequestedBefore_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr<OnHMIStatusNotificationFromMobile> command = + std::shared_ptr<OnHMIStatusNotificationFromMobile> command = CreateCommand<OnHMIStatusNotificationFromMobile>(msg); MockAppPtr mock_app = CreateMockApp(); @@ -249,7 +249,7 @@ TEST_F(OnHMIStatusNotificationFromMobileTest, Run_AnotherForegroundSDLApp_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(mobile_apis::HMILevel::HMI_FULL); - SharedPtr<OnHMIStatusNotificationFromMobile> command = + std::shared_ptr<OnHMIStatusNotificationFromMobile> command = CreateCommand<OnHMIStatusNotificationFromMobile>(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<OnHMIStatusNotification> command = + std::shared_ptr<OnHMIStatusNotification> command = CreateCommand<OnHMIStatusNotification>(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<OnHMIStatusNotification> command = + std::shared_ptr<OnHMIStatusNotification> command = CreateCommand<OnHMIStatusNotification>(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<OnHMIStatusNotification> command = + std::shared_ptr<OnHMIStatusNotification> command = CreateCommand<OnHMIStatusNotification>(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<OnHMIStatusNotification> command = + std::shared_ptr<OnHMIStatusNotification> command = CreateCommand<OnHMIStatusNotification>(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<ApplicationSet>& app_set) { - app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set); + MockAppPtr InitAppSetDataAccessor(std::shared_ptr<ApplicationSet>& app_set) { + app_set = (!app_set ? std::make_shared<ApplicationSet>() : app_set); MockAppPtr app(CreateMockApp()); app_set->insert(app); EXPECT_CALL(app_mngr_, applications()) @@ -88,14 +88,14 @@ class OnKeyBoardInputNotificationTest return app; } - SharedPtr<ApplicationSet> app_set_; + std::shared_ptr<ApplicationSet> app_set_; std::shared_ptr<sync_primitives::Lock> lock_; }; TEST_F(OnKeyBoardInputNotificationTest, Run_ActionActive_SUCCESS) { MessageSharedPtr msg = CreateMessage(); - SharedPtr<OnKeyBoardInputNotification> command = + std::shared_ptr<OnKeyBoardInputNotification> command = CreateCommand<OnKeyBoardInputNotification>(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<OnKeyBoardInputNotification> command = + std::shared_ptr<OnKeyBoardInputNotification> command = CreateCommand<OnKeyBoardInputNotification>(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<OnKeyBoardInputNotification> command = + std::shared_ptr<OnKeyBoardInputNotification> command = CreateCommand<OnKeyBoardInputNotification>(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<OnSystemRequestNotification> command = + std::shared_ptr<OnSystemRequestNotification> command = CreateCommand<OnSystemRequestNotification>(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<OnSystemRequestNotification> command = + std::shared_ptr<OnSystemRequestNotification> command = CreateCommand<OnSystemRequestNotification>(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<OnSystemRequestNotification> command = + std::shared_ptr<OnSystemRequestNotification> command = CreateCommand<OnSystemRequestNotification>(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<OnSystemRequestNotification> command = + std::shared_ptr<OnSystemRequestNotification> command = CreateCommand<OnSystemRequestNotification>(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<OnTBTClientStateNotification> NotificationPtr; +typedef std::shared_ptr<OnTBTClientStateNotification> 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<OnTouchEventNotification> NotificationPtr; +typedef std::shared_ptr<OnTouchEventNotification> 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<OnWayPointChangeNotification> NotificationPtr; +typedef std::shared_ptr<OnWayPointChangeNotification> 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<SmartObject>(::smart_objects::SmartType_Map)) + , message_(std::make_shared<SmartObject>(::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<PerformAudioPassThruRequest> command_sptr_; + std::shared_ptr<PerformAudioPassThruRequest> 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<SmartObject>(::smart_objects::SmartType_Map); + std::make_shared<SmartObject>(::smart_objects::SmartType_Map); (*message)[am::strings::params][am::strings::connection_key] = kConnectionKey; - utils::SharedPtr<PerformAudioPassThruRequest> command = + std::shared_ptr<PerformAudioPassThruRequest> command = CreateCommand<PerformAudioPassThruRequest>(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<PerformAudioPassThruRequest> command = + std::shared_ptr<PerformAudioPassThruRequest> command = CreateCommand<PerformAudioPassThruRequest>(mobile_request); ON_CALL(mock_hmi_interfaces_, @@ -271,7 +271,7 @@ TEST_F(PerformAudioPassThruRequestTest, TEST_F(PerformAudioPassThruRequestTest, Run_InvalidApp_ApplicationNotRegisteredResponce) { - utils::SharedPtr<am::Application> null_application_sptr; + std::shared_ptr<am::Application> 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<PerformInteractionRequest> command = + std::shared_ptr<PerformInteractionRequest> command = CreateCommand<PerformInteractionRequest>(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<PerformInteractionRequest> command = + std::shared_ptr<PerformInteractionRequest> command = CreateCommand<PerformInteractionRequest>(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<PerformInteractionRequest> command = + std::shared_ptr<PerformInteractionRequest> command = CreateCommand<PerformInteractionRequest>(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<PutFileRequest> PutFileRequestPtr; -typedef SharedPtr<PutFileResponse> PutFileResponsePtr; +typedef std::shared_ptr<PutFileRequest> PutFileRequestPtr; +typedef std::shared_ptr<PutFileResponse> PutFileResponsePtr; namespace { const uint32_t kConnectionKey = 1u; @@ -131,7 +131,7 @@ class PutFileResponceTest : public CommandsTest<CommandsTestMocks::kIsNice> { } MessageSharedPtr message_; - SharedPtr<PutFileResponse> command_sptr_; + std::shared_ptr<PutFileResponse> 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<am::Application> null_application_sptr; + std::shared_ptr<am::Application> 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<am::Application> application_sptr = - utils::MakeShared<MockApplication>(); + std::shared_ptr<am::Application> application_sptr = + std::make_shared<MockApplication>(); 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<application_manager::Application>( + std::static_pointer_cast<application_manager::Application>( mock_app))); } MessageSharedPtr msg_; - SharedPtr<RegisterAppInterfaceRequest> command_; + std::shared_ptr<RegisterAppInterfaceRequest> command_; const utils::custom_string::CustomString app_name_; std::shared_ptr<sync_primitives::Lock> 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<utils::CallNothing>(); + std::make_shared<utils::CallNothing>(); 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<utils::CallNothing>(); + std::make_shared<utils::CallNothing>(); 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<application_manager::Application>( + std::static_pointer_cast<application_manager::Application>( 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<application_manager::Application>( + std::static_pointer_cast<application_manager::Application>( mock_app), request_hash_id)).WillOnce(Return(false)); EXPECT_CALL( mock_application_helper_, RecallApplicationData( - MockAppPtr::static_pointer_cast<application_manager::Application>( + std::static_pointer_cast<application_manager::Application>( mock_app), _)); @@ -506,7 +506,7 @@ TEST_F(RegisterAppInterfaceRequestTest, EXPECT_CALL( mock_application_helper_, RecallApplicationData( - MockAppPtr::static_pointer_cast<application_manager::Application>( + std::static_pointer_cast<application_manager::Application>( 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<ResetGlobalPropertiesRequest> ResetGlobalPropertiesRequestPtr; -typedef SharedPtr<ResetGlobalPropertiesResponse> +typedef std::shared_ptr<ResetGlobalPropertiesRequest> ResetGlobalPropertiesRequestPtr; +typedef std::shared_ptr<ResetGlobalPropertiesResponse> 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); *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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); *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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); *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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); *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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*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<ScrollableMessageRequest> command_; + std::shared_ptr<ScrollableMessageRequest> 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<ScrollableMessageRequest> command = + std::shared_ptr<ScrollableMessageRequest> command = CreateCommand<ScrollableMessageRequest>(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<SendHapticDataRequest> SendHapticDataRequestPtr; -typedef SharedPtr<SendHapticDataResponse> SendHapticDataResponsePtr; +typedef std::shared_ptr<SendHapticDataRequest> SendHapticDataRequestPtr; +typedef std::shared_ptr<SendHapticDataResponse> SendHapticDataResponsePtr; namespace { const uint32_t kConnectionKey = 1u; @@ -91,7 +91,7 @@ class SendHapticDataResponseTest } MessageSharedPtr message_; - SharedPtr<SendHapticDataResponse> command_sptr_; + std::shared_ptr<SendHapticDataResponse> 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<UnwrappedSendLocationRequest> CommandSPrt; + typedef std::shared_ptr<UnwrappedSendLocationRequest> CommandSPrt; SendLocationRequestTest() { mock_app_ = CreateMockApp(); - disp_cap_ = utils::MakeShared<SmartObject>(smart_objects::SmartType_Map); + disp_cap_ = std::make_shared<SmartObject>(smart_objects::SmartType_Map); message_ = CreateMessage(); command_ = CreateCommand<UnwrappedSendLocationRequest>(message_); } @@ -158,7 +158,7 @@ class SendLocationRequestTest } MockAppPtr mock_app_; - SharedPtr<SmartObject> disp_cap_; + std::shared_ptr<SmartObject> 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<SetAppIconRequest> req_vr = + std::shared_ptr<SetAppIconRequest> req_vr = CreateCommand<SetAppIconRequest>(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<SetDisplayLayoutRequest> CommandPtr; +typedef std::shared_ptr<SetDisplayLayoutRequest> 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<SetDisplayLayoutRequest> command = + std::shared_ptr<SetDisplayLayoutRequest> command = CreateCommand<SetDisplayLayoutRequest>(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<SetGlobalPropertiesRequest> command) { + std::shared_ptr<SetGlobalPropertiesRequest> 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<SetGlobalPropertiesRequest> command) { + std::shared_ptr<SetGlobalPropertiesRequest> 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<SetGlobalPropertiesRequest> command = + std::shared_ptr<SetGlobalPropertiesRequest> command = CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command = + std::shared_ptr<SetGlobalPropertiesRequest> command = CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command = + std::shared_ptr<SetGlobalPropertiesRequest> command = CreateCommand<SetGlobalPropertiesRequest>(response); EXPECT_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) @@ -427,7 +427,7 @@ TEST_F(SetGlobalPropertiesRequestTest, TEST_F(SetGlobalPropertiesRequestTest, Run_VRNoMenuAndKeyboard_SUCCESS) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -506,7 +506,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenMenuIcon_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -528,7 +528,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRBrokenVRHelp_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -552,7 +552,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRIncorrectSyntax_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(_)).Times(0); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -573,7 +573,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingTitle_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey)); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -590,7 +590,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRMissingArray_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey)); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -611,7 +611,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_VRWrongOrder_Canceled) { EXPECT_CALL(app_mngr_, RemoveAppFromTTSGlobalPropertiesList(kConnectionKey)); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -741,7 +741,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSHelpAndTimeout_SUCCESS) { EXPECT_CALL(*mock_help_prompt_manager_, OnSetGlobalPropertiesReceived(_, false)); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -826,7 +826,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_TTSIncorrectSyntax_Canceled) { EXPECT_CALL(mock_message_helper_, VerifyImageVrHelpItems(_, _, _)).Times(0); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -842,7 +842,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidHelpPromptText_INVALID_DATA) { ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); ExpectInvalidData(); @@ -860,7 +860,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidVrHelpText_INVALID_DATA) { ExpectVerifyImageVrHelpSuccess(vr_help); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); ExpectInvalidData(); @@ -879,7 +879,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidImageValue_INVALID_DATA) { ExpectVerifyImageVrHelpSuccess(vr_help); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); ExpectInvalidData(); @@ -897,7 +897,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuIcon_INVALID_DATA) { ExpectVerifyImageSuccess(menu_icon); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); ExpectInvalidData(); @@ -914,7 +914,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidMenuTitle_INVALID_DATA) { ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); ExpectInvalidData(); @@ -934,7 +934,7 @@ TEST_F(SetGlobalPropertiesRequestTest, ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); ExpectInvalidData(); @@ -954,7 +954,7 @@ TEST_F(SetGlobalPropertiesRequestTest, ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); ExpectInvalidData(); @@ -968,7 +968,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_NoData_Canceled) { ExpectVerifyImageVrHelpUnsuccess(); EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -982,7 +982,7 @@ TEST_F(SetGlobalPropertiesRequestTest, Run_InvalidApp_Canceled) { EmptyExpectationsSetupHelper(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); OnEventUISetupHelper(msg, command); @@ -1111,7 +1111,7 @@ TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidApp_Canceled) { TEST_F(SetGlobalPropertiesRequestTest, OnEvent_InvalidEventID_Canceled) { MessageSharedPtr msg = CreateMessage(); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<SetMediaClockRequest> SetMediaClockRequestPtr; +typedef std::shared_ptr<SetMediaClockRequest> 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<SetMediaClockRequest> command = + std::shared_ptr<SetMediaClockRequest> command = CreateCommand<SetMediaClockRequest>(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<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(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<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(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<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(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<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(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<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(msg)); ExpectationsSetupHelper(true); @@ -284,7 +284,7 @@ TEST_F(SetMediaClockRequestTest, Run_NoStartTime_Canceled) { TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(msg)); ExpectationsSetupHelper(true); @@ -295,7 +295,7 @@ TEST_F(SetMediaClockRequestTest, Run_NoUpdateMode_Canceled) { TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(msg)); ExpectationsSetupHelper(false); @@ -306,7 +306,7 @@ TEST_F(SetMediaClockRequestTest, Run_NotMediaApp_Canceled) { TEST_F(SetMediaClockRequestTest, Run_InvalidApp_Canceled) { MessageSharedPtr msg = CreateMsgParams(); - SharedPtr<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(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<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(msg)); command->on_event(event); } @@ -340,7 +340,7 @@ TEST_F(SetMediaClockRequestTest, OnEvent_Success) { TEST_F(SetMediaClockRequestTest, OnEvent_Canceled) { MessageSharedPtr msg = CreateMessage(); - SharedPtr<SetMediaClockRequest> command( + std::shared_ptr<SetMediaClockRequest> command( CreateCommand<SetMediaClockRequest>(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<ShowRequest> command = CreateCommand<ShowRequest>(msg_vr); + std::shared_ptr<ShowRequest> command = CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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<ShowRequest> command(CreateCommand<ShowRequest>(msg)); + std::shared_ptr<ShowRequest> command(CreateCommand<ShowRequest>(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 <string> #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<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); 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<commands::ListFilesResponse, TYPED_TEST_CASE(MobileResponseCommandsTest, ResponseCommandsList); TYPED_TEST(MobileResponseCommandsTest, Run_SendResponseToMobile_SUCCESS) { - ::utils::SharedPtr<typename TestFixture::CommandType> command = + std::shared_ptr<typename TestFixture::CommandType> command = this->template CreateCommand<typename TestFixture::CommandType>(); 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<commands::GenericResponse> command( + std::shared_ptr<commands::GenericResponse> command( CreateCommand<commands::GenericResponse>(command_msg)); EXPECT_CALL( @@ -175,7 +175,7 @@ TEST_F(ScrollableMessageResponseTest, Run_SUCCESS) { MockAppPtr app(CreateMockApp()); - SharedPtr<commands::ScrollableMessageResponse> command( + std::shared_ptr<commands::ScrollableMessageResponse> command( CreateCommand<commands::ScrollableMessageResponse>(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<SliderRequest> CommandPtr; +typedef std::shared_ptr<SliderRequest> 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<SliderRequest> command = + std::shared_ptr<SliderRequest> command = CreateCommand<SliderRequest>(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 <string> #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<SpeakRequest> CommandPtr; +typedef std::shared_ptr<SpeakRequest> CommandPtr; namespace { const uint32_t kAppId = 10u; @@ -92,7 +92,7 @@ class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { const mobile_apis::Result::eType mobile_response, const am::HmiInterfaces::InterfaceState state, const bool success) { - utils::SharedPtr<SpeakRequest> command = + std::shared_ptr<SpeakRequest> command = CreateCommand<SpeakRequest>(request_); (*response_)[strings::params][hmi_response::code] = hmi_response; @@ -129,7 +129,7 @@ class SpeakRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { }; TEST_F(SpeakRequestTest, OnEvent_SUCCESS_Expect_true) { - utils::SharedPtr<SpeakRequest> command = + std::shared_ptr<SpeakRequest> command = CreateCommand<SpeakRequest>(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 <string> #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<SubscribeButtonRequest> CommandPtr; +typedef std::shared_ptr<SubscribeButtonRequest> CommandPtr; class SubscribeButtonRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { @@ -78,7 +78,7 @@ TEST_F(SubscribeButtonRequestTest, Run_AppNotRegistered_UNSUCCESS) { CommandPtr command(CreateCommand<SubscribeButtonRequest>()); ON_CALL(app_mngr_, application(_)) - .WillByDefault(Return(SharedPtr<am::Application>())); + .WillByDefault(Return(std::shared_ptr<am::Application>())); 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<SubscribeWayPointsRequest> CommandPtr; +typedef std::shared_ptr<SubscribeWayPointsRequest> CommandPtr; class SubscribeWayPointsRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; 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<SystemRequest> command(CreateCommand<SystemRequest>(msg)); + std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(msg)); command->Run(); } @@ -163,7 +163,7 @@ TEST_F(SystemRequestTest, EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_)) .WillOnce(DoAll(SaveArg<0>(&result), Return(true))); - SharedPtr<SystemRequest> command(CreateCommand<SystemRequest>(msg)); + std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(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<SystemRequest> command(CreateCommand<SystemRequest>(msg)); + std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(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<SystemRequest> command(CreateCommand<SystemRequest>(msg)); + std::shared_ptr<SystemRequest> command(CreateCommand<SystemRequest>(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 <string> #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<UnregisterAppInterfaceRequest> CommandPtr; +typedef std::shared_ptr<UnregisterAppInterfaceRequest> CommandPtr; class UnregisterAppInterfaceRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> {}; 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 <string> #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<UnsubscribeButtonRequest> CommandPtr; +typedef std::shared_ptr<UnsubscribeButtonRequest> 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<UnSubscribeWayPointsRequest> command_; + std::shared_ptr<UnSubscribeWayPointsRequest> 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<UpdateTurnListRequest> command_; + std::shared_ptr<UpdateTurnListRequest> 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<smart_objects::SmartObject> get_type( + std::shared_ptr<smart_objects::SmartObject> 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<VehicleInfoAppExtension*>(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<VehicleInfoAppExtension>(*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 <vector> #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<VIGetVehicleDataResponse> VIGetVehicleDataResponsePtr; +typedef std::shared_ptr<VIGetVehicleDataResponse> 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<VIIsReadyRequest> VIIsReadyRequestPtr; +typedef std::shared_ptr<VIIsReadyRequest> VIIsReadyRequestPtr; class VIIsReadyRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { 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 <vector> #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<DiagnosticMessageRequest> DiagnosticMessageRequestPtr; +typedef std::shared_ptr<DiagnosticMessageRequest> 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 <vector> #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<GetDTCsRequest> GetDTCsRequestPtr; +typedef std::shared_ptr<GetDTCsRequest> GetDTCsRequestPtr; class GetDTCsRequestTest : public CommandRequestTest<CommandsTestMocks::kIsNice> { 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 <vector> #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<GetVehicleDataRequest> GetVehicleDataRequestPtr; +typedef std::shared_ptr<GetVehicleDataRequest> 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<UnwrappedGetVehicleDataRequest> command( + std::shared_ptr<UnwrappedGetVehicleDataRequest> command( CreateCommand<UnwrappedGetVehicleDataRequest>(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<UnwrappedGetVehicleDataRequest> command( + std::shared_ptr<UnwrappedGetVehicleDataRequest> command( CreateCommand<UnwrappedGetVehicleDataRequest>(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<UnwrappedGetVehicleDataRequest> command( + std::shared_ptr<UnwrappedGetVehicleDataRequest> command( CreateCommand<UnwrappedGetVehicleDataRequest>(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<OnVehicleDataNotification> NotificationPtr; +typedef std::shared_ptr<OnVehicleDataNotification> 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 <string> #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<CommandsTestMocks::kIsNice> {}; TEST_F(ReadDIDRequestTest, OnEvent_WrongEventId_UNSUCCESS) { Event event(Event::EventID::INVALID_ENUM); - SharedPtr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); + std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); 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<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); + std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); 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<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); + std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); ON_CALL(app_mngr_, application(_)) - .WillByDefault(Return(SharedPtr<am::Application>())); + .WillByDefault(Return(std::shared_ptr<am::Application>())); 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<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); + std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); 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<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); + std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>()); 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<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>(msg)); + std::shared_ptr<ReadDIDRequest> command(CreateCommand<ReadDIDRequest>(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 <string> #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<UnsubscribeVehicleDataRequest> CommandPtr; +typedef std::shared_ptr<UnsubscribeVehicleDataRequest> CommandPtr; namespace { const uint32_t kConnectionKey = 1u; @@ -71,7 +71,7 @@ class UnsubscribeVehicleRequestTest UnsubscribeVehicleRequestTest() : mock_app_(CreateMockApp()) , vi_app_extension_ptr_( - utils::MakeShared<vehicle_info_plugin::VehicleInfoAppExtension>( + std::make_shared<vehicle_info_plugin::VehicleInfoAppExtension>( vi_plugin_, *mock_app_)) , app_set_lock_ptr_(std::make_shared<sync_primitives::Lock>()) {} 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 <stdint.h> #include <string> #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<SmartObject>(smart_objects::SmartType_Map); + std::make_shared<SmartObject>(smart_objects::SmartType_Map); (*command_msg)[am::strings::msg_params][am::strings::success] = false; - ::utils::SharedPtr<UnsubscribeVehicleDataResponse> command = + std::shared_ptr<UnsubscribeVehicleDataResponse> command = CreateCommand<UnsubscribeVehicleDataResponse>(command_msg); EXPECT_CALL( @@ -81,9 +81,9 @@ TEST_F(UnsubscribeVehicleResponseTest, TEST_F(UnsubscribeVehicleResponseTest, Run_SendSuccessfulResponseToMobile_SUCCESS) { MessageSharedPtr command_msg = - ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map); + std::make_shared<SmartObject>(smart_objects::SmartType_Map); (*command_msg)[am::strings::msg_params][am::strings::success] = true; - ::utils::SharedPtr<UnsubscribeVehicleDataResponse> command = + std::shared_ptr<UnsubscribeVehicleDataResponse> command = CreateCommand<UnsubscribeVehicleDataResponse>(command_msg); EXPECT_CALL( @@ -95,13 +95,13 @@ TEST_F(UnsubscribeVehicleResponseTest, TEST_F(UnsubscribeVehicleResponseTest, Run_SendResponseToMobile_SendCodeToMobile) { MessageSharedPtr command_msg = - ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map); + std::make_shared<SmartObject>(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<UnsubscribeVehicleDataResponse> command = + std::shared_ptr<UnsubscribeVehicleDataResponse> command = CreateCommand<UnsubscribeVehicleDataResponse>(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<ApplicationData>( + ApplicationDataPtr app_data = std::make_shared<ApplicationData>( 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<ApplicationDataPtr> 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<ApplicationData>( + dev_apps.push_back(std::make_shared<ApplicationData>( 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<ApplicationDataPtr> AppLaunchDataJson::GetAppDataByDevMac( if (deviceMac == dev_mac) { dev_apps.push_back( - utils::MakeShared<ApplicationData>(appID, bundleID, deviceMac)); + std::make_shared<ApplicationData>(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 <algorithm> #include "application_manager/app_launch/apps_launcher.h" -#include "utils/make_shared.h" + #include "utils/timer_task_impl.h" #include <iostream> @@ -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<AppsLauncher::Launcher>( + return std::make_shared<AppsLauncher::Launcher>( 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 <iostream> @@ -16,7 +16,7 @@ namespace app_launch { CREATE_LOGGERPTR_GLOBAL(logger_, "AppLaunch") typedef std::pair<std::string, std::vector<ApplicationDataPtr> > AppsOnDevice; -typedef utils::SharedPtr<AppsOnDevice> AppsOnDevicePtr; +typedef std::shared_ptr<AppsOnDevice> AppsOnDevicePtr; class Launcher { public: @@ -95,7 +95,7 @@ class Launcher { AppsOnDevicePtr apps_on_device_; }; -typedef utils::SharedPtr<Launcher> LauncherPtr; +typedef std::shared_ptr<Launcher> LauncherPtr; typedef std::vector<LauncherPtr> Launchers; struct LauncherGenerator { @@ -107,7 +107,7 @@ struct LauncherGenerator { , apps_launcher_(apps_launcher) {} LauncherPtr operator()() const { - return utils::MakeShared<Launcher>( + return std::make_shared<Launcher>( resume_ctrl_, interface_, apps_launcher_); } @@ -130,7 +130,7 @@ DeviceAppsLauncherImpl::DeviceAppsLauncherImpl(DeviceAppsLauncher& interface, } bool DeviceAppsLauncherImpl::LauncherFinder::operator()( - const utils::SharedPtr<Launcher>& launcher) const { + const std::shared_ptr<Launcher>& 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<AppsOnDevice>(device_mac, applications_to_launch); + std::make_shared<AppsOnDevice>(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<ApplicationImpl> application = - ApplicationSharedPtr::dynamic_pointer_cast<ApplicationImpl>(app); + std::shared_ptr<ApplicationImpl> application = + std::dynamic_pointer_cast<ApplicationImpl>(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<usage_statistics::StatisticsManager> statistics_manager, + std::shared_ptr<usage_statistics::StatisticsManager> 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<timer::Timer>( + TimerSPtr clearing_timer(std::make_shared<timer::Timer>( "ClearTimerPoolTimer", new TimerTaskImpl<ApplicationManagerImpl>( 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<smart_objects::SmartObject>& + const std::shared_ptr<smart_objects::SmartObject>& 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<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> response( MessageHelper::CreateNegativeResponse( connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID, @@ -539,7 +539,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( GetPolicyHandler().GetStatisticManager(), *this)); if (!application) { - utils::SharedPtr<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> response( MessageHelper::CreateNegativeResponse( connection_key, mobile_apis::FunctionID::RegisterAppInterfaceID, @@ -550,7 +550,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( } HmiStatePtr initial_state = - CreateRegularState(utils::SharedPtr<Application>(application), + CreateRegularState(std::shared_ptr<Application>(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<smart_objects::SmartObject> is_vr_ready( + std::shared_ptr<smart_objects::SmartObject> is_vr_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_IsReady, *this)); rpc_service_->ManageHMICommand(is_vr_ready); - utils::SharedPtr<smart_objects::SmartObject> is_tts_ready( + std::shared_ptr<smart_objects::SmartObject> is_tts_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_IsReady, *this)); rpc_service_->ManageHMICommand(is_tts_ready); - utils::SharedPtr<smart_objects::SmartObject> is_ui_ready( + std::shared_ptr<smart_objects::SmartObject> is_ui_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_IsReady, *this)); rpc_service_->ManageHMICommand(is_ui_ready); - utils::SharedPtr<smart_objects::SmartObject> is_navi_ready( + std::shared_ptr<smart_objects::SmartObject> is_navi_ready( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::Navigation_IsReady, *this)); rpc_service_->ManageHMICommand(is_navi_ready); - utils::SharedPtr<smart_objects::SmartObject> is_ivi_ready( + std::shared_ptr<smart_objects::SmartObject> is_ivi_ready( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::VehicleInfo_IsReady, *this)); rpc_service_->ManageHMICommand(is_ivi_ready); - utils::SharedPtr<smart_objects::SmartObject> is_rc_ready( + std::shared_ptr<smart_objects::SmartObject> is_rc_ready( MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::RC_IsReady, *this)); rpc_service_->ManageHMICommand(is_rc_ready); - utils::SharedPtr<smart_objects::SmartObject> button_capabilities( + std::shared_ptr<smart_objects::SmartObject> button_capabilities( MessageHelper::CreateModuleInfoSO( hmi_apis::FunctionID::Buttons_GetCapabilities, *this)); rpc_service_->ManageHMICommand(button_capabilities); - utils::SharedPtr<smart_objects::SmartObject> mixing_audio_supported_request( + std::shared_ptr<smart_objects::SmartObject> 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<Application> app, + std::shared_ptr<Application> 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>(); 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<smart_objects::SmartObject>(); + auto update_list = std::make_shared<smart_objects::SmartObject>(); 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::SmartObject>(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> message_to_send( + std::shared_ptr<Message> 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<timer::Timer>( + TimerSPtr close_timer(std::make_shared<timer::Timer>( "CloseNaviAppTimer", new TimerTaskImpl<ApplicationManagerImpl>( 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<timer::Timer>( + TimerSPtr end_stream_timer(std::make_shared<timer::Timer>( "AppShouldFinishStreaming", new TimerTaskImpl<ApplicationManagerImpl>( this, &ApplicationManagerImpl::EndNaviStreaming))); @@ -2973,11 +2973,11 @@ void ApplicationManagerImpl::ProcessApp(const uint32_t app_id, } void ApplicationManagerImpl::SendHMIStatusNotification( - const utils::SharedPtr<Application> app) { + const std::shared_ptr<Application> app) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); smart_objects::SmartObjectSPtr notification = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); 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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*on_driver_distraction)[strings::params][strings::message_type] = static_cast<int32_t>(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<smart_objects::SmartObject> command) { + std::shared_ptr<smart_objects::SmartObject> 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 <numeric> #include <string> #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::SmartObject>(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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); 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<smart_objects::SmartObject>(); 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<smart_objects::SmartObject>(); 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<smart_objects::SmartObject>(); 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>(); 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>(); 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<Application> app, +HmiState::HmiState(std::shared_ptr<Application> app, const ApplicationManager& app_mngr, StateID state_id) : app_(app) @@ -55,7 +55,7 @@ HmiState::HmiState(utils::SharedPtr<Application> app, LOG4CXX_DEBUG(logger_, *this); } -HmiState::HmiState(utils::SharedPtr<Application> app, +HmiState::HmiState(std::shared_ptr<Application> 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<Application> app, +VRHmiState::VRHmiState(std::shared_ptr<Application> 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<Application> app, +TTSHmiState::TTSHmiState(std::shared_ptr<Application> 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<Application> app, const ApplicationManager& app_mngr) + std::shared_ptr<Application> 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<Application> app, +NaviStreamingHmiState::NaviStreamingHmiState(std::shared_ptr<Application> 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<Application> app, +PhoneCallHmiState::PhoneCallHmiState(std::shared_ptr<Application> 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<Application> app, +SafetyModeHmiState::SafetyModeHmiState(std::shared_ptr<Application> 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<Application> app, +DeactivateHMI::DeactivateHMI(std::shared_ptr<Application> 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<Application> app, +AudioSource::AudioSource(std::shared_ptr<Application> 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<Application> app, +EmbeddedNavi::EmbeddedNavi(std::shared_ptr<Application> 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<SmartObject>(SmartType_Map); + std::make_shared<SmartObject>(SmartType_Map); SmartObject& notification = *notification_ptr; notification[strings::params][strings::message_type] = static_cast<int32_t>(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<SmartObject>(SmartType_Map); + SmartObjectSPtr message = std::make_shared<SmartObject>(SmartType_Map); SmartObject& ref = *message; ref[strings::params][strings::message_type] = static_cast<int>(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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = static_cast<int32_t>( @@ -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<smart_objects::SmartObject>(); if (!notification) { LOG4CXX_ERROR(logger_, "Failed to create smart object"); return; @@ -739,8 +739,8 @@ void MessageHelper::SendActivateAppToHMI( return; } - utils::SharedPtr<smart_objects::SmartObject> message = - new smart_objects::SmartObject(smart_objects::SmartType_Map); + std::shared_ptr<smart_objects::SmartObject> message = + std::make_shared<smart_objects::SmartObject>(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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*request)[strings::params][strings::message_type] = static_cast<int>(kRequest); @@ -853,7 +853,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse( uint32_t connection_key) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr response = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*response)[strings::params][strings::function_id] = static_cast<int>(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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); smart_objects::SmartObject& object = *module_info; object[strings::params][strings::message_type] = static_cast<int>(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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( smart_objects::SmartType_Map); if (!set_icon) { @@ -954,7 +954,7 @@ void MessageHelper::SendOnButtonSubscriptionNotification( LOG4CXX_AUTO_TRACE(logger_); SmartObjectSPtr notification_ptr = - utils::MakeShared<SmartObject>(SmartType_Map); + std::make_shared<SmartObject>(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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject> message = - utils::MakeShared<smart_objects::SmartObject>( + std::shared_ptr<smart_objects::SmartObject> message = + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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::SmartObject>(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<SmartObject>(SmartType_Map); + SmartObjectSPtr message = std::make_shared<SmartObject>(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<SmartObject>(SmartType_Map); + SmartObjectSPtr message = std::make_shared<SmartObject>(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<smart_objects::SmartObject>(response_data); + return std::make_shared<smart_objects::SmartObject>(response_data); } void MessageHelper::SendNaviSetVideoConfig( @@ -2136,7 +2136,7 @@ void MessageHelper::SendOnDataStreaming( } smart_objects::SmartObjectSPtr notification = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>(content), + std::make_shared<smart_objects::SmartObject>(content), commands::Command::SOURCE_SDL)); } @@ -2394,7 +2394,7 @@ void MessageHelper::SendOnPermissionsChangeNotification( } app_mngr.GetRPCService().ManageMobileCommand( - utils::MakeShared<smart_objects::SmartObject>(content), + std::make_shared<smart_objects::SmartObject>(content), commands::Command::SOURCE_SDL); } @@ -2479,14 +2479,14 @@ void MessageHelper::SendOnAppPermissionsChangedNotification( } app_mngr.GetRPCService().ManageHMICommand( - utils::MakeShared<smart_objects::SmartObject>(message)); + std::make_shared<smart_objects::SmartObject>(message)); } void MessageHelper::SendGetStatusUpdateResponse(const std::string& status, const uint32_t correlation_id, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr message = - utils::MakeShared<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<StatisticManagerImpl>(this)) + , statistic_manager_impl_(std::make_shared<StatisticManagerImpl>(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<PolicyEventObserver>(new PolicyEventObserver( + std::shared_ptr<PolicyEventObserver>(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<PolicyManager>(create_manager(), delete_manager); + std::shared_ptr<PolicyManager>(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<utils::CallNothing>()); + POLICY_LIB_CHECK(std::make_shared<utils::CallNothing>()); 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<FunctionalGroupPermission> PolicyHandler::CollectAppPermissions( ApplicationSharedPtr app = application_manager_.application(connection_key); std::vector<FunctionalGroupPermission> 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<usage_statistics::StatisticsManager> +std::shared_ptr<usage_statistics::StatisticsManager> 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<uint64_t>(request->default_timeout()); RequestInfoPtr request_info_ptr = - utils::MakeShared<HMIRequestInfo>(request, timeout_in_mseconds); + std::make_shared<HMIRequestInfo>(request, timeout_in_mseconds); if (0 == timeout_in_mseconds) { LOG4CXX_DEBUG(logger_, @@ -287,7 +287,7 @@ void RequestController::terminateWaitingForExecutionAppRequests( std::list<RequestPtr>::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<MobileRequestInfo>(request_ptr, timeout_in_mseconds); + std::make_shared<MobileRequestInfo>(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<FakeRequestInfo> request_info_for_search( + std::shared_ptr<FakeRequestInfo> 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<ResumptionData> mock_storage) { + std::shared_ptr<ResumptionData> 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> message) { + const std::shared_ptr<Message> 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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); 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> message) { + const std::shared_ptr<Message> message) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr smart_object(new smart_objects::SmartObject); + smart_objects::SmartObjectSPtr smart_object = std::make_shared<smart_objects::SmartObject>(); if (!smart_object) { LOG4CXX_ERROR(logger_, "Null pointer"); @@ -154,7 +154,7 @@ void RPCHandlerImpl::OnMessageReceived( return; } - utils::SharedPtr<Message> outgoing_message = ConvertRawMsgToMessage(message); + std::shared_ptr<Message> 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<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject> response( + std::shared_ptr<smart_objects::SmartObject> 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<smart_objects::SmartObject>(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<Message> RPCHandlerImpl::ConvertRawMsgToMessage( +std::shared_ptr<Message> RPCHandlerImpl::ConvertRawMsgToMessage( const protocol_handler::RawMessagePtr message) { LOG4CXX_AUTO_TRACE(logger_); DCHECK(message); - utils::SharedPtr<Message> outgoing_message; + std::shared_ptr<Message> outgoing_message; LOG4CXX_DEBUG(logger_, "Service type." << message->service_type()); if (message->service_type() != protocol_handler::kRpc && @@ -347,7 +347,7 @@ utils::SharedPtr<Message> RPCHandlerImpl::ConvertRawMsgToMessage( MobileMessageHandler::HandleIncomingMessageProtocol(message); if (convertion_result) { - outgoing_message = convertion_result; + outgoing_message = std::shared_ptr<Message>(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<protocol_handler::RawMessage> rawMessage = - MobileMessageHandler::HandleOutgoingMessageProtocol(message); + std::shared_ptr<protocol_handler::RawMessage> 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> message_to_send( + std::shared_ptr<Message> 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> message_to_send( + std::shared_ptr<Message> 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<HmiState>(*regular); + HmiStatePtr new_regular = std::make_shared<HmiState>(*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<Application> app, HmiState::StateID state_id) const { + std::shared_ptr<Application> 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<PhoneCallHmiState>(app, app_mngr_); + new_state = std::make_shared<PhoneCallHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_SAFETY_MODE: { - new_state = MakeShared<SafetyModeHmiState>(app, app_mngr_); + new_state = std::make_shared<SafetyModeHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_VR_SESSION: { - new_state = MakeShared<VRHmiState>(app, app_mngr_); + new_state = std::make_shared<VRHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_TTS_SESSION: { - new_state = MakeShared<TTSHmiState>(app, app_mngr_); + new_state = std::make_shared<TTSHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_VIDEO_STREAMING: { - new_state = MakeShared<VideoStreamingHmiState>(app, app_mngr_); + new_state = std::make_shared<VideoStreamingHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_NAVI_STREAMING: { - new_state = MakeShared<NaviStreamingHmiState>(app, app_mngr_); + new_state = std::make_shared<NaviStreamingHmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_REGULAR: { - new_state = MakeShared<HmiState>(app, app_mngr_); + new_state = std::make_shared<HmiState>(app, app_mngr_); break; } case HmiState::STATE_ID_POSTPONED: { - new_state = MakeShared<HmiState>(app, app_mngr_, state_id); + new_state = std::make_shared<HmiState>(app, app_mngr_, state_id); break; } case HmiState::STATE_ID_DEACTIVATE_HMI: { - new_state = MakeShared<DeactivateHMI>(app, app_mngr_); + new_state = std::make_shared<DeactivateHMI>(app, app_mngr_); break; } case HmiState::STATE_ID_AUDIO_SOURCE: { - new_state = MakeShared<AudioSource>(app, app_mngr_); + new_state = std::make_shared<AudioSource>(app, app_mngr_); break; } case HmiState::STATE_ID_EMBEDDED_NAVI: { - new_state = MakeShared<EmbeddedNavi>(app, app_mngr_); + new_state = std::make_shared<EmbeddedNavi>(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<StatisticsManager> statistics_manager) + std::shared_ptr<StatisticsManager> 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<StatisticsManager> statistics_manager, + std::shared_ptr<StatisticsManager> 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<am_test::MockApplication> MockAppPtr; +typedef std::shared_ptr<am_test::MockApplication> MockAppPtr; class AppLaunchCtrlTest : public ::testing::Test { public: MockAppPtr AppFromAppData(const app_launch::ApplicationData& app_data) { - utils::SharedPtr<NiceMock<am_test::MockApplication> > app = - utils::MakeShared<NiceMock<am_test::MockApplication> >(); + std::shared_ptr<NiceMock<am_test::MockApplication> > app = + std::make_shared<NiceMock<am_test::MockApplication> >(); 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<NiceMock<app_launch::ApplicationData> >( + std::make_shared<NiceMock<app_launch::ApplicationData> >( 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<ApplicationData>(app_id, bundle_id, device_mac); + std::make_shared<ApplicationData>(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<ApplicationData>( + ApplicationDataPtr app_data = std::make_shared<ApplicationData>( 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<ApplicationData>( + ApplicationDataPtr app_data = std::make_shared<ApplicationData>( 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<ApplicationData>( + ApplicationDataPtr app_data = std::make_shared<ApplicationData>( 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<ApplicationData>( + ApplicationDataPtr app_data = std::make_shared<ApplicationData>( 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<ApplicationImpl>( application_id, policy_app_id, mac_address, device_id, app_name, - utils::MakeShared<usage_statistics_test::MockStatisticsManager>(), + std::make_shared<usage_statistics_test::MockStatisticsManager>(), 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<MockStatisticsManager>(), + std::make_shared<MockStatisticsManager>(), 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<ApplicationImpl> app_impl; + std::shared_ptr<ApplicationImpl> 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<HmiState>( - static_cast<utils::SharedPtr<Application> >(app_impl), + HmiStatePtr testState = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); 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<NiceMock<resumption_test::MockResumptionData> >( + std::make_shared<NiceMock<resumption_test::MockResumptionData> >( mock_app_mngr_)) {} protected: @@ -146,7 +146,7 @@ class ApplicationManagerImplMockHmiTest : public ::testing::Test { Return(0))); } - utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> > + std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_; application_manager_test::MockApplicationManager mock_app_mngr_; NiceMock<policy_handler_test::MockPolicySettings> mock_policy_settings_; @@ -168,13 +168,13 @@ TEST_F(ApplicationManagerImplMockHmiTest, plugin_manager::MockRPCPluginManager* mock_rpc_plugin_manager = new plugin_manager::MockRPCPluginManager; - utils::SharedPtr<ApplicationImpl> app_impl = new ApplicationImpl( + std::shared_ptr<ApplicationImpl> app_impl = std::make_shared<ApplicationImpl>( application_id, policy_app_id, encryption::MakeHash(mac_address), device_id, app_name, - utils::SharedPtr<usage_statistics::StatisticsManager>( + std::shared_ptr<usage_statistics::StatisticsManager>( new usage_statistics_test::MockStatisticsManager()), *app_manager_impl_); std::unique_ptr<plugin_manager::RPCPluginManager> 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<commands::Command>())); + .WillOnce(Return(std::shared_ptr<commands::Command>())); plugin_manager::MockRPCPlugin mock_rpc_plugin; utils::Optional<plugin_manager::RPCPlugin> 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<NiceMock<MockRequest> > cmd_1 = - utils::MakeShared<NiceMock<MockRequest> >(connection_key, + std::shared_ptr<NiceMock<MockRequest> > cmd_1 = + std::make_shared<NiceMock<MockRequest> >(connection_key, correlation_id_1); - utils::SharedPtr<NiceMock<MockRequest> > cmd_2 = - utils::MakeShared<NiceMock<MockRequest> >(connection_key, + std::shared_ptr<NiceMock<MockRequest> > cmd_2 = + std::make_shared<NiceMock<MockRequest> >(connection_key, correlation_id_2); - utils::SharedPtr<NiceMock<MockRequest> > cmd_3 = - utils::MakeShared<NiceMock<MockRequest> >(connection_key, + std::shared_ptr<NiceMock<MockRequest> > cmd_3 = + std::make_shared<NiceMock<MockRequest> >(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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); commands::MessageSharedPtr hmi_msg_2 = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); commands::MessageSharedPtr hmi_msg_3 = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*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<NiceMock<resumption_test::MockResumptionData> >( + std::make_shared<NiceMock<resumption_test::MockResumptionData> >( 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<MockApplication>(new MockApplication()); + mock_app_ptr_ = std::shared_ptr<MockApplication>(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<policy_test::MockPolicySettings> mock_policy_settings_; - utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> > + std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_; std::unique_ptr<rpc_service::RPCService> mock_rpc_service_; @@ -207,7 +207,7 @@ class ApplicationManagerImplTest : public ::testing::Test { std::unique_ptr<am::ApplicationManagerImpl> app_manager_impl_; application_manager::MockMessageHelper* mock_message_helper_; - utils::SharedPtr<MockApplication> mock_app_ptr_; + std::shared_ptr<MockApplication> mock_app_ptr_; NiceMock<protocol_handler_test::MockProtocolHandler> 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<SmartObject>(sm_object); + SmartObjectSPtr sptr = std::make_shared<SmartObject>(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<am::Application>(mock_app_ptr_); + std::static_pointer_cast<am::Application>(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<am::Application>(mock_app_ptr_); + std::static_pointer_cast<am::Application>(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<am::Application>(mock_app_ptr_); + std::static_pointer_cast<am::Application>(mock_app_ptr_); app_manager_impl_->SubscribeAppForWayPoints(app_ptr); std::set<int32_t> 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<SmartObject>(dummy_object); + SmartObjectSPtr sptr = std::make_shared<SmartObject>(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<SmartObject>(dummy_object); + SmartObjectSPtr sptr = std::make_shared<SmartObject>(dummy_object); EXPECT_CALL(*mock_message_helper_, CreateModuleInfoSO( @@ -778,8 +778,8 @@ TEST_F(ApplicationManagerImplTest, TEST_F(ApplicationManagerImplTest, OnDeviceSwitchingStart_ExpectPutAppsInWaitList) { - utils::SharedPtr<MockApplication> switching_app_ptr = - utils::MakeShared<MockApplication>(); + std::shared_ptr<MockApplication> switching_app_ptr = + std::make_shared<MockApplication>(); 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<MockApplication> nonswitching_app_ptr = - utils::MakeShared<MockApplication>(); + std::shared_ptr<MockApplication> nonswitching_app_ptr = + std::make_shared<MockApplication>(); 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<MockApplication> switching_app_ptr = - utils::MakeShared<MockApplication>(); + std::shared_ptr<MockApplication> switching_app_ptr = + std::make_shared<MockApplication>(); 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<MockApplication> nonswitching_app_ptr = - utils::MakeShared<MockApplication>(); + std::shared_ptr<MockApplication> nonswitching_app_ptr = + std::make_shared<MockApplication>(); 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<ApplicationImpl> app_impl = new ApplicationImpl( + std::shared_ptr<ApplicationImpl> app_impl = std::make_shared<ApplicationImpl>( application_id, policy_app_id, mac_address, device_id, app_name, - utils::SharedPtr<usage_statistics::StatisticsManager>( + std::shared_ptr<usage_statistics::StatisticsManager>( 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<MockApplication> mock_app_1 = - utils::SharedPtr<MockApplication>(new MockApplication()); + std::shared_ptr<MockApplication> mock_app_1 = + std::shared_ptr<MockApplication>(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<MockApplication> mock_app_2 = - utils::SharedPtr<MockApplication>(new MockApplication()); + std::shared_ptr<MockApplication> mock_app_2 = + std::shared_ptr<MockApplication>(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<smart_objects::SmartObject>(request_for_registration); + std::make_shared<smart_objects::SmartObject>(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<MockApplication> mock_app_; + std::shared_ptr<MockApplication> mock_app_; MockApplicationManager app_mngr_; }; @@ -85,8 +85,8 @@ std::vector<StateID> ApplicationStateTest::added_states_ = TEST_F(ApplicationStateTest, AddStates_GetCurrentStates) { std::vector<StateID>::iterator new_state = added_states_.begin(); for (; new_state != added_states_.end(); ++new_state) { - HmiStatePtr state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<StateID>::iterator new_state = added_states_.begin(); for (; new_state != added_states_.end(); ++new_state) { - HmiStatePtr state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(mock_app_), app_mngr_, *new_state); app_state.AddState(state); @@ -120,18 +120,18 @@ TEST_F(ApplicationStateTest, AddStatesAddPostponedState_GetPostponedState) { // Added some states std::vector<StateID>::iterator new_state = added_states_.begin(); for (; new_state != added_states_.end(); ++new_state) { - HmiStatePtr state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<StateID>::iterator new_state = added_states_.begin(); - HmiStatePtr state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<StateID>::iterator new_state = added_states_.begin(); - HmiStatePtr state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(mock_app_), app_mngr_, *new_state); app_state.AddState(state); ++new_state; // Add postponed state - state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(mock_app_), app_mngr_, first_state); app_state.AddState(state); // Add postponed state - state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(mock_app_), app_mngr_, postponed_id); app_state.AddState(state); // Add new postponed state - utils::SharedPtr<MockApplication> mock_app_2(new MockApplication); - state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + std::shared_ptr<MockApplication> mock_app_2(new MockApplication); + state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(mock_app_), app_mngr_, postponed_id); app_state.AddState(state); // Add regular state - state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<smart_objects::SmartObject> cmd_ptr_; - utils::SharedPtr<MockApplication> mock_app_ptr_; + std::shared_ptr<smart_objects::SmartObject> cmd_ptr_; + std::shared_ptr<MockApplication> 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<MockApplication> another_app = - utils::MakeShared<MockApplication>(); + std::shared_ptr<MockApplication> another_app = + std::make_shared<MockApplication>(); 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<MockApplication> another_app = - utils::MakeShared<MockApplication>(); + std::shared_ptr<MockApplication> another_app = + std::make_shared<MockApplication>(); 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 <set> #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<MockApplication> MockAppPtr; +typedef std::shared_ptr<MockApplication> MockAppPtr; namespace { const uint32_t kDefaultMsgCount = 5u; @@ -125,11 +125,11 @@ class CommandImplTest : public CommandsTest<CommandsTestMocks::kIsNice> { }; typedef CommandImplTest::UnwrappedCommandImpl UCommandImpl; -typedef SharedPtr<UCommandImpl> UCommandImplPtr; +typedef std::shared_ptr<UCommandImpl> UCommandImplPtr; TEST_F(CommandImplTest, GetMethods_SUCCESS) { MessageSharedPtr msg; - SharedPtr<CommandImpl> command = + std::shared_ptr<CommandImpl> command = CreateCommand<CommandImpl>(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<ApplicationSet>& app_set) { - app_set = (!app_set ? ::utils::MakeShared<ApplicationSet>() : app_set); + MockAppPtr InitAppSetDataAccessor(std::shared_ptr<ApplicationSet>& app_set) { + app_set = (!app_set ? std::make_shared<ApplicationSet>() : 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<UCommandRequestImpl> CommandPtr; +typedef std::shared_ptr<UCommandRequestImpl> CommandPtr; TEST_F(CommandRequestImplTest, OnTimeOut_StateCompleted_UNSUCCESS) { CommandPtr command = CreateCommand<UCommandRequestImpl>(); 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 <string> #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<CommandsTestMocks::kIsNice> {}; TEST_F(CommandResponseImplTest, BasicMethodsOverloads_SUCCESS) { - SharedPtr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>(); + std::shared_ptr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>(); // 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<CommandResponseImpl> command = + std::shared_ptr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>(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<CommandResponseImpl> command = + std::shared_ptr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>(msg); const bool kSuccess = true; @@ -108,7 +108,7 @@ TEST_F(CommandResponseImplTest, TEST_F(CommandResponseImplTest, SendResponse_EmptyMessageInvalidResultCode_SUCCESS) { MessageSharedPtr msg; - SharedPtr<CommandResponseImpl> command = + std::shared_ptr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>(msg); const bool kSuccess = true; @@ -133,7 +133,7 @@ TEST_F(CommandResponseImplTest, TEST_F(CommandResponseImplTest, SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_SUCCESS) { MessageSharedPtr msg; - SharedPtr<CommandResponseImpl> command = + std::shared_ptr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>(msg); const mobile_apis::Result::eType kResultCode = @@ -158,7 +158,7 @@ TEST_F(CommandResponseImplTest, TEST_F(CommandResponseImplTest, SendResponse_EmptyMessageInvalidResultCodeNoHmiResponse_INVALID_ENUM) { MessageSharedPtr msg; - SharedPtr<CommandResponseImpl> command = + std::shared_ptr<CommandResponseImpl> command = CreateCommand<CommandResponseImpl>(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<usage_statistics::StatisticsManager> statistics_manager, + std::shared_ptr<usage_statistics::StatisticsManager> 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 <class Command> - SharedPtr<Command> CreateCommand(MessageSharedPtr& msg) { - return ::utils::MakeShared<Command>(msg, + std::shared_ptr<Command> CreateCommand(MessageSharedPtr& msg) { + return std::make_shared<Command>(msg, app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -136,17 +136,17 @@ class HelpPromptManagerTest : public ::testing::Test { typedef CommandsTest<CommandsTestMocks::kIsNice>::MockAppManager MockAppManager; MockAppManager app_mngr_; - utils::SharedPtr<ApplicationImplTest> app_impl_; + std::shared_ptr<ApplicationImplTest> app_impl_; MockHmiInterfaces mock_hmi_interfaces_; NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_; NiceMock<MockApplicationManagerSettings> app_mngr_settings_; - utils::SharedPtr<application_manager_test::MockApplication> mock_app_; + std::shared_ptr<application_manager_test::MockApplication> 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<MockHelpPromptManager> mock_help_prompt_manager_; + std::shared_ptr<MockHelpPromptManager> mock_help_prompt_manager_; }; void HelpPromptManagerTest::SetUp() { @@ -173,17 +173,17 @@ void HelpPromptManagerTest::SetUp() { .WillByDefault(Return(0)); mock_help_prompt_manager_ = - utils::SharedPtr<MockHelpPromptManager>(new MockHelpPromptManager()); + std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager()); - HmiStatePtr state = utils::MakeShared<HmiState>( - static_cast<utils::SharedPtr<Application> >(mock_app_), + HmiStatePtr state = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(mock_app_), app_mngr_, HmiState::STATE_ID_REGULAR); std::string path = file_system::CreateDirectory("storage"); file_system::CreateFile(path + "/" + "certificate"); - mock_app_ = utils::MakeShared<application_manager_test::MockApplication>(); + mock_app_ = std::make_shared<application_manager_test::MockApplication>(); } void HelpPromptManagerTest::TearDown() { @@ -192,7 +192,7 @@ void HelpPromptManagerTest::TearDown() { MessageSharedPtr HelpPromptManagerTest::CreateMsgParams() { MessageSharedPtr msg = - ::utils::MakeShared<SmartObject>(smart_objects::SmartType_Map); + std::make_shared<SmartObject>(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<HmiState>( - static_cast<utils::SharedPtr<Application> >(app_impl_), + HmiStatePtr testState = std::make_shared<HmiState>( + static_cast<std::shared_ptr<Application> >(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<MockStatisticsManager>(), + std::make_shared<MockStatisticsManager>(), 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<SmartObject>(smart_objects::SmartType_Map); + std::make_shared<SmartObject>(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<SmartObject>(smart_objects::SmartType_Map); + std::make_shared<SmartObject>(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<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(msg)); command->Run(); @@ -358,7 +358,7 @@ TEST_F(HelpPromptManagerTest, EXPECT_CALL(*mock_help_prompt_manager_, OnSetGlobalPropertiesReceived(_, false)); - SharedPtr<SetGlobalPropertiesRequest> command( + std::shared_ptr<SetGlobalPropertiesRequest> command( CreateCommand<SetGlobalPropertiesRequest>(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<HMICapabilitiesForTesting>(app_mngr_); + std::make_shared<HMICapabilitiesForTesting>(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<HMICapabilitiesForTesting> hmi_capabilities_test; + std::shared_ptr<HMICapabilitiesForTesting> 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<HMICapabilitiesForTesting> hmi_capabilities = - utils::MakeShared<HMICapabilitiesForTesting>(mock_app_mngr); + std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities = + std::make_shared<HMICapabilitiesForTesting>(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<HMICapabilitiesForTesting> hmi_capabilities = - utils::MakeShared<HMICapabilitiesForTesting>(mock_app_mngr); + std::shared_ptr<HMICapabilitiesForTesting> hmi_capabilities = + std::make_shared<HMICapabilitiesForTesting>(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<application_manager_test::MockApplication> MockApp; typedef NiceMock<application_manager_test::MockRPCService> MockRPCService; -typedef SharedPtr<MockApp> ApplicationSharedPtr; +typedef std::shared_ptr<MockApp> 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<am::HMILanguageHandler>(app_manager_); + std::make_shared<am::HMILanguageHandler>(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<MockApp>(); + ApplicationSharedPtr app = std::make_shared<MockApp>(); 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<am::HMILanguageHandler> hmi_language_handler_; + std::shared_ptr<am::HMILanguageHandler> hmi_language_handler_; std::shared_ptr<sync_primitives::Lock> 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<smart_objects::SmartObject>())); + .WillByDefault(Return(std::make_shared<smart_objects::SmartObject>())); // 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 <stdint.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/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 <stdint.h> #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<kIsNice, NiceMock<MockApplication>, MockApplication>::Result MockApp; - typedef SharedPtr<MockApp> MockAppPtr; + typedef std::shared_ptr<MockApp> 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<SmartObject>(type); + return std::make_shared<SmartObject>(type); } static MockAppPtr CreateMockApp() { - return ::utils::MakeShared<MockApp>(); + return std::make_shared<MockApp>(); } template <class Command> - SharedPtr<Command> CreateCommand(const uint32_t timeout, + std::shared_ptr<Command> CreateCommand(const uint32_t timeout, MessageSharedPtr& msg) { InitCommand(timeout); - return ::utils::MakeShared<Command>((msg ? msg : msg = CreateMessage()), + return std::make_shared<Command>((msg ? msg : msg = CreateMessage()), app_mngr_, mock_rpc_service_, mock_hmi_capabilities_, @@ -131,15 +131,15 @@ class CommandsTest : public ::testing::Test { } template <class Command> - SharedPtr<Command> CreateCommand(MessageSharedPtr& msg) { + std::shared_ptr<Command> CreateCommand(MessageSharedPtr& msg) { return CreateCommand<Command>(kDefaultTimeout_, msg); } template <class Command> - SharedPtr<Command> CreateCommand(const uint32_t timeout = kDefaultTimeout_) { + std::shared_ptr<Command> CreateCommand(const uint32_t timeout = kDefaultTimeout_) { InitCommand(timeout); MessageSharedPtr msg = CreateMessage(); - return ::utils::MakeShared<Command>(msg, + return std::make_shared<Command>(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<resumption::ResumptionData> mock_storage)); + void(std::shared_ptr<resumption::ResumptionData> 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<NiceMock<application_manager_test::MockApplication> > + std::shared_ptr<NiceMock<application_manager_test::MockApplication> > 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<NiceMock<application_manager_test::MockAppExtension> > + std::shared_ptr<NiceMock<application_manager_test::MockAppExtension> > mock_app_extension_; std::list<application_manager::AppExtensionPtr> 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<MockApplication> MockApplicationSharedPtr; +typedef std::shared_ptr<MockApplication> MockApplicationSharedPtr; typedef std::vector<std::string> StringArray; -typedef utils::SharedPtr<application_manager::Application> ApplicationSharedPtr; +typedef std::shared_ptr<application_manager::Application> 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<MockApplication>(); + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); 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<MockApplication>(); + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); smart_objects::SmartObjectSPtr objPtr = - MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*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<MockApplication>(); + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); smart_objects::SmartObjectSPtr smartObjectPtr = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); const smart_objects::SmartObject& object = *smartObjectPtr; @@ -251,7 +251,7 @@ TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) { TEST(MessageHelperTestCreate, CreateAddCommandRequestToHMI_SendSmartObject_Empty) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>(); + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); ::application_manager::CommandsMap vis; DataAccessor<application_manager::CommandsMap> data_accessor( vis, std::make_shared<sync_primitives::Lock>(true)); @@ -267,12 +267,12 @@ TEST(MessageHelperTestCreate, TEST(MessageHelperTestCreate, CreateAddCommandRequestToHMI_SendSmartObject_Equal) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>(); + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); CommandsMap vis; DataAccessor<CommandsMap> data_accessor( vis, std::make_shared<sync_primitives::Lock>(true)); smart_objects::SmartObjectSPtr smartObjectPtr = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); smart_objects::SmartObject& object = *smartObjectPtr; @@ -309,7 +309,7 @@ TEST(MessageHelperTestCreate, TEST(MessageHelperTestCreate, CreateAddVRCommandRequestFromChoiceToHMI_SendEmptyData_EmptyList) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>(); + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); application_manager::ChoiceSetMap vis; DataAccessor< ::application_manager::ChoiceSetMap> data_accessor( vis, std::make_shared<sync_primitives::Lock>(true)); @@ -325,12 +325,12 @@ TEST(MessageHelperTestCreate, TEST(MessageHelperTestCreate, CreateAddVRCommandRequestFromChoiceToHMI_SendObject_EqualList) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>(); + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); application_manager::ChoiceSetMap vis; DataAccessor< ::application_manager::ChoiceSetMap> data_accessor( vis, std::make_shared<sync_primitives::Lock>(true)); smart_objects::SmartObjectSPtr smartObjectPtr = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); smart_objects::SmartObject& object = *smartObjectPtr; @@ -372,12 +372,12 @@ TEST(MessageHelperTestCreate, } TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>(); + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); application_manager::SubMenuMap vis; DataAccessor< ::application_manager::SubMenuMap> data_accessor( vis, std::make_shared<sync_primitives::Lock>(true)); smart_objects::SmartObjectSPtr smartObjectPtr = - utils::MakeShared<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); smart_objects::SmartObject& object = *smartObjectPtr; @@ -412,7 +412,7 @@ TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) { TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendEmptyMap_EmptySmartObjectList) { - MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>(); + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); application_manager::SubMenuMap vis; DataAccessor< ::application_manager::SubMenuMap> data_accessor( vis, std::make_shared<sync_primitives::Lock>(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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + // Creating std::shared_ptr to MockApplication + MockApplicationSharedPtr appSharedMock = std::make_shared<MockApplication>(); // 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<MockApplication>(); + MockApplicationSharedPtr appSharedPtr = std::make_shared<MockApplication>(); // 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<RawMessage>(connection_key_, + message_ptr_ = std::make_shared<RawMessage>(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<Message>( + MobileMessage message = std::make_shared<Message>( 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<Message>(protocol_handler::MessagePriority::kDefault); + std::make_shared<Message>(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<RawMessage>( + RawMessagePtr message = std::make_shared<RawMessage>( 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<const unsigned char*>(full_data.c_str()); - RawMessagePtr message = utils::MakeShared<RawMessage>( + RawMessagePtr message = std::make_shared<RawMessage>( 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<application_manager::Message>( + std::make_shared<application_manager::Message>( 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<MockPolicySettings> policy_settings_; NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_; - utils::SharedPtr<application_manager_test::MockApplication> mock_app_; + std::shared_ptr<application_manager_test::MockApplication> 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<policy_manager_test::MockPolicyManager> mock_policy_manager_; + std::shared_ptr<policy_manager_test::MockPolicyManager> 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<policy_manager_test::MockPolicyManager>(); - ASSERT_TRUE(mock_policy_manager_.valid()); + std::make_shared<policy_manager_test::MockPolicyManager>(); + 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<application_manager_test::MockApplication>(); + mock_app_ = std::make_shared<application_manager_test::MockApplication>(); } virtual void TearDown() OVERRIDE { @@ -444,7 +444,7 @@ TEST_F(PolicyHandlerTest, OnPermissionsUpdated_method_With2Parameters) { } TEST_F(PolicyHandlerTest, OnPermissionsUpdated_TwoParams_InvalidApp_UNSUCCESS) { - utils::SharedPtr<application_manager_test::MockApplication> invalid_app; + std::shared_ptr<application_manager_test::MockApplication> 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<application_manager_test::MockApplication> invalid_app; + std::shared_ptr<application_manager_test::MockApplication> 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<application_manager_test::MockApplication> application1 = - utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> application1 = + std::make_shared<application_manager_test::MockApplication>(); 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<usage_statistics_test::MockStatisticsManager> + std::shared_ptr<usage_statistics_test::MockStatisticsManager> mock_statistics_manager = - utils::MakeShared<usage_statistics_test::MockStatisticsManager>(); + std::make_shared<usage_statistics_test::MockStatisticsManager>(); UsageStatistics usage_stats( "0", - utils::SharedPtr<usage_statistics::StatisticsManager>( + std::shared_ptr<usage_statistics::StatisticsManager>( 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<application_manager_test::MockApplication> invalid_app; + std::shared_ptr<application_manager_test::MockApplication> 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<usage_statistics_test::MockStatisticsManager> + std::shared_ptr<usage_statistics_test::MockStatisticsManager> mock_statistics_manager = - utils::MakeShared<usage_statistics_test::MockStatisticsManager>(); + std::make_shared<usage_statistics_test::MockStatisticsManager>(); UsageStatistics usage_stats( "0", - utils::SharedPtr<usage_statistics::StatisticsManager>( + std::shared_ptr<usage_statistics::StatisticsManager>( 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_manager_test::MockApplication> application = - utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> application = + std::make_shared<application_manager_test::MockApplication>(); 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<NsSmartDeviceLink::NsSmartObjects::SmartObject>(); + std::make_shared<NsSmartDeviceLink::NsSmartObjects::SmartObject>(); // 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<NsSmartDeviceLink::NsSmartObjects::SmartObject>(); + std::make_shared<NsSmartDeviceLink::NsSmartObjects::SmartObject>(); // 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_manager_test::MockApplication> application = - utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> application = + std::make_shared<application_manager_test::MockApplication>(); 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_manager_test::MockApplication> application = - utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> application = + std::make_shared<application_manager_test::MockApplication>(); 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_manager_test::MockApplication> application = - utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> application = + std::make_shared<application_manager_test::MockApplication>(); // 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<utils::CallNothing>())); + .WillOnce(Return(std::make_shared<utils::CallNothing>())); // Act policy_handler_.AddApplication(kPolicyAppId_, HmiTypes(policy_table::AHT_DEFAULT)); @@ -1953,8 +1953,8 @@ TEST_F(PolicyHandlerTest, GetAppIdForSending_ExpectReturnAnyIdButNone) { // Arrange EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr<application_manager_test::MockApplication> mock_app_in_full = - utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> mock_app_in_full = + std::make_shared<application_manager_test::MockApplication>(); 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<application_manager_test::MockApplication> + std::shared_ptr<application_manager_test::MockApplication> mock_app_in_limited = - utils::MakeShared<application_manager_test::MockApplication>(); + std::make_shared<application_manager_test::MockApplication>(); 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<application_manager_test::MockApplication> + std::shared_ptr<application_manager_test::MockApplication> mock_app_in_background = - utils::MakeShared<application_manager_test::MockApplication>(); + std::make_shared<application_manager_test::MockApplication>(); 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<application_manager_test::MockApplication> mock_app_in_none = - utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> mock_app_in_none = + std::make_shared<application_manager_test::MockApplication>(); 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<application_manager_test::MockApplication> + std::shared_ptr<application_manager_test::MockApplication> mock_app_in_none_1 = - utils::MakeShared<application_manager_test::MockApplication>(); + std::make_shared<application_manager_test::MockApplication>(); 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<application_manager_test::MockApplication> + std::shared_ptr<application_manager_test::MockApplication> mock_app_in_none_2 = - utils::MakeShared<application_manager_test::MockApplication>(); + std::make_shared<application_manager_test::MockApplication>(); 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<application_manager_test::MockApplication>())); + std::shared_ptr<application_manager_test::MockApplication>())); EXPECT_FALSE(policy_handler_.SendMessageToSDK(msg, url)); } @@ -2122,8 +2122,8 @@ TEST_F(PolicyHandlerTest, CanUpdate) { TEST_F(PolicyHandlerTest, CanUpdate_TwoApplicationForSending_SUCCESS) { EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr<application_manager_test::MockApplication> second_mock_app = - utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> second_mock_app = + std::make_shared<application_manager_test::MockApplication>(); 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_handler_test::MockPolicySettings> policy_settings_; - utils::SharedPtr<application_manager_test::MockApplication> mock_app_; + std::shared_ptr<application_manager_test::MockApplication> 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<policy_manager_test::MockPolicyManager> mock_policy_manager_; + std::shared_ptr<policy_manager_test::MockPolicyManager> 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<policy_manager_test::MockPolicyManager>(); - ASSERT_TRUE(mock_policy_manager_.valid()); + std::make_shared<policy_manager_test::MockPolicyManager>(); + 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<application_manager_test::MockApplication>(); + mock_app_ = std::make_shared<application_manager_test::MockApplication>(); } virtual void TearDown() OVERRIDE { @@ -206,7 +206,7 @@ TEST_F(RCPolicyHandlerTest, SendMessageToSDK_RemoteControl_SUCCESS) { TEST_F(RCPolicyHandlerTest, OnUpdateHMILevel_InvalidApp_UNSUCCESS) { EnablePolicyAndPolicyManagerMock(); - utils::SharedPtr<application_manager_test::MockApplication> invalid_app; + std::shared_ptr<application_manager_test::MockApplication> 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<application_manager_test::MockApplication> invalid_app; + std::shared_ptr<application_manager_test::MockApplication> 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<smart_objects::SmartObject>( + std::make_shared<smart_objects::SmartObject>( 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<application_manager_test::MockRequest> MRequest; -typedef utils::SharedPtr<MRequest> RequestPtr; -typedef utils::SharedPtr<RequestController> RequestControllerSPtr; +typedef std::shared_ptr<MRequest> RequestPtr; +typedef std::shared_ptr<RequestController> 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<RequestController>(mock_request_controller_settings_); + std::make_shared<RequestController>(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<MRequest>(connection_key, correlation_id); + std::make_shared<MRequest>(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 <vector> #include <limits> #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<TestRequestInfo> CreateTestInfo( + std::shared_ptr<TestRequestInfo> 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<MockRequest> mock_request = - utils::MakeShared<MockRequest>(connection_key, correlation_id); - utils::SharedPtr<TestRequestInfo> request = - utils::MakeShared<TestRequestInfo>( + std::shared_ptr<MockRequest> mock_request = + std::make_shared<MockRequest>(connection_key, correlation_id); + std::shared_ptr<TestRequestInfo> request = + std::make_shared<TestRequestInfo>( mock_request, requst_type, start_time, timeout_msec); return request; } }; TEST_F(RequestInfoTest, RequestInfoEqualEndTime) { - std::vector<utils::SharedPtr<TestRequestInfo> > requests; + std::vector<std::shared_ptr<TestRequestInfo> > requests; const TimevalStruct& time = date_time::DateTime::getCurrentTime(); for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) { - utils::SharedPtr<TestRequestInfo> request = CreateTestInfo( + std::shared_ptr<TestRequestInfo> 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<TestRequestInfo> request = + std::shared_ptr<TestRequestInfo> 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<utils::SharedPtr<TestRequestInfo> > requests; + std::vector<std::shared_ptr<TestRequestInfo> > requests; // Add hmi requests for (uint32_t i = 0; i < count_of_requests_for_test_; ++i) { - utils::SharedPtr<TestRequestInfo> request = + std::shared_ptr<TestRequestInfo> 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<utils::SharedPtr<TestRequestInfo> >::iterator req_it = + std::vector<std::shared_ptr<TestRequestInfo> >::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<TestRequestInfo> mobile_request1 = + std::shared_ptr<TestRequestInfo> 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<TestRequestInfo> mobile_request2 = + std::shared_ptr<TestRequestInfo> 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<utils::SharedPtr<TestRequestInfo> > requests; + std::vector<std::shared_ptr<TestRequestInfo> > 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<TestRequestInfo> mobile_request1 = + std::shared_ptr<TestRequestInfo> 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<TestRequestInfo> mobile_request2 = + std::shared_ptr<TestRequestInfo> 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<TestRequestInfo> request = + std::shared_ptr<TestRequestInfo> 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<TestRequestInfo> request = + std::shared_ptr<TestRequestInfo> 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<TestRequestInfo> request = + std::shared_ptr<TestRequestInfo> 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<time_t>::max(); - utils::SharedPtr<TestRequestInfo> request = + std::shared_ptr<TestRequestInfo> 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<TestRequestInfo> request = + std::shared_ptr<TestRequestInfo> 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<TestRequestInfo> request = + std::shared_ptr<TestRequestInfo> 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<NiceMock<resumption_test::MockResumptionData> >( + std::make_shared<NiceMock<resumption_test::MockResumptionData> >( mock_app_mngr_); - mock_app_ = utils::MakeShared<NiceMock<MockApplication> >(); + mock_app_ = std::make_shared<NiceMock<MockApplication> >(); mock_help_prompt_manager_ = std::shared_ptr<MockHelpPromptManager>(new MockHelpPromptManager()); - mock_app_extension_ = utils::MakeShared< + mock_app_extension_ = std::make_shared< NiceMock<application_manager_test::MockAppExtension> >(); const_app_ = static_cast<application_manager::ApplicationConstSharedPtr>(mock_app_); - res_ctrl_ = utils::MakeShared<ResumeCtrlImpl>(mock_app_mngr_); + res_ctrl_ = std::make_shared<ResumeCtrlImpl>(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<NiceMock<application_manager_test::MockAppExtension> > + std::shared_ptr<NiceMock<application_manager_test::MockAppExtension> > mock_app_extension_; MockStateController mock_state_controller_; - utils::SharedPtr<ResumeCtrl> res_ctrl_; - utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> > + std::shared_ptr<ResumeCtrl> res_ctrl_; + std::shared_ptr<NiceMock<resumption_test::MockResumptionData> > mock_storage_; - utils::SharedPtr<NiceMock<MockApplication> > mock_app_; + std::shared_ptr<NiceMock<MockApplication> > mock_app_; std::shared_ptr<MockHelpPromptManager> 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<application_manager_test::MockApplication> test_app = - ::utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> test_app = + std::make_shared<application_manager_test::MockApplication>(); 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<application_manager::Application> mock_app = - ::utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager::Application> mock_app = + std::make_shared<application_manager_test::MockApplication>(); application_manager::ApplicationSet app_set; @@ -1001,8 +1001,8 @@ TEST_F(ResumeCtrlTest, SaveAllApplications_EmptyApplicationlist) { } TEST_F(ResumeCtrlTest, SaveApplication) { - utils::SharedPtr<application_manager::Application> app_sh_mock = - ::utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager::Application> app_sh_mock = + std::make_shared<application_manager_test::MockApplication>(); 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<application_manager_test::MockApplication> app_sh_mock = - ::utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> app_sh_mock = + std::make_shared<application_manager_test::MockApplication>(); EXPECT_CALL(*app_sh_mock, app_id()).WillOnce(Return(kTestAppId_)); res_ctrl_->OnAppActivated(app_sh_mock); } TEST_F(ResumeCtrlTest, OnAppActivated_ResumptionNotActive) { - utils::SharedPtr<application_manager_test::MockApplication> app_sh_mock = - ::utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager_test::MockApplication> app_sh_mock = + std::make_shared<application_manager_test::MockApplication>(); 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<application_manager::Application> mock_app = - ::utils::MakeShared<application_manager_test::MockApplication>(); + std::shared_ptr<application_manager::Application> mock_app = + std::make_shared<application_manager_test::MockApplication>(); 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<NiceMock<MockApplication> >(); + app_mock = std::make_shared<NiceMock<MockApplication> >(); 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<application_manager_test::MockApplication>(); + app_mock = std::make_shared<NiceMock<application_manager_test::MockApplication>>(); 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<application_manager_test::MockAppExtension> >(); 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<usage_statistics::StatisticsManager>( + std::shared_ptr<usage_statistics::StatisticsManager>( new usage_statistics_test::MockStatisticsManager)) , applications_lock_ptr_(std::make_shared<sync_primitives::Lock>()) , applications_(application_set_, applications_lock_ptr_) @@ -164,7 +164,7 @@ class StateControllerImplTest : public ::testing::Test { am::ApplicationSet application_set_; mutable std::shared_ptr<sync_primitives::Lock> applications_lock_ptr_; DataAccessor<am::ApplicationSet> applications_; - utils::SharedPtr<am::StateControllerImpl> state_ctrl_; + std::shared_ptr<am::StateControllerImpl> state_ctrl_; am::ApplicationSharedPtr simple_app_; NiceMock<application_manager_test::MockApplication>* simple_app_ptr_; @@ -222,7 +222,7 @@ class StateControllerImplTest : public ::testing::Test { namespace SystemContext = mobile_apis::SystemContext; am::HmiStatePtr state = - utils::MakeShared<am::HmiState>(simple_app_, app_manager_mock_); + std::make_shared<am::HmiState>(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<HmiStateType>(app, app_manager_mock_); + std::make_shared<HmiStateType>(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<T>(app, app_manager_mock_); + std::make_shared<T>(app, app_manager_mock_); am::HmiStatePtr state_second = - utils::MakeShared<Q>(app, app_manager_mock_); + std::make_shared<Q>(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<am::StateControllerImpl>(app_manager_mock_); + state_ctrl_ = std::make_shared<am::StateControllerImpl>(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<smart_objects::SmartObject>(); (*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<StateLevelPair>::iterator it = hmi_states.begin(); std::vector<StateLevelPair>::iterator it2 = initial_hmi_states.begin(); smart_objects::SmartObjectSPtr bc_activate_app_request = - new smart_objects::SmartObject(); + std::make_shared<smart_objects::SmartObject>(); (*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<am::PhoneCallHmiState>(simple_app_, app_manager_mock_); + std::make_shared<am::PhoneCallHmiState>(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<am::PhoneCallHmiState>(media_app_, app_manager_mock_); + std::make_shared<am::PhoneCallHmiState>(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::PhoneCallHmiState>( + am::HmiStatePtr state_phone_call = std::make_shared<am::PhoneCallHmiState>( 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<am::VRHmiState>(simple_app_, app_manager_mock_); + std::make_shared<am::VRHmiState>(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<am::VRHmiState>(media_app_, app_manager_mock_); + std::make_shared<am::VRHmiState>(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<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_); + std::make_shared<am::VRHmiState>(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<am::TTSHmiState>(simple_app_, app_manager_mock_); + std::make_shared<am::TTSHmiState>(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<am::TTSHmiState>(simple_app_, app_manager_mock_); + std::make_shared<am::TTSHmiState>(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<am::TTSHmiState>(media_app_, app_manager_mock_); + std::make_shared<am::TTSHmiState>(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<am::TTSHmiState>(media_app_, app_manager_mock_); + std::make_shared<am::TTSHmiState>(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<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_); + std::make_shared<am::TTSHmiState>(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<am::TTSHmiState>(media_navi_vc_app_, app_manager_mock_); + std::make_shared<am::TTSHmiState>(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<am::VideoStreamingHmiState>(simple_app_, + std::make_shared<am::VideoStreamingHmiState>(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<am::VideoStreamingHmiState>(media_app_, + std::make_shared<am::VideoStreamingHmiState>(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<am::VideoStreamingHmiState>(media_app_, + std::make_shared<am::VideoStreamingHmiState>(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<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_); + std::make_shared<am::VideoStreamingHmiState>(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<am::VideoStreamingHmiState>(vc_app_, app_manager_mock_); + std::make_shared<am::VideoStreamingHmiState>(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<am::VideoStreamingHmiState>(navi_app_, + std::make_shared<am::VideoStreamingHmiState>(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<am::VideoStreamingHmiState>(media_navi_app_, + std::make_shared<am::VideoStreamingHmiState>(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<am::SafetyModeHmiState>(simple_app_, app_manager_mock_); + std::make_shared<am::SafetyModeHmiState>(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<am::VRHmiState>(media_app_, app_manager_mock_); + std::make_shared<am::VRHmiState>(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<am::VRHmiState>(media_navi_vc_app_, app_manager_mock_); + std::make_shared<am::VRHmiState>(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<smart_objects::SmartObject>(); + std::make_shared<smart_objects::SmartObject>(); (*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<MockStatisticsManager>()) + std::make_shared<MockStatisticsManager>()) , usage_statistics_test_object1_sptr_( new application_manager::UsageStatistics( kAppId, mock_statistics_manager_sptr_)) , language_(LanguageIdToString(kTestLanguageId)) {} protected: - utils::SharedPtr<MockStatisticsManager> mock_statistics_manager_sptr_; + std::shared_ptr<MockStatisticsManager> mock_statistics_manager_sptr_; std::unique_ptr<application_manager::UsageStatistics> usage_statistics_test_object1_sptr_; const std::string language_; |