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
199b2db5
Commit
199b2db5
authored
Sep 07, 2010
by
Jason Edmeades
Committed by
Alexandre Julliard
Sep 08, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Make tests supply stderr + more diagnostics.
parent
38e1b22d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
batch.c
programs/cmd/tests/batch.c
+12
-3
No files found.
programs/cmd/tests/batch.c
View file @
199b2db5
...
...
@@ -31,7 +31,7 @@ static BOOL run_cmd(const char *cmd_data, DWORD cmd_size)
char
command
[]
=
"test.cmd"
;
STARTUPINFOA
si
=
{
sizeof
(
si
)};
PROCESS_INFORMATION
pi
;
HANDLE
file
;
HANDLE
file
,
fileerr
;
DWORD
size
;
BOOL
bres
;
...
...
@@ -53,8 +53,15 @@ static BOOL run_cmd(const char *cmd_data, DWORD cmd_size)
if
(
file
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
fileerr
=
CreateFileA
(
"test.err"
,
GENERIC_WRITE
,
FILE_SHARE_WRITE
|
FILE_SHARE_READ
,
&
sa
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
fileerr
!=
INVALID_HANDLE_VALUE
,
"CreateFile stderr failed
\n
"
);
if
(
fileerr
==
INVALID_HANDLE_VALUE
)
return
FALSE
;
si
.
dwFlags
=
STARTF_USESTDHANDLES
;
si
.
hStdOutput
=
file
;
si
.
hStdError
=
fileerr
;
bres
=
CreateProcessA
(
NULL
,
command
,
NULL
,
NULL
,
TRUE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
);
ok
(
bres
,
"CreateProcess failed: %u
\n
"
,
GetLastError
());
if
(
!
bres
)
{
...
...
@@ -66,6 +73,7 @@ static BOOL run_cmd(const char *cmd_data, DWORD cmd_size)
CloseHandle
(
pi
.
hThread
);
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
file
);
CloseHandle
(
fileerr
);
DeleteFileA
(
"test.cmd"
);
return
TRUE
;
}
...
...
@@ -185,8 +193,8 @@ static void test_output(const char *out_data, DWORD out_size, const char *exp_da
exp_ptr
++
;
}
ok
(
exp_ptr
>=
exp_data
+
exp_size
,
"unexpected end of output in line %d,
expected 0x%x
\n
"
,
line
,
*
exp_ptr
);
ok
(
out_ptr
>=
out_data
+
out_size
,
"too long output
\n
"
);
ok
(
exp_ptr
>=
exp_data
+
exp_size
,
"unexpected end of output in line %d,
missing %s
\n
"
,
line
,
exp_ptr
);
ok
(
out_ptr
>=
out_data
+
out_size
,
"too long output
, got additional %s
\n
"
,
out_ptr
);
}
static
void
run_test
(
const
char
*
cmd_data
,
DWORD
cmd_size
,
const
char
*
exp_data
,
DWORD
exp_size
)
...
...
@@ -203,6 +211,7 @@ static void run_test(const char *cmd_data, DWORD cmd_size, const char *exp_data,
UnmapViewOfFile
(
out_data
);
}
DeleteFileA
(
"test.out"
);
DeleteFileA
(
"test.err"
);
}
static
void
run_from_file
(
char
*
file_name
)
...
...
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