Giter Club home page Giter Club logo

Comments (5)

hjagodzinski avatar hjagodzinski commented on June 26, 2024

@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.

devesh25427 avatar devesh25427 commented on June 26, 2024

@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.

hjagodzinski avatar hjagodzinski commented on June 26, 2024

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.

devesh25427 avatar devesh25427 commented on June 26, 2024

Thanks @hjagodzinski

from c-mock.

hjagodzinski avatar hjagodzinski commented on June 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.