Re: chef_wrap run issue, VS2010
- Subject: Re: chef_wrap run issue, VS2010
- From: Daniel Miller <dmiller@xxxxxxxxxxxxxxxx>
- Date: Wed, 24 Feb 2016 10:48:06 -0800
- To: James Grenning <james@xxxxxxxxxxxx>
- Cc: cmocka@xxxxxxxxxxxxxx, Andreas Schneider <asn@xxxxxxxxxxxxxx>
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
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 Grenning - Author of TDD for Embedded C - wingman-sw.com/tddec
> [![wingman software](
> On 24 Feb 2016, at 12:26, Daniel Miller wrote:
>> 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>
>> 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
>>>> 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
>>>> work, it is sort of mis-leading...
>>> Or just test should be skipped if building with "Visual Studio".
>>> Because other features should.