diff options
author | alexcrush <alexcrush@yandex-team.ru> | 2022-02-10 16:50:33 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:33 +0300 |
commit | 34f0683c2d7731f2f9f59966c12e602f405fa0d6 (patch) | |
tree | 9af7dd74efcfa3d8aa7b40bd757ad8f2d89f6902 /util/stream/zlib_ut.cpp | |
parent | a1d67d6a31f789aa011250c3edce5751c0cadad2 (diff) | |
download | ydb-34f0683c2d7731f2f9f59966c12e602f405fa0d6.tar.gz |
Restoring authorship annotation for <alexcrush@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream/zlib_ut.cpp')
-rw-r--r-- | util/stream/zlib_ut.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/util/stream/zlib_ut.cpp b/util/stream/zlib_ut.cpp index 2290b4a9de..b8a9e03dae 100644 --- a/util/stream/zlib_ut.cpp +++ b/util/stream/zlib_ut.cpp @@ -74,7 +74,7 @@ Y_UNIT_TEST_SUITE(TZLibTest) { UNIT_ASSERT_EQUAL(d.ReadAll(), DATA); } } - + Y_UNIT_TEST(Dictionary) { static constexpr TStringBuf data = "<html><body></body></html>"; static constexpr TStringBuf dict = "</<html><body>"; @@ -91,26 +91,26 @@ Y_UNIT_TEST_SUITE(TZLibTest) { } Y_UNIT_TEST(DecompressTwoStreams) { - // Check that Decompress(Compress(X) + Compress(Y)) == X + Y - TTempFile tmpFile(ZDATA); - { + // Check that Decompress(Compress(X) + Compress(Y)) == X + Y + TTempFile tmpFile(ZDATA); + { TUnbufferedFileOutput o(ZDATA); - TZLibCompress c1(&o, ZLib::ZLib); + TZLibCompress c1(&o, ZLib::ZLib); c1.Write(DATA.data(), DATA.size()); - c1.Finish(); - TZLibCompress c2(&o, ZLib::ZLib); + c1.Finish(); + TZLibCompress c2(&o, ZLib::ZLib); c2.Write(DATA2.data(), DATA2.size()); - c2.Finish(); - o.Finish(); - } - { + c2.Finish(); + o.Finish(); + } + { TUnbufferedFileInput i(ZDATA); - TZLibDecompress d(&i); - + TZLibDecompress d(&i); + UNIT_ASSERT_EQUAL(d.ReadAll(), DATA + DATA2); - } - } - + } + } + Y_UNIT_TEST(CompressionExceptionSegfault) { TVector<char> buf(512 * 1024); EntropyPool().Load(buf.data(), buf.size()); @@ -127,26 +127,26 @@ Y_UNIT_TEST_SUITE(TZLibTest) { } Y_UNIT_TEST(DecompressFirstOfTwoStreams) { - // Check that Decompress(Compress(X) + Compress(Y)) == X when single stream is allowed - TTempFile tmpFile(ZDATA); - { + // Check that Decompress(Compress(X) + Compress(Y)) == X when single stream is allowed + TTempFile tmpFile(ZDATA); + { TUnbufferedFileOutput o(ZDATA); - TZLibCompress c1(&o, ZLib::ZLib); + TZLibCompress c1(&o, ZLib::ZLib); c1.Write(DATA.data(), DATA.size()); - c1.Finish(); - TZLibCompress c2(&o, ZLib::ZLib); + c1.Finish(); + TZLibCompress c2(&o, ZLib::ZLib); c2.Write(DATA2.data(), DATA2.size()); - c2.Finish(); - o.Finish(); - } - { + c2.Finish(); + o.Finish(); + } + { TUnbufferedFileInput i(ZDATA); - TZLibDecompress d(&i); - d.SetAllowMultipleStreams(false); - + TZLibDecompress d(&i); + d.SetAllowMultipleStreams(false); + UNIT_ASSERT_EQUAL(d.ReadAll(), DATA); - } - } + } + } Y_UNIT_TEST(CompressFlush) { TString data = ""; |