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
25c02c88
Commit
25c02c88
authored
Apr 16, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Apr 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Split the GetComputerName/Ex tests into their own test functions.
parent
b8bdb130
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
environ.c
dlls/kernel32/tests/environ.c
+33
-7
No files found.
dlls/kernel32/tests/environ.c
View file @
25c02c88
...
...
@@ -25,6 +25,17 @@
#include "winbase.h"
#include "winerror.h"
static
BOOL
(
WINAPI
*
pGetComputerNameExA
)(
COMPUTER_NAME_FORMAT
,
LPSTR
,
LPDWORD
);
static
BOOL
(
WINAPI
*
pGetComputerNameExW
)(
COMPUTER_NAME_FORMAT
,
LPWSTR
,
LPDWORD
);
static
void
init_functionpointers
(
void
)
{
HMODULE
hkernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
pGetComputerNameExA
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetComputerNameExA"
);
pGetComputerNameExW
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"GetComputerNameExW"
);
}
static
void
test_GetSetEnvironmentVariableA
(
void
)
{
char
buf
[
256
];
...
...
@@ -291,9 +302,6 @@ static void test_ExpandEnvironmentStringsA(void)
SetEnvironmentVariableA
(
"EnvVar"
,
NULL
);
}
static
BOOL
(
WINAPI
*
pGetComputerNameExA
)(
COMPUTER_NAME_FORMAT
,
LPSTR
,
LPDWORD
);
static
BOOL
(
WINAPI
*
pGetComputerNameExW
)(
COMPUTER_NAME_FORMAT
,
LPWSTR
,
LPDWORD
);
static
void
test_GetComputerName
(
void
)
{
DWORD
size
;
...
...
@@ -347,11 +355,18 @@ static void test_GetComputerName(void)
ok
(
ret
,
"GetComputerNameW failed with error %d
\n
"
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
nameW
);
}
}
static
void
test_GetComputerNameExA
(
void
)
{
DWORD
size
;
BOOL
ret
;
LPSTR
name
;
DWORD
error
;
pGetComputerNameExA
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"kernel32.dll"
),
"GetComputerNameExA"
);
if
(
!
pGetComputerNameExA
)
{
skip
(
"GetComputerNameExA function not implemented
, so not testing
\n
"
);
skip
(
"GetComputerNameExA function not implemented
\n
"
);
return
;
}
...
...
@@ -402,11 +417,18 @@ static void test_GetComputerName(void)
ok
(
ret
,
"GetComputerNameExA(ComputerNameNetBIOS) failed with error %d
\n
"
,
GetLastError
());
trace
(
"NetBIOS name is
\"
%s
\"\n
"
,
name
);
HeapFree
(
GetProcessHeap
(),
0
,
name
);
}
static
void
test_GetComputerNameExW
(
void
)
{
DWORD
size
;
BOOL
ret
;
LPWSTR
nameW
;
DWORD
error
;
pGetComputerNameExW
=
(
void
*
)
GetProcAddress
(
GetModuleHandle
(
"kernel32.dll"
),
"GetComputerNameExW"
);
if
(
!
pGetComputerNameExW
)
{
skip
(
"GetComputerNameExW function not implemented
, so not testing
\n
"
);
skip
(
"GetComputerNameExW function not implemented
\n
"
);
return
;
}
...
...
@@ -453,8 +475,12 @@ static void test_GetComputerName(void)
START_TEST
(
environ
)
{
init_functionpointers
();
test_GetSetEnvironmentVariableA
();
test_GetSetEnvironmentVariableW
();
test_ExpandEnvironmentStringsA
();
test_GetComputerName
();
test_GetComputerNameExA
();
test_GetComputerNameExW
();
}
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