diff options
author | artkolesnikov <artkolesnikov@yandex-team.ru> | 2022-02-10 16:47:36 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:36 +0300 |
commit | 8611780b719073fe6c7e6536c71d61e20d57a5d6 (patch) | |
tree | 1284229a15a8eeeb4e9c81a6473f4e31d625cb52 /library/cpp | |
parent | cfadda92ca195da3ad68d721a58872a4f1ced696 (diff) | |
download | ydb-8611780b719073fe6c7e6536c71d61e20d57a5d6.tar.gz |
Restoring authorship annotation for <artkolesnikov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/http/server/response.h | 8 | ||||
-rw-r--r-- | library/cpp/string_utils/parse_size/parse_size.cpp | 20 | ||||
-rw-r--r-- | library/cpp/string_utils/parse_size/parse_size.h | 8 | ||||
-rw-r--r-- | library/cpp/string_utils/parse_size/parse_size_ut.cpp | 84 | ||||
-rw-r--r-- | library/cpp/string_utils/parse_size/ut/ya.make | 14 | ||||
-rw-r--r-- | library/cpp/string_utils/parse_size/ya.make | 18 |
6 files changed, 76 insertions, 76 deletions
diff --git a/library/cpp/http/server/response.h b/library/cpp/http/server/response.h index a75cb85605..65e941ba3d 100644 --- a/library/cpp/http/server/response.h +++ b/library/cpp/http/server/response.h @@ -64,10 +64,10 @@ public: return SetContent(content).SetContentType(contentType); } - HttpCodes HttpCode() const { - return Code; - } - + HttpCodes HttpCode() const { + return Code; + } + THttpResponse& SetHttpCode(HttpCodes code) { Code = code; return *this; diff --git a/library/cpp/string_utils/parse_size/parse_size.cpp b/library/cpp/string_utils/parse_size/parse_size.cpp index 39188d560b..57c4c9c3a9 100644 --- a/library/cpp/string_utils/parse_size/parse_size.cpp +++ b/library/cpp/string_utils/parse_size/parse_size.cpp @@ -1,10 +1,10 @@ -#include "parse_size.h" - -#include <util/generic/yexception.h> -#include <util/generic/ylimits.h> +#include "parse_size.h" + +#include <util/generic/yexception.h> +#include <util/generic/ylimits.h> #include <util/string/cast.h> #include <util/stream/output.h> - + namespace { enum ESuffixShifts { ESS_KILO_BYTES = 10, @@ -64,16 +64,16 @@ namespace NSize { } else { return value; } - } - + } + TSize FromKiloBytes(ui64 value) { return TSize(ShiftValue(value, ESS_KILO_BYTES)); } - + TSize FromMegaBytes(ui64 value) { return TSize(ShiftValue(value, ESS_MEGA_BYTES)); - } - + } + TSize FromGigaBytes(ui64 value) { return TSize(ShiftValue(value, ESS_GIGA_BYTES)); } diff --git a/library/cpp/string_utils/parse_size/parse_size.h b/library/cpp/string_utils/parse_size/parse_size.h index ad235ef02f..6ce20ca8d4 100644 --- a/library/cpp/string_utils/parse_size/parse_size.h +++ b/library/cpp/string_utils/parse_size/parse_size.h @@ -1,7 +1,7 @@ -#pragma once - -#include <util/generic/strbuf.h> - +#pragma once + +#include <util/generic/strbuf.h> + namespace NSize { ui64 ParseSize(TStringBuf size); diff --git a/library/cpp/string_utils/parse_size/parse_size_ut.cpp b/library/cpp/string_utils/parse_size/parse_size_ut.cpp index 8fff4f56b2..a30b9e77be 100644 --- a/library/cpp/string_utils/parse_size/parse_size_ut.cpp +++ b/library/cpp/string_utils/parse_size/parse_size_ut.cpp @@ -1,48 +1,48 @@ -#include "parse_size.h" - +#include "parse_size.h" + #include <library/cpp/testing/unittest/registar.h> - + using namespace NSize; -class TParseSizeTest: public TTestBase { - UNIT_TEST_SUITE(TParseSizeTest); - - UNIT_TEST(TestPlain); - UNIT_TEST(TestKiloBytes); - UNIT_TEST(TestMegaBytes); - UNIT_TEST(TestGigaBytes); - UNIT_TEST(TestTeraBytes); +class TParseSizeTest: public TTestBase { + UNIT_TEST_SUITE(TParseSizeTest); + + UNIT_TEST(TestPlain); + UNIT_TEST(TestKiloBytes); + UNIT_TEST(TestMegaBytes); + UNIT_TEST(TestGigaBytes); + UNIT_TEST(TestTeraBytes); UNIT_TEST(TestOverflow); UNIT_TEST(TestStaticCreators); UNIT_TEST(TestToString); - - UNIT_TEST_SUITE_END(); - -private: - void TestPlain() { - UNIT_ASSERT(ParseSize("1024") == 1024); - } - - void TestKiloBytes() { - UNIT_ASSERT(ParseSize("10K") == 1024 * 10); - UNIT_ASSERT(ParseSize("10k") == 1024 * 10); - } - - void TestMegaBytes() { - UNIT_ASSERT(ParseSize("10M") == 1024 * 1024 * 10); - UNIT_ASSERT(ParseSize("10m") == 1024 * 1024 * 10); - } - - void TestGigaBytes() { - UNIT_ASSERT(ParseSize("10G") == 1024ul * 1024ul * 1024ul * 10ul); - UNIT_ASSERT(ParseSize("10g") == 1024ul * 1024ul * 1024ul * 10ul); - } - - void TestTeraBytes() { - UNIT_ASSERT(ParseSize("10T") == 1024ul * 1024ul * 1024ul * 1024ul * 10ul); - UNIT_ASSERT(ParseSize("10t") == 1024ul * 1024ul * 1024ul * 1024ul * 10ul); - } - + + UNIT_TEST_SUITE_END(); + +private: + void TestPlain() { + UNIT_ASSERT(ParseSize("1024") == 1024); + } + + void TestKiloBytes() { + UNIT_ASSERT(ParseSize("10K") == 1024 * 10); + UNIT_ASSERT(ParseSize("10k") == 1024 * 10); + } + + void TestMegaBytes() { + UNIT_ASSERT(ParseSize("10M") == 1024 * 1024 * 10); + UNIT_ASSERT(ParseSize("10m") == 1024 * 1024 * 10); + } + + void TestGigaBytes() { + UNIT_ASSERT(ParseSize("10G") == 1024ul * 1024ul * 1024ul * 10ul); + UNIT_ASSERT(ParseSize("10g") == 1024ul * 1024ul * 1024ul * 10ul); + } + + void TestTeraBytes() { + UNIT_ASSERT(ParseSize("10T") == 1024ul * 1024ul * 1024ul * 1024ul * 10ul); + UNIT_ASSERT(ParseSize("10t") == 1024ul * 1024ul * 1024ul * 1024ul * 10ul); + } + void TestStaticCreators() { UNIT_ASSERT_EQUAL(FromKiloBytes(10), 1024ul * 10ul); UNIT_ASSERT_EQUAL(FromMegaBytes(10), 1024ul * 1024ul * 10ul); @@ -58,6 +58,6 @@ private: void TestToString() { UNIT_ASSERT_VALUES_EQUAL(ToString(FromKiloBytes(1)), TString("1024")); } -}; - -UNIT_TEST_SUITE_REGISTRATION(TParseSizeTest); +}; + +UNIT_TEST_SUITE_REGISTRATION(TParseSizeTest); diff --git a/library/cpp/string_utils/parse_size/ut/ya.make b/library/cpp/string_utils/parse_size/ut/ya.make index da19cf025b..9b9e9f111e 100644 --- a/library/cpp/string_utils/parse_size/ut/ya.make +++ b/library/cpp/string_utils/parse_size/ut/ya.make @@ -1,9 +1,9 @@ UNITTEST_FOR(library/cpp/string_utils/parse_size) - + OWNER(g:images-robot) - -SRCS( - parse_size_ut.cpp -) - -END() + +SRCS( + parse_size_ut.cpp +) + +END() diff --git a/library/cpp/string_utils/parse_size/ya.make b/library/cpp/string_utils/parse_size/ya.make index 4a62abcac2..e003f15761 100644 --- a/library/cpp/string_utils/parse_size/ya.make +++ b/library/cpp/string_utils/parse_size/ya.make @@ -1,10 +1,10 @@ -LIBRARY() - +LIBRARY() + OWNER(g:images-robot) - -SRCS( - parse_size.cpp - parse_size.h -) - -END() + +SRCS( + parse_size.cpp + parse_size.h +) + +END() |