summaryrefslogtreecommitdiff
path: root/tests/sys_socket_test.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-12-15 13:55:53 -0800
committerElliott Hughes <enh@google.com>2017-12-15 13:55:53 -0800
commita7f12944d4154a445ee774683e27447d609de540 (patch)
tree7e2683233d0a36b825f630b1fc0f069e306463e8 /tests/sys_socket_test.cpp
parent59a6ee963f96eedf01df7db1e57397ff71852b15 (diff)
A few more trivial tests.
Based on gaps in the list of functions not referenced by the test executable. Bug: N/A Test: ran tests Change-Id: I73c238e7cf360f94670c7cd13eb954341c940b7b
Diffstat (limited to 'tests/sys_socket_test.cpp')
-rw-r--r--tests/sys_socket_test.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/sys_socket_test.cpp b/tests/sys_socket_test.cpp
index 8f5afac04..506e01f23 100644
--- a/tests/sys_socket_test.cpp
+++ b/tests/sys_socket_test.cpp
@@ -22,6 +22,8 @@
#include <sys/un.h>
#include <fcntl.h>
+#include "utils.h"
+
struct ConnectData {
bool (*callback_fn)(int);
const char* sock_path;
@@ -106,8 +108,8 @@ static void TestAccept4(struct sockaddr_un* addr, int fd) {
int fd_acc = accept4(fd, reinterpret_cast<struct sockaddr*>(addr), &len, SOCK_CLOEXEC);
ASSERT_NE(fd_acc, -1) << strerror(errno);
- // Check that the flag was set properly.
- ASSERT_EQ(FD_CLOEXEC, fcntl(fd_acc, F_GETFD) & FD_CLOEXEC);
+ // Check that SOCK_CLOEXEC was set properly.
+ AssertCloseOnExec(fd_acc, true);
close(fd_acc);
}