Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d36e7857
Commit
d36e7857
authored
Jan 16, 2022
by
Jinoh Kang
Committed by
Alexandre Julliard
Jun 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi/tests: Add more tests for interface identifier conversion failure.
Signed-off-by:
Jinoh Kang
<
jinoh.kang.kr@gmail.com
>
parent
f30ee1e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
iphlpapi.c
dlls/iphlpapi/tests/iphlpapi.c
+23
-0
No files found.
dlls/iphlpapi/tests/iphlpapi.c
View file @
d36e7857
...
...
@@ -2231,11 +2231,18 @@ static void test_interface_identifier_conversion_failure(void)
WCHAR
nameW
[
IF_MAX_STRING_SIZE
+
1
];
char
nameA
[
IF_MAX_STRING_SIZE
+
1
],
*
name
;
NET_IFINDEX
index
;
NET_LUID
luid
;
GUID
guid
;
static
const
GUID
guid_zero
;
static
const
GUID
guid_ones
=
{
0xffffffffUL
,
0xffff
,
0xffff
,
{
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
}
};
/* ConvertInterfaceIndexToLuid */
ret
=
ConvertInterfaceIndexToLuid
(
0
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %lu
\n
"
,
ret
);
ret
=
ConvertInterfaceIndexToLuid
(
-
1
,
&
luid
);
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"expected ERROR_FILE_NOT_FOUND, got %lu
\n
"
,
ret
);
/* ConvertInterfaceLuidToIndex */
ret
=
ConvertInterfaceLuidToIndex
(
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %lu
\n
"
,
ret
);
...
...
@@ -2243,10 +2250,22 @@ static void test_interface_identifier_conversion_failure(void)
ret
=
ConvertInterfaceLuidToIndex
(
NULL
,
&
index
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %lu
\n
"
,
ret
);
luid
.
Value
=
-
1
;
index
=
-
1
;
ret
=
ConvertInterfaceLuidToIndex
(
&
luid
,
&
index
);
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"expected ERROR_FILE_NOT_FOUND, got %lu
\n
"
,
ret
);
ok
(
index
==
0
,
"index shall be zero (got %lu)
\n
"
,
index
);
/* ConvertInterfaceLuidToGuid */
ret
=
ConvertInterfaceLuidToGuid
(
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %lu
\n
"
,
ret
);
luid
.
Value
=
-
1
;
memcpy
(
&
guid
,
&
guid_ones
,
sizeof
(
guid
)
);
ret
=
ConvertInterfaceLuidToGuid
(
&
luid
,
&
guid
);
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"expected ERROR_FILE_NOT_FOUND, got %lu
\n
"
,
ret
);
ok
(
memcmp
(
&
guid
,
&
guid_zero
,
sizeof
(
guid
)
)
==
0
,
"guid shall be nil
\n
"
);
/* ConvertInterfaceGuidToLuid */
ret
=
ConvertInterfaceGuidToLuid
(
NULL
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %lu
\n
"
,
ret
);
...
...
@@ -2255,15 +2274,19 @@ static void test_interface_identifier_conversion_failure(void)
ret
=
ConvertInterfaceLuidToNameW
(
NULL
,
NULL
,
0
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %lu
\n
"
,
ret
);
memset
(
nameW
,
0
,
sizeof
(
nameW
)
);
ret
=
ConvertInterfaceLuidToNameW
(
NULL
,
nameW
,
0
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %lu
\n
"
,
ret
);
ok
(
!
nameW
[
0
],
"nameW shall not change
\n
"
);
/* ConvertInterfaceLuidToNameA */
ret
=
ConvertInterfaceLuidToNameA
(
NULL
,
NULL
,
0
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %lu
\n
"
,
ret
);
memset
(
nameA
,
0
,
sizeof
(
nameA
)
);
ret
=
ConvertInterfaceLuidToNameA
(
NULL
,
nameA
,
0
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"got %lu
\n
"
,
ret
);
ok
(
!
nameA
[
0
],
"nameA shall not change
\n
"
);
/* ConvertInterfaceNameToLuidW */
ret
=
ConvertInterfaceNameToLuidW
(
NULL
,
NULL
);
...
...
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