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
d8bbf6d0
Commit
d8bbf6d0
authored
Apr 20, 2024
by
Tuomas Räsänen
Committed by
Alexandre Julliard
Apr 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/tests: Add tests for reading INF class with %strkey% tokens.
parent
7f190e67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
devinst.c
dlls/setupapi/tests/devinst.c
+23
-0
No files found.
dlls/setupapi/tests/devinst.c
View file @
d8bbf6d0
...
...
@@ -1876,6 +1876,8 @@ static void test_get_inf_class(void)
static
const
char
inffile
[]
=
"winetest.inf"
;
static
const
char
content
[]
=
"[Version]
\r\n\r\n
"
;
static
const
char
*
signatures
[]
=
{
"
\"
$CHICAGO$
\"
"
,
"
\"
$Windows NT$
\"
"
};
static
const
GUID
deadbeef_class_guid
=
{
0xdeadbeef
,
0xdead
,
0xbeef
,{
0xde
,
0xad
,
0xbe
,
0xef
,
0xde
,
0xad
,
0xbe
,
0xef
}};
static
const
char
deadbeef_class_name
[]
=
"DeadBeef"
;
char
cn
[
MAX_PATH
];
char
filename
[
MAX_PATH
];
...
...
@@ -2014,6 +2016,27 @@ static void test_get_inf_class(void)
todo_wine
ok
(
count
==
4
,
"expected count==4, got %lu(%s)
\n
"
,
count
,
cn
);
/* Test Strings substitution */
WritePrivateProfileStringA
(
"Version"
,
"Class"
,
"%ClassName%"
,
filename
);
WritePrivateProfileStringA
(
"Version"
,
"ClassGUID"
,
"%ClassGuid%"
,
filename
);
/* Without Strings section the ClassGUID is invalid (has non-substituted strkey token) */
retval
=
SetupDiGetINFClassA
(
filename
,
&
guid
,
cn
,
MAX_PATH
,
NULL
);
ok
(
!
retval
,
"expected SetupDiGetINFClassA to fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected error ERROR_INVALID_PARAMETER, got %lu
\n
"
,
GetLastError
());
/* With Strings section the ClassGUID and Class should be substituted */
WritePrivateProfileStringA
(
"Strings"
,
"ClassName"
,
deadbeef_class_name
,
filename
);
WritePrivateProfileStringA
(
"Strings"
,
"ClassGuid"
,
"{deadbeef-dead-beef-dead-beefdeadbeef}"
,
filename
);
count
=
0xdeadbeef
;
retval
=
SetupDiGetINFClassA
(
filename
,
&
guid
,
cn
,
MAX_PATH
,
&
count
);
todo_wine
{
ok
(
retval
,
"expected SetupDiGetINFClassA to succeed! error %lu
\n
"
,
GetLastError
());
ok
(
count
==
lstrlenA
(
deadbeef_class_name
)
+
1
,
"expected count=%d, got %lu
\n
"
,
lstrlenA
(
deadbeef_class_name
)
+
1
,
count
);
ok
(
!
lstrcmpA
(
deadbeef_class_name
,
cn
),
"expected class_name='%s', got '%s'
\n
"
,
deadbeef_class_name
,
cn
);
ok
(
IsEqualGUID
(
&
deadbeef_class_guid
,
&
guid
),
"expected ClassGUID to be deadbeef-dead-beef-dead-beefdeadbeef
\n
"
);
}
DeleteFileA
(
filename
);
}
}
...
...
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