aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/http/io/stream_ut_medium.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/http/io/stream_ut_medium.cpp
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/io/stream_ut_medium.cpp')
-rw-r--r--library/cpp/http/io/stream_ut_medium.cpp94
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 2c125eb21e..e70d47555d 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