How can I mock Memcached (C++)?

Asked by chris wu on 2011-09-07

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:
2011-09-07
Last query:
2011-09-07
Last reply:
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.