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

Method TestRawRead

util/system/file_ut.cpp:242–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242void TFileTest::TestRawRead() {
243 TTempFile tmp("tmp");
244
245 {
246 TFile file(tmp.Name(), OpenAlways | WrOnly);
247 file.Write("1234567", 7);
248 file.Flush();
249 file.Close();
250 }
251
252 {
253 TFile file(tmp.Name(), OpenExisting | RdOnly);
254 char buf[7];
255 i32 reallyRead = file.RawRead(buf, 7);
256 Y_ENSURE(0 <= reallyRead && reallyRead <= 7);
257 Y_ENSURE(TStringBuf(buf, reallyRead) == TStringBuf("1234567").Head(reallyRead));
258 }
259}
260
261void TFileTest::TestRead() {
262 TTempFile tmp("tmp");

Callers

nothing calls this directly

Calls 6

NameMethod · 0.45
WriteMethod · 0.45
FlushMethod · 0.45
CloseMethod · 0.45
RawReadMethod · 0.45
HeadMethod · 0.45

Tested by

no test coverage detected