diff options
author | Ruslan Kovalev <ruslan.a.kovalev@gmail.com> | 2022-02-10 16:46:44 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:44 +0300 |
commit | 59e19371de37995fcb36beb16cd6ec030af960bc (patch) | |
tree | fa68e36093ebff8b805462e9e6d331fe9d348214 /library/cpp/blockcodecs | |
parent | 89db6fe2fe2c32d2a832ddfeb04e8d078e301084 (diff) | |
download | ydb-59e19371de37995fcb36beb16cd6ec030af960bc.tar.gz |
Restoring authorship annotation for Ruslan Kovalev <ruslan.a.kovalev@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/blockcodecs')
-rw-r--r-- | library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp | 8 | ||||
-rw-r--r-- | library/cpp/blockcodecs/codecs_ut.cpp | 36 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/codecs.cpp | 2 | ||||
-rw-r--r-- | library/cpp/blockcodecs/core/common.h | 16 |
4 files changed, 31 insertions, 31 deletions
diff --git a/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp b/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp index 042f031679..a5c63b9be4 100644 --- a/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp +++ b/library/cpp/blockcodecs/codecs/legacy_zstd06/legacy_zstd06.cpp @@ -2,14 +2,14 @@ #include <library/cpp/blockcodecs/core/common.h> #include <library/cpp/blockcodecs/core/register.h> -#include <contrib/libs/zstd06/common/zstd.h> -#include <contrib/libs/zstd06/common/zstd_static.h> +#include <contrib/libs/zstd06/common/zstd.h> +#include <contrib/libs/zstd06/common/zstd_static.h> using namespace NBlockCodecs; namespace { - struct TZStd06Codec: public TAddLengthCodec<TZStd06Codec> { - inline TZStd06Codec(unsigned level) + struct TZStd06Codec: public TAddLengthCodec<TZStd06Codec> { + inline TZStd06Codec(unsigned level) : Level(level) , MyName(TStringBuf("zstd06_") + ToString(Level)) { diff --git a/library/cpp/blockcodecs/codecs_ut.cpp b/library/cpp/blockcodecs/codecs_ut.cpp index bfe5a23690..54c1ce376f 100644 --- a/library/cpp/blockcodecs/codecs_ut.cpp +++ b/library/cpp/blockcodecs/codecs_ut.cpp @@ -10,22 +10,22 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) { using namespace NBlockCodecs; - TBuffer Buffer(TStringBuf b) { - TBuffer bb; + TBuffer Buffer(TStringBuf b) { + TBuffer bb; bb.Assign(b.data(), b.size()); - return bb; - } - + return bb; + } + void TestAllAtOnce(size_t n, size_t m) { TVector<TBuffer> datas; datas.emplace_back(); - datas.push_back(Buffer("na gorshke sidel korol")); - datas.push_back(Buffer(TStringBuf("", 1))); - datas.push_back(Buffer(" ")); - datas.push_back(Buffer(" ")); - datas.push_back(Buffer(" ")); - datas.push_back(Buffer(" ")); + datas.push_back(Buffer("na gorshke sidel korol")); + datas.push_back(Buffer(TStringBuf("", 1))); + datas.push_back(Buffer(" ")); + datas.push_back(Buffer(" ")); + datas.push_back(Buffer(" ")); + datas.push_back(Buffer(" ")); { TStringStream data; @@ -49,15 +49,15 @@ Y_UNIT_TEST_SUITE(TBlockCodecsTest) { } for (size_t j = 0; j < datas.size(); ++j) { - const TBuffer& data = datas[j]; + const TBuffer& data = datas[j]; TString res; - + try { - TBuffer e, d; - c->Encode(data, e); - c->Decode(e, d); - d.AsString(res); - UNIT_ASSERT_EQUAL(NBlockCodecs::TData(res), NBlockCodecs::TData(data)); + TBuffer e, d; + c->Encode(data, e); + c->Decode(e, d); + d.AsString(res); + UNIT_ASSERT_EQUAL(NBlockCodecs::TData(res), NBlockCodecs::TData(data)); } catch (...) { Cerr << c->Name() << "(" << res.Quote() << ")(" << TString{NBlockCodecs::TData(data)}.Quote() << ")" << Endl; diff --git a/library/cpp/blockcodecs/core/codecs.cpp b/library/cpp/blockcodecs/core/codecs.cpp index 21506e812b..3df2ca698e 100644 --- a/library/cpp/blockcodecs/core/codecs.cpp +++ b/library/cpp/blockcodecs/core/codecs.cpp @@ -1,5 +1,5 @@ #include "codecs.h" -#include "common.h" +#include "common.h" #include "register.h" #include <util/ysaveload.h> diff --git a/library/cpp/blockcodecs/core/common.h b/library/cpp/blockcodecs/core/common.h index f05df4d334..cd8e5899dd 100644 --- a/library/cpp/blockcodecs/core/common.h +++ b/library/cpp/blockcodecs/core/common.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "codecs.h" @@ -17,7 +17,7 @@ #include <util/generic/algorithm.h> #include <util/generic/mem_copy.h> -namespace NBlockCodecs { +namespace NBlockCodecs { struct TDecompressError: public TDataError { TDecompressError(int code) { *this << "cannot decompress (errcode " << code << ")"; @@ -26,14 +26,14 @@ namespace NBlockCodecs { TDecompressError(size_t exp, size_t real) { *this << "broken input (expected len: " << exp << ", got: " << real << ")"; } - }; - + }; + struct TCompressError: public TDataError { TCompressError(int code) { *this << "cannot compress (errcode " << code << ")"; } - }; - + }; + struct TNullCodec: public ICodec { size_t DecompressedLength(const TData& in) const override { return in.size(); @@ -92,8 +92,8 @@ namespace NBlockCodecs { const auto len = ReadUnaligned<ui64>(in.data()); if (!len) - return 0; - + return 0; + Base()->DoDecompress(TData(in).Skip(sizeof(len)), out, len); return len; } |