1 #include <gtest/gtest.h> 2 #include <string.h> 3 4 using namespace testing::ext; 5 6 class StringStrpbrkTest : public testing::Test { SetUp()7 void SetUp() override {} TearDown()8 void TearDown() override {} 9 }; 10 11 /** 12 * @tc.name: strpbrk_001 13 * @tc.desc: Verify that it functions normally 14 * @tc.type: FUNC 15 * */ 16 HWTEST_F(StringStrpbrkTest, strpbrk_001, TestSize.Level1) 17 { 18 const char* srcChar = "source"; 19 const char* dstChar = "target"; 20 EXPECT_STREQ("rce", strpbrk(srcChar, dstChar)); 21 22 srcChar = "abcdefg"; 23 dstChar = "hijklmn"; 24 EXPECT_STREQ(nullptr, strpbrk(srcChar, dstChar)); 25 26 srcChar = nullptr; 27 dstChar = nullptr; 28 }