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

Function Y_UNIT_TEST

util/system/file_ut.cpp:410–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408
409Y_UNIT_TEST_SUITE(TTestFileHandle) {
410 Y_UNIT_TEST(MoveAssignment) {
411 TTempFile tmp("tmp");
412 {
413 TFileHandle file1(tmp.Name(), OpenAlways | WrOnly);
414 file1.Write("1", 1);
415
416 TFileHandle file2;
417 file2 = std::move(file1);
418 Y_ENSURE(!file1.IsOpen());
419 Y_ENSURE(file2.IsOpen());
420
421 file2.Write("2", 1);
422 }
423
424 {
425 TFileHandle file(tmp.Name(), OpenExisting | RdOnly);
426 char buf[2];
427 Y_ENSURE(file.Read(buf, 2) == 2);
428 Y_ENSURE(TStringBuf(buf, 2) == "12");
429 }
430 }
431} // Y_UNIT_TEST_SUITE(TTestFileHandle)
432
433Y_UNIT_TEST_SUITE(TTestDecodeOpenMode) {

Callers

nothing calls this directly

Calls 6

DecodeOpenModeFunction · 0.85
moveFunction · 0.50
NameMethod · 0.45
WriteMethod · 0.45
IsOpenMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected