How can I mock Memcached (C++)?

Asked by chris wu

I'm trying to mock memcache for my unit tests but it seems the methods are not virtual (and difficult to mock unless I create a proxy object).

Would it possible to change the methods to virtual in future versions?

Question information

Language:
English Edit question
Status:
Solved
For:
libmemcached Edit question
Assignee:
No assignee Edit question
Solved by:
chris wu
Solved:
Last query:
Last reply:
Revision history for this message
chris wu (chris-wu225) said :
#1

nevermind. going to use http://code.google.com/p/googlemock/wiki/CookBook#Mocking_Nonvirtual_Methods

pattern instead.

Although It would be nice if there was an abstract interface that Memcache would subclass to enable mocking.