todo_wine under the hood

Henri Verbeet hverbeet at gmail.com
Fri Oct 17 03:18:02 CDT 2014


On 16 October 2014 23:59, Jonathan Vollebregt <jnvsor at gmail.com> wrote:
> I was looking at verify_reg_() in programs/reg/tests/reg.c:61 and noticed
> some simple if statements:
>
>>     if (todo & TODO_REG_TYPE)
>>         todo_wine lok(type == exp_type, "got wrong type %d, expected
>> %d\n", type, exp_type);
>>     else
>>         lok(type == exp_type, "got wrong type %d, expected %d\n", type,
>> exp_type);
>>     if (todo & TODO_REG_SIZE)
>>         todo_wine lok(size == exp_size, "got wrong size %d, expected
>> %d\n", size, exp_size);
>>     else
>>         lok(size == exp_size, "got wrong size %d, expected %d\n", size,
>> exp_size);
>>     if (todo & TODO_REG_DATA)
>>         todo_wine lok(memcmp(data, exp_data, size) == 0, "got wrong
>> data\n");
>>     else
>>         lok(memcmp(data, exp_data, size) == 0, "got wrong data\n");
>
>
> Simple enough, except if I pass TODO_REG_TYPE to this function it never even
> tries the size or data blocks. While this makes sense to implement (You
> can't test the data if you don't know it's size) I have no idea *how* it
> does it.
>
>From your description, it's not all that clear to me what's actually happening.

> In fact the todo_wine macro appears to start a loop for some reason and all
The "loop" is mostly just to generate a proper block around the tests
it contains.



More information about the wine-devel mailing list