• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 #include <string.h>
3 
4 constexpr int STR_SIZE_ONE = 6;
5 
6 using namespace testing::ext;
7 
8 class StringStrspnTest : public testing::Test {
SetUp()9     void SetUp() override {}
TearDown()10     void TearDown() override {}
11 };
12 
13 /**
14  * @tc.name: strspn_001
15  * @tc.desc: Verify that it functions normally
16  * @tc.type: FUNC
17  * */
18 HWTEST_F(StringStrspnTest, strspn_001, TestSize.Level1)
19 {
20     const char* srcChar = "ABCDEF123456";
21     const char* dstChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
22     EXPECT_EQ(STR_SIZE_ONE, strspn(srcChar, dstChar));
23 
24     srcChar = nullptr;
25     dstChar = nullptr;
26 }