• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <fcntl.h>
2 #include <gtest/gtest.h>
3 #include <stdlib.h>
4 #include <sys/auxv.h>
5 #include <sys/uio.h>
6 #include <unistd.h>
7 
8 using namespace testing::ext;
9 
10 class UnistdPipe2Test : public testing::Test {
SetUp()11     void SetUp() override {}
TearDown()12     void TearDown() override {}
13 };
14 
15 /**
16  * @tc.name: pipe2_001
17  * @tc.desc: Verified whether the pipe function can successfully create a pipeline, and whether data can be correctly
18  *           written and read to the pipeline in both child and parent processes.
19  * @tc.type: FUNC
20  * */
21 HWTEST_F(UnistdPipe2Test, pipe2_001, TestSize.Level1)
22 {
23     std::vector<int> fds = { -1, -1 };
24     EXPECT_EQ(0, pipe2(fds.data(), O_CLOEXEC));
25 }