diff options
author | ermolovd <ermolovd@yandex-team.ru> | 2022-02-10 16:47:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:53 +0300 |
commit | 2a4a975b112fa0fa138abc7457fe67e0e1e7fd02 (patch) | |
tree | c0748b5dcbade83af788c0abfa89c0383d6b779c /util/system/file_ut.cpp | |
parent | b91bcef7c99a119b0846479ef71bfab4beec72ca (diff) | |
download | ydb-2a4a975b112fa0fa138abc7457fe67e0e1e7fd02.tar.gz |
Restoring authorship annotation for <ermolovd@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/file_ut.cpp')
-rw-r--r-- | util/system/file_ut.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/util/system/file_ut.cpp b/util/system/file_ut.cpp index 07b2b7a96d..941e6a50f3 100644 --- a/util/system/file_ut.cpp +++ b/util/system/file_ut.cpp @@ -17,8 +17,8 @@ class TFileTest: public TTestBase { UNIT_TEST(TestLinkTo); UNIT_TEST(TestResize); UNIT_TEST(TestLocale); - UNIT_TEST(TestFlush); - UNIT_TEST(TestFlushSpecialFile); + UNIT_TEST(TestFlush); + UNIT_TEST(TestFlushSpecialFile); UNIT_TEST(TestRawRead); UNIT_TEST(TestRead); UNIT_TEST(TestRawPread); @@ -31,8 +31,8 @@ public: void TestOpenSync(); void TestRW(); void TestLocale(); - void TestFlush(); - void TestFlushSpecialFile(); + void TestFlush(); + void TestFlushSpecialFile(); void TestRawRead(); void TestRead(); void TestRawPread(); @@ -216,29 +216,29 @@ void TFileTest::TestLocale() { #endif } -void TFileTest::TestFlush() { - TTempFile tmp("tmp"); - - { - TFile f(tmp.Name(), OpenAlways | WrOnly); - f.Flush(); - f.FlushData(); - f.Close(); - - UNIT_ASSERT_EXCEPTION(f.Flush(), TFileError); - UNIT_ASSERT_EXCEPTION(f.FlushData(), TFileError); - } -} - -void TFileTest::TestFlushSpecialFile() { -#ifdef _unix_ - TFile devNull("/dev/null", WrOnly); - devNull.FlushData(); - devNull.Flush(); - devNull.Close(); -#endif -} - +void TFileTest::TestFlush() { + TTempFile tmp("tmp"); + + { + TFile f(tmp.Name(), OpenAlways | WrOnly); + f.Flush(); + f.FlushData(); + f.Close(); + + UNIT_ASSERT_EXCEPTION(f.Flush(), TFileError); + UNIT_ASSERT_EXCEPTION(f.FlushData(), TFileError); + } +} + +void TFileTest::TestFlushSpecialFile() { +#ifdef _unix_ + TFile devNull("/dev/null", WrOnly); + devNull.FlushData(); + devNull.Flush(); + devNull.Close(); +#endif +} + void TFileTest::TestRawRead() { TTempFile tmp("tmp"); |