• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 #include <string.h>
3 
4 using namespace testing::ext;
5 
6 class StringStrcasecmpTest : public testing::Test {
SetUp()7     void SetUp() override {}
TearDown()8     void TearDown() override {}
9 };
10 
11 /**
12  * @tc.name: strcasecmp_001
13  * @tc.desc: Verify the correctness of the strcasecmp function for case-insensitive comparison of strings, including
14  *           comparisons for equality, less than, and greater than scenarios.
15  * @tc.type: FUNC
16  */
17 HWTEST_F(StringStrcasecmpTest, strcasecmp_001, TestSize.Level1)
18 {
19     EXPECT_TRUE(strcasecmp("world", "WORLD") == 0);
20     EXPECT_TRUE(strcasecmp("world1", "world2") < 0);
21     EXPECT_TRUE(strcasecmp("world2", "world1") > 0);
22 }