I have tested Google Mock for virtual function, but am unable to do it for non-virtual. I didn't understand the concept of "hi-perf dependency injection".
Below is class having one non-virtual function. I want to use Google Mock to test this function. For simplicity, I have removed core part and just kept single return statement.
Below is example:
// gtest and gmock files are added class DetectorGPIO { DetectorGPIO(void); virtual ~DetectorGPIO() {} StartPulseHigh(); }; BOOL DetectorGPIO::StartPulseHigh() { return 1; } class MockDetectorGPIO : public DetectorGPIO { public: MOCK_METHOD0(StartPulseHigh,BOOL(void)); }; Am I missing any concept?
I am new to Google Mock. Any help will be appreciated.
StartPulseHigh, but it doesn't seem to be defined in yourDetectorGPIOclass.