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
797d6cb4
Commit
797d6cb4
authored
Oct 06, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Oct 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt/tests: Add tests for the __p__(w)environ accessors.
parent
eebf331e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
environ.c
dlls/msvcrt/tests/environ.c
+31
-0
No files found.
dlls/msvcrt/tests/environ.c
View file @
797d6cb4
...
...
@@ -45,6 +45,9 @@ static const char *a_very_long_env_string =
void
__cdecl
__getmainargs
(
int
*
,
char
***
,
char
***
,
int
,
int
*
);
void
__cdecl
__wgetmainargs
(
int
*
,
wchar_t
***
,
wchar_t
***
,
int
,
int
*
);
static
char
***
(
__cdecl
*
p__p__environ
)(
void
);
static
WCHAR
***
(
__cdecl
*
p__p__wenviron
)(
void
);
static
char
***
p_environ
;
static
WCHAR
***
p_wenviron
;
...
...
@@ -52,6 +55,8 @@ static void init(void)
{
HMODULE
hmod
=
GetModuleHandleA
(
"msvcrt.dll"
);
p__p__environ
=
(
void
*
)
GetProcAddress
(
hmod
,
"__p__environ"
);
p__p__wenviron
=
(
void
*
)
GetProcAddress
(
hmod
,
"__p__wenviron"
);
p_environ
=
(
void
*
)
GetProcAddress
(
hmod
,
"_environ"
);
p_wenviron
=
(
void
*
)
GetProcAddress
(
hmod
,
"_wenviron"
);
}
...
...
@@ -81,6 +86,15 @@ static void test__environ(void)
return
;
}
/* Examine the returned pointer from __p__environ(), if available. */
if
(
p__p__environ
)
{
ok
(
*
p__p__environ
()
==
*
p_environ
,
"Expected _environ pointers to be identical
\n
"
);
}
else
skip
(
"__p__environ() is not available
\n
"
);
/* Note that msvcrt from Windows versions older than Vista
* expects the mode pointer parameter to be valid.*/
__getmainargs
(
&
argc
,
&
argv
,
&
envp
,
0
,
&
mode
);
...
...
@@ -125,6 +139,15 @@ static void test__wenviron(void)
return
;
}
/* Examine the returned pointer from __p__wenviron(), if available. */
if
(
p__p__wenviron
)
{
ok
(
*
p__p__wenviron
()
==
NULL
,
"Expected _wenviron pointers to be NULL
\n
"
);
}
else
skip
(
"__p__wenviron() is not available
\n
"
);
/* __getmainargs doesn't initialize _wenviron. */
__getmainargs
(
&
argc
,
&
argv
,
&
envp
,
0
,
&
mode
);
...
...
@@ -153,6 +176,14 @@ static void test__wenviron(void)
return
;
}
/* Examine the returned pointer from __p__wenviron(),
* if available, after _wenviron is initialized. */
if
(
p__p__wenviron
)
{
ok
(
*
p__p__wenviron
()
==
*
p_wenviron
,
"Expected _wenviron pointers to be identical
\n
"
);
}
for
(
i
=
0
;
;
i
++
)
{
if
((
*
p_wenviron
)[
i
])
...
...
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