Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e486a021
Commit
e486a021
authored
Mar 18, 2010
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Added @or_broken@ handling to test templates and use it to fix tests on win2k.
parent
e7615e00
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
4 deletions
+31
-4
batch.c
programs/cmd/tests/batch.c
+29
-4
test_builtins.cmd
programs/cmd/tests/test_builtins.cmd
+1
-0
test_builtins.cmd.exp
programs/cmd/tests/test_builtins.cmd.exp
+1
-0
No files found.
programs/cmd/tests/batch.c
View file @
e486a021
...
...
@@ -101,9 +101,11 @@ static const char *compare_line(const char *out_line, const char *out_end, const
const
char
*
exp_end
)
{
const
char
*
out_ptr
=
out_line
,
*
exp_ptr
=
exp_line
;
const
char
*
err
=
NULL
;
static
const
char
pwd_cmd
[]
=
{
'@'
,
'p'
,
'w'
,
'd'
,
'@'
};
static
const
char
todo_space_cmd
[]
=
{
'@'
,
't'
,
'o'
,
'd'
,
'o'
,
'_'
,
's'
,
'p'
,
'a'
,
'c'
,
'e'
,
'@'
};
static
const
char
or_broken_cmd
[]
=
{
'@'
,
'o'
,
'r'
,
'_'
,
'b'
,
'r'
,
'o'
,
'k'
,
'e'
,
'n'
,
'@'
};
while
(
exp_ptr
<
exp_end
)
{
if
(
*
exp_ptr
==
'@'
)
{
...
...
@@ -112,10 +114,12 @@ static const char *compare_line(const char *out_line, const char *out_end, const
exp_ptr
+=
sizeof
(
pwd_cmd
);
if
(
out_end
-
out_ptr
<
workdir_len
||
(
CompareStringA
(
LOCALE_SYSTEM_DEFAULT
,
NORM_IGNORECASE
,
out_ptr
,
workdir_len
,
workdir
,
workdir_len
)
!=
CSTR_EQUAL
))
return
out_ptr
;
workdir
,
workdir_len
)
!=
CSTR_EQUAL
))
{
err
=
out_ptr
;
}
else
{
out_ptr
+=
workdir_len
;
continue
;
}
}
else
if
(
exp_ptr
+
sizeof
(
todo_space_cmd
)
<=
exp_end
&&
!
memcmp
(
exp_ptr
,
todo_space_cmd
,
sizeof
(
todo_space_cmd
)))
{
exp_ptr
+=
sizeof
(
todo_space_cmd
);
...
...
@@ -123,10 +127,31 @@ static const char *compare_line(const char *out_line, const char *out_end, const
if
(
out_ptr
<
out_end
&&
*
out_ptr
==
' '
)
out_ptr
++
;
continue
;
}
else
if
(
exp_ptr
+
sizeof
(
or_broken_cmd
)
<=
exp_end
&&
!
memcmp
(
exp_ptr
,
or_broken_cmd
,
sizeof
(
or_broken_cmd
)))
{
exp_ptr
=
exp_end
;
continue
;
}
}
else
if
(
out_ptr
==
out_end
||
*
out_ptr
!=
*
exp_ptr
)
{
err
=
out_ptr
;
}
if
(
err
)
{
if
(
!
broken
(
1
))
return
err
;
while
(
exp_ptr
+
sizeof
(
or_broken_cmd
)
<=
exp_end
&&
memcmp
(
exp_ptr
,
or_broken_cmd
,
sizeof
(
or_broken_cmd
)))
exp_ptr
++
;
if
(
!
exp_ptr
)
return
err
;
exp_ptr
+=
sizeof
(
or_broken_cmd
);
out_ptr
=
out_line
;
err
=
NULL
;
continue
;
}
if
(
out_ptr
==
out_end
||
*
out_ptr
!=
*
exp_ptr
++
)
return
out_ptr
;
exp_ptr
++
;
out_ptr
++
;
}
...
...
programs/cmd/tests/test_builtins.cmd
View file @
e486a021
...
...
@@ -23,6 +23,7 @@ cd dummydir
echo %~dp0
cd ..
rmdir dummydir
echo CD value %CD%
echo %%
echo P%
echo %P
...
...
programs/cmd/tests/test_builtins.cmd.exp
View file @
e486a021
...
...
@@ -16,6 +16,7 @@ bar
~dp0 should be directory containing batch file
@pwd@\
@pwd@\
CD value @pwd@@or_broken@CD value
%
P
P
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment