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
83933c59
Commit
83933c59
authored
Apr 28, 2020
by
Fabian Maurer
Committed by
Alexandre Julliard
Apr 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
find.exe/tests: Add test for multiple files at once.
Signed-off-by:
Fabian Maurer
<
dark.shadow4@web.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
53b305c3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
find.c
programs/find/tests/find.c
+51
-0
No files found.
programs/find/tests/find.c
View file @
83933c59
...
...
@@ -264,6 +264,56 @@ static void run_find_unicode_(const BYTE *input, int input_len, const BYTE *out_
run_find_stdin_
(
wstr_quoted_test
,
input
,
input_len
,
out_expected_mangled
,
out_expected_mangled_len
,
exitcode_expected
,
file
,
line
);
}
static
void
run_find_file_multi
(
void
)
{
char
path_temp_file1
[
MAX_PATH
];
char
path_temp_file2
[
MAX_PATH
];
char
path_temp_file3
[
MAX_PATH
];
char
path_temp_dir
[
MAX_PATH
];
HANDLE
handle_file
;
WCHAR
commandline_new
[
MAX_PATH
];
char
out_expected
[
500
];
const
char
*
input
=
"ab
\n
bd"
;
GetTempPathA
(
ARRAY_SIZE
(
path_temp_dir
),
path_temp_dir
);
GetTempFileNameA
(
path_temp_dir
,
""
,
0
,
path_temp_file1
);
GetTempFileNameA
(
path_temp_dir
,
""
,
0
,
path_temp_file2
);
GetTempFileNameA
(
path_temp_dir
,
""
,
0
,
path_temp_file3
);
handle_file
=
CreateFileA
(
path_temp_file1
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
write_to_handle
(
handle_file
,
(
BYTE
*
)
input
,
strlen
(
input
));
CloseHandle
(
handle_file
);
handle_file
=
CreateFileA
(
path_temp_file2
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
write_to_handle
(
handle_file
,
(
BYTE
*
)
input
,
strlen
(
input
));
CloseHandle
(
handle_file
);
wsprintfW
(
commandline_new
,
L"
\"
b
\"
C:
\\
doesnotexist1 %hs C:
\\
doesnotexist1 %hs C:
\\
doesnotexist1 %hs"
,
path_temp_file1
,
path_temp_file2
,
path_temp_file3
);
/* Keep file open during the test */
handle_file
=
CreateFileA
(
path_temp_file3
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
CharUpperA
(
path_temp_file1
);
CharUpperA
(
path_temp_file2
);
CharUpperA
(
path_temp_file3
);
wsprintfA
(
out_expected
,
"File not found - C:
\\
DOESNOTEXIST1
\r\n
"
"
\r\n
---------- %s
\r\n
"
"ab
\r\n
bd
\r\n
"
"File not found - C:
\\
DOESNOTEXIST1
\r\n
"
"
\r\n
---------- %s
\r\n
"
"ab
\r\n
bd
\r\n
"
"File not found - C:
\\
DOESNOTEXIST1
\r\n
"
"File not found - %s
\r\n
"
,
path_temp_file1
,
path_temp_file2
,
path_temp_file3
);
todo_wine
run_find_stdin_
(
commandline_new
,
(
BYTE
*
)
""
,
0
,
(
BYTE
*
)
out_expected
,
strlen
(
out_expected
),
0
,
__FILE__
,
__LINE__
);
CloseHandle
(
handle_file
);
DeleteFileA
(
path_temp_file1
);
DeleteFileA
(
path_temp_file2
);
DeleteFileA
(
path_temp_file3
);
}
static
void
test_errors
(
void
)
{
run_find_stdin_str
(
""
,
""
,
"FIND: Parameter format not correct
\r\n
"
,
2
);
...
...
@@ -411,6 +461,7 @@ START_TEST(find)
else
{
test_errors
();
run_find_file_multi
();
}
test_singleline_without_switches
();
test_multiline
();
...
...
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