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

Method TestRead

util/system/file_ut.cpp:261–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261void TFileTest::TestRead() {
262 TTempFile tmp("tmp");
263
264 {
265 TFile file(tmp.Name(), OpenAlways | WrOnly);
266 file.Write("1234567", 7);
267 file.Flush();
268 file.Close();
269 }
270
271 {
272 TFile file(tmp.Name(), OpenExisting | RdOnly);
273 char buf[7];
274 Y_ENSURE(file.Read(buf, 7) == 7);
275 Y_ENSURE(TStringBuf(buf, 7) == "1234567");
276
277 memset(buf, 0, sizeof(buf));
278 file.Seek(0, sSet);
279 Y_ENSURE(file.Read(buf, 123) == 7);
280 Y_ENSURE(TStringBuf(buf, 7) == "1234567");
281 }
282}
283
284void TFileTest::TestRawPread() {
285 TTempFile tmp("tmp");

Callers

nothing calls this directly

Calls 6

NameMethod · 0.45
WriteMethod · 0.45
FlushMethod · 0.45
CloseMethod · 0.45
ReadMethod · 0.45
SeekMethod · 0.45

Tested by

no test coverage detected