• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 #include <sys/resource.h>
3 
4 using namespace testing::ext;
5 
6 class MiscSetpriorityTest : public testing::Test {
SetUp()7     void SetUp() override {}
TearDown()8     void TearDown() override {}
9 };
10 
11 /**
12  * @tc.name: setpriority_001
13  * @tc.desc: This test verifies whether the setpriority function can correctly set the scheduling priority of the
14  *           current process to 1 and return 0 when set successfully.
15  * @tc.type: FUNC
16  */
17 HWTEST_F(MiscSetpriorityTest, setpriority_001, TestSize.Level1)
18 {
19     int setResult = setpriority(PRIO_PROCESS, getpid(), 1);
20     EXPECT_EQ(0, setResult);
21 }