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
740e5ac7
Commit
740e5ac7
authored
Nov 10, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Test adding Unicode env variables.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
a5d7cc47
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
environ.c
dlls/msvcrt/tests/environ.c
+18
-0
No files found.
dlls/msvcrt/tests/environ.c
View file @
740e5ac7
...
...
@@ -22,6 +22,7 @@
#include <errno.h>
#include <stdlib.h>
#include <process.h>
#include <winnls.h>
static
const
char
*
a_very_long_env_string
=
"LIBRARY_PATH="
...
...
@@ -375,6 +376,23 @@ static void test_environment_manipulation(void)
ok
(
getenv
(
"__winetest_cat"
)
==
NULL
,
"msvcrt env cache shouldn't have been updated
\n
"
);
ok
(
_putenv
(
"__winetest_cat="
)
==
0
,
"Couldn't reset env var
\n
"
);
ok
(
_putenv
(
"__winetest_dog="
)
==
0
,
"Couldn't reset env var
\n
"
);
/* test setting unicode bits */
count
=
env_get_entry_countA
(
*
p_environ
);
ret
=
WideCharToMultiByte
(
CP_ACP
,
0
,
L"\u263a"
,
-
1
,
buf
,
ARRAY_SIZE
(
buf
),
0
,
0
);
ok
(
ret
,
"WideCharToMultiByte failed: %lu
\n
"
,
GetLastError
()
);
ok
(
_wputenv
(
L"__winetest_cat=\u263a"
)
==
0
,
"Couldn't set env var
\n
"
);
ok
(
_wgetenv
(
L"__winetest_cat"
)
&&
!
wcscmp
(
_wgetenv
(
L"__winetest_cat"
),
L"\u263a"
),
"Couldn't retrieve env var
\n
"
);
ok
(
getenv
(
"__winetest_cat"
)
&&
!
strcmp
(
getenv
(
"__winetest_cat"
),
buf
),
"Couldn't retrieve env var
\n
"
);
ok
(
_wputenv
(
L"__winetest_cat="
)
==
0
,
"Couldn't reset env var
\n
"
);
ret
=
WideCharToMultiByte
(
CP_ACP
,
0
,
L"__winetest_\u263a"
,
-
1
,
buf
,
ARRAY_SIZE
(
buf
),
0
,
0
);
ok
(
ret
,
"WideCharToMultiByte failed: %lu
\n
"
,
GetLastError
()
);
ok
(
_wputenv
(
L"__winetest_\u263a=bark"
)
==
0
,
"Couldn't set env var
\n
"
);
ok
(
_wgetenv
(
L"__winetest_\u263a"
)
&&
!
wcscmp
(
_wgetenv
(
L"__winetest_\u263a"
),
L"bark"
),
"Couldn't retrieve env var
\n
"
);
ok
(
getenv
(
buf
)
&&
!
strcmp
(
getenv
(
buf
),
"bark"
),
"Couldn't retrieve env var %s
\n
"
,
wine_dbgstr_a
(
buf
)
);
ok
(
_wputenv
(
L"__winetest_\u263a="
)
==
0
,
"Couldn't reset env var
\n
"
);
ok
(
count
==
env_get_entry_countA
(
*
p_environ
),
"Unexpected modification of _environ[]
\n
"
);
}
START_TEST
(
environ
)
...
...
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