Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22248

Using google mock for C code

$
0
0

I'm maintaining a legacy project written in C and it's unfeasible to get it running with a C++ compiler. Since the code is cross compiled it is however possible to run unit-tests or similar in a host environment. hence it's also possible to interface with a C++ host compiler and use google-test and google-mock.

There are certain capabilities of google-mock which seem to be very tempting to be used for testing as invoking real implementations and setting call expectations.

I would like to be able to use them in C code. I can see that it is indeed possible to use google-mock without using vtables, but it requires templates.

Is there a way to mock bare C functions with google mock?


Viewing all articles
Browse latest Browse all 22248

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>