Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
d1dc7e5b
Commit
d1dc7e5b
authored
16 years ago
by
Juan Lang
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
kernel32: Fix test failures on NT4.
parent
705cdc88
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/kernel32/tests/environ.c
+14
-6
14 additions, 6 deletions
dlls/kernel32/tests/environ.c
with
14 additions
and
6 deletions
dlls/kernel32/tests/environ.c
+
14
−
6
View file @
d1dc7e5b
...
...
@@ -245,13 +245,14 @@ static void test_ExpandEnvironmentStringsA(void)
SetEnvironmentVariableA
(
"EnvVar"
,
value
);
ret_size
=
ExpandEnvironmentStringsA
(
NULL
,
buf1
,
sizeof
(
buf1
));
ok
(
ret_size
==
1
||
ret_size
==
0
/* Win9x */
,
ok
(
ret_size
==
1
||
ret_size
==
0
/* Win9x
*/
||
ret_size
==
2
/* NT4
*/
,
"ExpandEnvironmentStrings returned %d
\n
"
,
ret_size
);
/* Try to get the required buffer size 'the natural way' */
strcpy
(
buf
,
"%EnvVar%"
);
ret_size
=
ExpandEnvironmentStringsA
(
buf
,
NULL
,
0
);
ok
(
ret_size
==
strlen
(
value
)
+
1
||
/* win98 */
ret_size
==
(
strlen
(
value
)
+
1
)
*
2
||
/* NT4 */
ret_size
==
strlen
(
value
)
+
2
||
/* win2k, XP, win2k3 */
ret_size
==
0
/* Win95 */
,
"ExpandEnvironmentStrings returned %d instead of %d, %d or %d
\n
"
,
...
...
@@ -260,21 +261,24 @@ static void test_ExpandEnvironmentStringsA(void)
/* Again, side-stepping the Win95 bug */
ret_size
=
ExpandEnvironmentStringsA
(
buf
,
buf1
,
0
);
/* v5.1.2600.2945 (XP SP2) returns len + 2 here! */
ok
(
ret_size
==
strlen
(
value
)
+
1
||
ret_size
==
strlen
(
value
)
+
2
,
ok
(
ret_size
==
strlen
(
value
)
+
1
||
ret_size
==
strlen
(
value
)
+
2
||
ret_size
==
(
strlen
(
value
)
+
1
)
*
2
/* NT4 */
,
"ExpandEnvironmentStrings returned %d instead of %d
\n
"
,
ret_size
,
lstrlenA
(
value
)
+
1
);
/* Try with a buffer that's too small */
ret_size
=
ExpandEnvironmentStringsA
(
buf
,
buf1
,
12
);
/* v5.1.2600.2945 (XP SP2) returns len + 2 here! */
ok
(
ret_size
==
strlen
(
value
)
+
1
||
ret_size
==
strlen
(
value
)
+
2
,
ok
(
ret_size
==
strlen
(
value
)
+
1
||
ret_size
==
strlen
(
value
)
+
2
||
ret_size
==
(
strlen
(
value
)
+
1
)
*
2
/* NT4 */
,
"ExpandEnvironmentStrings returned %d instead of %d
\n
"
,
ret_size
,
lstrlenA
(
value
)
+
1
);
/* Try with a buffer of just the right size */
/* v5.1.2600.2945 (XP SP2) needs and returns len + 2 here! */
ret_size
=
ExpandEnvironmentStringsA
(
buf
,
buf1
,
ret_size
);
ok
(
ret_size
==
strlen
(
value
)
+
1
||
ret_size
==
strlen
(
value
)
+
2
,
ok
(
ret_size
==
strlen
(
value
)
+
1
||
ret_size
==
strlen
(
value
)
+
2
||
ret_size
==
strlen
(
value
)
*
2
/* NT4 */
,
"ExpandEnvironmentStrings returned %d instead of %d
\n
"
,
ret_size
,
lstrlenA
(
value
)
+
1
);
ok
(
!
strcmp
(
buf1
,
value
),
"ExpandEnvironmentStrings returned [%s]
\n
"
,
buf1
);
...
...
@@ -282,7 +286,9 @@ static void test_ExpandEnvironmentStringsA(void)
/* Try with an unset environment variable */
strcpy
(
buf
,
not_an_env_var
);
ret_size
=
ExpandEnvironmentStringsA
(
buf
,
buf1
,
sizeof
(
buf1
));
ok
(
ret_size
==
strlen
(
not_an_env_var
)
+
1
,
"ExpandEnvironmentStrings returned %d instead of %d
\n
"
,
ret_size
,
lstrlenA
(
value
)
+
1
);
ok
(
ret_size
==
strlen
(
not_an_env_var
)
+
1
||
ret_size
==
(
strlen
(
not_an_env_var
)
+
1
)
*
2
/* NT4 */
,
"ExpandEnvironmentStrings returned %d instead of %d
\n
"
,
ret_size
,
lstrlenA
(
not_an_env_var
)
+
1
);
ok
(
!
strcmp
(
buf1
,
not_an_env_var
),
"ExpandEnvironmentStrings returned [%s]
\n
"
,
buf1
);
/* test a large destination size */
...
...
@@ -303,7 +309,9 @@ static void test_ExpandEnvironmentStringsA(void)
strcpy
(
buf
,
"Indirect-%IndirectVar%-Indirect"
);
strcpy
(
buf2
,
"Indirect-Foo%EnvVar%Bar-Indirect"
);
ret_size
=
ExpandEnvironmentStringsA
(
buf
,
buf1
,
sizeof
(
buf1
));
ok
(
ret_size
==
strlen
(
buf2
)
+
1
,
"ExpandEnvironmentStrings returned %d instead of %d
\n
"
,
ret_size
,
lstrlen
(
buf2
)
+
1
);
ok
(
ret_size
==
strlen
(
buf2
)
+
1
||
ret_size
==
(
strlen
(
buf2
)
+
1
)
*
2
/* NT4 */
,
"ExpandEnvironmentStrings returned %d instead of %d
\n
"
,
ret_size
,
lstrlen
(
buf2
)
+
1
);
ok
(
!
strcmp
(
buf1
,
buf2
),
"ExpandEnvironmentStrings returned [%s]
\n
"
,
buf1
);
SetEnvironmentVariableA
(
"IndirectVar"
,
NULL
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment