# CppFreeMock **Repository Path**: LightSeed460/CppFreeMock ## Basic Information - **Project Name**: CppFreeMock - **Description**: @fork https://github.com/gzc9047/CppFreeMock googletes gmock增强工具, 可以打桩自由函数,static成员函数,非virtual成员函数 #define private public - **Primary Language**: C++ - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-03-30 - **Last Updated**: 2025-03-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README CppFreeMock =========== Based on gmock, can mock global function, member function, class static function without change source code. [Here](https://onedrive.live.com/redir.aspx?cid=4c6fdc828365b80e&page=view&resid=4C6FDC828365B80E!28191&parId=4C6FDC828365B80E!28141&authkey=!AtpjZailG7DIcVg&Bpub=SDX.SkyDrive&Bsrc=Share) is the document and design notes host on OneNote. Hello world: ```cpp 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](https://github.com/gzc9047/cpp_non_virtual_mock) is the prototype when I try to solve this problem.