From da5c2ea6dc4ea01c667bff88aa37f5efb39b704a Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Tue, 18 Aug 2020 09:52:53 -0700 Subject: Fix return value for MMap Tests in OpenSource Some systems return 128 + errno instead of just errno, which is the case here. PiperOrigin-RevId: 327247836 --- test/syscalls/linux/mmap.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/syscalls') diff --git a/test/syscalls/linux/mmap.cc b/test/syscalls/linux/mmap.cc index 6d3227ab6..e52c9cbcb 100644 --- a/test/syscalls/linux/mmap.cc +++ b/test/syscalls/linux/mmap.cc @@ -43,6 +43,8 @@ #include "test/util/temp_path.h" #include "test/util/test_util.h" +using ::testing::AnyOf; +using ::testing::Eq; using ::testing::Gt; namespace gvisor { @@ -296,7 +298,8 @@ TEST_F(MMapTest, MapDevZeroSegfaultAfterUnmap) { }; EXPECT_THAT(InForkedProcess(rest), - IsPosixErrorOkAndHolds(W_EXITCODE(0, SIGSEGV))); + IsPosixErrorOkAndHolds(AnyOf(Eq(W_EXITCODE(0, SIGSEGV)), + Eq(W_EXITCODE(0, 128 + SIGSEGV))))); } TEST_F(MMapTest, MapDevZeroUnaligned) { -- cgit v1.2.3