diff options
author | Zach Koopmans <zkoopmans@google.com> | 2020-08-18 09:52:53 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-18 09:54:48 -0700 |
commit | da5c2ea6dc4ea01c667bff88aa37f5efb39b704a (patch) | |
tree | 64274f87f61164261bad8e19855e1a770d75f64b /test/syscalls/linux/mmap.cc | |
parent | 6d0c5803d557d453f15ac6f683697eeb46dab680 (diff) |
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
Diffstat (limited to 'test/syscalls/linux/mmap.cc')
-rw-r--r-- | test/syscalls/linux/mmap.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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) { |