I want to mock malloc in C++ using Gmock framework. Is it possible? I have tried all possible ways. But the class which is hosting this malloc implementation has got a private constructor and destructor?

Is there any way in which we can directly mock malloc to return NULL?

Edit
Report