I have a class that I want to mock using Google Mock. My class has BOTH non-virtual and virtual methods. I read the Google Mock ForDummies and the Google Mock CookBook . The examples and explanations provided by these resources mention classes with ALL virtual functions or NO virtual functions, but not one with both. So, I have two questions:
(1) Is it possible to mock a class with mixed virtual / non-virtual types?
(2) What method should be used (if question 1 is correct) to mock this class, (If question 1 is incorrect), what can be used instead?
A bit of code if this helps:
class Time_Device : public Time_Device_Interface
{
private:
...
bool read32_irig_data( uint32_t *data_read, uint32_t reg_address);
bool thread_monitor_irig_changed( irig_callback_t callback );
public:
...
virtual bool set_time( struct time_sample const &time );
virtual bool get_time( struct time_sample *time );
virtual bool register_is_connected_notification(
irig_callback_t callback );
};
Tiny background:
Google Mock Google Test, , .. Google Test, .
Visual Studio 2010, CMake
Google Test Google Mock
.