[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cmocka mocking capability in windows is missing


On Tuesday 28 July 2015 14:44:45 Shai Peretz wrote:
> Hi,

Hi,

> Two things:
> 1.
> I'm unable to build cmocka 1.0.1 on windows with visual studio 10.

well, if you do not provide details then I assume it is your fault ...
 
> 2.
> I notice that on windows I can't use the __wrap_ functionality which is
> important feature for the mocking capability,
> What do I do in Windows?
> the '-Wl,--wrap=...' linker options exists only in GNU Linker.
> Is this true?
> If it is then this means that i can't really use cmocka mocking
> capabilities in windows, is that correct? i can't mock some function being
> called by another module which I interact with.

If you want to mock strdup e.g you need to use:

#ifdef UNIT_TESTING
#define strdup test_strdup
#endif

In your code ...

-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx


Follow-Ups:
Re: cmocka mocking capability in windows is missing"James Grenning" <james@xxxxxxxxxxxx>
References:
cmocka mocking capability in windows is missingShai Peretz <ssperetz@xxxxxxxxx>