aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/codecs/ut
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:25 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:25 +0300
commit344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/codecs/ut
parent706b83ed7de5a473436620367af31fc0ceecde07 (diff)
downloadydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/codecs/ut')
-rw-r--r--library/cpp/codecs/ut/codecs_ut.cpp76
-rw-r--r--library/cpp/codecs/ut/float_huffman_ut.cpp6
2 files changed, 41 insertions, 41 deletions
diff --git a/library/cpp/codecs/ut/codecs_ut.cpp b/library/cpp/codecs/ut/codecs_ut.cpp
index 581650a65b..caf6089aef 100644
--- a/library/cpp/codecs/ut/codecs_ut.cpp
+++ b/library/cpp/codecs/ut/codecs_ut.cpp
@@ -872,8 +872,8 @@ class TCodecsTest: public TTestBase {
UNIT_TEST_SUITE_END();
private:
- TString PrintError(TStringBuf learn, TStringBuf test, TStringBuf codec, ui32 i) {
- TString s;
+ TString PrintError(TStringBuf learn, TStringBuf test, TStringBuf codec, ui32 i) {
+ TString s;
TStringOutput sout(s);
sout << codec << ": " << i << ", "
<< "\n";
@@ -882,7 +882,7 @@ private:
sout << HexEncode(test.data(), test.size()); //NEscJ::EscapeJ<true>(test, sout);
if (s.Size() > 1536) {
- TString res = s.substr(0, 512);
+ TString res = s.substr(0, 512);
res.append("...<skipped ").append(ToString(s.size() - 1024)).append(">...");
res.append(s.substr(s.size() - 512));
}
@@ -895,13 +895,13 @@ private:
}
template <typename TCodec, bool testsaveload>
- void TestCodec(const TVector<TBuffer>& inlearn = TVector<TBuffer>(), const TVector<TBuffer>& in = TVector<TBuffer>(), NCodecs::TCodecPtr c = new TCodec) {
+ void TestCodec(const TVector<TBuffer>& inlearn = TVector<TBuffer>(), const TVector<TBuffer>& in = TVector<TBuffer>(), NCodecs::TCodecPtr c = new TCodec) {
using namespace NCodecs;
TBuffer buff;
{
- TVector<TBuffer> out;
+ TVector<TBuffer> out;
c->Learn(inlearn.begin(), inlearn.end());
@@ -973,7 +973,7 @@ private:
void TestDelta() {
using namespace NCodecs;
- TVector<TBuffer> d;
+ TVector<TBuffer> d;
// 1. common case
d.emplace_back();
@@ -1016,7 +1016,7 @@ private:
void TestPFor() {
using namespace NCodecs;
{
- TVector<TBuffer> d;
+ TVector<TBuffer> d;
d.emplace_back();
AppendTo(d.back(), -1LL);
AppendTo(d.back(), -1LL);
@@ -1054,7 +1054,7 @@ private:
TestCodec<TPForCodec<ui64, true>, true>(d);
}
{
- TVector<TBuffer> d;
+ TVector<TBuffer> d;
d.emplace_back();
AppendTo(d.back(), -1);
AppendTo(d.back(), -1);
@@ -1084,7 +1084,7 @@ private:
TestCodec<TPForCodec<ui32, true>, false>(d);
}
{
- TVector<TBuffer> d;
+ TVector<TBuffer> d;
d.emplace_back();
for (auto& textValue : TextValues) {
AppendTo(d.back(), (ui32)strlen(textValue));
@@ -1094,7 +1094,7 @@ private:
TestCodec<TPForCodec<ui32, true>, false>(d);
}
{
- TVector<TBuffer> d;
+ TVector<TBuffer> d;
d.emplace_back();
for (auto& textValue : TextValues) {
AppendTo(d.back(), (ui64)strlen(textValue));
@@ -1109,7 +1109,7 @@ private:
void DoTestSimpleCodec() {
using namespace NCodecs;
{
- TVector<TBuffer> learn;
+ TVector<TBuffer> learn;
for (auto& textValue : TextValues) {
learn.emplace_back(textValue, strlen(textValue));
@@ -1122,11 +1122,11 @@ private:
}
{
- TVector<TBuffer> learn;
+ TVector<TBuffer> learn;
learn.emplace_back();
learn.back().Append('a');
- TVector<TBuffer> test;
+ TVector<TBuffer> test;
test.emplace_back();
for (ui32 i = 0; i < 256; ++i) {
test.back().Append((ui8)i);
@@ -1136,7 +1136,7 @@ private:
}
{
- TVector<TBuffer> learn;
+ TVector<TBuffer> learn;
learn.emplace_back();
for (ui32 i = 0; i < 256; ++i) {
for (ui32 j = 0; j < i; ++j) {
@@ -1144,7 +1144,7 @@ private:
}
}
- TVector<TBuffer> test;
+ TVector<TBuffer> test;
test.emplace_back();
for (ui32 i = 0; i < 256; ++i) {
test.back().Append((ui8)i);
@@ -1154,7 +1154,7 @@ private:
}
{
- TVector<TBuffer> learn;
+ TVector<TBuffer> learn;
learn.emplace_back();
for (ui32 i = 0; i < 128; ++i) {
for (ui32 j = 0; j < i; ++j) {
@@ -1162,7 +1162,7 @@ private:
}
}
- TVector<TBuffer> test;
+ TVector<TBuffer> test;
test.emplace_back();
for (ui32 i = 128; i < 256; ++i) {
test.back().Append((ui8)i);
@@ -1197,13 +1197,13 @@ private:
void TestHuffmanLearnByFreqs() {
using namespace NCodecs;
- TVector<TBuffer> data;
+ TVector<TBuffer> data;
for (auto& textValue : TextValues) {
data.emplace_back(textValue, strlen(textValue));
}
- TVector<TBuffer> outLearn;
+ TVector<TBuffer> outLearn;
{
THuffmanCodec codec;
@@ -1215,7 +1215,7 @@ private:
}
}
- TVector<TBuffer> outLearnByFreqs;
+ TVector<TBuffer> outLearnByFreqs;
{
THuffmanCodec codec;
@@ -1251,30 +1251,30 @@ private:
void TestSolar() {
using namespace NCodecs;
{
- TVector<TBuffer> learn;
+ TVector<TBuffer> learn;
for (auto& textValue : TextValues) {
learn.emplace_back(textValue, strlen(textValue));
}
- TestCodec<TSolarCodec, true>(learn, TVector<TBuffer>(), new TSolarCodec(512, 8));
- TestCodec<TAdaptiveSolarCodec, false>(learn, TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8));
- TestCodec<TAdaptiveSolarCodec, true>(learn, TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8));
- TestCodec<TSolarCodecShortInt, true>(learn, TVector<TBuffer>(), new TSolarCodecShortInt(512, 8));
+ TestCodec<TSolarCodec, true>(learn, TVector<TBuffer>(), new TSolarCodec(512, 8));
+ TestCodec<TAdaptiveSolarCodec, false>(learn, TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8));
+ TestCodec<TAdaptiveSolarCodec, true>(learn, TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8));
+ TestCodec<TSolarCodecShortInt, true>(learn, TVector<TBuffer>(), new TSolarCodecShortInt(512, 8));
}
{
- TestCodec<TSolarCodec, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TSolarCodec(512, 8));
- TestCodec<TAdaptiveSolarCodec, false>(TVector<TBuffer>(), TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8));
- TestCodec<TAdaptiveSolarCodec, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8));
- TestCodec<TSolarCodecShortInt, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TSolarCodecShortInt(512, 8));
+ TestCodec<TSolarCodec, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TSolarCodec(512, 8));
+ TestCodec<TAdaptiveSolarCodec, false>(TVector<TBuffer>(), TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8));
+ TestCodec<TAdaptiveSolarCodec, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TAdaptiveSolarCodec(512, 8));
+ TestCodec<TSolarCodecShortInt, true>(TVector<TBuffer>(), TVector<TBuffer>(), new TSolarCodecShortInt(512, 8));
}
{
- TVector<TBuffer> learn;
+ TVector<TBuffer> learn;
learn.emplace_back();
learn.back().Append('a');
- TVector<TBuffer> test;
+ TVector<TBuffer> test;
test.emplace_back();
for (ui32 i = 0; i < 256; ++i) {
test.back().Append((ui8)i);
@@ -1287,7 +1287,7 @@ private:
}
{
- TVector<TBuffer> learn;
+ TVector<TBuffer> learn;
learn.emplace_back();
for (ui32 i = 0; i < 256; ++i) {
for (ui32 j = 0; j < i; ++j) {
@@ -1295,7 +1295,7 @@ private:
}
}
- TVector<TBuffer> test;
+ TVector<TBuffer> test;
test.emplace_back();
for (ui32 i = 0; i < 256; ++i) {
test.back().Append((ui8)i);
@@ -1311,7 +1311,7 @@ private:
void TestPipeline() {
using namespace NCodecs;
{
- TVector<TBuffer> learn;
+ TVector<TBuffer> learn;
learn.emplace_back();
for (ui32 i = 0; i < 256; ++i) {
for (i32 j = i; j >= 0; --j) {
@@ -1319,7 +1319,7 @@ private:
}
}
- TVector<TBuffer> test;
+ TVector<TBuffer> test;
test.emplace_back();
for (ui32 i = 0; i < 256; ++i) {
test.back().Append((ui8)i);
@@ -1329,7 +1329,7 @@ private:
new TPipelineCodec(new TSolarCodec(512, 8), new TSolarCodec(512, 8), new THuffmanCodec));
}
{
- TVector<TBuffer> d;
+ TVector<TBuffer> d;
d.emplace_back();
for (ui32 i = 0; i < 256; ++i) {
for (i32 j = i; j >= 0; --j) {
@@ -1337,14 +1337,14 @@ private:
}
}
- TestCodec<TPipelineCodec, false>(d, TVector<TBuffer>(),
+ TestCodec<TPipelineCodec, false>(d, TVector<TBuffer>(),
new TPipelineCodec(new TDeltaCodec<ui32, false>, new TPForCodec<ui32>));
}
}
void TestRegistry() {
using namespace NCodecs;
- TVector<TString> vs = ICodec::GetCodecsList();
+ TVector<TString> vs = ICodec::GetCodecsList();
for (const auto& v : vs) {
TCodecPtr p = ICodec::GetInstance(v);
if (v == "none") {
diff --git a/library/cpp/codecs/ut/float_huffman_ut.cpp b/library/cpp/codecs/ut/float_huffman_ut.cpp
index d9bda02850..3156fb1f46 100644
--- a/library/cpp/codecs/ut/float_huffman_ut.cpp
+++ b/library/cpp/codecs/ut/float_huffman_ut.cpp
@@ -142,7 +142,7 @@ Y_UNIT_TEST_SUITE(FloatHuffmanTest) {
}
// Helper for dumping compressed values
- void PrintCompressed(const TVector<ui8>& codedFactors) {
+ void PrintCompressed(const TVector<ui8>& codedFactors) {
for (size_t i = 0; i < codedFactors.size(); ++i) {
if (i % 0x10 == 0)
Cerr << Endl;
@@ -152,7 +152,7 @@ Y_UNIT_TEST_SUITE(FloatHuffmanTest) {
}
// Helper for dumping decompressed values
- void PrintDecompressed(const TVector<float>& factors) {
+ void PrintDecompressed(const TVector<float>& factors) {
TStringStream result;
TStringStream line;
@@ -220,7 +220,7 @@ Y_UNIT_TEST_SUITE(FloatHuffmanTest) {
Y_UNIT_TEST(TestDecompressForgedData) {
// this coredumps without end-of-coded-stream check, see SEARCH-1156 for details
- TString brokenBase64Encoded =
+ TString brokenBase64Encoded =
"NLjYltUWs5pqnd3d3f05Li4OAwCAEqrP6mv06jDt7PiAUVu7Y+PiMpuZmdzeM"
"ArqOLxS2q4FKCII52dktcVs7y0zL+OKgeO9SOzEkFj7uPfFqqoCAAAAAADAtZ"
"mZ2fdmICAgANQXhi1WVRUAAAAAAAAGjvcWq6oKAAAAAAAAA8d7qe4rV3Nxcd3"