summaryrefslogtreecommitdiff
path: root/src/components/application_manager/test
diff options
context:
space:
mode:
authorAKalinich-Luxoft <AKalinich@luxoft.com>2017-06-09 09:33:10 +0300
committerAKalinich-Luxoft <AKalinich@luxoft.com>2017-12-12 14:09:24 +0200
commit6153f79de2c362dd51c3e945294b74cd9f965ac5 (patch)
treeb3095b8abd593ce7055bfd25ac672e87f993ad9e /src/components/application_manager/test
parent9e95f67178c575ca5a537f9ef3a69653219b073d (diff)
downloadsdl_core-6153f79de2c362dd51c3e945294b74cd9f965ac5.tar.gz
Renamed OnSuspend->IncrementIgnOffCount and OnAwake->DecrementIgnOffCount
This functions of ResumptionData class was renamed according to their exact logic. Also renamed in mock class and in unit tests.
Diffstat (limited to 'src/components/application_manager/test')
-rw-r--r--src/components/application_manager/test/include/application_manager/mock_resumption_data.h4
-rw-r--r--src/components/application_manager/test/resumption/resume_ctrl_test.cc6
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_db_test.cc26
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_json_test.cc26
4 files changed, 31 insertions, 31 deletions
diff --git a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
index 7b16a3bf00..0566c8cda6 100644
--- a/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
+++ b/src/components/application_manager/test/include/application_manager/mock_resumption_data.h
@@ -59,12 +59,12 @@ class MockResumptionData : public ::resumption::ResumptionData {
MOCK_CONST_METHOD2(GetHMIApplicationID,
uint32_t(const std::string& policy_app_id,
const std::string& device_id));
- MOCK_METHOD0(OnSuspend, void());
+ MOCK_METHOD0(IncrementIgnOffCount, void());
MOCK_CONST_METHOD3(GetHashId,
bool(const std::string& policy_app_id,
const std::string& device_id,
std::string& hash_id));
- MOCK_METHOD0(OnAwake, void());
+ MOCK_METHOD0(DecrementIgnOffCount, void());
MOCK_CONST_METHOD3(GetSavedApplication,
bool(const std::string& policy_app_id,
const std::string& device_id,
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 f2fc18ca58..bbb814fb5b 100644
--- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc
+++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc
@@ -880,7 +880,7 @@ TEST_F(ResumeCtrlTest, CheckPersistenceFilesForResumption_WithChoiceSet) {
// TODO (VVeremjova) APPLINK-16718
TEST_F(ResumeCtrlTest, DISABLED_OnSuspend) {
- EXPECT_CALL(*mock_storage_, OnSuspend());
+ EXPECT_CALL(*mock_storage_, IncrementIgnOffCount());
res_ctrl_->OnSuspend();
}
@@ -896,7 +896,7 @@ TEST_F(ResumeCtrlTest, OnSuspend_EmptyApplicationlist) {
ON_CALL(app_mngr_, applications()).WillByDefault(Return(accessor));
EXPECT_CALL(*mock_storage_, SaveApplication(mock_app)).Times(0);
- EXPECT_CALL(*mock_storage_, OnSuspend());
+ EXPECT_CALL(*mock_storage_, IncrementIgnOffCount()).Times(0);
EXPECT_CALL(*mock_storage_, Persist());
res_ctrl_->OnSuspend();
}
@@ -906,7 +906,7 @@ TEST_F(ResumeCtrlTest, OnAwake) {
EXPECT_CALL(mock_application_manager_settings_,
app_resumption_save_persistent_data_timeout())
.WillOnce(ReturnRef(timeout));
- EXPECT_CALL(*mock_storage_, OnAwake());
+ EXPECT_CALL(*mock_storage_, DecrementIgnOffCount()).Times(0);
res_ctrl_->OnAwake();
}
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 aa4db59eac..cf0ebb7fd2 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
@@ -728,7 +728,7 @@ TEST_F(ResumptionDataDBTest, OnSuspend) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
}
@@ -740,18 +740,18 @@ TEST_F(ResumptionDataDBTest, OnSuspendFourTimes) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ssize_t result = res_db()->IsApplicationSaved(policy_app_id_, kMacAddress_);
EXPECT_EQ(-1, result);
@@ -765,11 +765,11 @@ TEST_F(ResumptionDataDBTest, OnSuspendOnAwake) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
ign_off_count_++;
CheckSavedDB();
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedDB();
}
@@ -782,7 +782,7 @@ TEST_F(ResumptionDataDBTest, Awake_AppNotSuspended) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedDB();
}
@@ -795,12 +795,12 @@ TEST_F(ResumptionDataDBTest, TwiceAwake_AppNotSuspended) {
res_db()->SaveApplication(app_mock);
CheckSavedDB();
- res_db()->OnSuspend();
- res_db()->OnAwake();
+ res_db()->IncrementIgnOffCount();
+ res_db()->DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedDB();
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
CheckSavedDB();
}
@@ -826,14 +826,14 @@ TEST_F(ResumptionDataDBTest, GetIgnOffTime_AfterSuspendAndAwake) {
last_ign_off_time = res_db()->GetIgnOffTime();
EXPECT_EQ(0u, last_ign_off_time);
- res_db()->OnSuspend();
+ res_db()->IncrementIgnOffCount();
uint32_t after_suspend;
after_suspend = res_db()->GetIgnOffTime();
EXPECT_LE(last_ign_off_time, after_suspend);
uint32_t after_awake;
- res_db()->OnAwake();
+ res_db()->DecrementIgnOffCount();
after_awake = res_db()->GetIgnOffTime();
EXPECT_LE(after_suspend, after_awake);
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 834637fa62..e017c39497 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
@@ -257,7 +257,7 @@ TEST_F(ResumptionDataJsonTest, OnSuspend) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
ign_off_count_++;
CheckSavedJson();
}
@@ -268,13 +268,13 @@ TEST_F(ResumptionDataJsonTest, OnSuspendFourTimes) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
ign_off_count_++;
CheckSavedJson();
- res_json.OnSuspend();
- res_json.OnSuspend();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
+ res_json.IncrementIgnOffCount();
+ res_json.IncrementIgnOffCount();
EXPECT_TRUE(-1 != res_json.IsApplicationSaved(policy_app_id_, kMacAddress_));
}
@@ -285,11 +285,11 @@ TEST_F(ResumptionDataJsonTest, OnSuspendOnAwake) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
ign_off_count_++;
CheckSavedJson();
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedJson();
}
@@ -300,7 +300,7 @@ TEST_F(ResumptionDataJsonTest, Awake_AppNotSuspended) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedJson();
}
@@ -311,12 +311,12 @@ TEST_F(ResumptionDataJsonTest, TwiceAwake_AppNotSuspended) {
res_json.SaveApplication(app_mock);
CheckSavedJson();
- res_json.OnSuspend();
- res_json.OnAwake();
+ res_json.IncrementIgnOffCount();
+ res_json.DecrementIgnOffCount();
ign_off_count_ = 0;
CheckSavedJson();
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
CheckSavedJson();
}
@@ -339,14 +339,14 @@ TEST_F(ResumptionDataJsonTest, GetIgnOffTime_AfterSuspendAndAwake) {
last_ign_off_time = res_json.GetIgnOffTime();
EXPECT_EQ(0u, last_ign_off_time);
- res_json.OnSuspend();
+ res_json.IncrementIgnOffCount();
uint32_t after_suspend;
after_suspend = res_json.GetIgnOffTime();
EXPECT_LE(last_ign_off_time, after_suspend);
uint32_t after_awake;
- res_json.OnAwake();
+ res_json.DecrementIgnOffCount();
after_awake = res_json.GetIgnOffTime();
EXPECT_LE(after_suspend, after_awake);