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
18e30524
Commit
18e30524
authored
Mar 27, 2008
by
Paul Vriens
Committed by
Alexandre Julliard
Mar 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi/tests: Add some tests for the last error returned.
parent
f8ea9ec1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
0 deletions
+119
-0
parser.c
dlls/setupapi/tests/parser.c
+119
-0
No files found.
dlls/setupapi/tests/parser.c
View file @
18e30524
...
...
@@ -480,6 +480,124 @@ static void test_pSetupGetField(void)
SetupCloseInfFile
(
hinf
);
}
static
void
test_GLE
(
void
)
{
static
const
char
*
inf
=
"[Version]
\n
"
"Signature=
\"
$Windows NT$
\"\n
"
"[Sectionname]
\n
"
"Keyname1=Field1,Field2,Field3
\n
"
"
\n
"
"Keyname2=Field4,Field5
\n
"
;
HINF
hinf
;
UINT
err
;
INFCONTEXT
context
;
BOOL
retb
;
LONG
retl
;
char
buf
[
MAX_INF_STRING_LENGTH
];
int
bufsize
=
MAX_INF_STRING_LENGTH
;
DWORD
retsize
;
hinf
=
test_file_contents
(
inf
,
&
err
);
ok
(
hinf
!=
NULL
,
"Expected valid INF file
\n
"
);
SetLastError
(
0xdeadbeef
);
retb
=
SetupFindFirstLineA
(
hinf
,
"ImNotThere"
,
NULL
,
&
context
);
ok
(
!
retb
,
"Expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_LINE_NOT_FOUND
,
"Expected ERROR_LINE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupFindFirstLineA
(
hinf
,
"ImNotThere"
,
"ImNotThere"
,
&
context
);
ok
(
!
retb
,
"Expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_LINE_NOT_FOUND
,
"Expected ERROR_LINE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupFindFirstLineA
(
hinf
,
"Sectionname"
,
NULL
,
&
context
);
ok
(
retb
,
"Expected success
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupFindFirstLineA
(
hinf
,
"Sectionname"
,
"ImNotThere"
,
&
context
);
ok
(
!
retb
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_LINE_NOT_FOUND
,
"Expected ERROR_LINE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupFindFirstLineA
(
hinf
,
"Sectionname"
,
"Keyname1"
,
&
context
);
ok
(
retb
,
"Expected success
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupFindNextMatchLineA
(
&
context
,
"ImNotThere"
,
&
context
);
ok
(
!
retb
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_LINE_NOT_FOUND
,
"Expected ERROR_LINE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupFindNextMatchLineA
(
&
context
,
"Keyname2"
,
&
context
);
ok
(
retb
,
"Expected success
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retl
=
SetupGetLineCountA
(
hinf
,
"ImNotThere"
);
ok
(
retl
==
-
1
,
"Expected -1, got %d
\n
"
,
retl
);
ok
(
GetLastError
()
==
ERROR_SECTION_NOT_FOUND
,
"Expected ERROR_SECTION_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retl
=
SetupGetLineCountA
(
hinf
,
"Sectionname"
);
ok
(
retl
==
2
,
"Expected 2, got %d
\n
"
,
retl
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupGetLineTextA
(
NULL
,
hinf
,
"ImNotThere"
,
"ImNotThere"
,
buf
,
bufsize
,
&
retsize
);
ok
(
!
retb
,
"Expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_LINE_NOT_FOUND
,
"Expected ERROR_LINE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupGetLineTextA
(
NULL
,
hinf
,
"Sectionname"
,
"ImNotThere"
,
buf
,
bufsize
,
&
retsize
);
ok
(
!
retb
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_LINE_NOT_FOUND
,
"Expected ERROR_LINE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupGetLineTextA
(
NULL
,
hinf
,
"Sectionname"
,
"Keyname1"
,
buf
,
bufsize
,
&
retsize
);
ok
(
retb
,
"Expected success
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupGetLineByIndexA
(
hinf
,
"ImNotThere"
,
1
,
&
context
);
ok
(
!
retb
,
"Expected failure
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_LINE_NOT_FOUND
,
"Expected ERROR_LINE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupGetLineByIndexA
(
hinf
,
"Sectionname"
,
1
,
&
context
);
ok
(
retb
,
"Expected success
\n
"
);
ok
(
GetLastError
()
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %08x
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
retb
=
SetupGetLineByIndexA
(
hinf
,
"Sectionname"
,
3
,
&
context
);
ok
(
!
retb
,
"Expected failure
\n
"
);
ok
(
GetLastError
()
==
ERROR_LINE_NOT_FOUND
,
"Expected ERROR_LINE_NOT_FOUND, got %08x
\n
"
,
GetLastError
());
SetupCloseInfFile
(
hinf
);
}
START_TEST
(
parser
)
{
init_function_pointers
();
...
...
@@ -488,5 +606,6 @@ START_TEST(parser)
test_key_names
();
test_close_inf_file
();
test_pSetupGetField
();
test_GLE
();
DeleteFileA
(
tmpfilename
);
}
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