1 //===-- Unittests for socket ----------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "src/sys/socket/socket.h"
11 #include "src/unistd/close.h"
13 #include "src/errno/libc_errno.h"
14 #include "test/UnitTest/Test.h"
16 #include <sys/socket.h> // For AF_UNIX and SOCK_DGRAM
18 TEST(LlvmLibcSocketTest
, LocalSocket
) {
19 int sock
= LIBC_NAMESPACE::socket(AF_UNIX
, SOCK_DGRAM
, 0);
21 ASSERT_ERRNO_SUCCESS();
23 LIBC_NAMESPACE::close(sock
);