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

chef_wrap run issue, VS2010

I'm new to cmocka, and am trying to run the chef_wrap example.
We use Visual Studio 2010 here.
I used CMake to prepare the project, then (after several difficulties) got
it to build, however I cannot get it to run successfully.

The core issue appears to be that dish_out in chef_cook() is not valid; I
modified it as such:

int chef_cook(const char *order, char **dish_out)
    puts("in chef_cook");
    if (order == NULL || dish_out == NULL) return EINVAL;
    printf("order=%s\n", order);
    if (strcmp(order, "hotdog") == 0)
      printf("dish=%08X, pdish=%08X\n", (unsigned) dish_out, (unsigned)
*dish_out) ;
      sprintf(*dish_out, "hotdog");
      return 0 ;
    return -ENOSYS; //  -40

and when I run, I see:
[==========] Running 2 test(s).
[ RUN      ] test_order_hotdog
in chef_cook
dish=003FF964, pdish=CCCCCCCC

Where is dish_out supposed to get created?  And why isn't that working?  It
appears to be getting allocated somewhere in cmocka.c, but haven't yet
quite figured it out... and to be honest, I was hoping it would just work,
since it's the core cmocka library module.

Dan Miller

Re: chef_wrap run issue, VS2010Daniel Miller <dmiller@xxxxxxxxxxxxxxxx>
Re: chef_wrap run issue, VS2010Andreas Schneider <asn@xxxxxxxxxxxxxx>