diff options
| author | Oleg Sidorkin <[email protected]> | 2022-02-10 16:49:36 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:36 +0300 | 
| commit | f8f6804a3e352897afabc93afcb32081e3fca601 (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/system | |
| parent | 5ce74d4fee2d42a4b86efc02dfdc704d458760e1 (diff) | |
Restoring authorship annotation for Oleg Sidorkin <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/system')
| -rw-r--r-- | util/system/compat.h | 2 | ||||
| -rw-r--r-- | util/system/filemap.cpp | 14 | ||||
| -rw-r--r-- | util/system/filemap.h | 10 | ||||
| -rw-r--r-- | util/system/filemap_ut.cpp | 70 | 
4 files changed, 48 insertions, 48 deletions
diff --git a/util/system/compat.h b/util/system/compat.h index e7394d2cfff..c53dbcca178 100644 --- a/util/system/compat.h +++ b/util/system/compat.h @@ -4,7 +4,7 @@  #include <cstdarg> -#include <csignal>  +#include <csignal>  #if defined(_unix_)      #include <unistd.h> diff --git a/util/system/filemap.cpp b/util/system/filemap.cpp index b64e2d53148..7454a4cb948 100644 --- a/util/system/filemap.cpp +++ b/util/system/filemap.cpp @@ -214,10 +214,10 @@ public:              ;      } -    inline bool IsWritable() const noexcept {  +    inline bool IsWritable() const noexcept {          return (Mode_ & oRdWr || Mode_ & oCopyOnWr); -    }  -  +    } +      inline TMapResult Map(i64 offset, size_t size) {          assert(File_.IsOpen()); @@ -427,10 +427,10 @@ bool TMemoryMap::IsOpen() const noexcept {      return Impl_->IsOpen();  } -bool TMemoryMap::IsWritable() const noexcept {  -    return Impl_->IsWritable();  -}  -  +bool TMemoryMap::IsWritable() const noexcept { +    return Impl_->IsWritable(); +} +  TMemoryMap::EOpenMode TMemoryMap::GetMode() const noexcept {      return Impl_->GetMode();  } diff --git a/util/system/filemap.h b/util/system/filemap.h index 8be30c0a71a..11be64bff47 100644 --- a/util/system/filemap.h +++ b/util/system/filemap.h @@ -88,7 +88,7 @@ public:      i64 Length() const noexcept;      bool IsOpen() const noexcept; -    bool IsWritable() const noexcept;  +    bool IsWritable() const noexcept;      EOpenMode GetMode() const noexcept;      TFile GetFile() const noexcept; @@ -146,10 +146,10 @@ public:          return Map_.IsOpen();      } -    inline bool IsWritable() const noexcept {  -        return Map_.IsWritable();  -    }  -  +    inline bool IsWritable() const noexcept { +        return Map_.IsWritable(); +    } +      EOpenMode GetMode() const noexcept {          return Map_.GetMode();      } diff --git a/util/system/filemap_ut.cpp b/util/system/filemap_ut.cpp index 91ab5026b80..73f109dc880 100644 --- a/util/system/filemap_ut.cpp +++ b/util/system/filemap_ut.cpp @@ -317,43 +317,43 @@ Y_UNIT_TEST_SUITE(TFileMapTest) {          }          NFs::Remove(FileName_);      } -  +      Y_UNIT_TEST(TestMemoryMapIsWritable) { -        TFile file(FileName_, CreateAlways | WrOnly);  -        file.Close();  -  -        {  -            TMemoryMap mappedMem(FileName_, TMemoryMap::oRdOnly);  -            UNIT_ASSERT(!mappedMem.IsWritable());  -        }  -        {  -            TMemoryMap mappedMem(FileName_, TMemoryMap::oRdWr);  -            UNIT_ASSERT(mappedMem.IsWritable());  -        }  +        TFile file(FileName_, CreateAlways | WrOnly); +        file.Close(); + +        { +            TMemoryMap mappedMem(FileName_, TMemoryMap::oRdOnly); +            UNIT_ASSERT(!mappedMem.IsWritable()); +        } +        { +            TMemoryMap mappedMem(FileName_, TMemoryMap::oRdWr); +            UNIT_ASSERT(mappedMem.IsWritable()); +        }          NFs::Remove(FileName_); -    }  -  +    } +      Y_UNIT_TEST(TestFileMapIsWritable) { -        TFile file(FileName_, CreateAlways | WrOnly);  -        file.Close();  -        {  -            TMemoryMap mappedMem(FileName_, TMemoryMap::oRdOnly);  -            TFileMap fileMap(mappedMem);  -            UNIT_ASSERT(!fileMap.IsWritable());  -        }  -        {  -            TMemoryMap mappedMem(FileName_, TMemoryMap::oRdWr);  -            TFileMap fileMap(mappedMem);  -            UNIT_ASSERT(fileMap.IsWritable());  -        }  -        {  -            TFileMap fileMap(FileName_, TFileMap::oRdOnly);  -            UNIT_ASSERT(!fileMap.IsWritable());  -        }  -        {  -            TFileMap fileMap(FileName_, TFileMap::oRdWr);  -            UNIT_ASSERT(fileMap.IsWritable());  -        }  +        TFile file(FileName_, CreateAlways | WrOnly); +        file.Close(); +        { +            TMemoryMap mappedMem(FileName_, TMemoryMap::oRdOnly); +            TFileMap fileMap(mappedMem); +            UNIT_ASSERT(!fileMap.IsWritable()); +        } +        { +            TMemoryMap mappedMem(FileName_, TMemoryMap::oRdWr); +            TFileMap fileMap(mappedMem); +            UNIT_ASSERT(fileMap.IsWritable()); +        } +        { +            TFileMap fileMap(FileName_, TFileMap::oRdOnly); +            UNIT_ASSERT(!fileMap.IsWritable()); +        } +        { +            TFileMap fileMap(FileName_, TFileMap::oRdWr); +            UNIT_ASSERT(fileMap.IsWritable()); +        }          NFs::Remove(FileName_); -    }  +    }  };  | 
