diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/stream/zlib_ut.cpp | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream/zlib_ut.cpp')
-rw-r--r-- | util/stream/zlib_ut.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/util/stream/zlib_ut.cpp b/util/stream/zlib_ut.cpp index 2290b4a9de..39e33035f4 100644 --- a/util/stream/zlib_ut.cpp +++ b/util/stream/zlib_ut.cpp @@ -1,14 +1,14 @@ -#include "zlib.h" - +#include "zlib.h" + #include <library/cpp/testing/unittest/registar.h> - -#include "file.h" -#include <util/system/tempfile.h> + +#include "file.h" +#include <util/system/tempfile.h> #include <util/random/entropy.h> #include <util/random/random.h> - -#define ZDATA "./zdata" - + +#define ZDATA "./zdata" + class TThrowingStream: public IOutputStream { public: TThrowingStream(int limit) @@ -54,25 +54,25 @@ private: Y_UNIT_TEST_SUITE(TZLibTest) { static const TString DATA = "8s7d5vc6s5vc67sa4c65ascx6asd4xcv76adsfxv76s"; static const TString DATA2 = "cn8wk2bd9vb3vdfif83g1ks94bfiovtwv"; - + Y_UNIT_TEST(Compress) { TUnbufferedFileOutput o(ZDATA); - TZLibCompress c(&o, ZLib::ZLib); - + TZLibCompress c(&o, ZLib::ZLib); + c.Write(DATA.data(), DATA.size()); - c.Finish(); - o.Finish(); - } - + c.Finish(); + o.Finish(); + } + Y_UNIT_TEST(Decompress) { - TTempFile tmpFile(ZDATA); - - { + TTempFile tmpFile(ZDATA); + + { TUnbufferedFileInput i(ZDATA); - TZLibDecompress d(&i); - + TZLibDecompress d(&i); + UNIT_ASSERT_EQUAL(d.ReadAll(), DATA); - } + } } Y_UNIT_TEST(Dictionary) { @@ -227,4 +227,4 @@ Y_UNIT_TEST_SUITE(TZLibTest) { } } } -} +} |