SkillAgentSearch skills...

CppFreeMock

Based on gmock, can mock global function, member function, class static function without changing source code.

Install / Use

/learn @gzc9047/CppFreeMock
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

CppFreeMock

Based on gmock, can mock global function, member function, class static function without change source code.

Here is the document and design notes host on OneNote.

Hello world:

string func() {
    return "Non mocked.";
}

TEST(HelloWorld, First) {
    EXPECT_CALL(*MOCKER(func), MOCK_FUNCTION()).Times(Exactly(1))
        .WillOnce(Return("Hello world."));
    EXPECT_EQ("Hello world.", func());
}

Here is the prototype when I try to solve this problem.

View on GitHub
GitHub Stars82
CategoryDevelopment
Updated4mo ago
Forks35

Languages

C++

Security Score

92/100

Audited on Nov 21, 2025

No findings