the class in hpp is:
class ComposedClass
{
public:
int getComposedData();
};
class POCClassForTypeMock
{
public:
int callGetNumber();
int getComposedData();
private:
ComposedClass mComposedClass;
int getNumber();
};
the test is:
TEST_CASE("Testing private Search")
{
POCClassForTypeMock * obj = new POCClassForTypeMock;
PRIVATE_WHEN_CALLED(obj, getNumber).Return(0);
REQUIRE(obj->callGetNumber() == 0);
delete obj;
}
got error message:
- The function 'POCClassForTypeMock::getNumber' could not be found. If the method is not called in the code under test it will be optimized away. Remove any inline keywords, and Add ISOLATOR_TESTABLE to the method.
looks like it doesn't recognize private functions.
this example works fine in your standalone