summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLitvinenkoIra <ilytvynenko@luxoft.com>2018-08-31 11:44:19 +0300
committerLitvinenkoIra <ilytvynenko@luxoft.com>2018-08-31 11:44:19 +0300
commit6d3f840eb03f1585c4e77f2e15a909378d0cadb1 (patch)
treefc4fd3adeee6a0f4b699d38e8bd8b1610a85c8ba
parentddc79ce414adcd966bdab61b814ce8a422e780f8 (diff)
downloadsdl_core-6d3f840eb03f1585c4e77f2e15a909378d0cadb1.tar.gz
fixup! remove struct timeval and use boost time_duration instead
-rw-r--r--src/components/policy/policy_external/src/policy_manager_impl.cc2
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc2
-rw-r--r--src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/components/policy/policy_external/src/policy_manager_impl.cc b/src/components/policy/policy_external/src/policy_manager_impl.cc
index c7d814e56e..e2b0d6524f 100644
--- a/src/components/policy/policy_external/src/policy_manager_impl.cc
+++ b/src/components/policy/policy_external/src/policy_manager_impl.cc
@@ -1498,7 +1498,7 @@ bool PolicyManagerImpl::ExceededDays() {
date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- const int days = current_time.tv_sec / kSecondsInDay;
+ const int days = date_time::getSecs(current_time) / kSecondsInDay;
DCHECK(std::numeric_limits<uint16_t>::max() >= days);
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
index 8d2802c831..dd9b43d53c 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_ptu_test.cc
@@ -926,7 +926,7 @@ TEST_F(
uint32_t GetCurrentDaysCount() {
date_time::TimeDuration current_time = date_time::getCurrentTime();
const uint32_t kSecondsInDay = 60 * 60 * 24;
- return current_time.tv_sec / kSecondsInDay;
+ return date_time::getSecs(current_time) / kSecondsInDay;
}
TEST_F(PolicyManagerImplTest2,
diff --git a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
index 4df4012ad3..93cfa36277 100644
--- a/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
+++ b/src/components/policy/policy_external/test/policy_manager_impl_user_consent_test.cc
@@ -71,7 +71,7 @@ TEST_F(
const date_time::TimeDuration current_time = date_time::getCurrentTime();
const int kSecondsInDay = 60 * 60 * 24;
- const int days_after_epoch = current_time.tv_sec / kSecondsInDay;
+ const int days_after_epoch = date_time::getSecs(current_time) / kSecondsInDay;
policy_manager_->PTUpdatedAt(DAYS_AFTER_EPOCH, days_after_epoch);
policy_manager_->PTUpdatedAt(KILOMETERS, 1000);