From 26c588f06368c21130bb356c6088b76ea715d1ef Mon Sep 17 00:00:00 2001 From: Zach Koopmans Date: Thu, 27 Aug 2020 14:09:25 -0700 Subject: Fix BadSocketPair for open source. BadSocketPair test will return several errnos (EPREM, ESOCKTNOSUPPORT, EAFNOSUPPORT) meaning the test is just too specific. Checking the syscall fails is appropriate. PiperOrigin-RevId: 328813071 --- test/syscalls/linux/socket_inet_loopback.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/test/syscalls/linux/socket_inet_loopback.cc b/test/syscalls/linux/socket_inet_loopback.cc index 7c1d6a414..67893033c 100644 --- a/test/syscalls/linux/socket_inet_loopback.cc +++ b/test/syscalls/linux/socket_inet_loopback.cc @@ -97,13 +97,9 @@ TEST(BadSocketPairArgs, ValidateErrForBadCallsToSocketPair) { ASSERT_THAT(socketpair(AF_INET6, 0, 0, fd), SyscallFailsWithErrno(ESOCKTNOSUPPORT)); - // Invalid AF will return ENOAFSUPPORT or EPERM. - ASSERT_THAT(socketpair(AF_MAX, 0, 0, fd), - ::testing::AnyOf(SyscallFailsWithErrno(EAFNOSUPPORT), - SyscallFailsWithErrno(EPERM))); - ASSERT_THAT(socketpair(8675309, 0, 0, fd), - ::testing::AnyOf(SyscallFailsWithErrno(EAFNOSUPPORT), - SyscallFailsWithErrno(EPERM))); + // Invalid AF will fail. + ASSERT_THAT(socketpair(AF_MAX, 0, 0, fd), SyscallFails()); + ASSERT_THAT(socketpair(8675309, 0, 0, fd), SyscallFails()); } enum class Operation { -- cgit v1.2.3