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
f0009e17
Commit
f0009e17
authored
Sep 26, 2015
by
Vincent Povirk
Committed by
Alexandre Julliard
Oct 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/tests: Add tests for dirid values.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
parent
0072188b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
install.c
dlls/setupapi/tests/install.c
+50
-0
No files found.
dlls/setupapi/tests/install.c
View file @
f0009e17
...
@@ -720,6 +720,55 @@ static void test_inffilelist(void)
...
@@ -720,6 +720,55 @@ static void test_inffilelist(void)
RemoveDirectoryA
(
dirA
);
RemoveDirectoryA
(
dirA
);
}
}
static
const
char
dirid_inf
[]
=
"[Version]
\n
"
"Signature=
\"
$Chicago$
\"\n
"
"[DefaultInstall]
\n
"
"AddReg=Add.Settings
\n
"
"[Add.Settings]
\n
"
"HKCU,Software
\\
Wine
\\
setupapitest,dirid,,%%%i%%
\n
"
;
static
void
check_dirid
(
int
dirid
,
LPCSTR
expected
)
{
char
buffer
[
sizeof
(
dirid_inf
)
+
11
];
char
path
[
MAX_PATH
],
actual
[
MAX_PATH
];
LONG
ret
;
DWORD
size
;
sprintf
(
buffer
,
dirid_inf
,
dirid
);
create_inf_file
(
inffile
,
buffer
);
sprintf
(
path
,
"%s
\\
%s"
,
CURR_DIR
,
inffile
);
run_cmdline
(
"DefaultInstall"
,
128
,
path
);
size
=
sizeof
(
actual
);
ret
=
RegGetValueA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
setupapitest"
,
"dirid"
,
RRF_RT_REG_SZ
|
RRF_ZEROONFAILURE
,
NULL
,
&
actual
,
&
size
);
ok
(
ret
==
ERROR_SUCCESS
,
"Failed getting value for dirid %i, err=%d
\n
"
,
dirid
,
ret
);
ok
(
!
strcmp
(
actual
,
expected
),
"Expected path for dirid %i was
\"
%s
\"
, got
\"
%s
\"\n
"
,
dirid
,
expected
,
actual
);
ok_registry
(
TRUE
);
ret
=
DeleteFileA
(
inffile
);
ok
(
ret
,
"Expected source inf to exist, last error was %d
\n
"
,
GetLastError
());
}
/* Test dirid values */
static
void
test_dirid
(
void
)
{
char
expected
[
MAX_PATH
];
check_dirid
(
DIRID_NULL
,
""
);
GetWindowsDirectoryA
(
expected
,
MAX_PATH
);
check_dirid
(
DIRID_WINDOWS
,
expected
);
GetSystemDirectoryA
(
expected
,
MAX_PATH
);
check_dirid
(
DIRID_SYSTEM
,
expected
);
strcat
(
expected
,
"
\\
unknown"
);
check_dirid
(
40
,
expected
);
}
START_TEST
(
install
)
START_TEST
(
install
)
{
{
HMODULE
hsetupapi
=
GetModuleHandleA
(
"setupapi.dll"
);
HMODULE
hsetupapi
=
GetModuleHandleA
(
"setupapi.dll"
);
...
@@ -770,6 +819,7 @@ START_TEST(install)
...
@@ -770,6 +819,7 @@ START_TEST(install)
test_registry
();
test_registry
();
test_install_svc_from
();
test_install_svc_from
();
test_driver_install
();
test_driver_install
();
test_dirid
();
UnhookWindowsHookEx
(
hhook
);
UnhookWindowsHookEx
(
hhook
);
...
...
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