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
This commit is contained in:
Zach Koopmans
2020-08-18 09:54:48 -07:00
committed by gVisor bot
parent 6d0c5803d5
commit da5c2ea6dc
+4 -1
View File
@@ -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) {