after i mock a c++ class function, my program still go into the function i mocked.
but, in the same folder, same CMakeLists.txt, another test_cpp file could mock successful.
my project folder like this:
a.cpp
{
b.func();
}
b.cpp
main.cpp
CMakeLists.txt
my test folder :
test_a.cpp
test_b.cpp
test_main.cpp
i want to use b.cpp's function in a.cpp, and i mock b.func in a.cpp for test a.func.
after i mock a c++ class function, my program still go into the function i mocked. but, in the same folder, same CMakeLists.txt, another test_cpp file could mock successful. my project folder like this: a.cpp { b.func(); } b.cpp main.cpp CMakeLists.txt my test folder : test_a.cpp test_b.cpp test_main.cpp i want to use b.cpp's function in a.cpp, and i mock b.func in a.cpp for test a.func.