cmd/tests: Fix test failures on latest Windows 10.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-12-11 16:29:14 +01:00
parent b3167770e7
commit 0e33105abb
2 changed files with 20 additions and 12 deletions

View File

@ -165,6 +165,7 @@ static const char *compare_line(const char *out_line, const char *out_end, const
static const char path_cmd[] = {'@','p','a','t','h','@'}; static const char path_cmd[] = {'@','p','a','t','h','@'};
static const char shortpath_cmd[] = {'@','s','h','o','r','t','p','a','t','h','@'}; static const char shortpath_cmd[] = {'@','s','h','o','r','t','p','a','t','h','@'};
static const char space_cmd[] = {'@','s','p','a','c','e','@'}; static const char space_cmd[] = {'@','s','p','a','c','e','@'};
static const char spaces_cmd[] = {'@','s','p','a','c','e','s','@'};
static const char tab_cmd[] = {'@','t','a','b','@'}; static const char tab_cmd[] = {'@','t','a','b','@'};
static const char or_broken_cmd[] = {'@','o','r','_','b','r','o','k','e','n','@'}; static const char or_broken_cmd[] = {'@','o','r','_','b','r','o','k','e','n','@'};
@ -223,6 +224,15 @@ static const char *compare_line(const char *out_line, const char *out_end, const
} else { } else {
err = out_end; err = out_end;
} }
}else if(exp_ptr+sizeof(spaces_cmd) <= exp_end
&& !memcmp(exp_ptr, spaces_cmd, sizeof(spaces_cmd))) {
exp_ptr += sizeof(spaces_cmd);
if(out_ptr < out_end && *out_ptr == ' ') {
while (out_ptr < out_end && *out_ptr == ' ') out_ptr++;
continue;
} else {
err = out_end;
}
}else if(exp_ptr+sizeof(tab_cmd) <= exp_end }else if(exp_ptr+sizeof(tab_cmd) <= exp_end
&& !memcmp(exp_ptr, tab_cmd, sizeof(tab_cmd))) { && !memcmp(exp_ptr, tab_cmd, sizeof(tab_cmd))) {
exp_ptr += sizeof(tab_cmd); exp_ptr += sizeof(tab_cmd);
@ -250,10 +260,8 @@ static const char *compare_line(const char *out_line, const char *out_end, const
while(exp_ptr+sizeof(or_broken_cmd) <= exp_end && memcmp(exp_ptr, or_broken_cmd, sizeof(or_broken_cmd))) while(exp_ptr+sizeof(or_broken_cmd) <= exp_end && memcmp(exp_ptr, or_broken_cmd, sizeof(or_broken_cmd)))
exp_ptr++; exp_ptr++;
if(!exp_ptr)
return err;
exp_ptr += sizeof(or_broken_cmd); exp_ptr += sizeof(or_broken_cmd);
if (exp_ptr > exp_end) return err;
out_ptr = out_line; out_ptr = out_line;
err = NULL; err = NULL;
continue; continue;

View File

@ -1392,22 +1392,22 @@ bar\baz removed
@drive@@path@foobar @drive@@path@foobar
@pwd@ @pwd@
------------ Testing attrib ------------ ------------ Testing attrib ------------
A @drive@@path@foobar\foo@or_broken@A @drive@@path@foobar\foo@or_broken@A I @drive@@path@foobar\foo A@spaces@@drive@@path@foobar\foo@or_broken@A I@spaces@@drive@@path@foobar\foo
--- read-only attribute --- read-only attribute
A R @drive@@path@foobar\foo@or_broken@A R @drive@@path@foobar\foo@or_broken@A R I @drive@@path@foobar\foo A R@spaces@@drive@@path@foobar\foo@or_broken@A R I@spaces@@drive@@path@foobar\foo
foo foo
foo original contents foo original contents
Read-only file not deleted Read-only file not deleted
Read-only file forcibly deleted Read-only file forcibly deleted
--- recursive behaviour --- recursive behaviour
A @drive@@path@foobar\baz\level2@or_broken@A @drive@@path@foobar\baz\level2@or_broken@A I @drive@@path@foobar\baz\level2 A@spaces@@drive@@path@foobar\baz\level2@or_broken@A I@spaces@@drive@@path@foobar\baz\level2
A R @drive@@path@foobar\level1@or_broken@A R @drive@@path@foobar\level1@or_broken@A R I @drive@@path@foobar\level1 A R@spaces@@drive@@path@foobar\level1@or_broken@A R I@spaces@@drive@@path@foobar\level1
A R @drive@@path@foobar\baz\level2@or_broken@A R @drive@@path@foobar\baz\level2@or_broken@A R I @drive@@path@foobar\baz\level2 A R@spaces@@drive@@path@foobar\baz\level2@or_broken@A R I@spaces@@drive@@path@foobar\baz\level2
A @drive@@path@foobar\bar@or_broken@A @drive@@path@foobar\bar@or_broken@A I @drive@@path@foobar\bar A@spaces@@drive@@path@foobar\bar@or_broken@A I@spaces@@drive@@path@foobar\bar
--- folders processing --- folders processing
@drive@@path@foobar@or_broken@ @drive@@path@foobar@or_broken@ I @drive@@path@foobar @spaces@@drive@@path@foobar@or_broken@ I@spaces@@drive@@path@foobar
@todo_wine@ R @drive@@path@foobar\baz@or_broken@ R @drive@@path@foobar\baz@or_broken@ @drive@@path@foobar\baz@or_broken@ R I @drive@@path@foobar\baz @todo_wine@ R@spaces@@drive@@path@foobar\baz@or_broken@@spaces@@drive@@path@foobar\baz@or_broken@ R I@spaces@@drive@@path@foobar\baz
A @drive@@path@foobar\baz\toto@or_broken@A @drive@@path@foobar\baz\toto@or_broken@A I @drive@@path@foobar\baz\toto A@spaces@@drive@@path@foobar\baz\toto@or_broken@A I@spaces@@drive@@path@foobar\baz\toto
toto toto
lulu lulu
file created in read-only dir file created in read-only dir