diff options
Diffstat (limited to 'test/syscalls/linux/msync.cc')
-rw-r--r-- | test/syscalls/linux/msync.cc | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/test/syscalls/linux/msync.cc b/test/syscalls/linux/msync.cc index 72d90dc78..0ddc621aa 100644 --- a/test/syscalls/linux/msync.cc +++ b/test/syscalls/linux/msync.cc @@ -43,13 +43,14 @@ class MsyncParameterizedTest : public ::testing::TestWithParam<MsyncTestParam> { protected: int msync_flags() const { return std::get<0>(GetParam()); } - PosixErrorOr<Mapping> GetMapping() const { return std::get<1>(GetParam())(); } + PosixErrorOr<Mapping> GetMapping() const { + auto rv = std::get<1>(GetParam())(); + return rv; + } }; -// All valid msync(2) flag combinations, not including MS_INVALIDATE. ("Linux -// permits a call to msync() that specifies neither [MS_SYNC or MS_ASYNC], with -// semantics that are (currently) equivalent to specifying MS_ASYNC." - -// msync(2)) +// All valid msync(2) flag combinations (not including MS_INVALIDATE, which +// gVisor doesn't implement). constexpr std::initializer_list<int> kMsyncFlags = {MS_SYNC, MS_ASYNC, 0}; // Returns functions that return mappings that should be successfully @@ -133,15 +134,6 @@ TEST_P(MsyncFullParamTest, UnalignedAddressFails) { SyscallFailsWithErrno(EINVAL)); } -TEST_P(MsyncFullParamTest, InvalidateUnlockedSucceeds) { - auto m = ASSERT_NO_ERRNO_AND_VALUE(GetMapping()); - EXPECT_THAT(msync(m.ptr(), m.len(), msync_flags() | MS_INVALIDATE), - SyscallSucceeds()); -} - -// The test for MS_INVALIDATE on mlocked pages is in mlock.cc since it requires -// probing for mlock support. - INSTANTIATE_TEST_CASE_P( All, MsyncFullParamTest, ::testing::Combine(::testing::ValuesIn(kMsyncFlags), |