aboutsummaryrefslogtreecommitdiffstats
path: root/util/datetime
diff options
context:
space:
mode:
authortobo <tobo@yandex-team.ru>2022-02-10 16:47:27 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:27 +0300
commit55a7f90e4cd31e9481cace8ee5dfd682c27e810e (patch)
tree9814fbd1c3effac9b8377c5d604b367b14e2db55 /util/datetime
parent7fe839092527589b38f014d854c51565b3c1adfa (diff)
downloadydb-55a7f90e4cd31e9481cace8ee5dfd682c27e810e.tar.gz
Restoring authorship annotation for <tobo@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/datetime')
-rw-r--r--util/datetime/base.cpp2
-rw-r--r--util/datetime/base_ut.cpp4
-rw-r--r--util/datetime/cputimer.h2
-rw-r--r--util/datetime/parser_deprecated_ut.cpp16
-rw-r--r--util/datetime/parser_ut.cpp16
-rw-r--r--util/datetime/strptime.cpp2
-rw-r--r--util/datetime/systime.cpp4
7 files changed, 23 insertions, 23 deletions
diff --git a/util/datetime/base.cpp b/util/datetime/base.cpp
index b78def8c77..38ecc3ab96 100644
--- a/util/datetime/base.cpp
+++ b/util/datetime/base.cpp
@@ -146,7 +146,7 @@ void Out<TInstant>(IOutputStream& os, TTypeTraits<TInstant>::TFuncParam instant)
auto len = FormatDate8601(buf, sizeof(buf), instant.TimeT());
// shouldn't happen due to current implementation of FormatDate8601() and GmTimeR()
- Y_ENSURE(len, TStringBuf("Out<TInstant>: year does not fit into an integer"));
+ Y_ENSURE(len, TStringBuf("Out<TInstant>: year does not fit into an integer"));
os.Write(buf, len - 1 /* 'Z' */);
WriteMicroSecondsToStream(os, instant.MicroSecondsOfSecond());
diff --git a/util/datetime/base_ut.cpp b/util/datetime/base_ut.cpp
index e098ce06d5..afc3f802eb 100644
--- a/util/datetime/base_ut.cpp
+++ b/util/datetime/base_ut.cpp
@@ -493,8 +493,8 @@ Y_UNIT_TEST_SUITE(DateTimeTest) {
}
Y_UNIT_TEST(TestNoexceptConstruction) {
- UNIT_ASSERT_EXCEPTION(TDuration::MilliSeconds(FromString(TStringBuf("not a number"))), yexception);
- UNIT_ASSERT_EXCEPTION(TDuration::Seconds(FromString(TStringBuf("not a number"))), yexception);
+ 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) {
diff --git a/util/datetime/cputimer.h b/util/datetime/cputimer.h
index 820454f8b6..7d38d5bdb3 100644
--- a/util/datetime/cputimer.h
+++ b/util/datetime/cputimer.h
@@ -12,7 +12,7 @@ private:
TStringStream Message_;
public:
- TTimer(const TStringBuf message = TStringBuf(" took: "));
+ TTimer(const TStringBuf message = TStringBuf(" took: "));
~TTimer();
};
diff --git a/util/datetime/parser_deprecated_ut.cpp b/util/datetime/parser_deprecated_ut.cpp
index 13383d3f18..6ad9f885b1 100644
--- a/util/datetime/parser_deprecated_ut.cpp
+++ b/util/datetime/parser_deprecated_ut.cpp
@@ -466,53 +466,53 @@ Y_UNIT_TEST_SUITE(TDateTimeParseTestDeprecated) {
Y_UNIT_TEST(TestTInstantTryParseDeprecated) {
{
- const TStringBuf s = "2009-09-19 03:37:08.1+04:00";
+ const TStringBuf s = "2009-09-19 03:37:08.1+04:00";
const auto i = TInstant::ParseIso8601Deprecated(s);
TInstant iTry;
UNIT_ASSERT(TInstant::TryParseIso8601Deprecated(s, iTry));
UNIT_ASSERT_VALUES_EQUAL(i, iTry);
}
{
- const TStringBuf s = "2009-09aslkdjfkljasdjfl4:00";
+ const TStringBuf s = "2009-09aslkdjfkljasdjfl4:00";
TInstant iTry;
UNIT_ASSERT_EXCEPTION(TInstant::ParseIso8601Deprecated(s), TDateTimeParseException);
UNIT_ASSERT(!TInstant::TryParseIso8601Deprecated(s, iTry));
}
{
- const TStringBuf s = "Wed, 14 Oct 2009 16:55:33 GMT";
+ const TStringBuf s = "Wed, 14 Oct 2009 16:55:33 GMT";
const auto i = TInstant::ParseRfc822Deprecated(s);
TInstant iTry;
UNIT_ASSERT(TInstant::TryParseRfc822Deprecated(s, iTry));
UNIT_ASSERT_VALUES_EQUAL(i, iTry);
}
{
- const TStringBuf s = "Wed, alsdjflkasjdfl:55:33 GMT";
+ const TStringBuf s = "Wed, alsdjflkasjdfl:55:33 GMT";
TInstant iTry;
UNIT_ASSERT_EXCEPTION(TInstant::ParseRfc822Deprecated(s), TDateTimeParseException);
UNIT_ASSERT(!TInstant::TryParseRfc822Deprecated(s, iTry));
}
{
- const TStringBuf s = "20091014165533Z";
+ const TStringBuf s = "20091014165533Z";
const auto i = TInstant::ParseX509ValidityDeprecated(s);
TInstant iTry;
UNIT_ASSERT(TInstant::TryParseX509Deprecated(s, iTry));
UNIT_ASSERT_VALUES_EQUAL(i, iTry);
}
{
- const TStringBuf s = "200asdfasdf533Z";
+ const TStringBuf s = "200asdfasdf533Z";
TInstant iTry;
UNIT_ASSERT_EXCEPTION(TInstant::ParseX509ValidityDeprecated(s), TDateTimeParseException);
UNIT_ASSERT(!TInstant::TryParseX509Deprecated(s, iTry));
}
{
- const TStringBuf s = "990104074212Z";
+ const TStringBuf s = "990104074212Z";
const auto i = TInstant::ParseX509ValidityDeprecated(s);
TInstant iTry;
UNIT_ASSERT(TInstant::TryParseX509Deprecated(s, iTry));
UNIT_ASSERT_VALUES_EQUAL(i, iTry);
}
{
- const TStringBuf s = "9901asdf4212Z";
+ const TStringBuf s = "9901asdf4212Z";
TInstant iTry;
UNIT_ASSERT_EXCEPTION(TInstant::ParseX509ValidityDeprecated(s), TDateTimeParseException);
UNIT_ASSERT(!TInstant::TryParseX509Deprecated(s, iTry));
diff --git a/util/datetime/parser_ut.cpp b/util/datetime/parser_ut.cpp
index b430bc6abf..61364af997 100644
--- a/util/datetime/parser_ut.cpp
+++ b/util/datetime/parser_ut.cpp
@@ -516,53 +516,53 @@ Y_UNIT_TEST_SUITE(TDateTimeParseTest) {
Y_UNIT_TEST(TestTInstantTryParse) {
{
- const TStringBuf s = "2009-09-19 03:37:08.1+04:00";
+ const TStringBuf s = "2009-09-19 03:37:08.1+04:00";
const auto i = TInstant::ParseIso8601(s);
TInstant iTry;
UNIT_ASSERT(TInstant::TryParseIso8601(s, iTry));
UNIT_ASSERT_VALUES_EQUAL(i, iTry);
}
{
- const TStringBuf s = "2009-09aslkdjfkljasdjfl4:00";
+ const TStringBuf s = "2009-09aslkdjfkljasdjfl4:00";
TInstant iTry;
UNIT_ASSERT_EXCEPTION(TInstant::ParseIso8601(s), TDateTimeParseException);
UNIT_ASSERT(!TInstant::TryParseIso8601(s, iTry));
}
{
- const TStringBuf s = "Wed, 14 Oct 2009 16:55:33 GMT";
+ const TStringBuf s = "Wed, 14 Oct 2009 16:55:33 GMT";
const auto i = TInstant::ParseRfc822(s);
TInstant iTry;
UNIT_ASSERT(TInstant::TryParseRfc822(s, iTry));
UNIT_ASSERT_VALUES_EQUAL(i, iTry);
}
{
- const TStringBuf s = "Wed, alsdjflkasjdfl:55:33 GMT";
+ const TStringBuf s = "Wed, alsdjflkasjdfl:55:33 GMT";
TInstant iTry;
UNIT_ASSERT_EXCEPTION(TInstant::ParseRfc822(s), TDateTimeParseException);
UNIT_ASSERT(!TInstant::TryParseRfc822(s, iTry));
}
{
- const TStringBuf s = "20091014165533Z";
+ const TStringBuf s = "20091014165533Z";
const auto i = TInstant::ParseX509Validity(s);
TInstant iTry;
UNIT_ASSERT(TInstant::TryParseX509(s, iTry));
UNIT_ASSERT_VALUES_EQUAL(i, iTry);
}
{
- const TStringBuf s = "200asdfasdf533Z";
+ const TStringBuf s = "200asdfasdf533Z";
TInstant iTry;
UNIT_ASSERT_EXCEPTION(TInstant::ParseX509Validity(s), TDateTimeParseException);
UNIT_ASSERT(!TInstant::TryParseX509(s, iTry));
}
{
- const TStringBuf s = "990104074212Z";
+ const TStringBuf s = "990104074212Z";
const auto i = TInstant::ParseX509Validity(s);
TInstant iTry;
UNIT_ASSERT(TInstant::TryParseX509(s, iTry));
UNIT_ASSERT_VALUES_EQUAL(i, iTry);
}
{
- const TStringBuf s = "9901asdf4212Z";
+ const TStringBuf s = "9901asdf4212Z";
TInstant iTry;
UNIT_ASSERT_EXCEPTION(TInstant::ParseX509Validity(s), TDateTimeParseException);
UNIT_ASSERT(!TInstant::TryParseX509(s, iTry));
diff --git a/util/datetime/strptime.cpp b/util/datetime/strptime.cpp
index 709eb56b80..f0d4ec333e 100644
--- a/util/datetime/strptime.cpp
+++ b/util/datetime/strptime.cpp
@@ -190,7 +190,7 @@ _strptime(const char* buf, const char* fmt, struct tm* tm, int* GMTp)
if (c != '%') {
if (isspace((unsigned char)c))
while (*buf != 0 && isspace((unsigned char)*buf))
- ++buf;
+ ++buf;
else if (c != *buf++)
return 0;
continue;
diff --git a/util/datetime/systime.cpp b/util/datetime/systime.cpp
index f77464704b..6ee7e8fc6e 100644
--- a/util/datetime/systime.cpp
+++ b/util/datetime/systime.cpp
@@ -113,14 +113,14 @@ struct tm* GmTimeR(const time_t* timer, struct tm* tmbuf) {
tmbuf->tm_wday = (dayno + 4) % 7; // Day 0 was a thursday
while (dayno >= (ui64)YEARSIZE(year)) {
dayno -= YEARSIZE(year);
- ++year;
+ ++year;
}
tmbuf->tm_year = year - YEAR0;
tmbuf->tm_yday = dayno;
tmbuf->tm_mon = 0;
while (dayno >= (ui64)_ytab[LEAPYEAR(year)][tmbuf->tm_mon]) {
dayno -= _ytab[LEAPYEAR(year)][tmbuf->tm_mon];
- ++tmbuf->tm_mon;
+ ++tmbuf->tm_mon;
}
tmbuf->tm_mday = dayno + 1;
tmbuf->tm_isdst = 0;