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
08a778c5
Commit
08a778c5
authored
Dec 21, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Init pointers in common way, add some win_skip() while skipping.
parent
ea0af93c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
path.c
dlls/kernel32/tests/path.c
+26
-16
No files found.
dlls/kernel32/tests/path.c
View file @
08a778c5
...
@@ -1323,6 +1323,12 @@ static void test_GetWindowsDirectory(void)
...
@@ -1323,6 +1323,12 @@ static void test_GetWindowsDirectory(void)
static
void
test_NeedCurrentDirectoryForExePathA
(
void
)
static
void
test_NeedCurrentDirectoryForExePathA
(
void
)
{
{
if
(
!
pNeedCurrentDirectoryForExePathA
)
{
win_skip
(
"NeedCurrentDirectoryForExePathA is not available
\n
"
);
return
;
}
/* Crashes in Windows */
/* Crashes in Windows */
if
(
0
)
if
(
0
)
ok
(
pNeedCurrentDirectoryForExePathA
(
NULL
),
"returned FALSE for NULL
\n
"
);
ok
(
pNeedCurrentDirectoryForExePathA
(
NULL
),
"returned FALSE for NULL
\n
"
);
...
@@ -1344,6 +1350,12 @@ static void test_NeedCurrentDirectoryForExePathW(void)
...
@@ -1344,6 +1350,12 @@ static void test_NeedCurrentDirectoryForExePathW(void)
const
WCHAR
fullpath
[]
=
{
'c'
,
':'
,
'\\'
,
0
};
const
WCHAR
fullpath
[]
=
{
'c'
,
':'
,
'\\'
,
0
};
const
WCHAR
cmdname
[]
=
{
'c'
,
'm'
,
'd'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
const
WCHAR
cmdname
[]
=
{
'c'
,
'm'
,
'd'
,
'.'
,
'e'
,
'x'
,
'e'
,
0
};
if
(
!
pNeedCurrentDirectoryForExePathW
)
{
win_skip
(
"NeedCurrentDirectoryForExePathW is not available
\n
"
);
return
;
}
/* Crashes in Windows */
/* Crashes in Windows */
if
(
0
)
if
(
0
)
ok
(
pNeedCurrentDirectoryForExePathW
(
NULL
),
"returned FALSE for NULL
\n
"
);
ok
(
pNeedCurrentDirectoryForExePathW
(
NULL
),
"returned FALSE for NULL
\n
"
);
...
@@ -1444,19 +1456,23 @@ static void test_drive_letter_case(void)
...
@@ -1444,19 +1456,23 @@ static void test_drive_letter_case(void)
#undef is_upper_case_letter
#undef is_upper_case_letter
}
}
static
void
init_pointers
(
void
)
{
HMODULE
hKernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
#define MAKEFUNC(f) (p##f = (void*)GetProcAddress(hKernel32, #f))
MAKEFUNC
(
GetLongPathNameA
);
MAKEFUNC
(
GetLongPathNameW
);
MAKEFUNC
(
NeedCurrentDirectoryForExePathA
);
MAKEFUNC
(
NeedCurrentDirectoryForExePathW
);
#undef MAKEFUNC
}
START_TEST
(
path
)
START_TEST
(
path
)
{
{
CHAR
origdir
[
MAX_PATH
],
curdir
[
MAX_PATH
],
curDrive
,
otherDrive
;
CHAR
origdir
[
MAX_PATH
],
curdir
[
MAX_PATH
],
curDrive
,
otherDrive
;
pGetLongPathNameA
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"GetLongPathNameA"
);
init_pointers
();
pGetLongPathNameW
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
)
,
"GetLongPathNameW"
);
pNeedCurrentDirectoryForExePathA
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"NeedCurrentDirectoryForExePathA"
);
pNeedCurrentDirectoryForExePathW
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"kernel32.dll"
),
"NeedCurrentDirectoryForExePathW"
);
/* Report only once */
/* Report only once */
if
(
!
pGetLongPathNameA
)
if
(
!
pGetLongPathNameA
)
...
@@ -1474,13 +1490,7 @@ START_TEST(path)
...
@@ -1474,13 +1490,7 @@ START_TEST(path)
test_GetShortPathNameW
();
test_GetShortPathNameW
();
test_GetSystemDirectory
();
test_GetSystemDirectory
();
test_GetWindowsDirectory
();
test_GetWindowsDirectory
();
if
(
pNeedCurrentDirectoryForExePathA
)
{
test_NeedCurrentDirectoryForExePathA
();
test_NeedCurrentDirectoryForExePathA
();
}
if
(
pNeedCurrentDirectoryForExePathW
)
{
test_NeedCurrentDirectoryForExePathW
();
test_NeedCurrentDirectoryForExePathW
();
}
test_drive_letter_case
();
test_drive_letter_case
();
}
}
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