Comments (5)
@devesh25427 please take a look at section Specifying expectations. The botom line is:
The functions are mocked as long as its corresponding mocker class instance exists
If not mocked, the real function will be called.
from c-mock.
@hjagodzinski thanks for reply. I understood that real function is called when there is no mock class instance. Earlier I was able to call real function using Invoke(<mock_class_name>::real) because there was a static member in class pointing to real function. I can still see static real function pointer created by CMOCK_MOCK_FUNCTIONn macro but don't know how to call it.
Sometimes I need to call real instance while setting expectation.
from c-mock.
I see now what you're after. Unfortunately there is no support for calling a real function while specifying expectations. Internally C Mock keeps pointer to a real function and you could use that but it's far from being ideal. I will look into ways to expose a real function so it can be used in cases like yours.
from c-mock.
Thanks @hjagodzinski
from c-mock.
@devesh25427 in case you are still interested I have created pull request #22 which provides the means to call a real function when using the CMockMocker
class for mocking.
from c-mock.
Related Issues (12)
- Allow mocking a function that isn't linked into the exe HOT 10
- Compilation errors when using latest Google Test (post 1.8.0) HOT 1
- Compilation Errors when using Google test version 1.10 HOT 1
- error: βstd::tr1β has not been declared HOT 1
- C-Mock is not working with googlemock 1.7 HOT 3
- Add release for current code HOT 2
- Code and tests does not comile HOT 3
- Can't find the real function HOT 1
- [BUG] An error occurred when the constructor of a global instance called the mock method HOT 1
- Cygwin build environment Compatability HOT 3
- Suggested alternative usage, more similar to Google Mock HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c-mock.