• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <errno.h>
2 #include <gtest/gtest.h>
3 #include <signal.h>
4 using namespace testing::ext;
5 
6 class SignalSigemptySetTest : public testing::Test {
SetUp()7     void SetUp() override {}
TearDown()8     void TearDown() override {}
9 };
10 
11 /**
12  * @tc.name: sigemptyset_001
13  * @tc.desc: Verify whether the sigemptyset() and sigaddset() functions successfully initialize an empty
14  *           signal set and add two signals to the set without any errors.
15  * @tc.type: FUNC
16  **/
17 HWTEST_F(SignalSigemptySetTest, sigemptyset_001, TestSize.Level1)
18 {
19     sigset_t set;
20 
21     sigemptyset(&set);
22     sigaddset(&set, SIGINT);
23     sigaddset(&set, SIGTERM);
24 
25     EXPECT_EQ(0, sigemptyset(&set));
26 }