mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 10:53:38 +00:00
cmd/tests: Treat lines that start with '---' as resynchronization points.
This commit is contained in:
parent
84f158025b
commit
81f64ee906
|
@ -276,7 +276,8 @@ static void test_output(const char *out_data, DWORD out_size, const char *exp_da
|
|||
const char *out_ptr = out_data, *exp_ptr = exp_data, *out_nl, *exp_nl, *err;
|
||||
DWORD line = 0;
|
||||
static const char todo_wine_cmd[] = {'@','t','o','d','o','_','w','i','n','e','@'};
|
||||
BOOL is_todo_wine;
|
||||
static const char resync_cmd[] = {'-','-','-'};
|
||||
BOOL is_todo_wine, is_out_resync, is_exp_resync;
|
||||
|
||||
while(out_ptr < out_data+out_size && exp_ptr < exp_data+exp_size) {
|
||||
line++;
|
||||
|
@ -290,6 +291,10 @@ static void test_output(const char *out_data, DWORD out_size, const char *exp_da
|
|||
exp_ptr += sizeof(todo_wine_cmd);
|
||||
winetest_start_todo("wine");
|
||||
}
|
||||
is_exp_resync=(exp_ptr+sizeof(resync_cmd) <= exp_nl &&
|
||||
!memcmp(exp_ptr, resync_cmd, sizeof(resync_cmd)));
|
||||
is_out_resync=(out_ptr+sizeof(resync_cmd) <= out_nl &&
|
||||
!memcmp(out_ptr, resync_cmd, sizeof(resync_cmd)));
|
||||
|
||||
err = compare_line(out_ptr, out_nl, exp_ptr, exp_nl);
|
||||
if(err == out_nl)
|
||||
|
@ -298,18 +303,31 @@ static void test_output(const char *out_data, DWORD out_size, const char *exp_da
|
|||
else if(err == exp_nl)
|
||||
ok(0, "excess characters on line %d (got '%.*s', wanted '%.*s')\n",
|
||||
line, (int)(out_nl-out_ptr), out_ptr, (int)(exp_nl-exp_ptr), exp_ptr);
|
||||
else if (!err && is_todo_wine && is_out_resync && is_exp_resync)
|
||||
/* Consider that the todo_wine was to deal with extra lines,
|
||||
* not for the resync line itself
|
||||
*/
|
||||
err = NULL;
|
||||
else
|
||||
ok(!err, "unexpected char 0x%x position %d in line %d (got '%.*s', wanted '%.*s')\n",
|
||||
(err ? *err : 0), (err ? (int)(err-out_ptr) : -1), line, (int)(out_nl-out_ptr), out_ptr, (int)(exp_nl-exp_ptr), exp_ptr);
|
||||
|
||||
if(is_todo_wine) winetest_end_todo("wine");
|
||||
|
||||
exp_ptr = exp_nl+1;
|
||||
out_ptr = out_nl+1;
|
||||
if(out_nl+1 < out_data+out_size && out_nl[0] == '\r' && out_nl[1] == '\n')
|
||||
out_ptr++;
|
||||
if(exp_nl+1 < exp_data+exp_size && exp_nl[0] == '\r' && exp_nl[1] == '\n')
|
||||
exp_ptr++;
|
||||
if (is_exp_resync && err && is_todo_wine)
|
||||
exp_ptr -= sizeof(todo_wine_cmd);
|
||||
else if (!is_exp_resync || (is_exp_resync && !err))
|
||||
{
|
||||
exp_ptr = exp_nl+1;
|
||||
if(exp_nl+1 < exp_data+exp_size && exp_nl[0] == '\r' && exp_nl[1] == '\n')
|
||||
exp_ptr++;
|
||||
}
|
||||
if (!is_out_resync || (is_out_resync && !err))
|
||||
{
|
||||
out_ptr = out_nl+1;
|
||||
if(out_nl+1 < out_data+out_size && out_nl[0] == '\r' && out_nl[1] == '\n')
|
||||
out_ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
ok(exp_ptr >= exp_data+exp_size, "unexpected end of output in line %d, missing %s\n", line, exp_ptr);
|
||||
|
|
|
@ -164,7 +164,7 @@ type C
|
|||
(if 1==0 (echo A > B) else echo C)
|
||||
cd .. & rd /s/q foobar
|
||||
|
||||
echo ------------ Testing ^^ escape character --------------
|
||||
echo ------------ Testing circumflex escape character --------------
|
||||
rem Using something like "echo foo^" asks for an additional char after a "More?" prompt on the following line; it's not possible to currently test that non-interactively
|
||||
echo ^hell^o, world
|
||||
echo hell^o, world
|
||||
|
|
|
@ -178,7 +178,7 @@ foo
|
|||
A
|
||||
B
|
||||
C
|
||||
@todo_wine@------------ Testing ^ escape character --------------
|
||||
------------ Testing circumflex escape character --------------
|
||||
@todo_wine@hello, world
|
||||
@todo_wine@hello, world
|
||||
@todo_wine@hell^o, world
|
||||
|
|
Loading…
Reference in a new issue