diff options
author | Zach Koopmans <zkoopmans@google.com> | 2020-08-18 09:52:53 -0700 |
---|---|---|
committer | Rahat Mahmood <46939889+mrahatm@users.noreply.github.com> | 2020-08-19 11:38:34 -0700 |
commit | f3f29d8d6748ed67ce78789cf45f062f3d136d3d (patch) | |
tree | 64274f87f61164261bad8e19855e1a770d75f64b /test/syscalls/linux | |
parent | 4d571b4bf21147c132ea827fd19a0462a004688d (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')
-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) { |