From f6d24904829d71574821cce5515c5777e0837aff Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Tue, 18 Aug 2020 16:02:52 -0700 Subject: Fix return value in shm_test for opensource Some machines return 128 + signal for failures. Accept that as a valid result. PiperOrigin-RevId: 327326113 --- test/syscalls/linux/shm.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3