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
cb10a70a
Commit
cb10a70a
authored
Sep 07, 2004
by
Ferenc Wagner
Committed by
Alexandre Julliard
Sep 07, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
As test runs are not invoked from the option parsing loop anymore, we
can switch back to libc's strtok() implementation.
parent
7e848dc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
33 deletions
+9
-33
main.c
programs/winetest/main.c
+9
-33
No files found.
programs/winetest/main.c
View file @
cb10a70a
...
...
@@ -56,6 +56,7 @@ struct rev_info
static
struct
wine_test
*
wine_tests
;
static
struct
rev_info
*
rev_infos
=
NULL
;
static
const
char
whitespace
[]
=
"
\t\r\n
"
;
static
int
running_under_wine
()
{
...
...
@@ -324,7 +325,6 @@ get_subtests (const char *tempdir, struct wine_test *test, int id)
size_t
total
;
char
buffer
[
8192
],
*
index
;
static
const
char
header
[]
=
"Valid test names:"
;
static
const
char
seps
[]
=
"
\r\n
"
;
int
allocated
;
test
->
subtest_count
=
0
;
...
...
@@ -360,7 +360,7 @@ get_subtests (const char *tempdir, struct wine_test *test, int id)
allocated
=
10
;
test
->
subtests
=
xmalloc
(
allocated
*
sizeof
(
char
*
));
index
=
strtok
(
index
,
seps
);
index
=
strtok
(
index
,
whitespace
);
while
(
index
)
{
if
(
test
->
subtest_count
==
allocated
)
{
allocated
*=
2
;
...
...
@@ -368,7 +368,7 @@ get_subtests (const char *tempdir, struct wine_test *test, int id)
allocated
*
sizeof
(
char
*
));
}
test
->
subtests
[
test
->
subtest_count
++
]
=
strdup
(
index
);
index
=
strtok
(
NULL
,
seps
);
index
=
strtok
(
NULL
,
whitespace
);
}
test
->
subtests
=
xrealloc
(
test
->
subtests
,
test
->
subtest_count
*
sizeof
(
char
*
));
...
...
@@ -423,7 +423,7 @@ run_tests (char *logname, const char *tag)
0666
);
if
(
-
1
==
logfile
)
{
if
(
EEXIST
==
errno
)
report
(
R_FATAL
,
"File %s already exists."
);
report
(
R_FATAL
,
"File %s already exists."
,
logname
);
else
report
(
R_FATAL
,
"Could not open logfile: %d"
,
errno
);
}
if
(
-
1
==
dup2
(
logfile
,
1
))
...
...
@@ -518,30 +518,6 @@ Usage: winetest [OPTION]...\n\n\
-t TAG include TAG of characters [-.0-9a-zA-Z] in the report
\n
"
);
}
/* One can't nest strtok()-s, so here is a replacement. */
char
*
mystrtok
(
char
*
newstr
)
{
static
char
*
start
,
*
end
;
static
int
finish
=
1
;
if
(
newstr
)
{
start
=
newstr
;
finish
=
0
;
}
else
start
=
end
;
if
(
finish
)
return
NULL
;
while
(
*
start
==
' '
)
start
++
;
if
(
*
start
==
0
)
return
NULL
;
end
=
start
;
while
(
*
end
!=
' '
)
if
(
*
end
==
0
)
{
finish
=
1
;
return
start
;
}
else
end
++
;
*
end
++
=
0
;
return
start
;
}
int
WINAPI
WinMain
(
HINSTANCE
hInst
,
HINSTANCE
hPrevInst
,
LPSTR
cmdLine
,
int
cmdShow
)
{
...
...
@@ -552,7 +528,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
/* initialize the revision information first */
extract_rev_infos
();
cmdLine
=
mystrtok
(
cmdLin
e
);
cmdLine
=
strtok
(
cmdLine
,
whitespac
e
);
while
(
cmdLine
)
{
if
(
cmdLine
[
0
]
!=
'-'
||
cmdLine
[
2
])
{
report
(
R_ERROR
,
"Not a single letter option: %s"
,
cmdLine
);
...
...
@@ -573,16 +549,16 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
report
(
R_QUIET
);
break
;
case
's'
:
submit
=
mystrtok
(
NULL
);
submit
=
strtok
(
NULL
,
whitespace
);
if
(
tag
)
report
(
R_WARNING
,
"ignoring tag for submission"
);
send_file
(
submit
);
break
;
case
'o'
:
logname
=
mystrtok
(
NULL
);
logname
=
strtok
(
NULL
,
whitespace
);
break
;
case
't'
:
tag
=
mystrtok
(
NULL
);
tag
=
strtok
(
NULL
,
whitespace
);
cp
=
badtagchar
(
tag
);
if
(
cp
)
{
report
(
R_ERROR
,
"invalid char in tag: %c"
,
*
cp
);
...
...
@@ -595,7 +571,7 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
usage
();
exit
(
2
);
}
cmdLine
=
mystrtok
(
NULL
);
cmdLine
=
strtok
(
NULL
,
whitespace
);
}
if
(
!
submit
)
{
if
(
reset_env
&&
(
putenv
(
"WINETEST_PLATFORM=windows"
)
||
...
...
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