• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <errno.h>
2 #include <gtest/gtest.h>
3 #include <poll.h>
4 #include <sys/wait.h>
5 
6 using namespace testing::ext;
7 
8 class SelectPollTest : public testing::Test {
SetUp()9     void SetUp() override {}
TearDown()10     void TearDown() override {}
11 };
12 
13 /**
14  * @tc.name: poll_001
15  * @tc.desc: This test verifies the behavior of the poll() function when passing an empty pollfd array and a timeout of
16  *           1 millisecond.
17  * @tc.type: FUNC
18  */
19 HWTEST_F(SelectPollTest, poll_001, TestSize.Level1)
20 {
21     errno = 0;
22     int emptyPoll = poll(nullptr, 0, 1);
23     EXPECT_TRUE(emptyPoll == 0);
24     EXPECT_TRUE(errno == 0);
25 }