aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/timezone_conversion/ut/convert_ut.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/timezone_conversion/ut/convert_ut.cpp
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/timezone_conversion/ut/convert_ut.cpp')
-rw-r--r--library/cpp/timezone_conversion/ut/convert_ut.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/library/cpp/timezone_conversion/ut/convert_ut.cpp b/library/cpp/timezone_conversion/ut/convert_ut.cpp
index 477813e542..bbf9e9b826 100644
--- a/library/cpp/timezone_conversion/ut/convert_ut.cpp
+++ b/library/cpp/timezone_conversion/ut/convert_ut.cpp
@@ -29,11 +29,11 @@ void CompareCivilTimes(const TSimpleTM& expected, const TSimpleTM& actual) {
}
#define CHECK_ROUND_TRIP(tz, unixTime, civil) \
- EXPECT_EQ( \
- TInstant::Seconds(unixTime), \
- ToAbsoluteTime(civil, tz)); \
+ EXPECT_EQ( \
+ TInstant::Seconds(unixTime), \
+ ToAbsoluteTime(civil, tz)); \
CompareCivilTimes( \
- civil, \
+ civil, \
ToCivilTime(TInstant::Seconds(unixTime), tz));
// Tests only unambiguous civil times (i.e., those that occurred exactly once).
@@ -41,35 +41,35 @@ TEST(TimeZoneConversion, Simple) {
TTimeZone msk = GetTimeZone("Europe/Moscow");
// Before and after the temporary switch to UTC+3 in 2010.
CHECK_ROUND_TRIP(
- msk,
- 1288475999,
- ZonedTm(+4, true, 2010, 10, 31, 1, 59, 59));
+ msk,
+ 1288475999,
+ ZonedTm(+4, true, 2010, 10, 31, 1, 59, 59));
CHECK_ROUND_TRIP(
- msk,
- 1288475999 + 3 * 60 * 60,
- ZonedTm(+3, false, 2010, 10, 31, 3, 59, 59));
+ msk,
+ 1288475999 + 3 * 60 * 60,
+ ZonedTm(+3, false, 2010, 10, 31, 3, 59, 59));
// Before and after the permanent switch to UTC+4 in 2011.
CHECK_ROUND_TRIP(
- msk,
- 1301180399,
- ZonedTm(+3, false, 2011, 3, 27, 1, 59, 59));
+ msk,
+ 1301180399,
+ ZonedTm(+3, false, 2011, 3, 27, 1, 59, 59));
CHECK_ROUND_TRIP(
- msk,
- 1301180399 + 60 * 60,
- ZonedTm(+4, false, 2011, 3, 27, 3, 59, 59));
+ msk,
+ 1301180399 + 60 * 60,
+ ZonedTm(+4, false, 2011, 3, 27, 3, 59, 59));
// Some random moment between 2011 and 2014 when UTC+4 (no DST) was in place.
CHECK_ROUND_TRIP(
- msk,
- 1378901234,
- ZonedTm(+4, false, 2013, 9, 11, 16, 7, 14));
+ msk,
+ 1378901234,
+ ZonedTm(+4, false, 2013, 9, 11, 16, 7, 14));
// As of right now (i.e., as I'm writing this) Moscow is in UTC+3 (no DST).
CHECK_ROUND_TRIP(
- msk,
- 1458513396,
- ZonedTm(+3, false, 2016, 3, 21, 1, 36, 36));
+ msk,
+ 1458513396,
+ ZonedTm(+3, false, 2016, 3, 21, 1, 36, 36));
// Please add a new test if the current president moves Moscow back to UTC+4
// or introduces DST again.
@@ -122,9 +122,9 @@ TEST(TimeZoneConversion, TestSkippedDate) {
TEST(TimeZoneConversion, Utc) {
CHECK_ROUND_TRIP(
- GetUtcTimeZone(),
- 1451703845,
- ZonedTm(0, false, 2016, 1, 2, 3, 4, 5));
+ GetUtcTimeZone(),
+ 1451703845,
+ ZonedTm(0, false, 2016, 1, 2, 3, 4, 5));
}
TEST(TimeZoneConversion, Local) {
@@ -182,7 +182,7 @@ TEST(TimeZoneConversion, TestFutureDstChanges) {
// 31 days later we're back to UTC+0 again.
CHECK_ROUND_TRIP(
london,
- 1760124660 + 31 * 24 * 60 * 60,
+ 1760124660 + 31 * 24 * 60 * 60,
ZonedTm(+0, false, 2025, 11, 10, 19, 31, 0));
}