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
1c4897ec
Commit
1c4897ec
authored
Nov 21, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Test passing environment in child process.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
a2d3b27b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
environ.c
dlls/msvcrt/tests/environ.c
+49
-0
No files found.
dlls/msvcrt/tests/environ.c
View file @
1c4897ec
...
...
@@ -393,12 +393,61 @@ static void test_environment_manipulation(void)
ok
(
count
==
env_get_entry_countA
(
*
p_environ
),
"Unexpected modification of _environ[]
\n
"
);
}
static
void
test_child_env
(
char
**
argv
)
{
STARTUPINFOA
si
=
{
sizeof
(
si
)};
WCHAR
*
cur_env
,
*
env
,
*
p
,
*
q
;
PROCESS_INFORMATION
pi
;
char
tmp
[
1024
];
BOOL
ret
;
int
len
;
cur_env
=
GetEnvironmentStringsW
();
ok
(
cur_env
!=
NULL
,
"GetEnvironemntStrings failed
\n
"
);
p
=
cur_env
;
while
(
*
p
)
p
+=
wcslen
(
p
)
+
1
;
len
=
p
-
cur_env
;
env
=
malloc
(
(
len
+
1024
)
*
sizeof
(
*
env
)
);
memcpy
(
env
,
cur_env
,
len
*
sizeof
(
*
env
)
);
q
=
env
+
len
;
FreeEnvironmentStringsW
(
cur_env
);
wcscpy
(
q
,
L"__winetest_dog=bark"
);
q
+=
wcslen
(
L"__winetest_dog=bark"
)
+
1
;
wcscpy
(
q
,
L"__winetest_\u263a=\u03b2"
);
q
+=
wcslen
(
L"__winetest_\u263a=\u03b2"
)
+
1
;
*
q
=
0
;
snprintf
(
tmp
,
sizeof
(
tmp
),
"%s %s create"
,
argv
[
0
],
argv
[
1
]
);
ret
=
CreateProcessA
(
NULL
,
tmp
,
NULL
,
NULL
,
FALSE
,
CREATE_UNICODE_ENVIRONMENT
,
env
,
NULL
,
&
si
,
&
pi
);
ok
(
ret
,
"Couldn't create child process %s
\n
"
,
tmp
);
winetest_wait_child_process
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
free
(
env
);
}
START_TEST
(
environ
)
{
char
**
argv
;
int
argc
;
init
();
argc
=
winetest_get_mainargs
(
&
argv
);
if
(
argc
==
3
&&
!
strcmp
(
argv
[
2
],
"create"
))
{
ok
(
getenv
(
"__winetest_dog"
)
&&
!
strcmp
(
getenv
(
"__winetest_dog"
),
"bark"
),
"Couldn't find env var
\n
"
);
ok
(
_wgetenv
(
L"__winetest_\u263a"
)
&&
!
wcscmp
(
_wgetenv
(
L"__winetest_\u263a"
),
L"\u03b2"
),
"Couldn't find unicode env var
\n
"
);
return
;
}
test__environ
();
test__wenviron
();
test_environment_manipulation
();
test_child_env
(
argv
);
test_system
();
}
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