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
b8d081b0
Commit
b8d081b0
authored
Feb 12, 2013
by
Roman Dadkov
Committed by
Alexandre Julliard
Feb 13, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpr/tests: Test to check the return values of WNetGetUniversalNameA.
parent
8a4557ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
94 additions
and
2 deletions
+94
-2
mpr.c
dlls/mpr/tests/mpr.c
+94
-2
No files found.
dlls/mpr/tests/mpr.c
View file @
b8d081b0
...
...
@@ -28,11 +28,12 @@ static void test_WNetGetUniversalName(void)
{
DWORD
ret
;
char
buffer
[
1024
];
DWORD
drive_type
,
info_size
;
DWORD
drive_type
,
info_size
,
fail_size
;
char
driveA
[]
=
"A:
\\
"
;
char
driveandpathA
[]
=
"A:
\\
file.txt"
;
WCHAR
driveW
[]
=
{
'A'
,
':'
,
'\\'
,
0
};
for
(;
*
driveA
<=
'Z'
;
++*
driveA
,
++*
driveW
){
for
(;
*
driveA
<=
'Z'
;
++*
driveA
,
++*
driveandpathA
,
++*
driveW
){
drive_type
=
GetDriveTypeW
(
driveW
);
info_size
=
sizeof
(
buffer
);
...
...
@@ -50,6 +51,25 @@ static void test_WNetGetUniversalName(void)
ok
(
info_size
==
sizeof
(
buffer
),
"Got wrong size: %u
\n
"
,
info_size
);
fail_size
=
0
;
ret
=
WNetGetUniversalNameA
(
driveA
,
UNIVERSAL_NAME_INFO_LEVEL
,
buffer
,
&
fail_size
);
if
(
drive_type
==
DRIVE_REMOTE
)
todo_wine
ok
(
ret
==
WN_BAD_VALUE
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
else
ok
(
ret
==
ERROR_NOT_CONNECTED
,
"WNetGetUniversalNameA gave wrong error: %08x
\n
"
,
ret
);
fail_size
=
sizeof
(
driveA
)
/
sizeof
(
char
)
-
1
;
ret
=
WNetGetUniversalNameA
(
driveA
,
UNIVERSAL_NAME_INFO_LEVEL
,
buffer
,
&
fail_size
);
if
(
drive_type
==
DRIVE_REMOTE
)
ok
(
ret
==
WN_MORE_DATA
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
ret
=
WNetGetUniversalNameA
(
driveandpathA
,
UNIVERSAL_NAME_INFO_LEVEL
,
buffer
,
&
info_size
);
if
(
drive_type
==
DRIVE_REMOTE
)
todo_wine
ok
(
ret
==
WN_NO_ERROR
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
info_size
=
sizeof
(
buffer
);
ret
=
WNetGetUniversalNameW
(
driveW
,
UNIVERSAL_NAME_INFO_LEVEL
,
buffer
,
&
info_size
);
...
...
@@ -60,7 +80,78 @@ static void test_WNetGetUniversalName(void)
ok
((
ret
==
WN_NOT_CONNECTED
)
||
(
ret
==
WN_NO_NET_OR_BAD_PATH
),
"WNetGetUniversalNameW(%s, ...) returned %u (drive_type: %u)
\n
"
,
wine_dbgstr_w
(
driveW
),
ret
,
drive_type
);
if
(
drive_type
!=
DRIVE_REMOTE
)
ok
(
info_size
==
sizeof
(
buffer
),
"Got wrong size: %u
\n
"
,
info_size
);
}
}
static
void
test_WNetGetRemoteName
(
void
)
{
DWORD
ret
;
char
buffer
[
1024
];
DWORD
drive_type
,
info_size
,
fail_size
;
char
driveA
[]
=
"A:
\\
"
;
char
driveandpathA
[]
=
"A:
\\
file.txt"
;
WCHAR
driveW
[]
=
{
'A'
,
':'
,
'\\'
,
0
};
for
(;
*
driveA
<=
'Z'
;
++*
driveA
,
++*
driveandpathA
,
++*
driveW
){
drive_type
=
GetDriveTypeW
(
driveW
);
info_size
=
sizeof
(
buffer
);
ret
=
WNetGetUniversalNameA
(
driveA
,
REMOTE_NAME_INFO_LEVEL
,
buffer
,
&
info_size
);
todo_wine
{
if
(
drive_type
==
DRIVE_REMOTE
)
ok
(
ret
==
WN_NO_ERROR
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
else
ok
(
ret
==
ERROR_NOT_CONNECTED
,
"WNetGetUniversalNameA gave wrong error: %08x
\n
"
,
ret
);
}
ok
(
info_size
==
sizeof
(
buffer
),
"Got wrong size: %u
\n
"
,
info_size
);
fail_size
=
0
;
ret
=
WNetGetUniversalNameA
(
driveA
,
REMOTE_NAME_INFO_LEVEL
,
buffer
,
&
fail_size
);
todo_wine
{
if
(
drive_type
==
DRIVE_REMOTE
)
ok
(
ret
==
WN_BAD_VALUE
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
else
ok
(
ret
==
ERROR_NOT_CONNECTED
,
"WNetGetUniversalNameA gave wrong error: %08x
\n
"
,
ret
);
}
ret
=
WNetGetUniversalNameA
(
driveA
,
REMOTE_NAME_INFO_LEVEL
,
buffer
,
NULL
);
todo_wine
ok
(
ret
==
WN_BAD_POINTER
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
ret
=
WNetGetUniversalNameA
(
driveA
,
REMOTE_NAME_INFO_LEVEL
,
NULL
,
&
info_size
);
todo_wine
{
if
(((
GetVersion
()
&
0x8000ffff
)
==
0x00000004
)
||
/* NT40 */
(
drive_type
==
DRIVE_REMOTE
))
ok
(
ret
==
WN_BAD_POINTER
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
else
ok
(
ret
==
ERROR_NOT_CONNECTED
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
}
fail_size
=
sizeof
(
driveA
)
/
sizeof
(
char
)
-
1
;
ret
=
WNetGetUniversalNameA
(
driveA
,
REMOTE_NAME_INFO_LEVEL
,
buffer
,
&
fail_size
);
if
(
drive_type
==
DRIVE_REMOTE
)
todo_wine
ok
(
ret
==
WN_MORE_DATA
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
ret
=
WNetGetUniversalNameA
(
driveandpathA
,
REMOTE_NAME_INFO_LEVEL
,
buffer
,
&
info_size
);
if
(
drive_type
==
DRIVE_REMOTE
)
todo_wine
ok
(
ret
==
WN_NO_ERROR
,
"WNetGetUniversalNameA failed: %08x
\n
"
,
ret
);
info_size
=
sizeof
(
buffer
);
ret
=
WNetGetUniversalNameW
(
driveW
,
REMOTE_NAME_INFO_LEVEL
,
buffer
,
&
info_size
);
todo_wine
{
if
(
drive_type
==
DRIVE_REMOTE
)
ok
(
ret
==
WN_NO_ERROR
,
"WNetGetUniversalNameW failed: %08x
\n
"
,
ret
);
else
ok
(
ret
==
ERROR_NOT_CONNECTED
,
"WNetGetUniversalNameW gave wrong error: %08x
\n
"
,
ret
);
}
ok
(
info_size
==
sizeof
(
buffer
),
"Got wrong size: %u
\n
"
,
info_size
);
}
}
...
...
@@ -68,4 +159,5 @@ static void test_WNetGetUniversalName(void)
START_TEST
(
mpr
)
{
test_WNetGetUniversalName
();
test_WNetGetRemoteName
();
}
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