• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 #include <time.h>
3 using namespace testing::ext;
4 
5 class TimeTimezoneTest : public testing::Test {
SetUp()6     void SetUp() override {}
TearDown()7     void TearDown() override {}
8 };
9 
10 /**
11  * @tc.name: tzname_001
12  * @tc.desc: Test the tzname array, which should contain the names of the local time zone and the
13  *           alternate time zone (if available).
14  * @tc.type: FUNC
15  **/
16 HWTEST_F(TimeTimezoneTest, tzname_001, TestSize.Level1)
17 {
18     time_t currTime;
19     struct tm* timeInfo;
20 
21     time(&currTime);
22     timeInfo = localtime(&currTime);
23 
24     EXPECT_TRUE(tzname[0]);
25     EXPECT_TRUE(tzname[1]);
26 }
27