[2/3] cmd/tests: Add support for todo_wine constructions (try 3)

Frédéric Delanoy frederic.delanoy at gmail.com
Wed Jun 15 20:41:34 CDT 2011

On Thu, Jun 16, 2011 at 02:24, Octavian Voicu <octavian.voicu at gmail.com> wrote:
> Hello,
> I think Jacek was suggesting something among these lines, which does
> look prettier imho (replace quoted text with following):
> ...
> +        }else {
> +            if (!is_todo_wine)
> +                ok(!err, "unexpected char 0x%x position %d in line %d
> (got '%.*s', wanted '%.*s')\n",
> +                   *err, (int)(err-out_ptr), line, (int)(out_nl-out_ptr),
> +                   out_ptr, (int)(exp_nl-exp_ptr), exp_ptr);
> +            else
> +                todo_wine
> +                ok(!err, "unexpected char 0x%x position %d in line %d
> (got '%.*s', wanted '%.*s')\n",
> +                   *err, (int)(err-out_ptr), line,
> (int)(out_nl-out_ptr), out_ptr,
> +                   (int)(exp_nl-exp_ptr-sizeof(todo_wine_cmd)),
> exp_ptr+sizeof(todo_wine_cmd));
> +        }
> There is also another difference from your code: the code above also
> counts the succeeded tests, whereas your code doesn't.

Yes, except err is dereferenced in ok arguments so this doesn't work
I discussed with jacek on irc: you could remove the ok(!err, ...) and
use sthg like (err ? *err : 0) instead of the *err but you then get a
problem for "tests succeeded in todo block" to report the correct char
and position in the error message.
Also, jacek didn't particularly care about the # of tests reported
executed, as long as all tests are run and errors are reported
correctly, so tbe ok(TRUE,...) was removed.


More information about the wine-devel mailing list