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

Method TestMemoryStream

util/stream/ios_ut.cpp:151–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void TStreamsTest::TestMemoryStream() {
152 char buf[1024];
153 TMemoryOutput mo(buf, sizeof(buf));
154 bool ehandled = false;
155
156 try {
157 for (size_t i = 0; i < sizeof(buf) + 1; ++i) {
158 mo.Write(i % 127);
159 }
160 } catch (...) {
161 ehandled = true;
162 }
163
164 UNIT_ASSERT_EQUAL(ehandled, true);
165
166 for (size_t i = 0; i < sizeof(buf); ++i) {
167 UNIT_ASSERT_EQUAL(buf[i], (char)(i % 127));
168 }
169}
170
171class TMyStringOutput: public IOutputStream {
172public:

Callers

nothing calls this directly

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected