1 #include <gtest/gtest.h> 2 3 using namespace testing::ext; 4 5 extern "C" int init_module(void* a, unsigned long b, const char* c); 6 7 class LinuxInitmoduleTest : public testing::Test { SetUp()8 void SetUp() override {} TearDown()9 void TearDown() override {} 10 }; 11 12 /** 13 * @tc.name: init_module_001 14 * @tc.desc: Verify if the init_module operation is normal. 15 * @tc.type: FUNC 16 * */ 17 HWTEST_F(LinuxInitmoduleTest, init_module_001, TestSize.Level1) 18 { 19 int result1 = init_module(reinterpret_cast<void*>(const_cast<char*>("example_module")), 0, nullptr); 20 int result2 = init_module(nullptr, 0, nullptr); 21 EXPECT_EQ(-1, result1); 22 EXPECT_EQ(-1, result2); 23 }