diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/http/io/stream_ut_medium.cpp | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/http/io/stream_ut_medium.cpp')
-rw-r--r-- | library/cpp/http/io/stream_ut_medium.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/library/cpp/http/io/stream_ut_medium.cpp b/library/cpp/http/io/stream_ut_medium.cpp index e70d47555d..2c125eb21e 100644 --- a/library/cpp/http/io/stream_ut_medium.cpp +++ b/library/cpp/http/io/stream_ut_medium.cpp @@ -1,54 +1,54 @@ -#include "stream.h" +#include "stream.h" #include <library/cpp/testing/unittest/registar.h> -#include <util/stream/zlib.h> - +#include <util/stream/zlib.h> + Y_UNIT_TEST_SUITE(THttpTestMedium) { Y_UNIT_TEST(TestCodings2) { - TStringBuf data = "aaaaaaaaaaaaaaaaaaaaaaa"; - - for (auto codec : SupportedCodings()) { + TStringBuf data = "aaaaaaaaaaaaaaaaaaaaaaa"; + + for (auto codec : SupportedCodings()) { if (codec == TStringBuf("z-zlib-0")) { - continue; - } - + continue; + } + if (codec == TStringBuf("z-null")) { - continue; - } - - TString s; - - { - TStringOutput so(s); - THttpOutput ho(&so); - TBufferedOutput bo(&ho, 10000); - - bo << "HTTP/1.1 200 Ok\r\n" - << "Connection: close\r\n" - << "Content-Encoding: " << codec << "\r\n\r\n"; - - for (size_t i = 0; i < 100; ++i) { - bo << data; - } - } - - try { + continue; + } + + TString s; + + { + TStringOutput so(s); + THttpOutput ho(&so); + TBufferedOutput bo(&ho, 10000); + + bo << "HTTP/1.1 200 Ok\r\n" + << "Connection: close\r\n" + << "Content-Encoding: " << codec << "\r\n\r\n"; + + for (size_t i = 0; i < 100; ++i) { + bo << data; + } + } + + try { UNIT_ASSERT(s.size() > 10); - UNIT_ASSERT(s.find(data) == TString::npos); - } catch (...) { - Cerr << codec << " " << s << Endl; - - throw; - } - - { - TStringInput si(s); - THttpInput hi(&si); - - auto res = hi.ReadAll(); - - UNIT_ASSERT(res.find(data) == 0); - } - } - } - + UNIT_ASSERT(s.find(data) == TString::npos); + } catch (...) { + Cerr << codec << " " << s << Endl; + + throw; + } + + { + TStringInput si(s); + THttpInput hi(&si); + + auto res = hi.ReadAll(); + + UNIT_ASSERT(res.find(data) == 0); + } + } + } + } // THttpTestMedium suite |