Today writing a testcase I found a "problem" on todo_wine construct. In short :
void first_test_part() { ok(test1(), "failed\n"); }
void second_test_part() { ok(test2(), "failed\n"); }
todo_wine { first_test_part(); second_test_part(); }
this "fails" (i.e. is marked as passing inside todo_wine block) if first_test_part() passes, which is not what wished; in this case the test should be considered passing if BOTH first and second part passes, and failed otherwise. The problem arose on bitmap creation test (gdiplus) on which the testcase should check for creation success AND bitmap internal consiscency. My example is short, but in my case there's a single function used to test many kind of bitmaps; that's impossible to do with todo_wine actual construct. It could be obviously separated into many functions, each enclosed on its own todo_wine, but this would vanify the "single test function for many bitmaps types" way.
Max
This is by design. Each call to ok() is an individual test, independent of the others, and todo_wine marks them all as todo.
If you have the same code running multiple tests, you can mark some of them as todo by putting a todo flag in your data.
If you really want multiple checks to be dependent, you'll need to reduce them to one ok() call.
Vincent Povirk
Vincent Povirk ha scritto:
This is by design. Each call to ok() is an individual test, independent of the others, and todo_wine marks them all as todo.
If you have the same code running multiple tests, you can mark some of them as todo by putting a todo flag in your data.
If you really want multiple checks to be dependent, you'll need to reduce them to one ok() call.
Vincent Povirk
Yep, that what I'm doing now.... but the code is quite less clean than before.
Thank you for answer
Max