1 #include <fcntl.h> 2 #include <gtest/gtest.h> 3 #include <locale.h> 4 #include <nl_types.h> 5 using namespace testing::ext; 6 7 class LocaleCatopenTest : public testing::Test { SetUp()8 void SetUp() override {} TearDown()9 void TearDown() override {} 10 }; 11 12 /** 13 * @tc.name: catopen_001 14 * @tc.desc: The test check whether the catopen function successfully opens a message catalog named "my_messages" 15 * using the NL_CAT_LOCALE category. 16 * @tc.type: FUNC 17 **/ 18 HWTEST_F(LocaleCatopenTest, catopen_001, TestSize.Level1) 19 { 20 nl_catd result = catopen("not_exist", NL_CAT_LOCALE); 21 EXPECT_EQ(reinterpret_cast<nl_catd>(-1), result); 22 }