diff options
author | aosipenko <aosipenko@yandex-team.ru> | 2022-02-10 16:48:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:08 +0300 |
commit | 69e3c43df1c96bc2ac8946bf4dfb1f5fc438ff7f (patch) | |
tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /util/datetime | |
parent | 948fd24d47d4b3b7815aaef1686aea00ef3f4288 (diff) | |
download | ydb-69e3c43df1c96bc2ac8946bf4dfb1f5fc438ff7f.tar.gz |
Restoring authorship annotation for <aosipenko@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/datetime')
-rw-r--r-- | util/datetime/base.h | 8 | ||||
-rw-r--r-- | util/datetime/base_ut.cpp | 20 | ||||
-rw-r--r-- | util/datetime/systime.cpp | 4 |
3 files changed, 16 insertions, 16 deletions
diff --git a/util/datetime/base.h b/util/datetime/base.h index 91d987a865..5e902b8f63 100644 --- a/util/datetime/base.h +++ b/util/datetime/base.h @@ -24,11 +24,11 @@ #include <time.h> -#ifdef _MSC_VER +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4244) // conversion from 'time_t' to 'long', possible loss of data #endif // _MSC_VER - + // Microseconds since epoch class TInstant; @@ -818,6 +818,6 @@ static inline TInstant Now() noexcept { return TInstant::Now(); } -#ifdef _MSC_VER +#ifdef _MSC_VER #pragma warning(pop) -#endif // _MSC_VER +#endif // _MSC_VER diff --git a/util/datetime/base_ut.cpp b/util/datetime/base_ut.cpp index 5db2bead12..afc3f802eb 100644 --- a/util/datetime/base_ut.cpp +++ b/util/datetime/base_ut.cpp @@ -298,7 +298,7 @@ Y_UNIT_TEST_SUITE(TDateTimeTest) { } return strcmp(zone0, zone1) == 0; } - + static bool CompareTMFull(const tm* t0, const tm* t1) { return t0 && t1 && CompareTM(*t0, *t1) && @@ -320,14 +320,14 @@ Y_UNIT_TEST_SUITE(TDateTimeTest) { for (time_t t = starttime; t < finishtime; t += step) { ptm0 = GmTimeR(&t, &tms0); UNIT_ASSERT_EQUAL(ptm0, &tms0); - -#ifdef _win_ + +#ifdef _win_ if (tms0.tm_year + 1900 > 3000) { // Windows: _MAX__TIME64_T == 23:59:59. 12/31/3000 UTC continue; } -#endif - +#endif + ptm1 = gmtime_r(&t, &tms1); if (!ptm1) { continue; @@ -372,7 +372,7 @@ Y_UNIT_TEST_SUITE(DateTimeTest) { } Y_UNIT_TEST(TestFromString) { - static const struct T { + static const struct T { const char* const Str; const TDuration::TValue MicroSeconds; const bool Parseable; @@ -383,7 +383,7 @@ Y_UNIT_TEST_SUITE(DateTimeTest) { {"3ms", 3000, true}, {"x3ms", 0, false}, }; - + for (const T* t = tests; t != std::end(tests); ++t) { // FromString bool parsed = false; @@ -400,9 +400,9 @@ Y_UNIT_TEST_SUITE(DateTimeTest) { if (t->Parseable) { UNIT_ASSERT_EQUAL(t->MicroSeconds, tryTime.MicroSeconds()); } - } - } - + } + } + Y_UNIT_TEST(TestSleep) { // check does not throw Sleep(TDuration::Seconds(0)); diff --git a/util/datetime/systime.cpp b/util/datetime/systime.cpp index 6425aafe0c..6ee7e8fc6e 100644 --- a/util/datetime/systime.cpp +++ b/util/datetime/systime.cpp @@ -89,9 +89,9 @@ struct tm* GmTimeR(const time_t* timer, struct tm* tmbuf) { static const int _ytab[2][12] = { {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}}; - + i64 time = static_cast<i64>(*timer); - + ui64 dayclock, dayno; int year = EPOCH_YR; |