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

Re: chef_wrap run issue, VS2010


Right, the crashing itself isn't the real issue here; that was caused by me
mis-understanding how data was being passed around.  The core issue,
though, is that with VS, the wrapper function was not getting called, but
the original chef_cook() was called instead; in other words, mocking was
not occurring.

On Wed, Feb 24, 2016 at 10:37 AM, James Grenning <james@xxxxxxxxxxxx> wrote:

> Hi Daniel
>
> You don't need wrapping for what you are trying to do.  You code fails
> because of a runtime error.  You seem to have some pointer usage problems.
>
> Think of a test harness (like cmocka) as a alternative way to exercise
> your code.
>
> James
> --------------------------------------------------------------------------
> James Grenning - Author of TDD for Embedded C - wingman-sw.com/tddec
> wingman-sw.com
> wingman-sw.com/blog
> twitter.com/jwgrenning
> facebook.com/wingman.sw
> [![wingman software](
> http://www.wingman-sw.com/images/wingman.png)](http://wingman-sw.com)
> On 24 Feb 2016, at 12:26, Daniel Miller wrote:
>
> Lukas;
>> So will cmocka even *do* anything, if the wrapper functionality isn't
>> available??  When I was trying to get the chef project to work with VS
>> yesterday, it looked to me as though I was going to have to
>> re-write chef_cook() itself in order to get the testing functionality, but
>> that sort of defeats the purpose of using cmocka at all...
>>
>> I'll admit that I'm stumbling a bit in understanding how the whole example
>> actually works...
>>
>>
>> On Wed, Feb 24, 2016 at 10:22 AM, Lukas Slebodnik <lslebodn@xxxxxxxxxx>
>> wrote:
>>
>> On (24/02/16 10:06), Daniel Miller wrote:
>>>
>>>> Hi Andreas;
>>>> Yes, I finally figured that out once I studied cmocka further; I didn't
>>>> understand what --wrap was doing at first.  It appears that VS doesn't
>>>> support that operation, at least the way that your CMake build script
>>>>
>>> tried
>>>
>>>> to do it (with '/Wl,--wrap=chef_cook', which simply doesn't exist).
>>>>
>>>> I tried building with MinGW (A Gnu port to Windows), and this all works
>>>> fine, and furthermore, I understand it!  I'll have to see if the
>>>> engineering team is interested in dealing with yet another toolchain...
>>>>
>>>> I would suggest that you simply remove the CMake scripts, which are
>>>> building a .sln project for Visual Studio; since the entire concept
>>>> cannot
>>>> work, it is sort of mis-leading...
>>>>
>>> Or just test should be skipped if building with "Visual Studio".
>>> Because other features should.
>>>
>>> LS
>>>
>>>
>
>
>

Follow-Ups:
Re: chef_wrap run issue, VS2010Andreas Schneider <asn@xxxxxxxxxxxxxx>
References:
chef_wrap run issue, VS2010Daniel Miller <dmiller@xxxxxxxxxxxxxxxx>
Re: chef_wrap run issue, VS2010Andreas Schneider <asn@xxxxxxxxxxxxxx>
Re: chef_wrap run issue, VS2010Daniel Miller <dmiller@xxxxxxxxxxxxxxxx>
Re: chef_wrap run issue, VS2010Lukas Slebodnik <lslebodn@xxxxxxxxxx>
Re: chef_wrap run issue, VS2010Daniel Miller <dmiller@xxxxxxxxxxxxxxxx>
Re: chef_wrap run issue, VS2010"James Grenning" <james@xxxxxxxxxxxx>