Uploaded image for project: 'Qpid Dispatch'
  1. Qpid Dispatch
  2. DISPATCH-1783

Add ability to use test doubles (mocks, fakes, ...) in C tests

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.14.0
    • None
    • Tests
    • None

    Description

      During the work on https://github.com/apache/qpid-dispatch/pull/684, there was at one point a version of the PR, which tested what happens if vsnprintf called from safe_snprinf returns -1.

      This was done by replacing the vsnprintf with a mock (technically it's probably a stub, or maybe fake, but let's ignore the proper terminology).

      There are various possibilities how to approach mocking in C. They are less nice than in more dynamic languages such as Java, or even C++ (where it's possible to subclass things). Nevertheless, it can be useful technique, and it should be explored.

      CC cans

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jdanek Jiri Daněk
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: