aboutsummaryrefslogtreecommitdiffstats
path: root/util/draft
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:48 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:48 +0300
commit9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /util/draft
parent8cbc307de0221f84c80c42dcbe07d40727537e2c (diff)
downloadydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/draft')
-rw-r--r--util/draft/date.h12
-rw-r--r--util/draft/date_ut.cpp4
-rw-r--r--util/draft/datetime.cpp10
-rw-r--r--util/draft/datetime_ut.cpp8
-rw-r--r--util/draft/enum.h8
-rw-r--r--util/draft/holder_vector.h2
-rw-r--r--util/draft/holder_vector_ut.cpp16
-rw-r--r--util/draft/ip.h2
-rw-r--r--util/draft/matrix.h10
-rw-r--r--util/draft/memory_ut.cpp4
10 files changed, 38 insertions, 38 deletions
diff --git a/util/draft/date.h b/util/draft/date.h
index 13d86032b7..e3eb616fe5 100644
--- a/util/draft/date.h
+++ b/util/draft/date.h
@@ -1,7 +1,7 @@
#pragma once
-#include <util/stream/output.h>
-#include <util/stream/input.h>
+#include <util/stream/output.h>
+#include <util/stream/input.h>
#include <util/generic/string.h>
#include <util/datetime/constants.h>
@@ -83,8 +83,8 @@ public:
friend bool operator==(const TDate& left, const TDate& right);
friend int operator-(const TDate& left, const TDate& right);
- friend IInputStream& operator>>(IInputStream& left, TDate& right);
- friend IOutputStream& operator<<(IOutputStream& left, const TDate& right);
+ friend IInputStream& operator>>(IInputStream& left, TDate& right);
+ friend IOutputStream& operator<<(IOutputStream& left, const TDate& right);
};
Y_DECLARE_PODTYPE(TDate);
@@ -116,7 +116,7 @@ inline int operator-(const TDate& left, const TDate& right) {
return static_cast<int>((left.Timestamp + SECONDS_IN_DAY / 2 - right.Timestamp) / SECONDS_IN_DAY);
}
-inline IInputStream& operator>>(IInputStream& left, TDate& right) {
+inline IInputStream& operator>>(IInputStream& left, TDate& right) {
TString stroka;
left >> stroka;
TDate date(stroka.c_str());
@@ -124,6 +124,6 @@ inline IInputStream& operator>>(IInputStream& left, TDate& right) {
return left;
}
-inline IOutputStream& operator<<(IOutputStream& left, const TDate& right) {
+inline IOutputStream& operator<<(IOutputStream& left, const TDate& right) {
return left << right.ToStroka();
}
diff --git a/util/draft/date_ut.cpp b/util/draft/date_ut.cpp
index 0efb5c5a36..8c33a6c1cf 100644
--- a/util/draft/date_ut.cpp
+++ b/util/draft/date_ut.cpp
@@ -2,8 +2,8 @@
#include <library/cpp/testing/unittest/registar.h>
-Y_UNIT_TEST_SUITE(TDateTest) {
- Y_UNIT_TEST(ComponentsTest) {
+Y_UNIT_TEST_SUITE(TDateTest) {
+ Y_UNIT_TEST(ComponentsTest) {
{
TDate d("20110215");
UNIT_ASSERT_EQUAL(d.GetYear(), 2011);
diff --git a/util/draft/datetime.cpp b/util/draft/datetime.cpp
index 902431734d..5cbe7d8847 100644
--- a/util/draft/datetime.cpp
+++ b/util/draft/datetime.cpp
@@ -6,7 +6,7 @@
#include <util/system/fasttime.h>
#include <util/datetime/base.h>
#include <util/datetime/systime.h>
-#include <util/stream/output.h>
+#include <util/stream/output.h>
#include <util/stream/mem.h>
#include <util/string/cast.h>
#include <util/string/printf.h>
@@ -28,12 +28,12 @@ namespace NDatetime {
// [31, ..., 365] or [31, ..., 366] (12 elements)
const ui32* pos = UpperBound(begin, end, yday);
- Y_ENSURE(pos != end, "day no. " << yday << " does not exist in " << (isleap ? "leap" : "non-leap") << " year");
+ Y_ENSURE(pos != end, "day no. " << yday << " does not exist in " << (isleap ? "leap" : "non-leap") << " year");
*month = pos - begin;
*mday = yday - *(pos - 1) + 1;
- Y_ASSERT((*month < 12) && (1 <= *mday) && (*mday <= MonthDays[isleap][*month]));
+ Y_ASSERT((*month < 12) && (1 <= *mday) && (*mday <= MonthDays[isleap][*month]));
}
struct TTimeData {
@@ -215,7 +215,7 @@ namespace NDatetime {
}
template <>
-void In<TMonth>(IInputStream& in, TMonth& t) {
+void In<TMonth>(IInputStream& in, TMonth& t) {
char buf[4];
LoadPodArray(&in, buf, 4);
t.Year = FromString<ui16>(buf, 4);
@@ -224,7 +224,7 @@ void In<TMonth>(IInputStream& in, TMonth& t) {
}
template <>
-void Out<TMonth>(IOutputStream& o, const TMonth& t) {
+void Out<TMonth>(IOutputStream& o, const TMonth& t) {
o << t.Year << Sprintf("%.2hu", (ui16)(t.Month + 1));
}
diff --git a/util/draft/datetime_ut.cpp b/util/draft/datetime_ut.cpp
index b64fdaa36a..a5e065ef6e 100644
--- a/util/draft/datetime_ut.cpp
+++ b/util/draft/datetime_ut.cpp
@@ -4,7 +4,7 @@
#include <util/string/builder.h>
-Y_UNIT_TEST_SUITE(TSimpleTMTest) {
+Y_UNIT_TEST_SUITE(TSimpleTMTest) {
TString PrintMarker(const TString& test, int line) {
return TStringBuilder() << "test " << test << " at line " << line;
}
@@ -52,7 +52,7 @@ Y_UNIT_TEST_SUITE(TSimpleTMTest) {
UNIT_ASSERT_VALUES_EQUAL_C((int)tms.Sec, sec, marker);
}
- Y_UNIT_TEST(TestLeap) {
+ Y_UNIT_TEST(TestLeap) {
using namespace NDatetime;
UNIT_ASSERT(LeapYearAD(2000));
UNIT_ASSERT(LeapYearAD(2012));
@@ -61,7 +61,7 @@ Y_UNIT_TEST_SUITE(TSimpleTMTest) {
UNIT_ASSERT(!LeapYearAD(1900));
}
- Y_UNIT_TEST(TestYDayConversion) {
+ Y_UNIT_TEST(TestYDayConversion) {
using namespace NDatetime;
ui32 month;
ui32 mday;
@@ -79,7 +79,7 @@ Y_UNIT_TEST_SUITE(TSimpleTMTest) {
UNIT_ASSERT_EXCEPTION(YDayToMonthAndDay(366, true, &month, &mday), yexception);
}
- Y_UNIT_TEST(SimpleTMTest) {
+ Y_UNIT_TEST(SimpleTMTest) {
using namespace NDatetime;
tzset();
diff --git a/util/draft/enum.h b/util/draft/enum.h
index cdee12564b..18002b7df2 100644
--- a/util/draft/enum.h
+++ b/util/draft/enum.h
@@ -11,13 +11,13 @@
class TEnumNotFoundException: public yexception {
};
-#define EnumFromString(key, entries) EnumFromStringImpl(key, entries, Y_ARRAY_SIZE(entries))
+#define EnumFromString(key, entries) EnumFromStringImpl(key, entries, Y_ARRAY_SIZE(entries))
#define EnumFromStringWithSize(key, entries, size) EnumFromStringImpl(key, entries, size)
-#define FindEnumFromString(key, entries) FindEnumFromStringImpl(key, entries, Y_ARRAY_SIZE(entries))
+#define FindEnumFromString(key, entries) FindEnumFromStringImpl(key, entries, Y_ARRAY_SIZE(entries))
#define FindEnumFromStringWithSize(key, entries, size) FindEnumFromStringImpl(key, entries, size)
-#define EnumToString(key, entries) EnumToStringImpl(key, entries, Y_ARRAY_SIZE(entries))
+#define EnumToString(key, entries) EnumToStringImpl(key, entries, Y_ARRAY_SIZE(entries))
#define EnumToStringWithSize(key, entries, size) EnumToStringImpl(key, entries, size)
-#define PrintEnumItems(entries) PrintEnumItemsImpl(entries, Y_ARRAY_SIZE(entries))
+#define PrintEnumItems(entries) PrintEnumItemsImpl(entries, Y_ARRAY_SIZE(entries))
template <class K1, class K2, class V>
const V* FindEnumFromStringImpl(K1 key, const std::pair<K2, V>* entries, size_t arraySize) {
diff --git a/util/draft/holder_vector.h b/util/draft/holder_vector.h
index 022f83cff2..1c62055bd9 100644
--- a/util/draft/holder_vector.h
+++ b/util/draft/holder_vector.h
@@ -52,7 +52,7 @@ public:
void Reset(size_t i, THolder<T> t) {
T* current = (*this)[i];
if (current) {
- Y_ASSERT(current != t.Get());
+ Y_ASSERT(current != t.Get());
D::Destroy(current);
}
(*this)[i] = t.Release();
diff --git a/util/draft/holder_vector_ut.cpp b/util/draft/holder_vector_ut.cpp
index babcfe8ea0..f64393860a 100644
--- a/util/draft/holder_vector_ut.cpp
+++ b/util/draft/holder_vector_ut.cpp
@@ -2,14 +2,14 @@
#include <library/cpp/testing/unittest/registar.h>
-Y_UNIT_TEST_SUITE(THolderVectorTest) {
- Y_UNIT_TEST(TestCreateEmpty) {
+Y_UNIT_TEST_SUITE(THolderVectorTest) {
+ Y_UNIT_TEST(TestCreateEmpty) {
THolderVector<int> ints;
UNIT_ASSERT_EQUAL(ints.Size(), 0);
UNIT_ASSERT(!ints);
}
- Y_UNIT_TEST(TestCreateNonEmpty) {
+ Y_UNIT_TEST(TestCreateNonEmpty) {
THolderVector<int> ints(5);
UNIT_ASSERT_EQUAL(ints.Size(), 5);
UNIT_ASSERT(ints);
@@ -19,7 +19,7 @@ Y_UNIT_TEST_SUITE(THolderVectorTest) {
}
}
- Y_UNIT_TEST(TestResetValue) {
+ Y_UNIT_TEST(TestResetValue) {
THolderVector<int> ints;
ints.PushBack(new int(0));
ints.PushBack(new int(1));
@@ -31,7 +31,7 @@ Y_UNIT_TEST_SUITE(THolderVectorTest) {
UNIT_ASSERT_VALUES_EQUAL(*ints[1], 3);
}
- Y_UNIT_TEST(TestResetNoValue) {
+ Y_UNIT_TEST(TestResetNoValue) {
THolderVector<int> ints;
ints.Resize(1);
UNIT_ASSERT_EQUAL(ints[0], (int*)nullptr);
@@ -40,7 +40,7 @@ Y_UNIT_TEST_SUITE(THolderVectorTest) {
UNIT_ASSERT_VALUES_EQUAL(*ints[0], 1);
}
- Y_UNIT_TEST(TestResetSmartPtr) {
+ Y_UNIT_TEST(TestResetSmartPtr) {
THolderVector<int> ints;
ints.Resize(2);
@@ -50,7 +50,7 @@ Y_UNIT_TEST_SUITE(THolderVectorTest) {
UNIT_ASSERT(!holder);
}
- Y_UNIT_TEST(TestSwap) {
+ Y_UNIT_TEST(TestSwap) {
THolderVector<int> v1;
v1.PushBack(new int(1));
@@ -59,7 +59,7 @@ Y_UNIT_TEST_SUITE(THolderVectorTest) {
UNIT_ASSERT(v1.empty() && v2.size() == 1 && *v2.front() == 1);
}
- Y_UNIT_TEST(TestUniquePtr) {
+ Y_UNIT_TEST(TestUniquePtr) {
THolderVector<TString> v;
std::unique_ptr<TString> str(new TString("hello"));
v.PushBack(std::move(str));
diff --git a/util/draft/ip.h b/util/draft/ip.h
index 97ddba39d5..eb947cd2cd 100644
--- a/util/draft/ip.h
+++ b/util/draft/ip.h
@@ -87,7 +87,7 @@ static inline TString Ip6ToString(const TIp6& ip) {
}
template <>
-inline void Out<TIp6>(IOutputStream& os, const TIp6& a) {
+inline void Out<TIp6>(IOutputStream& os, const TIp6& a) {
os << Ip6ToString(a);
}
diff --git a/util/draft/matrix.h b/util/draft/matrix.h
index 5b366d32b9..154d00b35e 100644
--- a/util/draft/matrix.h
+++ b/util/draft/matrix.h
@@ -47,7 +47,7 @@ public:
}
void ReDim(size_t m, size_t n) {
- Y_ASSERT(m >= 1 && n >= 1);
+ Y_ASSERT(m >= 1 && n >= 1);
size_t newSize = m * n;
if (newSize > BufSize) {
T* newBuf = new T[newSize];
@@ -69,25 +69,25 @@ public:
// Access element matrix[i][j]
T* operator[](size_t i) {
- Y_ASSERT(i >= 0 && i < M);
+ Y_ASSERT(i >= 0 && i < M);
return Arr + i * N;
}
// Access element matrix[i][j]
const T* operator[](size_t i) const {
- Y_ASSERT(i >= 0 && i < M);
+ Y_ASSERT(i >= 0 && i < M);
return Arr + i * N;
}
// Access element matrix(i, j)
T& operator()(size_t i, size_t j) {
- Y_ASSERT(i >= 0 && i < M && j >= 0 && j < N);
+ Y_ASSERT(i >= 0 && i < M && j >= 0 && j < N);
return Arr[i * N + j];
}
// Access element matrix(i, j)
const T& operator()(size_t i, size_t j) const {
- Y_ASSERT(i >= 0 && i < M && j >= 0 && j < N);
+ Y_ASSERT(i >= 0 && i < M && j >= 0 && j < N);
return Arr[i * N + j];
}
diff --git a/util/draft/memory_ut.cpp b/util/draft/memory_ut.cpp
index ef416705d5..76bee30549 100644
--- a/util/draft/memory_ut.cpp
+++ b/util/draft/memory_ut.cpp
@@ -23,8 +23,8 @@ struct Y_PACKED TSampleStruct3 {
#pragma pack()
-Y_UNIT_TEST_SUITE(TUtilDraftMemoryTest) {
- Y_UNIT_TEST(IsZeroTest) {
+Y_UNIT_TEST_SUITE(TUtilDraftMemoryTest) {
+ Y_UNIT_TEST(IsZeroTest) {
ui8 a1 = 0;
UNIT_ASSERT(IsZero(a1));
a1 = 0xF0;