diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/datetime/base_ut.cpp | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'util/datetime/base_ut.cpp')
-rw-r--r-- | util/datetime/base_ut.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/util/datetime/base_ut.cpp b/util/datetime/base_ut.cpp index 6699076949..afc3f802eb 100644 --- a/util/datetime/base_ut.cpp +++ b/util/datetime/base_ut.cpp @@ -411,9 +411,9 @@ Y_UNIT_TEST_SUITE(DateTimeTest) { } Y_UNIT_TEST(TestInstantToString) { - UNIT_ASSERT_VALUES_EQUAL(TString("2009-08-06T15:19:06.023455Z"), ToString(TInstant::Seconds(1249571946) + TDuration::MicroSeconds(23455))); - UNIT_ASSERT_VALUES_EQUAL(TString("2009-08-06T15:19:06.023455Z"), (TInstant::Seconds(1249571946) + TDuration::MicroSeconds(23455)).ToString()); - UNIT_ASSERT_VALUES_EQUAL(TString("2009-08-06T15:19:06Z"), (TInstant::Seconds(1249571946) + TDuration::MicroSeconds(23455)).ToStringUpToSeconds()); + UNIT_ASSERT_VALUES_EQUAL(TString("2009-08-06T15:19:06.023455Z"), ToString(TInstant::Seconds(1249571946) + TDuration::MicroSeconds(23455))); + UNIT_ASSERT_VALUES_EQUAL(TString("2009-08-06T15:19:06.023455Z"), (TInstant::Seconds(1249571946) + TDuration::MicroSeconds(23455)).ToString()); + UNIT_ASSERT_VALUES_EQUAL(TString("2009-08-06T15:19:06Z"), (TInstant::Seconds(1249571946) + TDuration::MicroSeconds(23455)).ToStringUpToSeconds()); } Y_UNIT_TEST(TestInstantToRfc822String) { @@ -461,10 +461,10 @@ Y_UNIT_TEST_SUITE(DateTimeTest) { template <class T> void TestTimeUnits() { - T withTime = T::MicroSeconds(1249571946000000L); - T onlyMinutes = T::MicroSeconds(1249571940000000L); - T onlyHours = T::MicroSeconds(1249570800000000L); - T onlyDays = T::MicroSeconds(1249516800000000L); + T withTime = T::MicroSeconds(1249571946000000L); + T onlyMinutes = T::MicroSeconds(1249571940000000L); + T onlyHours = T::MicroSeconds(1249570800000000L); + T onlyDays = T::MicroSeconds(1249516800000000L); ui64 minutes = 20826199; ui64 hours = 347103; ui64 days = 14462; @@ -496,22 +496,22 @@ Y_UNIT_TEST_SUITE(DateTimeTest) { UNIT_ASSERT_EXCEPTION(TDuration::MilliSeconds(FromString(TStringBuf("not a number"))), yexception); UNIT_ASSERT_EXCEPTION(TDuration::Seconds(FromString(TStringBuf("not a number"))), yexception); } - + Y_UNIT_TEST(TestFromValueForTDuration) { - // check that FromValue creates the same TDuration - TDuration d1 = TDuration::MicroSeconds(12345); - TDuration d2 = TDuration::FromValue(d1.GetValue()); - - UNIT_ASSERT_VALUES_EQUAL(d1, d2); - } - + // check that FromValue creates the same TDuration + TDuration d1 = TDuration::MicroSeconds(12345); + TDuration d2 = TDuration::FromValue(d1.GetValue()); + + UNIT_ASSERT_VALUES_EQUAL(d1, d2); + } + Y_UNIT_TEST(TestFromValueForTInstant) { - // check that FromValue creates the same TInstant - TInstant i1 = TInstant::MicroSeconds(12345); - TInstant i2 = TInstant::FromValue(i1.GetValue()); - - UNIT_ASSERT_VALUES_EQUAL(i1, i2); - } + // check that FromValue creates the same TInstant + TInstant i1 = TInstant::MicroSeconds(12345); + TInstant i2 = TInstant::FromValue(i1.GetValue()); + + UNIT_ASSERT_VALUES_EQUAL(i1, i2); + } Y_UNIT_TEST(TestTimeGmDateConversion) { tm time{}; |