include: Create todo_wine_if.

Sebastian Lackner sebastian at fds-team.de
Tue Jan 26 13:19:59 CST 2016


On 26.01.2016 18:06, Bernhard Übelacker wrote:
> Currently list based tests, where just some elements are todo_wine, need
> the same ok()-line twice, one without and one with todo_wine.
> (e.g. dlls/msvcr120/tests/msvcr120.c line 243)
> 
> This patch makes it possible to use a single ok()-line
> prefixed with a todo_wine_if(condition).
> e.g.:
>     todo_wine_if(tests[i].todo)
>     ok(...);
> 
> Questions:
> - Is "todo_level" ever supposed to have a value greater than 1?

I don't know if its used in practice anywhere, but the old way handling of nested
todo_wines was definitely more clear than your new proposed method. I would suggest
to keep this "feature", even when its probably not used in the Wine source. The
first idea which comes to my mind would be to store it in a bitmask (which allows
at least up to 32 bit nested todos when declaring todo_level as unsigned integer value).
For example:

start:   todo_level = (todo_level << 1) | (is_todo != 0);
testing: if (todo_level != 0)
end:     todo_level >>= 1;

> 
> Changes:
> 2016-01-26:
> - Give parameter is_todo just to *start_dodo.
> - Decrement in *end_todo just when todo_level > 0.
> 
> 2016-01-22:
> - First version
> (Thanks to Sebastian Lackner for review.)
> Comments: https://www.winehq.org/pipermail/wine-devel/2016-January/111386.html
> ---
>  include/wine/test.h | 21 ++++++++++++---------
>  1 file changed, 12 insertions(+), 9 deletions(-)
> 




More information about the wine-devel mailing list