• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- Unittests for pipe ------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 #include "src/unistd/close.h"
9 #include "src/unistd/pipe.h"
10 
11 #include "test/UnitTest/ErrnoCheckingTest.h"
12 #include "test/UnitTest/ErrnoSetterMatcher.h"
13 #include "test/UnitTest/Test.h"
14 
15 using namespace LIBC_NAMESPACE::testing::ErrnoSetterMatcher;
16 using LlvmLibcPipeTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
17 
TEST_F(LlvmLibcPipeTest,SmokeTest)18 TEST_F(LlvmLibcPipeTest, SmokeTest) {
19 
20   int pipefd[2];
21 
22   ASSERT_THAT(LIBC_NAMESPACE::pipe(pipefd), Succeeds());
23 
24   ASSERT_THAT(LIBC_NAMESPACE::close(pipefd[0]), Succeeds());
25   ASSERT_THAT(LIBC_NAMESPACE::close(pipefd[1]), Succeeds());
26 }
27 
28 // TODO: Functionality tests
29