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

Method TestBrokenPipe

util/network/socket_ut.cpp:145–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143};
144
145void TSockTest::TestBrokenPipe() {
146 TTempEnableSigPipe guard;
147
148 SOCKET socks[2];
149
150 int ret = SocketPair(socks);
151 UNIT_ASSERT_VALUES_EQUAL(ret, 0);
152
153 TSocket sender(socks[0]);
154 TSocket receiver(socks[1]);
155 receiver.ShutDown(SHUT_RDWR);
156 int sent = sender.Send("FOO", 3);
157 UNIT_ASSERT(sent < 0);
158
159 IOutputStream::TPart parts[] = {
160 {"foo", 3},
161 {"bar", 3},
162 };
163 sent = sender.SendV(parts, 2);
164 UNIT_ASSERT(sent < 0);
165}
166
167void TSockTest::TestClose() {
168 SOCKET socks[2];

Callers

nothing calls this directly

Calls 4

SocketPairFunction · 0.70
ShutDownMethod · 0.45
SendMethod · 0.45
SendVMethod · 0.45

Tested by

no test coverage detected