• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 #include <sys/syscall.h>
3 
4 using namespace testing::ext;
5 
6 class MiscSyscallTest : public testing::Test {
SetUp()7     void SetUp() override {}
TearDown()8     void TearDown() override {}
9 };
10 
11 /**
12  * @tc.name: syscall_001
13  * @tc.desc: This test verifies whether the results obtained by calling the getpid function and syscall (SYS_getpid) to
14  *           obtain the process ID are the same.
15  * @tc.type: FUNC
16  */
17 HWTEST_F(MiscSyscallTest, syscall_001, TestSize.Level1)
18 {
19     long result = syscall(SYS_getpid);
20     EXPECT_TRUE(getpid() == result);
21 }