Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9c23b5de
Commit
9c23b5de
authored
Jun 22, 2010
by
Ilya Basin
Committed by
Alexandre Julliard
Jun 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: SHELL_ArgifyW(%2|%*|%~3, ...) tests.
parent
a254524a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
137 additions
and
0 deletions
+137
-0
shlexec.c
dlls/shell32/tests/shlexec.c
+137
-0
No files found.
dlls/shell32/tests/shlexec.c
View file @
9c23b5de
...
...
@@ -960,6 +960,133 @@ static void test_lpFile_parsed(void)
"expected success (33), got %s (%d), lpFile: %s
\n
"
,
rc
>
32
?
"success"
:
"failure"
,
rc
,
fileA
);
}
static
void
test_argify
(
void
)
{
char
fileA
[
MAX_PATH
];
int
rc
;
sprintf
(
fileA
,
"%s
\\
test file.shlexec"
,
tmpdir
);
/* %2 */
rc
=
shell_execute
(
"NoQuotesParam2"
,
fileA
,
"a b"
,
NULL
);
ok
(
rc
>
32
,
"expected success (33), got %s (%d), lpFile: %s
\n
"
,
rc
>
32
?
"success"
:
"failure"
,
rc
,
fileA
);
if
(
rc
>
32
)
{
okChildInt
(
"argcA"
,
5
);
okChildString
(
"argvA4"
,
"a"
);
}
/* %2 */
/* '"a"""' -> 'a"' */
rc
=
shell_execute
(
"NoQuotesParam2"
,
fileA
,
"
\"
a:
\"\"
some string
\"\"\"
"
,
NULL
);
ok
(
rc
>
32
,
"expected success (33), got %s (%d), lpFile: %s
\n
"
,
rc
>
32
?
"success"
:
"failure"
,
rc
,
fileA
);
if
(
rc
>
32
)
{
okChildInt
(
"argcA"
,
5
);
todo_wine
{
okChildString
(
"argvA4"
,
"a:some string"
);
}
}
/* %2 */
/* backslash isn't escape char
* '"a\""' -> '"a\""' */
rc
=
shell_execute
(
"NoQuotesParam2"
,
fileA
,
"
\"
a:
\\\"
some string
\\\"\"
"
,
NULL
);
ok
(
rc
>
32
,
"expected success (33), got %s (%d), lpFile: %s
\n
"
,
rc
>
32
?
"success"
:
"failure"
,
rc
,
fileA
);
if
(
rc
>
32
)
{
okChildInt
(
"argcA"
,
5
);
todo_wine
{
okChildString
(
"argvA4"
,
"a:
\\
"
);
}
}
/* "%2" */
/* \t isn't whitespace */
rc
=
shell_execute
(
"QuotedParam2"
,
fileA
,
"a
\t
b c"
,
NULL
);
ok
(
rc
>
32
,
"expected success (33), got %s (%d), lpFile: %s
\n
"
,
rc
>
32
?
"success"
:
"failure"
,
rc
,
fileA
);
if
(
rc
>
32
)
{
okChildInt
(
"argcA"
,
5
);
todo_wine
{
okChildString
(
"argvA4"
,
"a
\t
b"
);
}
}
/* %* */
rc
=
shell_execute
(
"NoQuotesAllParams"
,
fileA
,
"a b c d e f g h"
,
NULL
);
ok
(
rc
>
32
,
"expected success (33), got %s (%d), lpFile: %s
\n
"
,
rc
>
32
?
"success"
:
"failure"
,
rc
,
fileA
);
if
(
rc
>
32
)
{
todo_wine
{
okChildInt
(
"argcA"
,
12
);
okChildString
(
"argvA4"
,
"a"
);
okChildString
(
"argvA11"
,
"h"
);
}
}
/* %* can sometimes contain only whitespaces and no args */
rc
=
shell_execute
(
"QuotedAllParams"
,
fileA
,
" "
,
NULL
);
ok
(
rc
>
32
,
"expected success (33), got %s (%d), lpFile: %s
\n
"
,
rc
>
32
?
"success"
:
"failure"
,
rc
,
fileA
);
if
(
rc
>
32
)
{
todo_wine
{
okChildInt
(
"argcA"
,
5
);
okChildString
(
"argvA4"
,
" "
);
}
}
/* %~3 */
rc
=
shell_execute
(
"NoQuotesParams345etc"
,
fileA
,
"a b c d e f g h"
,
NULL
);
ok
(
rc
>
32
,
"expected success (33), got %s (%d), lpFile: %s
\n
"
,
rc
>
32
?
"success"
:
"failure"
,
rc
,
fileA
);
if
(
rc
>
32
)
{
todo_wine
{
okChildInt
(
"argcA"
,
11
);
okChildString
(
"argvA4"
,
"b"
);
okChildString
(
"argvA10"
,
"h"
);
}
}
/* %~3 is rest of command line starting with whitespaces after 2nd arg */
rc
=
shell_execute
(
"QuotedParams345etc"
,
fileA
,
"a "
,
NULL
);
ok
(
rc
>
32
,
"expected success (33), got %s (%d), lpFile: %s
\n
"
,
rc
>
32
?
"success"
:
"failure"
,
rc
,
fileA
);
if
(
rc
>
32
)
{
okChildInt
(
"argcA"
,
5
);
todo_wine
{
okChildString
(
"argvA4"
,
" "
);
}
}
}
static
void
test_filename
(
void
)
...
...
@@ -1935,6 +2062,15 @@ static void init_test(void)
create_test_verb
(
".shlexec"
,
"QuotedLowerL"
,
0
,
"QuotedLowerL
\"
%l
\"
"
);
create_test_verb
(
".shlexec"
,
"UpperL"
,
0
,
"UpperL %L"
);
create_test_verb
(
".shlexec"
,
"QuotedUpperL"
,
0
,
"QuotedUpperL
\"
%L
\"
"
);
create_test_verb
(
".shlexec"
,
"NoQuotesParam2"
,
0
,
"NoQuotesParam2 %2"
);
create_test_verb
(
".shlexec"
,
"QuotedParam2"
,
0
,
"QuotedParam2
\"
%2
\"
"
);
create_test_verb
(
".shlexec"
,
"NoQuotesAllParams"
,
0
,
"NoQuotesAllParams %*"
);
create_test_verb
(
".shlexec"
,
"QuotedAllParams"
,
0
,
"QuotedAllParams
\"
%*
\"
"
);
create_test_verb
(
".shlexec"
,
"NoQuotesParams345etc"
,
0
,
"NoQuotesParams345etc %~3"
);
create_test_verb
(
".shlexec"
,
"QuotedParams345etc"
,
0
,
"QuotedParams345etc
\"
%~3
\"
"
);
}
static
void
cleanup_test
(
void
)
...
...
@@ -2048,6 +2184,7 @@ START_TEST(shlexec)
init_test
();
test_argify
();
test_lpFile_parsed
();
test_filename
();
test_find_executable
();
...
...
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