diff options
author | Zach Koopmans <zkoopmans@google.com> | 2020-08-27 14:09:25 -0700 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2020-09-09 17:53:10 -0700 |
commit | d50bfc1b0d9884c2f07c944eff7a7e7d40aceb1b (patch) | |
tree | bb4045e1f9b281f8db54f280c91246bf0cbe2e7a /test/syscalls/linux/socket_inet_loopback.cc | |
parent | 5ec86b76aa71417c09347253027ebbc33d4b3123 (diff) |
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
Diffstat (limited to 'test/syscalls/linux/socket_inet_loopback.cc')
-rw-r--r-- | test/syscalls/linux/socket_inet_loopback.cc | 10 |
1 files 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 { |