• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 #include <stdio.h>
3 using namespace testing::ext;
4 
5 class StdioFgetpos64Test : public testing::Test {
SetUp()6     void SetUp() override {}
TearDown()7     void TearDown() override {}
8 };
9 
10 /**
11  * @tc.name: fgetpos64_001
12  * @tc.desc: Ensure that the fgetpos64() function correctly retrieves the current position in the file.
13  * @tc.type: FUNC
14  **/
15 HWTEST_F(StdioFgetpos64Test, fgetpos64_001, TestSize.Level1)
16 {
17     FILE* file = fopen("/proc/version", "r");
18     ASSERT_NE(nullptr, file);
19     fpos64_t position;
20     int result = fgetpos64(file, &position);
21     EXPECT_EQ(0, result);
22     fclose(file);
23 }