MCPcopy Create free account
hub / github.com/catboost/catboost / Y_UNIT_TEST

Function Y_UNIT_TEST

library/cpp/http/io/stream_ut_medium.cpp:6–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5Y_UNIT_TEST_SUITE(THttpTestMedium) {
6 Y_UNIT_TEST(TestCodings2) {
7 TStringBuf data = "aaaaaaaaaaaaaaaaaaaaaaa";
8
9 for (auto codec : SupportedCodings()) {
10 if (codec == TStringBuf("z-zlib-0")) {
11 continue;
12 }
13
14 if (codec == TStringBuf("z-null")) {
15 continue;
16 }
17
18 TString s;
19
20 {
21 TStringOutput so(s);
22 THttpOutput ho(&so);
23 TBufferedOutput bo(&ho, 10000);
24
25 bo << "HTTP/1.1 200 Ok\r\n"
26 << "Connection: close\r\n"
27 << "Content-Encoding: " << codec << "\r\n\r\n";
28
29 for (size_t i = 0; i < 100; ++i) {
30 bo << data;
31 }
32 }
33
34 try {
35 UNIT_ASSERT(s.size() > 10);
36 UNIT_ASSERT(s.find(data) == TString::npos);
37 } catch (...) {
38 Cerr << codec << " " << s << Endl;
39
40 throw;
41 }
42
43 {
44 TStringInput si(s);
45 THttpInput hi(&si);
46
47 auto res = hi.ReadAll();
48
49 UNIT_ASSERT(res.find(data) == 0);
50 }
51 }
52 }
53
54} // THttpTestMedium suite

Callers

nothing calls this directly

Calls 4

SupportedCodingsFunction · 0.85
ReadAllMethod · 0.80
sizeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected