diff options
author | Zach Koopmans <zkoopmans@google.com> | 2020-08-18 16:02:52 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-18 16:07:35 -0700 |
commit | f6d24904829d71574821cce5515c5777e0837aff (patch) | |
tree | 3966f19fa9b928aa727ba7e6cc9bd922a4ff082c | |
parent | 4184a7d5f189cfac4a7c9d7a1f0197d074e74e9b (diff) |
Fix return value in shm_test for opensource
Some machines return 128 + signal for failures. Accept that
as a valid result.
PiperOrigin-RevId: 327326113
-rw-r--r-- | test/syscalls/linux/shm.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/syscalls/linux/shm.cc b/test/syscalls/linux/shm.cc index c7fdbb924..d6e8b3e59 100644 --- a/test/syscalls/linux/shm.cc +++ b/test/syscalls/linux/shm.cc @@ -29,6 +29,8 @@ namespace testing { namespace { using ::testing::_; +using ::testing::AnyOf; +using ::testing::Eq; const uint64_t kAllocSize = kPageSize * 128ULL; @@ -394,7 +396,8 @@ TEST(ShmDeathTest, SegmentNotAccessibleAfterDetach) { }; EXPECT_THAT(InForkedProcess(rest), - IsPosixErrorOkAndHolds(W_EXITCODE(0, SIGSEGV))); + IsPosixErrorOkAndHolds(AnyOf(Eq(W_EXITCODE(0, SIGSEGV)), + Eq(W_EXITCODE(0, 128 + SIGSEGV))))); } TEST(ShmTest, RequestingSegmentSmallerThanSHMMINFails) { |