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
e7e99800
Commit
e7e99800
authored
Jan 23, 2008
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Test the expansion of indirect environment variable references.
parent
269cb45f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
environ.c
dlls/kernel32/tests/environ.c
+13
-3
No files found.
dlls/kernel32/tests/environ.c
View file @
e7e99800
...
@@ -274,9 +274,19 @@ static void test_ExpandEnvironmentStringsA(void)
...
@@ -274,9 +274,19 @@ static void test_ExpandEnvironmentStringsA(void)
ret_size1
=
GetWindowsDirectoryA
(
buf1
,
256
);
ret_size1
=
GetWindowsDirectoryA
(
buf1
,
256
);
ok
((
ret_size1
>
0
)
&&
(
ret_size1
<
256
),
"GetWindowsDirectory Failed
\n
"
);
ok
((
ret_size1
>
0
)
&&
(
ret_size1
<
256
),
"GetWindowsDirectory Failed
\n
"
);
ret_size
=
ExpandEnvironmentStringsA
(
"%SystemRoot%"
,
buf
,
sizeof
(
buf
));
ret_size
=
ExpandEnvironmentStringsA
(
"%SystemRoot%"
,
buf
,
sizeof
(
buf
));
if
(
ERROR_ENVVAR_NOT_FOUND
==
GetLastError
())
if
(
ERROR_ENVVAR_NOT_FOUND
!=
GetLastError
())
return
;
{
ok
(
!
strcmp
(
buf
,
buf1
),
"ExpandEnvironmentStrings failed %s vs %s. ret_size = %d
\n
"
,
buf
,
buf1
,
ret_size
);
ok
(
!
strcmp
(
buf
,
buf1
),
"ExpandEnvironmentStrings failed %s vs %s. ret_size = %d
\n
"
,
buf
,
buf1
,
ret_size
);
}
/* Try with a variable that references another */
SetEnvironmentVariableA
(
"IndirectVar"
,
"Foo%EnvVar%Bar"
);
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
,
strlen
(
buf2
)
+
1
);
ok
(
!
strcmp
(
buf1
,
buf2
),
"ExpandEnvironmentStrings returned [%s]
\n
"
,
buf1
);
SetEnvironmentVariableA
(
"IndirectVar"
,
NULL
);
SetEnvironmentVariableA
(
"EnvVar"
,
NULL
);
SetEnvironmentVariableA
(
"EnvVar"
,
NULL
);
}
}
...
...
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