summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Gapchuk <igapchuck@luxoft.com>2019-09-11 19:26:22 +0300
committerIgor Gapchuk <igapchuck@luxoft.com>2019-09-11 19:26:22 +0300
commit0b50b09dccb77273e6047d277a99ef2ad28baaac (patch)
tree71e63bc5a5d4f094caa50cf6c54f01938727e796
parent847ef5be3d621cabf18d1f8c46810c8443a428cf (diff)
downloadsdl_core-fix/sdl_crash_during_retry_sequence.tar.gz
fixup! Fix SDL crash during retry sequencefix/sdl_crash_during_retry_sequence
-rw-r--r--src/components/application_manager/src/policies/policy_handler.cc4
-rw-r--r--src/components/application_manager/test/application_manager_impl_test.cc9
2 files changed, 8 insertions, 5 deletions
diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc
index d2ad5ec95f..f88eaf47a5 100644
--- a/src/components/application_manager/src/policies/policy_handler.cc
+++ b/src/components/application_manager/src/policies/policy_handler.cc
@@ -448,7 +448,7 @@ uint32_t PolicyHandler::GetAppIdForSending() const {
logger_,
"Number of apps with NONE level: " << apps_with_none_level.size());
- if (apps_with_none_level.empty() && apps_without_none_level.empty()) {
+ if (apps_with_none_level.empty()) {
LOG4CXX_WARN(logger_, "There is no registered application");
return 0;
}
@@ -1537,7 +1537,7 @@ void PolicyHandler::OnSnapshotCreated(const BinaryMessage& pt_string,
if (0 != app_id_for_sending) {
MessageHelper::SendPolicySnapshotNotification(
- app_id_for_sending, pt_string, std::string(""), application_manager_);
+ app_id_for_sending, pt_string, std::string(), application_manager_);
}
} else {
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 98496d77cc..bfd815cd8b 100644
--- a/src/components/application_manager/test/application_manager_impl_test.cc
+++ b/src/components/application_manager/test/application_manager_impl_test.cc
@@ -153,6 +153,9 @@ class ApplicationManagerImplTest
new MockAppServiceManager(mock_app_mngr_, mock_last_state_))
, mock_message_helper_(
application_manager::MockMessageHelper::message_helper_mock())
+ , mock_statistics_manager_(
+ std::make_shared<
+ NiceMock<usage_statistics_test::MockStatisticsManager> >())
{
#ifdef ENABLE_LOG
@@ -193,9 +196,7 @@ class ApplicationManagerImplTest
ON_CALL(*mock_message_helper_, CreateModuleInfoSO(_, _))
.WillByDefault(Return(request));
ON_CALL(*mock_policy_handler_, GetStatisticManager())
- .WillByDefault(
- Return(std::shared_ptr<usage_statistics::StatisticsManager>(
- new usage_statistics_test::MockStatisticsManager())));
+ .WillByDefault(Return(mock_statistics_manager_));
}
void CreateAppManager() {
@@ -285,6 +286,8 @@ class ApplicationManagerImplTest
std::shared_ptr<MockApplication> mock_app_ptr_;
NiceMock<protocol_handler_test::MockProtocolHandler> mock_protocol_handler_;
+ std::shared_ptr<NiceMock<usage_statistics_test::MockStatisticsManager> >
+ mock_statistics_manager_;
};
INSTANTIATE_TEST_CASE_P(