2011/6/15 Frédéric Delanoy frederic.delanoy@gmail.com:
- if(err == out_nl) {
- if (!is_todo_wine)
- ok(0, "unexpected end of line %d (got '%.*s', wanted '%.*s')\n",
- line, (int)(out_nl-out_ptr), out_ptr, (int)(exp_nl-exp_ptr), exp_ptr);
- else
- todo_wine
- ok(0, "unexpected end of line %d (got '%.*s', wanted '%.*s')\n",
- line, (int)(out_nl-out_ptr), out_ptr,
- (int)(exp_nl-exp_ptr-sizeof(todo_wine_cmd)), exp_ptr+sizeof(todo_wine_cmd));
- }else if(err) {
- if (!is_todo_wine)
- ok(0, "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(0, "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));
- }else {
- if(is_todo_wine)
- todo_wine ok(TRUE, "match at line %d\n", line);
- }
Hello,
I think Jacek was suggesting something among these lines, which does look prettier imho (replace quoted text with following):
+ if(err == out_nl) { + if (!is_todo_wine) + ok(0, "unexpected end of line %d (got '%.*s', wanted '%.*s')\n", + line, (int)(out_nl-out_ptr), out_ptr, (int)(exp_nl-exp_ptr), exp_ptr); + else + todo_wine + ok(0, "unexpected end of line %d (got '%.*s', wanted '%.*s')\n", + line, (int)(out_nl-out_ptr), out_ptr, + (int)(exp_nl-exp_ptr-sizeof(todo_wine_cmd)), exp_ptr+sizeof(todo_wine_cmd)); + }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.
Octavian